aboutsummaryrefslogtreecommitdiff
path: root/hosts/herra/ai.nix
diff options
context:
space:
mode:
Diffstat (limited to 'hosts/herra/ai.nix')
-rw-r--r--hosts/herra/ai.nix51
1 files changed, 51 insertions, 0 deletions
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";
+ };
+ };
+}