1
0
Fork 0
mirror of https://github.com/LnL7/nix-darwin.git synced 2025-03-31 04:04:45 +00:00

Set models as null by default

This commit is contained in:
Velnbur 2024-06-28 11:22:45 +03:00
parent 43de1c87a1
commit 4ebe46f225
No known key found for this signature in database

View file

@ -40,8 +40,8 @@ in {
};
models = mkOption {
type = types.str;
default = "$HOME/.ollama/models";
type = types.nullOr types.str;
default = null;
example = "/path/to/ollama/models";
description = ''
The directory that the ollama service will read models from and download new models to.
@ -79,9 +79,10 @@ in {
ProgramArguments = [ "${cfg.package}/bin/ollama" "serve" ];
EnvironmentVariables = cfg.environmentVariables // {
OLLAMA_MODELS = cfg.models;
OLLAMA_HOST = "${cfg.host}:${toString cfg.port}";
};
} // (optionalAttrs (cfg.models != null) {
OLLAMA_MODELS = cfg.models;
});
};
};
};