summaryrefslogtreecommitdiff
path: root/modules/hosts/luna/preservation.nix
blob: 7745e24f17af28463416e2751bc93778249aefb2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{ self, inputs, ... }: {

flake.nixosModules.lunaPreservation = { 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/REAPER"
        ];
        files = [];
      };
    };
  };
};

}