32 lines
677 B
Nix
32 lines
677 B
Nix
|
{ 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"
|
||
|
];
|
||
|
};
|
||
|
};
|
||
|
}
|