impermanence
This commit is contained in:
57
impermanence.nix
Normal file
57
impermanence.nix
Normal 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"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user