diff options
author | Franck Cuny <franck@fcuny.net> | 2022-04-05 17:27:04 -0700 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2022-04-05 17:27:04 -0700 |
commit | 35e8b8b78d4ad3b8002b922bc0a9f9dcbcf47351 (patch) | |
tree | 532c717f6a83d19c84d05c0cecd4e90c693bef58 /modules | |
parent | ssh: refactor to a module (diff) | |
download | world-35e8b8b78d4ad3b8002b922bc0a9f9dcbcf47351.tar.gz |
network: move tailscale in modules
Move the networking configuration for the hosts to its own file.
Diffstat (limited to 'modules')
-rw-r--r-- | modules/services/default.nix | 2 | ||||
-rw-r--r-- | modules/services/tailscale/default.nix | 13 |
2 files changed, 14 insertions, 1 deletions
diff --git a/modules/services/default.nix b/modules/services/default.nix index d34f57a..9a5338b 100644 --- a/modules/services/default.nix +++ b/modules/services/default.nix @@ -1 +1 @@ -{ ... }: { imports = [ ./ssh-server ]; } +{ ... }: { imports = [ ./ssh-server ./tailscale ]; } diff --git a/modules/services/tailscale/default.nix b/modules/services/tailscale/default.nix new file mode 100644 index 0000000..cad1cad --- /dev/null +++ b/modules/services/tailscale/default.nix @@ -0,0 +1,13 @@ +{ config, lib, ... }: +let cfg = config.my.services.tailscale; +in { + + options.my.services.tailscale = with lib; { + enable = mkEnableOption "tailscale configuration"; + }; + + config = lib.mkIf cfg.enable { + services.tailscale.enable = true; + networking.firewall.trustedInterfaces = [ "tailscale0" ]; + }; +} |