added ollama to defiant

This commit is contained in:
Leyla Becker 2025-05-24 22:17:19 -05:00
parent 5cc41542e1
commit 7b6344b419
3 changed files with 32 additions and 2 deletions

View file

@ -3,6 +3,10 @@
lib,
...
}: {
options = {
services.ollama.exposePort = lib.mkEnableOption "should we expose ollama on tailscale";
};
config = lib.mkMerge [
{
services.ollama = {
@ -22,6 +26,15 @@
}
];
};
networking.firewall.interfaces.${config.services.tailscale.interfaceName} = let
ports = [
config.services.ollama.port
];
in
lib.mkIf config.services.ollama.exposePort {
allowedTCPPorts = ports;
allowedUDPPorts = ports;
};
}))
];
}