diff options
author | tzlil <tzlils@protonmail.com> | 2023-07-29 20:53:14 +0300 |
---|---|---|
committer | tzlil <tzlils@protonmail.com> | 2023-07-29 20:53:14 +0300 |
commit | feefcfc89b00d4955dbb3314c20be035f3db206f (patch) | |
tree | 5099a13763dcfd274cae83af4dbac0bf4bef6cce /profiles/impermanence.nix | |
parent | 11526bdd2bb3b4b445665aa671e4bc72021b8183 (diff) |
disko for laptop, wip rewrite
Diffstat (limited to 'profiles/impermanence.nix')
-rw-r--r-- | profiles/impermanence.nix | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/profiles/impermanence.nix b/profiles/impermanence.nix new file mode 100644 index 0000000..5ee9c97 --- /dev/null +++ b/profiles/impermanence.nix @@ -0,0 +1,29 @@ +{inputs, ...}: { + config, + lib, + options, + ... +}: let + sshHostKeys = builtins.catAttrs "path" config.services.openssh.hostKeys; +in { + imports = [inputs.impermanence.nixosModules.impermanence]; + + config = lib.mkMerge [ + { + environment.persistence."/nix/persistent" = { + 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 = + [ + "/etc/machine-id" + ] + ++ sshHostKeys; + }; + } + (lib.optionalAttrs (options ? age) {age.identityPaths = map (x: "/nix/persistent" + x) sshHostKeys;}) + ]; +} |