about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--modules/services/tailscale.nix22
1 files changed, 22 insertions, 0 deletions
diff --git a/modules/services/tailscale.nix b/modules/services/tailscale.nix
new file mode 100644
index 0000000..8778524
--- /dev/null
+++ b/modules/services/tailscale.nix
@@ -0,0 +1,22 @@
+{ config, lib, ... }:
+
+with lib;
+let
+  cfg = config.modules.services.tailscale;
+in
+{
+  options.modules.services.tailscale = {
+    enable = mkEnableOption "tailscale";
+  };
+
+  config = mkIf cfg.enable {
+    services.tailscale = {
+      enable = true;
+      useRoutingFeatures = "both";
+    };
+
+    environment.persistence."/persist".directories = [
+      "/var/lib/tailscale"
+    ];
+  };
+}