Switch to impermanence

This commit is contained in:
Vili Sinervä 2025-06-29 15:25:07 +03:00
parent 44af0493db
commit 7e05e5ddc0
Signed by: Vili Sinervä
SSH key fingerprint: SHA256:FladqYjaE4scJY3Hi+gnShZ6ygnTJgixy0I6BAoHyos
5 changed files with 37 additions and 46 deletions

View file

@ -34,34 +34,23 @@
ssss
];
######################################## Preservation ###########################################
preservation = {
######################################## Impermanence ###########################################
environment.persistence."/persist" = {
enable = lib.mkDefault false;
preserveAt."/persist" = {
files = [
{
file = "/etc/machine-id";
inInitrd = true;
}
{
file = "/etc/ssh/ssh_host_rsa_key";
how = "symlink";
inInitrd = true; # sops-nix
}
{
file = "/etc/ssh/ssh_host_ed25519_key";
how = "symlink";
inInitrd = true; # sops-nix
}
];
directories = [
"/var/lib/systemd/timers"
"/var/lib/nixos"
"/var/log"
];
};
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"
];
};
systemd.suppressedSystemUnits = [ "systemd-machine-id-commit.service" ];
######################################## ZSH configuration ######################################
users.defaultUserShell = pkgs.zsh;

View file

@ -1,5 +1,7 @@
{ lib, ... }:
{
fileSystems."/persist".neededForBoot = true;
services.zfs = {
autoScrub.enable = true;
autoSnapshot = {