Skip to content

docs: apply the migration from impermanence with nixos-rebuild boot - #34

Open
ferris-qq wants to merge 1 commit into
nix-community:mainfrom
ferris-qq:docs-migration-boot
Open

ferris-qq wants to merge 1 commit into
nix-community:mainfrom
ferris-qq:docs-migration-boot

Conversation

@ferris-qq

Copy link
Copy Markdown

The migration guide doesn't say how to apply the configuration that replaces impermanence. A nixos-rebuild switch from a system that was booted with impermanence stops everything impermanence set up there, because the new configuration no longer declares it:

  • Each persisted file has a persist-*.service unit whose ExecStop removes the symlink, or unmounts and removes the bind-mounted file, at the file's path (impermanence nixos.nix). switch-to-configuration stops an active unit whose unit file is gone (main.rs).
  • Directories are bind mounts: /etc/fstab entries before nix-community/impermanence@2b99fef, mount units since. switch-to-configuration unmounts an fstab entry that disappeared (main.rs) and stops a removed mount unit as above.

Preservation sets up inInitrd entries only in the initrd (module.nix), so /etc/machine-id or /var/log stay missing from the running system until the next boot. #7 looks like the same thing: the first switch after a migration stopped the mounts, and switching was fine once the system had booted with Preservation.

This adds a short "Applying the migration" section that recommends nixos-rebuild boot and a reboot. I migrated my own system that way, and afterwards all 105 persisted paths were in place, the same as before. nix build ./docs#packages.x86_64-linux.docs builds, and the new section renders as a heading, three paragraphs and a two-item list. I haven't reproduced a failing switch; the above comes from reading the code.

Disclosure: researched and drafted with help from Claude Code (Claude Opus 5.5).

A switch from a system booted with impermanence stops its persist-*
services, whose ExecStop removes each persisted file's link, and
unmounts its directory bind mounts. Entries with inInitrd are only set
up at boot, so they stay missing until the next one.

Assisted-by: Claude Code (Claude Opus 5.5)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant