refactor: moved modules to legacy-modules
This commit is contained in:
parent
d646b954ac
commit
db7ac35613
233 changed files with 5 additions and 5 deletions
32
legacy-modules/nixos-modules/ollama/ollama.nix
Normal file
32
legacy-modules/nixos-modules/ollama/ollama.nix
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
...
|
||||
}: {
|
||||
options = {
|
||||
services.ollama.exposePort = lib.mkEnableOption "should we expose ollama on tailscale";
|
||||
};
|
||||
|
||||
config = lib.mkIf config.services.ollama.enable (
|
||||
lib.mkMerge [
|
||||
{
|
||||
services.ollama = {
|
||||
# TODO: these should match whats set in the users file
|
||||
group = "ollama";
|
||||
user = "ollama";
|
||||
};
|
||||
}
|
||||
(lib.mkIf config.services.ollama.exposePort (let
|
||||
ports = [
|
||||
config.services.ollama.port
|
||||
];
|
||||
in {
|
||||
services.ollama.host = "0.0.0.0";
|
||||
networking.firewall.interfaces.${config.services.tailscale.interfaceName} = {
|
||||
allowedTCPPorts = ports;
|
||||
allowedUDPPorts = ports;
|
||||
};
|
||||
}))
|
||||
]
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue