summary refs log tree commit diff stats
path: root/modules/nixos
diff options
context:
space:
mode:
Diffstat (limited to 'modules/nixos')
-rw-r--r--modules/nixos/sils/default.nix1
-rw-r--r--modules/nixos/sils/impermanence.nix31
-rw-r--r--modules/nixos/sils/roles.nix1
3 files changed, 33 insertions, 0 deletions
diff --git a/modules/nixos/sils/default.nix b/modules/nixos/sils/default.nix
index 7135ff9..a0fe1ac 100644
--- a/modules/nixos/sils/default.nix
+++ b/modules/nixos/sils/default.nix
@@ -5,6 +5,7 @@
     ./environment.nix
     ./font.nix
     ./hyprland.nix
+    ./impermanence.nix
     ./meta.nix
     ./networking.nix
     ./nix.nix
diff --git a/modules/nixos/sils/impermanence.nix b/modules/nixos/sils/impermanence.nix
new file mode 100644
index 0000000..55651e0
--- /dev/null
+++ b/modules/nixos/sils/impermanence.nix
@@ -0,0 +1,31 @@
+{
+  config,
+  lib,
+  ...
+}: let
+  cfg = config.sils.impermanence;
+in {
+  options.sils.impermanence.enable = lib.mkEnableOption "impermanence to persist directories";
+  config = lib.mkIf cfg.enable {
+    environment.persistence."/srv".directories = [
+      {
+        directory = "/var/lib/bluetooth";
+        user = "root";
+        group = "root";
+        mode = "0700";
+      }
+      {
+        directory = "/root";
+        user = "root";
+        group = "root";
+        mode = "0700";
+      }
+      {
+        directory = "/var/lib/waydroid";
+        user = "root";
+        group = "root";
+        mode = "0700";
+      }
+    ];
+  };
+}
diff --git a/modules/nixos/sils/roles.nix b/modules/nixos/sils/roles.nix
index e973759..94511b9 100644
--- a/modules/nixos/sils/roles.nix
+++ b/modules/nixos/sils/roles.nix
@@ -9,6 +9,7 @@ in {
       environment.enable = true;
       font.enable = true;
       hyprland.enable = true;
+      impermanence.enable = true;
       networking.enable = true;
       nix-config.enable = true;
       plymouth.enable = true;