29 lines
779 B
Nix
29 lines
779 B
Nix
{ config, lib, ... }:
|
|
{
|
|
options.server.ollama.enable = lib.mkEnableOption "Enable Ollama server /w GPU acceleration";
|
|
options.server.ollama.options = lib.mkOption {
|
|
description = "additional options to pass to ollama";
|
|
default = { };
|
|
};
|
|
|
|
config = lib.mkIf config.server.ollama.enable {
|
|
services.ollama = lib.attrsets.recursiveUpdate {
|
|
enable = true;
|
|
host = "0.0.0.0";
|
|
|
|
# acceleration = "rocm";
|
|
# rocmOverrideGfx = "11.0.0";
|
|
} config.server.ollama.options;
|
|
|
|
networking.firewall.allowedTCPPorts = [ 11434 ];
|
|
|
|
environment.persistence."/persist/cache".directories = [
|
|
{
|
|
directory = "/var/lib/private/ollama";
|
|
user = "nouser";
|
|
group = "nogroup";
|
|
mode = "u=rwx,g=,o=";
|
|
}
|
|
];
|
|
};
|
|
}
|