This commit is contained in:
KoenDR06 2026-03-24 01:57:19 +01:00
parent 34e69262ff
commit de19e95006
11 changed files with 206 additions and 153 deletions

View file

@ -20,9 +20,29 @@ in {
nixos.source = "/persist/etc/nixos";
machine-id.source = "/persist/etc/machine-id";
};
security.sudo.extraConfig = ''
Defaults lecture = never
'';
boot.initrd.postDeviceCommands = pkgs.lib.mkBefore ''
mkdir -p /mnt
mount -o subvol=/ /dev/disk/by-label/ROOT /mnt
btrfs subvolume list -o /mnt/root |
cut -f9 -d' ' |
while read subvolume; do
echo "deleting /$subvolume subvolume..."
btrfs subvolume delete "/mnt/$subvolume"
done &&
echo "deleting /root subvolume..." &&
btrfs subvolume delete /mnt/root
echo "restoring blank /root subvolume..."
btrfs subvolume snapshot /mnt/root-blank /mnt/root
umount /mnt
'';
};
}