Move tailscale to module

This commit is contained in:
2023-05-08 21:08:12 +01:00
parent 8448a7aee8
commit 6564ecc3ca
3 changed files with 23 additions and 1 deletions

View File

@ -20,9 +20,10 @@
./dev/zig.nix
./editors/neovim
./editors/vscode.nix
./networking/tailscale.nix
./security/gpg.nix
./security/pass.nix
./shell/git
./shell/zsh
];
}
}

View File

@ -0,0 +1,20 @@
{ config, lib, pkgs, ... }:
with lib;
with lib.my;
let cfg = config.modules.networking.tailscale;
in {
options.modules.networking.tailscale = {
enable = mkBoolOpt false;
};
config = mkIf cfg.enable {
services.tailscale.enable = true;
services.openssh.openFirewall = false;
networking.firewall = {
checkReversePath = "loose";
trustedInterfaces = [ "tailscale0" ];
allowedUDPPorts = [ config.services.tailscale.port ];
};
};
}