about summary refs log tree commit diff
path: root/modules
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2022-04-05 17:27:04 -0700
committerFranck Cuny <franck@fcuny.net>2022-04-05 17:27:04 -0700
commit35e8b8b78d4ad3b8002b922bc0a9f9dcbcf47351 (patch)
tree532c717f6a83d19c84d05c0cecd4e90c693bef58 /modules
parentssh: refactor to a module (diff)
downloadworld-35e8b8b78d4ad3b8002b922bc0a9f9dcbcf47351.tar.gz
network: move tailscale in modules
Move the networking configuration for the hosts to its own file.
Diffstat (limited to '')
-rw-r--r--modules/services/default.nix2
-rw-r--r--modules/services/tailscale/default.nix13
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" ];
+  };
+}