impermanence

This commit is contained in:
2025-10-06 14:47:19 -04:00
parent a4bf2a0ea9
commit 9d0d0b10d1
5 changed files with 104 additions and 2 deletions

57
impermanence.nix Normal file
View File

@@ -0,0 +1,57 @@
{
config,
lib,
pkgs,
username,
service_configs,
...
}:
{
environment.persistence."/persistent" = {
hideMounts = true;
directories = [
# System directories
"/etc/nixos"
"/var/log"
"/var/lib/nixos"
"/var/lib/systemd/coredump"
"/etc/NetworkManager/system-connections"
"/etc/ssh"
# Wireguard
"/etc/wireguard"
# Systemd persistent timers and state
"/var/lib/systemd/timers"
];
files = [
# SSH host keys
"/etc/ssh/ssh_host_ed25519_key"
"/etc/ssh/ssh_host_ed25519_key.pub"
"/etc/ssh/ssh_host_rsa_key"
"/etc/ssh/ssh_host_rsa_key.pub"
# Machine ID
"/etc/machine-id"
# ZFS cache
"/etc/zfs/zpool.cache"
];
users.${username} = {
directories = [
".ssh"
".config/fish"
".local/share/fish"
".cache"
".config/helix"
];
files = [
".bash_history"
];
};
};
}