From f01331669ac4c902504c81a92ea13bb6c0814e89 Mon Sep 17 00:00:00 2001 From: Tomas Rivera Date: Sat, 2 May 2026 12:24:01 +0200 Subject: [PATCH] ollama config --- hosts/laptop/configuration.nix | 1 + hostsModules/laptop/nixos/ollama.nix | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 hostsModules/laptop/nixos/ollama.nix diff --git a/hosts/laptop/configuration.nix b/hosts/laptop/configuration.nix index be55286..769c6c5 100755 --- a/hosts/laptop/configuration.nix +++ b/hosts/laptop/configuration.nix @@ -21,6 +21,7 @@ ../../hostsModules/laptop/nixos/udev.nix ../../hostsModules/laptop/nixos/disk.nix ../../modules/nixos/printer.nix + ../../hostsModules/laptop/nixos/ollama.nix # llm config ]; diff --git a/hostsModules/laptop/nixos/ollama.nix b/hostsModules/laptop/nixos/ollama.nix new file mode 100644 index 0000000..f9658bf --- /dev/null +++ b/hostsModules/laptop/nixos/ollama.nix @@ -0,0 +1,25 @@ +{ + pkgs-unstable, + ... +}: { + services.ollama = { + enable = true; + package = pkgs-unstable.ollama-vulkan; + #port = 11434; + #host = "127.0.0.1:11434"; + # loadModels load them directly into ram at startup. Doesn't download them. + #loadModels = [ "mistral:7b" ]; # don't forget the :xxxxx for ex: "mixtral" don't work + #syncModels = true; + }; + systemd.services.ollama.serviceConfig.ExecStartPost = [ # use this to auto download models + "${pkgs-unstable.ollama-vulkan}/bin/ollama pull mistral:7b" + ]; + /*services.open-webui = { + enable = true; + port = 8080; + environment = { + OLLAMA_BASE_URL = "http://127.0.0.1:11434"; + WEBUI_AUTH = "True"; + }; + };*/ +}