tree imports all now

This commit is contained in:
Callum Leslie 2026-04-22 18:32:42 +01:00
parent e692e1ec13
commit 9b48220a2a
Signed by: cleslie
GPG key ID: D382C4AFEECEAA90
11 changed files with 258 additions and 25 deletions

38
tree/tailscale.nix Normal file
View file

@ -0,0 +1,38 @@
{...}: {
flake.nixosModules.tailscale = {
config,
lib,
...
}:
with lib; let
cfg = config.c.services.mesh;
in {
options.c.services.mesh = {
enable = mkEnableOption "Enable tailscale daemon.";
exitNode = mkOption {
type = types.bool;
default = false;
description = "Enable advertising as an exit node.";
};
keyFile = mkOption {
type = types.path;
description = "Path to key file.";
};
};
config = mkIf cfg.enable {
services.tailscale = {
enable = true;
openFirewall = true;
authKeyFile = cfg.keyFile;
extraUpFlags = [
"--login-server"
"https://mesh.cleslie.uk"
];
extraSetFlags = [(mkIf cfg.exitNode "--advertise-exit-node")];
};
networking.firewall = {
trustedInterfaces = [config.services.tailscale.interfaceName];
};
};
};
}