From c54890e2263658f5f73b11fb451ea35d9bb69ee2 Mon Sep 17 00:00:00 2001 From: Pol Dellaiera Date: Wed, 5 Jun 2024 07:13:11 +0200 Subject: nixos/ollama: update `port` option, use `types.port` --- nixos/modules/services/misc/ollama.nix | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'nixos/modules') diff --git a/nixos/modules/services/misc/ollama.nix b/nixos/modules/services/misc/ollama.nix index 47ff201ef7800..886eaa180b9ef 100644 --- a/nixos/modules/services/misc/ollama.nix +++ b/nixos/modules/services/misc/ollama.nix @@ -78,11 +78,11 @@ in ''; }; port = lib.mkOption { - type = types.nullOr types.ints.u16; + type = types.port; default = 11434; example = 11111; description = '' - Which port the ollama server listens to. Set to `null` to not specify a port. + Which port the ollama server listens to. ''; }; acceleration = lib.mkOption { @@ -135,11 +135,7 @@ in environment = cfg.environmentVariables // { HOME = cfg.home; OLLAMA_MODELS = cfg.models; - OLLAMA_HOST = - if cfg.port == null then - cfg.host - else - "${cfg.host}:${toString cfg.port}"; + OLLAMA_HOST = "${cfg.host}:${toString cfg.port}"; }; serviceConfig = { ExecStart = "${lib.getExe ollamaPackage} serve"; -- cgit 1.4.1