diff options
| author | adikro <adikro@disroot.org> | 2025-12-20 03:14:45 +0100 |
|---|---|---|
| committer | adikro <adikro@disroot.org> | 2025-12-20 03:14:45 +0100 |
| commit | 791bc419b6dac7c70951981ef6b34cdf85828470 (patch) | |
| tree | 56d0962fdf829ae942feb1344763e54dbc3c89a3 /sys/srv/ollama.nix | |
| parent | e60410393cea222b16743a1a87f29c06b9b3543b (diff) | |
absolutely massive rewrite, made (almost) everything modular with changes to come
Diffstat (limited to 'sys/srv/ollama.nix')
| -rw-r--r-- | sys/srv/ollama.nix | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/sys/srv/ollama.nix b/sys/srv/ollama.nix new file mode 100644 index 0000000..7cb90bf --- /dev/null +++ b/sys/srv/ollama.nix @@ -0,0 +1,37 @@ +{ config, lib, pkgs, ... }: +let + cfg = config.szpont.sys.srv.ollama; +in +{ + options.szpont.sys.srv.ollama = { + enable = lib.mkEnableOption "Ollama AI service"; + + useRocm = lib.mkOption { + type = lib.types.bool; + default = true; + description = "whether to use ollama with ROCm support."; + }; + }; + + config = lib.mkIf cfg.enable { + fileSystems."/models" = { + device = "/home/ollama"; + fsType = "none"; + options = [ "bind" ]; + }; + + services.ollama = { + enable = true; + package = if cfg.useRocm then pkgs.ollama-rocm else pkgs.ollama; + + user = "ollama"; + models = "/models"; + + syncModels = true; + loadModels = [ + "deepseek-r1:14b" + "qwen3:14b" + ]; + }; + }; +} |
