rekey
This commit is contained in:
parent
34e69262ff
commit
de19e95006
11 changed files with 206 additions and 153 deletions
|
|
@ -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
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue