summary refs log tree commit diff stats
path: root/modules
diff options
context:
space:
mode:
authorSilas Schöffel <sils@sils.li>2024-06-02 14:57:04 +0200
committerSilas Schöffel <sils@sils.li>2024-06-02 14:57:04 +0200
commit6772fa0ce45c4b8408c6a1ae62ab7deaaefc2c5b (patch)
treef298fe021aa2c3fdee310c1a84b0f7eb81db0cc5 /modules
parentfont: init module (diff)
downloadnix-config-6772fa0ce45c4b8408c6a1ae62ab7deaaefc2c5b.tar.gz
nix-config-6772fa0ce45c4b8408c6a1ae62ab7deaaefc2c5b.zip
impermanence: init module
Diffstat (limited to 'modules')
-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;