summaryrefslogtreecommitdiff
path: root/modules/hosts/sol/preservation.nix
diff options
context:
space:
mode:
Diffstat (limited to 'modules/hosts/sol/preservation.nix')
-rw-r--r--modules/hosts/sol/preservation.nix54
1 files changed, 54 insertions, 0 deletions
diff --git a/modules/hosts/sol/preservation.nix b/modules/hosts/sol/preservation.nix
new file mode 100644
index 0000000..a42c890
--- /dev/null
+++ b/modules/hosts/sol/preservation.nix
@@ -0,0 +1,54 @@
+{ self, inputs, ... }: {
+
+flake.nixosModules.solPreservation = { pkgs, lib, ... }: {
+ boot.tmp.cleanOnBoot = true;
+
+ preservation = {
+ enable = true;
+
+ preserveAt."/persistent" = {
+ directories = [
+ "/etc/nixos"
+ {
+ directory = "/var/lib/nixos";
+ inInitrd = true;
+ }
+ "/var/lib/systemd/timers"
+ "/var/lib/bluetooth"
+ "/etc/NetworkManager/system-connections"
+ {
+ directory = "/tmp";
+ mode = "1777";
+ }
+ ];
+ files = [
+ {
+ file = "/etc/machine-id";
+ inInitrd = true;
+ }
+ ];
+
+ users.dk = {
+ directories = [
+ "Pictures"
+ "Projects"
+ "Music"
+ ".config/emacs"
+ "org"
+ ".ssh"
+ ".config/zen"
+ ".cache"
+ ".config/nixos"
+ ".steam"
+ ".local/share/Steam"
+ ".config/vesktop"
+ ".config/ardour9"
+ ".config/guitarix"
+ ];
+ files = [];
+ };
+ };
+ };
+};
+
+}