added essentials to darling erasure

nixos
Moritz Böhme 2021-09-30 20:26:36 +02:00
parent e9c6d14259
commit 2012b31d99
3 changed files with 40 additions and 0 deletions

View File

@ -8,6 +8,8 @@
adjtime.source = "/persist/etc/adjtime"; adjtime.source = "/persist/etc/adjtime";
NIXOS.source = "/persist/etc/NIXOS"; NIXOS.source = "/persist/etc/NIXOS";
machine-id.source = "/persist/etc/machine-id"; machine-id.source = "/persist/etc/machine-id";
ssh.source = "/persist/etc/ssh";
shadow.source = "/persist/etc/shadow";
}; };
systemd.tmpfiles.rules = [ systemd.tmpfiles.rules = [
"L /var/lib/NetworkManager/secret_key - - - - /persist/var/lib/NetworkManager/secret_key" "L /var/lib/NetworkManager/secret_key - - - - /persist/var/lib/NetworkManager/secret_key"
@ -58,4 +60,7 @@
# we can unmount /mnt and continue on the boot process. # we can unmount /mnt and continue on the boot process.
umount /mnt umount /mnt
''; '';
# In case one forgets to move /etc/shadow to /persist
users.users.moritz.initialPassword = "password";
} }

View File

@ -0,0 +1,22 @@
#!/usr/bin/env bash
# fs-diff.sh
set -euo pipefail
OLD_TRANSID=$(sudo btrfs subvolume find-new /mnt/root-blank 9999999)
OLD_TRANSID=${OLD_TRANSID#transid marker was }
sudo btrfs subvolume find-new "/mnt/root" "$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

View File

@ -0,0 +1,13 @@
#!/usr/bin/env bash
sudo mkdir -p /persist/etc/NetworkManager
sudo cp -r {,/persist}/etc/NetworkManager/system-connections
sudo mkdir -p /persist/var/lib/NetworkManager
sudo cp /var/lib/NetworkManager/{secret_key,seen-bssids,timestamps} /persist/var/lib/NetworkManager/
sudo cp -r {,/persist}/etc/nixos
sudo cp {,/persist}/etc/adjtime
sudo cp {,/persist}/etc/NIXOS
sudo cp -r {,/persist}/etc/ssh
sudo cp {,/persist}/etc/shadow