summaryrefslogtreecommitdiff
path: root/modules/nixos/traits/tailscale.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/nixos/traits/tailscale.nix')
-rw-r--r--modules/nixos/traits/tailscale.nix52
1 files changed, 0 insertions, 52 deletions
diff --git a/modules/nixos/traits/tailscale.nix b/modules/nixos/traits/tailscale.nix
deleted file mode 100644
index ea38e5c..0000000
--- a/modules/nixos/traits/tailscale.nix
+++ /dev/null
@@ -1,52 +0,0 @@
-{
- config,
- lib,
- secretsDir,
- ...
-}:
-let
- cfg = config.traits.tailscale;
-in
-{
- options.traits.tailscale = {
- enable = lib.mkEnableOption "Tailscale";
- ssh.enable = lib.mkEnableOption "Tailscale SSH";
- manageSecrets = lib.mkEnableOption "automatic management of secrets";
- };
-
- config = lib.mkIf cfg.enable (
- lib.mkMerge [
- {
- networking.firewall = {
- # all connections from tailscale are safe...or should be
- trustedInterfaces = [ config.services.tailscale.interfaceName ];
- };
-
- services.tailscale = {
- enable = true;
- openFirewall = true;
- };
- }
-
- (lib.mkIf cfg.ssh.enable {
- networking.firewall = {
- allowedTCPPorts = [ 22 ];
- };
-
- services.tailscale = {
- extraUpFlags = [ "--ssh" ];
- };
- })
-
- (lib.mkIf cfg.manageSecrets {
- age.secrets = lib.mkIf cfg.manageSecrets {
- tailscaleAuthKey.file = "${secretsDir}/tailscaleAuthKey.age";
- };
-
- services.tailscale = {
- authKeyFile = config.age.secrets.tailscaleAuthKey.path;
- };
- })
- ]
- );
-}