switched to new stateVersion on prod server

This commit is contained in:
bogale 2026-10-16 14:53:01 +09:00
commit 5cfc962977
7 changed files with 34 additions and 21 deletions

View file

@ -5,11 +5,11 @@ cryptsetup open $ROOTPART root
mkfs.ext4 /dev/mapper/root
mount /dev/mapper/root /mnt
mount $ESPPART --mkdir -o umask=077 /mnt/boot
mkdir /mnt/var
mkdir -p /mnt/var/lib
mkswap -F -s $SWAPSIZE /mnt/var/swapfile
swapon /mnt/var/swapfile
nixos-generate-config --root /mnt --kernel latest --flake
#copy backup
nixos-install --no-root-passwd --no-channel-copy --flake "/mnt/etc/nixos#nixos"
# restore backup
nixos-generate-config --root /mnt --show-hardware-config > /mnt/etc/nixos/$HOSTNAME/hardware.nix
nixos-install --no-root-passwd --no-channel-copy --flake "/mnt/etc/nixos#nixos-$HOSTNAME"
sbctl enroll-keys --yolo
systemd-cryptenroll --tpm2-device=auto --tpm2-pcrs=0+2+7 $ROOTPART