From 931c929fe918e72216fc1e77616c2b4b8656dda8 Mon Sep 17 00:00:00 2001 From: Aly Raffauf Date: Sun, 30 Jun 2024 23:01:57 -0400 Subject: [PATCH] nixosModules: remove ollama module --- hosts/mandarin/default.nix | 11 +++++------ hosts/mauville/default.nix | 11 +++++------ nixosModules/options.nix | 16 ---------------- nixosModules/services/default.nix | 1 - nixosModules/services/ollama/default.nix | 19 ------------------- 5 files changed, 10 insertions(+), 48 deletions(-) delete mode 100644 nixosModules/services/ollama/default.nix diff --git a/hosts/mandarin/default.nix b/hosts/mandarin/default.nix index f9c4dbcb..227e3850 100644 --- a/hosts/mandarin/default.nix +++ b/hosts/mandarin/default.nix @@ -20,6 +20,11 @@ networking.hostName = "mandarin"; + services.ollama = { + enable = true; + acceleration = "rocm"; + }; + system.stateVersion = "24.05"; ar = { @@ -48,12 +53,6 @@ services = { flatpak.enable = true; - - ollama = { - enable = true; - gpu = "amd"; - }; - tailscale.enable = true; }; diff --git a/hosts/mauville/default.nix b/hosts/mauville/default.nix index 5f18979e..d738146b 100644 --- a/hosts/mauville/default.nix +++ b/hosts/mauville/default.nix @@ -167,6 +167,11 @@ in { secretKeyFile = "/var/cache-priv-key.pem"; }; + ollama = { + enable = true; + acceleration = "rocm"; + }; + samba = { enable = true; openFirewall = true; @@ -253,12 +258,6 @@ in { }; services = { - ollama = { - enable = true; - gpu = "amd"; - listenAddress = "0.0.0.0:11434"; - }; - syncthing = { enable = true; syncMusic = true; diff --git a/nixosModules/options.nix b/nixosModules/options.nix index c7b272ff..70c360c1 100644 --- a/nixosModules/options.nix +++ b/nixosModules/options.nix @@ -189,22 +189,6 @@ services = { flatpak.enable = lib.mkEnableOption "Flatpak support with GUI."; - ollama = { - enable = lib.mkEnableOption "Ollama interface for LLMs."; - - listenAddress = lib.mkOption { - description = "Listen Address for Ollama."; - default = "127.0.0.1:11434"; - type = lib.types.str; - }; - - gpu = lib.mkOption { - description = "Type of GPU for enabling GPU acceleration."; - default = null; - type = lib.types.str; - }; - }; - syncthing = { enable = lib.mkEnableOption "Syncthing sync service."; diff --git a/nixosModules/services/default.nix b/nixosModules/services/default.nix index 9d161e1e..3fb69937 100644 --- a/nixosModules/services/default.nix +++ b/nixosModules/services/default.nix @@ -6,7 +6,6 @@ }: { imports = [ ./flatpak - ./ollama ./syncthing ./tailscale ]; diff --git a/nixosModules/services/ollama/default.nix b/nixosModules/services/ollama/default.nix deleted file mode 100644 index 01162272..00000000 --- a/nixosModules/services/ollama/default.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ - pkgs, - lib, - config, - ... -}: { - config = lib.mkIf config.ar.services.ollama.enable { - services.ollama = { - enable = true; - acceleration = - if config.ar.services.ollama.gpu == "amd" - then "rocm" - else if config.ar.services.ollama.gpu == "nvidia" - then "cuda" - else null; - listenAddress = config.ar.services.ollama.listenAddress; - }; - }; -}