3 KiB
3 KiB
“Impermanent” (in NixOS terms) usually means your / is treated as disposable: on boot you either mount it as tmpfs or roll it back to a clean Btrfs snapshot, and you only keep state in explicitly persistent mounts (commonly /nix, /home, plus a /persist).
What changes overall
- Your system becomes “reprovisioned” from Nix each boot/rebuild: the OS + config is reliable and drift-resistant, but anything that writes state under
/etcor/varwill be lost unless you persist it. - Declared things (NixOS options,
environment.systemPackages, enabled services) will come back automatically; undeclared/manual tweaks won’t.
In your repo, the big practical impacts would be
- Nix store and system packages: fine as long as
/nixis persistent (yourmodules/system/disko-btrfs.nixalready has a/nixsubvolume).environment.systemPackages(likegit,flatpak,podman-compose, etc.) is unaffected. - Flatpak (
modules/system/flatpak.nix): the declarative intent stays, but the actual installed Flatpaks/remotes live in state dirs (typically system:/var/lib/flatpak, user:~/.local/share/flatpak). If those aren’t persisted, you’ll re-download/reinstall frequently and offline boots can be annoying. - Secure Boot keys (
modules/system/secure-boot.nix): you already point Lanzaboote at/var/lib/secureboot. If that path isn’t persisted, you risk regenerating keys and getting into a “firmware enrolled keys vs disk keys” mismatch situation. - SSH (
modules/system/services.nixenablesopenssh): host keys are typically under/etc/ssh. If they aren’t persisted, the host key changes after resets, which breaks known-hosts trust and can lock you out in headless scenarios. - Libvirt/VMs (
modules/system/virtualization.nixenableslibvirtd+ virt-manager): libvirt state and VM images commonly live under/var/lib/libvirt. If/varis wiped, your VMs disappear unless you store/persist them elsewhere. - Podman/containers: rootless images/volumes are in your home (fine if
/homepersists); rootful storage is usually under/var/lib/containers(lost if not persisted). - Printing (
modules/system/printer.nix): CUPS queues/config live under/etc/cupsand/var/lib/cups. With an impermanent root, any printers you add via GUI will vanish unless you persist those paths or configure printers declaratively. - Home Manager bootstrap marker (
modules/users/admin.nix): it writes%h/.config/home-manager/.hm_bootstrap_done. If/homeisn’t persistent, that “one-time” bootstrap will run every login.
Rule of thumb
- Make
/nixpersistent (required). - Decide whether
/homeis persistent (strongly recommended with your current “HM standalone per-user” setup). - Persist selected state from
/etcand/varbased on the services you run (at minimum for your config:/var/lib/secureboot,/etc/ssh, plus whichever of/var/lib/flatpak,/var/lib/libvirt,/etc/cups//var/lib/cupsyou care about).