add straylight emergency recovery script
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
24
script/emergency/straylight-recover.sh
Executable file
24
script/emergency/straylight-recover.sh
Executable file
@@ -0,0 +1,24 @@
|
||||
#!/usr/bin/env bash
|
||||
# Emergency recovery for straylight from a NixOS live USB.
|
||||
# Assumes /tmp/nixos is already a copy of the repo.
|
||||
set -euo pipefail
|
||||
|
||||
ROOT_LUKS_UUID="922e2c13-35bc-40de-a829-716b9368e4a7"
|
||||
HOME_LUKS_UUID="edfdcdf4-083a-4826-a1f8-9670545e0bc5"
|
||||
BOOT_UUID="9BAD-52AA"
|
||||
|
||||
echo "==> Unlocking root LUKS volume..."
|
||||
cryptsetup luksOpen "/dev/disk/by-uuid/${ROOT_LUKS_UUID}" "luks-${ROOT_LUKS_UUID}"
|
||||
|
||||
echo "==> Unlocking home LUKS volume..."
|
||||
cryptsetup luksOpen "/dev/disk/by-uuid/${HOME_LUKS_UUID}" home-crypt
|
||||
|
||||
echo "==> Mounting filesystems..."
|
||||
mount "/dev/mapper/luks-${ROOT_LUKS_UUID}" /mnt
|
||||
mount "/dev/disk/by-uuid/${BOOT_UUID}" /mnt/boot
|
||||
mount /dev/mapper/home-crypt /mnt/home
|
||||
|
||||
echo "==> Running nixos-install..."
|
||||
nixos-install --root /mnt --flake /tmp/nixos#straylight
|
||||
|
||||
echo "==> Done. You can reboot now."
|
||||
Reference in New Issue
Block a user