docs: explain automatic generation prune for users (#128)
Some checks failed
Check / eval (push) Has been cancelled

RECOVERY §4 documents the 14-day / keep-≥3-past policy for system and
Home Manager gens, with dry-run and timer commands. README and
REQUIREMENTS point here so install and day-2 hygiene match the product.
This commit is contained in:
2026-07-15 12:00:17 +01:00
parent e4800d7d8e
commit c9dd7575bf
4 changed files with 61 additions and 10 deletions

View File

@@ -57,20 +57,52 @@ journalctl --user -b # Hyprland + the user services
## 3. A system change broke it — boot an older generation
Reboot and pick an older **NixOS generation** in the systemd-boot menu
(hold a key during firmware handoff if the menu doesn't linger; the
last 10 generations are kept). That boots yesterday's system unchanged.
(hold a key during firmware handoff if the menu doesn't linger). That
boots yesterday's system unchanged.
Booting an old generation is temporary — the default entry is still the
broken one. Make the fix stick from the working boot: revert the change
in `~/.nomarchy` (`git -C ~/.nomarchy revert …` or edit `system.nix`
back), then `nomarchy-rebuild`.
**Automatic prune (#128):** a weekly timer (`nomarchy-gen-prune`) removes
system *and* Home Manager generations that are **older than 14 days** and
**beyond the three most recent past gens** (current + ≥3 past always kept).
Manual: `sudo nomarchy-gen-prune` (or `--dry-run`).
How long generations stick around (and how cleanup works) is §4 below.
## 4. Files went missing or wrong — snapshots (BTRFS installs)
## 4. How generations are kept (and cleaned up)
Every `nomarchy-rebuild` and `nomarchy-home` (and every theme switch) leaves
a **generation** — a full previous system or desktop you can roll back to
(§1 and §3, and **System Recovery**). Those take disk space until they
are removed.
Nomarchy prunes them **automatically once a week** with a policy designed
not to strand you without rollback:
| Rule | Meaning |
|------|---------|
| **Age** | Generations older than **14 days** are eligible for removal. |
| **Safety floor** | Always keep the **current** generation and at least **3 past** ones — even if those three are older than 14 days. |
| **Both halves** | The same rule applies independently to the **system** (boot menu) and to **Home Manager** (desktop) profiles. |
So a busy machine that rebuilds often can still free old junk after two
weeks, while a rarely rebuilt laptop never drops below four usable
system gens (current + three past) or four desktop gens.
**What you do not need to do:** run aggressive `nix-collect-garbage -d`
day to day — that can delete *all* old generations and wipe the floor.
The weekly timer already reclaims store paths after a careful prune.
**Manual control:**
```sh
sudo nomarchy-gen-prune --dry-run # list what would be deleted
sudo nomarchy-gen-prune # prune now (same rules as the timer)
systemctl status nomarchy-gen-prune.timer
```
After a system prune the boot menu is refreshed so removed generations
no longer appear as boot entries.
## 5. Files went missing or wrong — snapshots (BTRFS installs)
With `nomarchy.system.snapper.enable` (the installer's default on
BTRFS), the root filesystem has hourly/daily history, and