From 4bfaeecd660880a018b5715f541ae1eb877f5d4c Mon Sep 17 00:00:00 2001 From: Natasha Moongrave Date: Mon, 1 Jun 2026 19:24:45 +0200 Subject: Added a local ai stack to herra --- hosts/herra/ai.nix | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 hosts/herra/ai.nix (limited to 'hosts/herra/ai.nix') diff --git a/hosts/herra/ai.nix b/hosts/herra/ai.nix new file mode 100644 index 0000000..9ca7632 --- /dev/null +++ b/hosts/herra/ai.nix @@ -0,0 +1,51 @@ +{pkgs, ...}: { + virtualisation.docker.enable = true; + + environment.systemPackages = with pkgs; [ + arion + ]; + + services.ollama = { + enable = true; + + host = "0.0.0.0"; + port = 11434; + + # probably won't work reliably on Polaris + # acceleration = "rocm"; + }; + + services.nginx = { + enable = true; + + virtualHosts."ai.local" = { + locations."/" = { + proxyPass = "http://127.0.0.1:7000"; + proxyWebsockets = true; + }; + }; + }; + + environment.etc."arion/arion-compose.nix".source = + ./arion-compose.nix; + + systemd.services.odysseus = { + wantedBy = ["multi-user.target"]; + + after = [ + "docker.service" + "ollama.service" + ]; + + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = true; + + WorkingDirectory = "/etc/arion"; + + ExecStart = "${pkgs.arion}/bin/arion up -d"; + + ExecStop = "${pkgs.arion}/bin/arion down"; + }; + }; +} -- cgit v1.2.3