diff --git a/hosts/kg/configuration.nix b/hosts/kg/configuration.nix index 9760f79..82dd44f 100644 --- a/hosts/kg/configuration.nix +++ b/hosts/kg/configuration.nix @@ -21,7 +21,6 @@ system = { inherit stateVersion; boot.efi.enable = true; - language = "de"; impermanence.enable = true; security = { uutils-coreutils.enable = true; @@ -205,13 +204,16 @@ physicalConnections = [ (topology.mkConnectionRev "router" "wifi") ]; }; - services.ai.ollama = { - enable = true; - acceleration = "cuda"; - models = [ - "llama3.2" - "llama3.1:8b" - ]; + services.ai = { + open-webui.enable = true; + ollama = { + enable = true; + acceleration = "cuda"; + models = [ + "llama3.2" + "llama3.1:8b" + ]; + }; }; time.timeZone = "Europe/Berlin"; diff --git a/services/ai/default.nix b/services/ai/default.nix index c5cbb37..a647fdd 100644 --- a/services/ai/default.nix +++ b/services/ai/default.nix @@ -1 +1,6 @@ -{ imports = [ ./ollama.nix ]; } +{ + imports = [ + ./ollama.nix + ./open-webui.nix + ]; +} diff --git a/services/ai/open-webui.nix b/services/ai/open-webui.nix new file mode 100644 index 0000000..2258e2b --- /dev/null +++ b/services/ai/open-webui.nix @@ -0,0 +1,23 @@ +{ config, lib, ... }: +let + cfg = config.services.ai.open-webui; +in +{ + options.services.ai.open-webui.enable = lib.mkEnableOption "Open-Webui"; + + config = lib.mkMerge [ + { + services.open-webui = { + inherit (cfg) enable; + host = "0.0.0.0"; + port = 11111; + openFirewall = true; + }; + } + + (lib.mkIf config.isImpermanenceEnabled { + environment.persistence."/persist".directories = + lib.optional cfg.enable "/var/lib/private/open-webui"; + }) + ]; +}