fix all the issues with persistence, and change GLaDOS to btrfs as an experiment

This commit is contained in:
Lillian Violet 2026-02-15 17:06:15 +01:00
parent e86ec419c2
commit 022ec828a8
6 changed files with 84 additions and 49 deletions

View file

@ -75,8 +75,36 @@
# };
# };
};
boot = {
# Nuke root AND home subvolumes on every boot
initrd.systemd.services.wipe-my-fs = {
requires = ["dev-mapper-nvme_crypted.device"];
after = ["dev-mapper-nvme_crypted.device"];
wantedBy = ["initrd.target"];
script = ''
mkdir -p /btrfs_tmp
mount /dev/mapper/cryptroot /btrfs_tmp
delete_subvolume_recursively() {
IFS=$'\n'
for i in $(btrfs subvolume list -o "$1" | cut -f 9- -d ' '); do
delete_subvolume_recursively "/btrfs_tmp/$i"
done
btrfs subvolume delete "$1"
}
# Nuke and recreate root
delete_subvolume_recursively /btrfs_tmp/root
btrfs subvolume create /btrfs_tmp/root
# Nuke and recreate home (wipes /home — but we restore via impermanence)
delete_subvolume_recursively /btrfs_tmp/home
btrfs subvolume create /btrfs_tmp/home
umount /btrfs_tmp
'';
};
loader.systemd-boot.enable = false;
initrd.systemd.enable = true;
kernelPackages = pkgs.linuxPackages_latest;
@ -89,9 +117,6 @@
pkiBundle = "/var/lib/sbctl";
};
extraModprobeConfig = ''
#fix for https://gitlab.freedesktop.org/drm/amd/-/issues/4141
amdgpu.runpm=0
amdgpu.dcdebugmask=0x10
'';
};