36 lines
721 B
Nix
36 lines
721 B
Nix
{ lib, ... }:
|
|
{
|
|
# Default set of directories we always want to persist
|
|
environment.persistence."/persist" = {
|
|
enable = true;
|
|
hideMounts = true;
|
|
|
|
files = [
|
|
"/etc/machine-id"
|
|
"/etc/ssh/ssh_host_rsa_key"
|
|
"/etc/ssh/ssh_host_ed25519_key"
|
|
];
|
|
|
|
directories = [
|
|
"/var/lib/systemd/timers"
|
|
"/var/lib/nixos"
|
|
"/var/log"
|
|
];
|
|
};
|
|
|
|
fileSystems."/persist".neededForBoot = true;
|
|
|
|
services.zfs = {
|
|
autoScrub.enable = true;
|
|
autoSnapshot = {
|
|
enable = true;
|
|
flags = "-k -p --utc";
|
|
};
|
|
trim.interval = "daily";
|
|
};
|
|
|
|
boot.initrd.postResumeCommands = lib.mkAfter ''
|
|
zfs rollback -r zroot/root@blank
|
|
zfs rollback -r zroot/home@blank
|
|
'';
|
|
}
|