about summary refs log tree commit diff stats
path: root/system
diff options
context:
space:
mode:
Diffstat (limited to 'system')
-rw-r--r--system/default.nix2
-rw-r--r--system/fileSystemLayouts/default.nix1
-rw-r--r--system/impermanence/default.nix45
3 files changed, 48 insertions, 0 deletions
diff --git a/system/default.nix b/system/default.nix
index 73f53119..543d889c 100644
--- a/system/default.nix
+++ b/system/default.nix
@@ -6,6 +6,8 @@
     ./locale
     ./packages
     ./sound
+
+    ./impermanence
   ];
 
 }
diff --git a/system/fileSystemLayouts/default.nix b/system/fileSystemLayouts/default.nix
index 9a9b8add..d861d888 100644
--- a/system/fileSystemLayouts/default.nix
+++ b/system/fileSystemLayouts/default.nix
@@ -35,6 +35,7 @@ in {
       "/srv" = {
         device = cfg.mainDisk;
         fsType = "btrfs";
+        neededForBoot = true;
         options = ["subvol=storage" "compress-force=zstd:15"];
       };
       "/boot" = {
diff --git a/system/impermanence/default.nix b/system/impermanence/default.nix
new file mode 100644
index 00000000..16ac3c47
--- /dev/null
+++ b/system/impermanence/default.nix
@@ -0,0 +1,45 @@
+{
+  config,
+  impermanence,
+  ...
+}: {
+  imports = [
+    impermanence.nixosModules.impermanence
+  ];
+
+  environment.persistence."/srv" = {
+    hideMounts = true;
+    directories = [
+      "/var/log"
+      # TODO this needs to be checked
+      #"/var/lib/bluetooth"
+      #"/var/lib/nixos"
+      #"/var/lib/systemd/coredump"
+      {
+        directory = "/var/lib/colord";
+        user = "colord";
+        group = "colord";
+        mode = "u=rwx,g=rx,o=";
+      }
+    ];
+    files = [
+      "/etc/machine-id"
+      {
+        file = "/etc/nix/id_rsa";
+        parentDirectory = {mode = "u=rwx,g=,o=";};
+      }
+    ];
+    users.soispha = {
+      home = "/srv/home/soispha"; # TODO link this to ${config.users.users.soispha.homeDirectory}
+      directories = [
+        ".local/share"
+        ".cache"
+
+        "media"
+        "repos"
+        "school"
+      ];
+      # TODO allowOther = true;
+    };
+  };
+}