1.8 KiB
installer
I have automated myself out of a job. Here's how to use the installer to create a new host:
-
Enable Secure Boot Setup Mode on the target device's UEFI menu - this will vary depending on the manufacturer
-
Boot into the installer
-
Connect to the internet with
sudo nmcli device wifi connect "<SSID>" [--ask]
-
Run
sudo nix-install /etc/nixos -m install|repair -s -h host [-k key] [-c] [-r]"
-
Enable Secure Boot on the device's UEFI menu.
Reinstalling the Installer
- Download a Minimal Live Nix ISO
- Visit the official NixOS website: https://nixos.org/download.html.
- Download the "Minimal ISO image".
- Burn the ISO
-
On Windows, use Rufus to burn the ISO to a USB drive.
-
On Linux, use the
dd
command:sudo dd if=<path-to-iso> of=/dev/sdX bs=4M status=progress
-
Boot into USB
-
Connect to the Internet with
wpa_supplicant
-
Identify your network interface:
ip link show | grep -E '^[0-9]+:' | awk '{print $2}' | tr -d ':'
-
For an open network:
wpa_supplicant -i "${interface}" -c <(wpa_passphrase "${ssid}") -B
-
For a secured network:
config=$(mktemp) wpa_passphrase "${ssid}" "${passphrase}" > "${config}" wpa_supplicant -i "${interface}" -c "${config}" -B rm "${config}"
-
Obtain an IP address:
dhcpcd
-
Clone the flake repository
git clone git.karaolidis.com/karaolidis/nix cd nix
-
I really hope you had a backup of the keys, because you must copy them to the repository before the next step.
-
Run
nix --experimental-features "nix-command flakes" shell nixpkgs#disko nixpkgs#sbctl nixpkgs#jq -c bash hosts/common/configs/system/nix-install/install.sh . -m install -h installer -k personal -c