Files
nix/hosts/installer/README.md
Nikolaos Karaolidis fba4691ae0 Graduate eirene
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
2025-05-29 19:05:37 +01:00

75 lines
1.6 KiB
Markdown

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