feat: Impermanence (system)

I had to disable initrd's systemd stuff.  I just /couldn't/ get a rollback
service working; believe me, not for a lack of effort!  I've been working on
this on-and-off for a month or two now.
This commit is contained in:
Madeleine Sydney
2025-01-01 15:45:10 -07:00
parent dfa5d6625b
commit 9516c35c7f
7 changed files with 109 additions and 381 deletions

View File

@@ -11,10 +11,6 @@ A second try at NixOS, now that I have a better idea of what I'm doing. The effo
* Inbox
** Refactor: single file per feature
Modules, but lightweight.
* Principles
** User configuration
@@ -75,7 +71,17 @@ Where =default.nix= returns an attrset of form
** Impermanence and persistence
- Persistent files to be linked into ~/~ go under ~/persist/root~
I use impermanence to wipe most of my filesystem on boot.
*** Boot process
What follows is an overview of [[file:modules/nixos/impermanence/rollback.nix][modules/nixos/impermanence/rollback.nix]].
On boot, ...
- The existing subvolume root filesystem will be moved to a 'death row' directory, where it will live for about three days before deletion. Precisely, =«btrfs-filesystem»/«root-subvolume»= is moved to =«btrfs-filesystem»/old-roots/«timestamp»=. The brief grace period allows for easy recovery in the (very common) case where files are unintentionally deleted due to the user's silly human negligence.
- A new, blank subvolume is created in place of the previous. Precisely, the subvolume =«btrfs-filesystem»/«root-subvolume»= is created.
- Any subvolumes under =«btrfs-filesystem»/old-roots= older than three days are deleted.
* Tasks
@@ -301,6 +307,8 @@ https://discourse.nixos.org/t/what-to-do-with-a-full-boot-partition/2049
- If neither are available, use ~nix run nixpkgs#nvim~
- If this fails, try ~nano~.
- Support ~--pager~
*** TODO =rage-edit=
*** TODO ~forget-host HOST~