about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--users/tazjin/nixos/modules/persistence.nix24
-rw-r--r--users/tazjin/nixos/modules/zerotier.nix12
-rw-r--r--users/tazjin/nixos/tverskoy/default.nix27
3 files changed, 39 insertions, 24 deletions
diff --git a/users/tazjin/nixos/modules/persistence.nix b/users/tazjin/nixos/modules/persistence.nix
new file mode 100644
index 000000000000..c07ec9227ca2
--- /dev/null
+++ b/users/tazjin/nixos/modules/persistence.nix
@@ -0,0 +1,24 @@
+# Configuration for persistent (non-home) data.
+{ depot, pkgs, lib, ... }:
+
+{
+  imports = [
+    "${depot.third_party.impermanence}/nixos.nix"
+  ];
+
+  environment.persistence."/persist" = {
+    directories = [
+      "/etc/NetworkManager/system-connections"
+      "/etc/mullvad-vpn"
+      "/var/cache/mullvad-vpn"
+      "/var/lib/bluetooth"
+      "/var/lib/systemd/coredump"
+      "/var/lib/tailscale"
+      "/var/log"
+    ];
+
+    files = [
+      "/etc/machine-id"
+    ];
+  };
+}
diff --git a/users/tazjin/nixos/modules/zerotier.nix b/users/tazjin/nixos/modules/zerotier.nix
new file mode 100644
index 000000000000..bbd6d850c180
--- /dev/null
+++ b/users/tazjin/nixos/modules/zerotier.nix
@@ -0,0 +1,12 @@
+# Configuration for my Zerotier network.
+
+{
+  environment.persistence."/persist".directories = [
+    "/var/lib/zerotier-one"
+  ];
+
+  services.zerotierone.enable = true;
+  services.zerotierone.joinNetworks = [
+    "35c192ce9bd4c8c7"
+  ];
+}
diff --git a/users/tazjin/nixos/tverskoy/default.nix b/users/tazjin/nixos/tverskoy/default.nix
index c2a8367846c4..e674b27730b0 100644
--- a/users/tazjin/nixos/tverskoy/default.nix
+++ b/users/tazjin/nixos/tverskoy/default.nix
@@ -14,9 +14,10 @@ in
 lib.fix (self: {
   imports = [
     (mod "open_eid.nix")
-    (usermod "physical.nix")
     (usermod "fonts.nix")
-    "${depot.third_party.impermanence}/nixos.nix"
+    (usermod "persistence.nix")
+    (usermod "physical.nix")
+    (usermod "zerotier.nix")
     "${pkgs.home-manager.src}/nixos"
   ] ++ lib.optional (builtins.pathExists ./local-config.nix) ./local-config.nix;
 
@@ -109,23 +110,6 @@ lib.fix (self: {
     ];
   };
 
-  environment.persistence."/persist" = {
-    directories = [
-      "/etc/NetworkManager/system-connections"
-      "/etc/mullvad-vpn"
-      "/var/cache/mullvad-vpn"
-      "/var/lib/bluetooth"
-      "/var/lib/systemd/coredump"
-      "/var/lib/tailscale"
-      "/var/lib/zerotier-one"
-      "/var/log"
-    ];
-
-    files = [
-      "/etc/machine-id"
-    ];
-  };
-
   # from https://github.com/NixOS/nixpkgs/issues/64965
   environment.etc."ipsec.secrets".text = ''
     include ipsec.d/ipsec.nm-l2tp.secrets
@@ -340,10 +324,5 @@ lib.fix (self: {
 
   services.tailscale.enable = true;
 
-  services.zerotierone.enable = true;
-  services.zerotierone.joinNetworks = [
-    "35c192ce9bd4c8c7"
-  ];
-
   system.stateVersion = "20.09";
 })