2024-04-12 13:22:20 +00:00
# Installer
2024-04-10 12:54:41 +00:00
2024-05-10 20:59:45 +00:00
Our installer image simplifies the process of performing remote installations.
2024-04-10 12:54:41 +00:00
2024-05-10 20:59:45 +00:00
Follow our step-by-step guide to create and transfer this image onto a bootable USB drive.
2024-04-10 12:54:41 +00:00
2024-05-10 20:59:45 +00:00
!!! info
If you already have a NixOS machine you can ssh into (in the cloud for example) you can skip this chapter and go directly to [Configure Machines ](configure.md ).
2024-04-16 10:02:22 +00:00
### Step 0. Prerequisites
2024-04-10 12:54:41 +00:00
- [x] A free USB Drive with at least 1.5GB (All data on it will be lost)
- [x] Linux/NixOS Machine with Internet
2024-04-16 10:02:22 +00:00
### Step 1. Identify the USB Flash Drive
2024-04-10 12:54:41 +00:00
1. Insert your USB flash drive into your computer.
2024-04-16 10:02:22 +00:00
2. Identify your flash drive with `lsblk` :
2024-04-10 12:54:41 +00:00
2024-04-19 12:10:28 +00:00
```shellSession
lsblk
2024-04-16 10:02:22 +00:00
```
2024-04-14 10:20:30 +00:00
2024-05-24 10:37:27 +00:00
```{.shellSession hl_lines="2" .no-copy}
2024-04-16 10:02:22 +00:00
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sdb 8:0 1 117,2G 0 disk
└─sdb1 8:1 1 117,2G 0 part /run/media/qubasa/INTENSO
nvme0n1 259:0 0 1,8T 0 disk
├─nvme0n1p1 259:1 0 512M 0 part /boot
└─nvme0n1p2 259:2 0 1,8T 0 part
└─luks-f7600028-9d83-4967-84bc-dd2f498bc486 254:0 0 1,8T 0 crypt /nix/store
```
2024-04-10 12:54:41 +00:00
2024-04-16 10:02:22 +00:00
!!! Info "In this case the USB device is `sdb` "
2024-04-10 12:54:41 +00:00
3. Ensure all partitions on the drive are unmounted. Replace `sdb1` in the command below with your device identifier (like `sdc1` , etc.):
2024-04-19 12:10:28 +00:00
```shellSession
2024-04-10 12:54:41 +00:00
sudo umount /dev/sdb1
```
2024-05-14 14:13:50 +00:00
=== "**Linux OS**"
### Step 2. Flash Custom Installer
2024-04-10 12:54:41 +00:00
2024-05-29 09:10:14 +00:00
Using clan flash enables the inclusion of ssh public keys.
It also allows to set language and keymap currently in the installer image.
2024-04-10 12:54:41 +00:00
2024-05-14 14:13:50 +00:00
```bash
2024-05-29 09:10:14 +00:00
clan flash --flake git+https://git.clan.lol/clan/clan-core \
--ssh-pubkey $HOME/.ssh/id_ed25519.pub \
--keymap en \
--language en \
--disk main /dev/sd< X > \
flash-installer
2024-05-14 14:13:50 +00:00
```
2024-04-10 12:54:41 +00:00
2024-05-30 20:41:30 +00:00
The `--ssh-pubkey` , `--language` and `--keymap` are optional.
Replace `$HOME/.ssh/id_ed25519.pub` with a path to your SSH public key.
If you do not have an ssh key yet, you can generate one with `ssh-keygen -t ed25519` command.
2024-05-29 09:10:14 +00:00
2024-05-14 14:13:50 +00:00
!!! Danger "Specifying the wrong device can lead to unrecoverable data loss."
2024-04-10 12:54:41 +00:00
2024-05-14 14:13:50 +00:00
The `clan flash` utility will erase the disk. Make sure to specify the correct device
2024-04-16 10:02:22 +00:00
2024-05-14 14:13:50 +00:00
=== "**Other OS**"
### Step 2. Download Generic Installer
2024-04-16 10:02:22 +00:00
2024-05-14 14:13:50 +00:00
```shellSession
wget https://github.com/nix-community/nixos-images/releases/download/nixos-unstable/nixos-installer-x86_64-linux.iso
```
2024-04-10 12:54:41 +00:00
2024-05-14 14:13:50 +00:00
### Step 3. Flash the Installer to the USB Drive
!!! Danger "Specifying the wrong device can lead to unrecoverable data loss."
The `dd` utility will erase the disk. Make sure to specify the correct device (`of=...`)
For example if the USB device is `sdb` use `of=/dev/sdb` .
Use the `dd` utility to write the NixOS installer image to your USB drive:
```shellSession
sudo dd bs=4M conv=fsync oflag=direct status=progress if=./nixos-installer-x86_64-linux.iso of=/dev/sd< X >
```
2024-04-10 12:54:41 +00:00
### Step 4. Boot and Connect to your network
After writing the installer to the USB drive, use it to boot the target machine.
2024-04-14 10:20:30 +00:00
!!! info
Plug it into the target machine and select the USB drive as a temporary boot device.
??? tip "Here you can find the key combinations for selection used by most vendors."
- **Dell**: F12 (Boot Menu), F2/Del (BIOS Setup)
- **HP**: F9 (Boot Menu), Esc (Startup Menu)
- **Lenovo**: F12 (ThinkPad Boot Menu), F2/Fn+F2/Novo Button (IdeaPad Boot Menu/BIOS Setup)
- **Acer**: F12 (Boot Menu), F2/Del (BIOS Setup)
- **Asus**: F8/Esc (Boot Menu), F2/Del (BIOS Setup)
- **Toshiba**: F12/F2 (Boot Menu), Esc then F12 (Alternate Method)
- **Sony**: F11/Assist Button (Boot Menu/Recovery Options)
- **Samsung**: F2/F12/Esc (Boot Menu), F2 (BIOS Setup)
- **MSI**: F11 (Boot Menu), Del (BIOS Setup)
- **Apple**: Option (Alt) Key (Boot Menu for Mac)
- If your hardware was not listed read the manufacturers instructions how to enter the boot Menu/BIOS Setup.
2024-04-10 12:54:41 +00:00
**During Boot**
2024-04-13 11:32:54 +00:00
Select `NixOS` to boot into the clan installer.
2024-04-10 12:54:41 +00:00
**After Booting**
2024-04-13 11:32:54 +00:00
For deploying your configuration the machine needs to be connected via LAN (recommended).
2024-04-10 12:54:41 +00:00
2024-04-16 10:02:22 +00:00
## (Optional) Connect to Wifi
2024-04-10 12:54:41 +00:00
If you don't have access via LAN the Installer offers support for connecting via Wifi.
2024-04-19 12:10:28 +00:00
```shellSession
2024-04-10 12:54:41 +00:00
iwctl
```
This will enter `iwd`
2024-04-14 10:30:56 +00:00
```{.console, .no-copy}
2024-04-10 12:54:41 +00:00
[iwd]#
```
Now run the following command to connect to your Wifi:
2024-05-24 10:37:27 +00:00
```{.shellSession .no-copy}
2024-04-10 12:54:41 +00:00
# Identify your network device.
device list
2024-05-14 14:13:50 +00:00
2024-04-16 10:02:22 +00:00
# Replace 'wlan0' with your wireless device name
2024-04-10 12:54:41 +00:00
# Find your Wifi SSID.
station wlan0 scan
station wlan0 get-networks
# Replace your_ssid with the Wifi SSID
# Connect to your network.
station wlan0 connect your_ssid
# Verify you are connected
station wlan0 show
```
If the connection was successful you should see something like this:
2024-04-14 10:30:56 +00:00
```{.console, .no-copy}
State connected
Connected network FRITZ!Box (Your router device)
2024-04-10 12:54:41 +00:00
IPv4 address 192.168.188.50 (Your new local ip)
```
2024-05-24 11:46:05 +00:00
Press ++ctrl+d++ to exit `IWD` .
2024-04-10 12:54:41 +00:00
2024-04-16 10:02:22 +00:00
!!! Important
2024-05-24 11:46:05 +00:00
Press ++ctrl+d++ **again** to update the displayed QR code and connection information.
2024-04-16 10:02:22 +00:00
You're all set up
2024-05-10 20:59:45 +00:00
---
## Whats next?
- [Configure Machines ](configure.md ): Customize machine configuration
2024-05-24 10:37:27 +00:00
---