Skip to content

Commit

Permalink
chore!: 2024-02-10 19:38:50 +0100
Browse files Browse the repository at this point in the history
  • Loading branch information
trueNAHO committed Feb 10, 2024
1 parent e14f20a commit 6736415
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions modules/impermanence/nixos/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -59,24 +59,16 @@
(
set -e
btrfs_subvolume_delete_recursive() {
btrfs subvolume list -o "$1" |
awk '{ print $NF }' |
while read -r subvolume; do
btrfs_subvolume_delete_recursive "$mount_point/$subvolume"
done
btrfs subvolume delete "$1"
}
mount_point="$(mktemp --directory)"
mkdir --parent "$mount_point"
mount "${cfg.btrfsSnapshots.filesystemRoot}" "$mount_point"
trap 'umount "$mount_point" && rmdir "$mount_point"' EXIT
btrfs_subvolume_delete_recursive \
btrfs \
subvolume \
delete \
"$mount_point/${cfg.btrfsSnapshots.snapshot.root}"
btrfs \
Expand Down

0 comments on commit 6736415

Please sign in to comment.