From 35e8b8b78d4ad3b8002b922bc0a9f9dcbcf47351 Mon Sep 17 00:00:00 2001 From: Franck Cuny Date: Tue, 5 Apr 2022 17:27:04 -0700 Subject: network: move tailscale in modules Move the networking configuration for the hosts to its own file. --- modules/services/default.nix | 2 +- modules/services/tailscale/default.nix | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 modules/services/tailscale/default.nix (limited to 'modules/services') 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" ]; + }; +} -- cgit 1.4.1