summary refs log tree commit diff
path: root/profiles/impermanence.nix
blob: c222a434781b1722c8d7da9d9ce3459bee94325a (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
{
  inputs,
  config,
  lib,
  options,
  ...
}: let
  sshHostKeys = ["/etc/ssh/ssh_host_ed25519_key" "/etc/ssh/ssh_host_rsa_key"];
in {
  imports = [inputs.impermanence.nixosModules.impermanence];

  config = {
    environment.persistence."/nix/persist" = {
      hideMounts = true;
      directories = [
        "/var/log"
        "/var/lib/systemd/coredump"
        "/tmp" # Make builds not crash by running them on disk instead of RAM (We still clean /tmp on boot)
      ];
      files =
        [
        ]
        ++ sshHostKeys
        ++ (map (x: x + ".pub") sshHostKeys);
    };
    age.identityPaths = map (x: "/nix/persist" + x) sshHostKeys;
  };
}