nix-infra/modules/nixos/impermanence/default.nix

32 lines
677 B
Nix
Raw Normal View History

2024-06-05 16:16:21 +00:00
{ lib, config, ... }:
let
cfg = config.cherrykitten.impermanence;
in
{
options.cherrykitten.impermanence = {
enable = lib.mkEnableOption "impermanence";
};
config = lib.mkIf cfg.enable {
environment.persistence."/nix/persist" = {
hideMounts = true;
directories = [
"/var/log"
"/var/lib/bluetooth"
"/var/lib/nixos"
"/var/lib/systemd/coredump"
"/var/lib/iwd"
"/home"
];
files = [
"/etc/machine-id"
"/etc/ssh/ssh_host_rsa_key"
"/etc/ssh/ssh_host_rsa_key.pub"
"/etc/ssh/ssh_host_ed25519_key"
"/etc/ssh/ssh_host_ed25519_key.pub"
];
};
};
}