nixos/ollama: update port option, use types.port
This commit is contained in:
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user