diff --git a/nixos/modules/services/misc/ollama.nix b/nixos/modules/services/misc/ollama.nix index 47ff201ef780..886eaa180b9e 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";