Post-Installation & Onboarding
Following an automated installation via install.sh, complete the onboarding steps to configure cryptographic hardware bindings, SSH keys, repository remotes, and agenix secrets.
Initial Boot
- If using LUKS + Secure Boot:
- Reboot into your BIOS setup.
- Re-enable Secure Boot.
- Save and exit BIOS.
- At the boot prompt, unlock the system using your manual LUKS password (if prompted).
- Log in with your user credentials.
Running post-install.sh
Navigate to the cloned repository in your home directory (~/nix-config):
cd ~/nix-config./post-install.shWhat post-install.sh Does Automatically (Hands-off):
- Converts Git Remote: Converts
originfrom HTTPS to SSH (git@gitlab.com:kylekwong/nix-config.git). - Enrolls TPM2: Automatically runs
systemd-cryptenrollagainst PCR 7 (--tpm2-device=auto --tpm2-pcrs=7) if a LUKS container and TPM2 device are detected (automatically skipped on unencrypted storage). - Generates SSH Keys: Creates ed25519 keys for both the host (
/etc/ssh/ssh_host_ed25519_key) and the user (~/.ssh/id_ed25519) if they do not exist. - Registers Public Keys: Injects the newly generated public keys directly into
secrets/keys.nixunder the current hostname.
Interactive Service Authentication (--auth)
To authenticate command-line services and automatically register your new user SSH key with remote providers, run:
./post-install.sh --auth-only(Or run ./post-install.sh --auth during initial setup).
This interactive flow guides you through:
- GitLab CLI (
glab): Authenticates via web session and uploads your public SSH key to your GitLab account (enabling git SSH push/pull access immediately). - GitHub CLI (
gh): Authenticates via web session and uploads your public SSH key to your GitHub account. - NordVPN: Triggers interactive login to enable VPN connectivity.
- Wallpapers: Automatically clones the private wallpaper repository (
private-wallpaper) via SSH, or falls back gracefully to the public wallpaper collection.
Fleet Rekeying & Secret Propagation
Because secrets are encrypted with public keys in secrets/keys.nix, the new machine’s keys must be pushed to git, rekeyed from an existing authorized machine, and pulled back down:
1. On the New Machine:
Commit and push the generated hardware-configuration.nix and updated secrets/keys.nix:
git lazy "feat(<host_name>): add host keys and hardware configuration"2. On an Authorized Machine (e.g. framework16):
Pull the changes, re-encrypt the agenix secrets with the new host’s public key, and push:
git pullcd secretsagenix --rekeygit lazy "chore(secrets): rekey secrets for <host_name>"3. Back on the New Machine:
Pull the re-encrypted secret files and trigger a system rebuild:
git pullnrsYour new machine is now fully provisioned and synchronized with the fleet.