This commit is contained in:
Lilith 2025-12-04 13:28:25 +01:00
parent a18e244ba5
commit 05a9d96d4e
No known key found for this signature in database
GPG key ID: 272C807BD91F8446
26 changed files with 861 additions and 182 deletions

29
server/ollama.nix Normal file
View file

@ -0,0 +1,29 @@
{ 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=";
}
];
};
}