about summary refs log tree commit diff
diff options
context:
space:
mode:
authorsefidel <contact@sefidel.net>2023-11-12 17:10:17 +0900
committersefidel <contact@sefidel.net>2023-11-12 17:10:17 +0900
commit6d8936dd7b7582c0a4d13e3ac895131f837f58ec (patch)
tree7e784b1cbe0c76cdfb0c602eb4b4da368c2bd96b
parentefd1420183b427bf0b0a9bb0e5915a1fa4061845 (diff)
downloadinfra-6d8936dd7b7582c0a4d13e3ac895131f837f58ec.tar.gz
infra-6d8936dd7b7582c0a4d13e3ac895131f837f58ec.zip
feat(modules/tailscale): init
-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"
+    ];
+  };
+}