summaryrefslogtreecommitdiff
path: root/scripts/setup.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/setup.sh')
-rw-r--r--scripts/setup.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/scripts/setup.sh b/scripts/setup.sh
new file mode 100644
index 0000000..a3b0cb2
--- /dev/null
+++ b/scripts/setup.sh
@@ -0,0 +1,22 @@
+#!/usr/bin/env bash
+# Automate the post-reboot steps
+sudo mkdir -p /mnt/usb && sudo mount /dev/sdb1 /mnt/usb
+gpg --import /mnt/usb/private.asc
+gpg --import /mnt/usb/public.asc
+gpg --import-ownertrust /mnt/usb/trust.txt
+
+# Setup the repo properly
+sudo mkdir -p /etc/nixos
+sudo chown -R $USER:users /etc/nixos
+git clone git@codeberg.org:adikro/nixos-config.git /etc/nixos
+
+# Fix hardware config for the actual live system
+sudo rm /etc/nixos/hosts/desktop/hardware-configuration.nix
+sudo nixos-generate-config --no-filesystems --root /
+# Move it to the right place
+sudo mv /etc/nixos/hardware-configuration.nix /etc/nixos/hosts/desktop/
+
+# Update SOPS with new SSH key
+NEW_AGE=$(ssh-to-age < /etc/ssh/ssh_host_ed25519_key.pub)
+echo "New Age Key: $NEW_AGE"
+# You'll still need to manually edit .sops.yaml unless you use 'sed' to replace the key