Import setup scripts.

This commit is contained in:
2024-01-03 15:28:53 +00:00
parent 2e33f49ec9
commit 17ff375971
9 changed files with 414 additions and 0 deletions

26
nixos-setup/fs-diff.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/usr/bin/env bash
# fs-diff.sh
set -euo pipefail
mkdir -p /mnt/root-blank
mount -o subvol=root-blank /dev/mapper/luksroot /mnt/root-blank
OLD_TRANSID=$(btrfs subvolume find-new /mnt/root-blank 9999999)
OLD_TRANSID=${OLD_TRANSID#transid marker was }
sudo btrfs subvolume find-new / "$OLD_TRANSID" |
sed '$d' |
cut -f17- -d' ' |
sort |
uniq |
while read path; do
path="/$path"
if [ -L "$path" ]; then
: # The path is a symbolic link, so is probably handled by NixOS already
elif [ -d "$path" ]; then
: # The path is a directory, ignore
else
echo "$path"
fi
done
umount /mnt/root-blank