diff --git a/hosts/ymir/configuration.nix b/hosts/ymir/configuration.nix index 68d7f2b..a26d092 100644 --- a/hosts/ymir/configuration.nix +++ b/hosts/ymir/configuration.nix @@ -26,6 +26,7 @@ enableSound = true; enableADB = true; # enableCaddy = true; + enableOllama = true; }; # Bootloader. @@ -96,25 +97,6 @@ nixd ]; - services.ollama = { - enable = true; - acceleration = "cuda"; - loadModels = ["deepseek-r1:7b" "deepseek-r1:14b"]; - }; - - services.open-webui = { - enable = true; - port = 7070; - host = "0.0.0.0"; - openFirewall = true; - environment = { - SCARF_NO_ANALYTICS = "True"; - DO_NOT_TRACK = "True"; - ANONYMIZED_TELEMETRY = "False"; - WEBUI_AUTH = "False"; - ENABLE_LOGIN_FORM = "False"; - }; - }; system.stateVersion = "25.05"; # great taboo of the nixos world } diff --git a/modules/default.nix b/modules/default.nix index b151a3c..9f0fd16 100644 --- a/modules/default.nix +++ b/modules/default.nix @@ -13,6 +13,7 @@ ./i18n.nix ./jellyfin.nix ./nix-settings.nix + ./ollama.nix ./remote-builds.nix ./secrets.nix ./sound.nix diff --git a/modules/ollama.nix b/modules/ollama.nix new file mode 100644 index 0000000..4638a99 --- /dev/null +++ b/modules/ollama.nix @@ -0,0 +1,40 @@ +{ + lib, + config, + ... +}: { + options = { + myModules = { + enableOllama = lib.mkOption { + type = lib.types.bool; + default = false; + description = "Enable Ollama services."; + }; + }; + }; + + + config = lib.mkMerge [ + (lib.mkIf config.myModules.enableOllama { + services.ollama = { + enable = true; + acceleration = "cuda"; + loadModels = ["deepseek-r1:7b" "deepseek-r1:14b"]; + }; + + services.open-webui = { + enable = true; + port = 7070; + host = "0.0.0.0"; + openFirewall = true; + environment = { + SCARF_NO_ANALYTICS = "True"; + DO_NOT_TRACK = "True"; + ANONYMIZED_TELEMETRY = "False"; + WEBUI_AUTH = "False"; + ENABLE_LOGIN_FORM = "False"; + }; + }; + }) + ]; +} \ No newline at end of file