Skip to content

Commit

Permalink
docs(nixos): document liveusb generation (#294)
Browse files Browse the repository at this point in the history
document liveusb generation
  • Loading branch information
TheButlah authored Nov 27, 2024
1 parent b05de65 commit ff235d3
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions docs/src/hil/nixos-setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,23 @@ On the ASUS NUCs, they don't support MBR partitioned live usbs. But for some
inexplicable reason the official NixOS installer *only* exists as a MBR partitioned
disk. This means we need to build our own GPT/UEFI based NixOS live usb ;(

TODO: Describe how to make a UEFI-compatible minimal nixos live usb. The TLDR
is that you use [nixos-generators][nixos-generators] with the `raw-efi` format.
To work around this limitation of the official installer, we provide a liveusb
image that has NixOS on it, and is built using the
[nixos-generators][nixos-generators] tool. To build the .img file yourself,
run:
```bash
nix build .#liveusb # if you are natively on x86-64 linux
```
If you are *not* on x86-64 linux, you should either ssh into a x86 linux
machine (such as one of the existing HILs) and SCP the image off, *or* you
should use the [remote builders][remote build] feature of nix. Here is an example:

```bash
# ensure that sshing as root works, and that your ssh keys don't require any passwords, etc
sudo ssh -T user@hostname
# actually do the build
nix build .#packages.x86_64-linux.liveusb --builders 'ssh://user@hostname x86_64-linux - - - kvm'
```

### Use the liveusb to install NixOS

Expand Down Expand Up @@ -128,3 +143,4 @@ config that we use. Luckily nix makes this really easy.

[nix config]: https://github.com/TheButlah/nix
[nixos-generators]: https://github.com/nix-community/nixos-generators
[remote build]: https://nix.dev/manual/nix/2.18/advanced-topics/distributed-builds

0 comments on commit ff235d3

Please sign in to comment.