2022-08-13 19:34:46 +00:00
|
|
|
# Installation Media
|
|
|
|
|
|
|
|
This project leverages [nix-community/nixos-generators][nixos-generators] for
|
|
|
|
building machine images. In most cases, you'll probably want to use the
|
|
|
|
`install-iso` format.
|
|
|
|
|
|
|
|
Making an installable ISO for `hosts/bootstrap.nix` is as simple as:
|
2021-02-14 02:38:20 +00:00
|
|
|
|
|
|
|
```sh
|
2022-08-13 19:34:46 +00:00
|
|
|
nix run github:nix-community/nixos-generators -- \
|
|
|
|
--format install-iso \
|
|
|
|
--flake '.#bootstrap'
|
2021-02-14 02:38:20 +00:00
|
|
|
```
|
|
|
|
|
2022-08-13 19:34:46 +00:00
|
|
|
Then "burn" the ISO to your USB stick (or CD-R if you like!) following the
|
|
|
|
[instructions in the NixOS manual][burn] (or using your preferred USB burner).
|
|
|
|
|
|
|
|
You can also swap out the `--format` for [any of the others][formats] supported
|
|
|
|
by nixos-generators.
|
2021-03-16 19:50:38 +00:00
|
|
|
|
2022-08-13 19:34:46 +00:00
|
|
|
Continue by following the usual installation instructions in the NixOS manual.
|
2021-03-16 23:01:29 +00:00
|
|
|
|
2022-08-13 19:34:46 +00:00
|
|
|
## ISO Nix Store and Cache
|
2021-03-16 23:01:29 +00:00
|
|
|
|
2022-08-13 19:34:46 +00:00
|
|
|
The ISO image holds the Nix store for the live environment and _also_ acts as a
|
|
|
|
binary cache to the installer. To considerably speed things up, the image
|
|
|
|
already includes all flake `inputs` as well as the `devshell` closures.
|
2021-03-16 23:01:29 +00:00
|
|
|
|
2022-08-13 19:34:46 +00:00
|
|
|
While you _could_ provision any NixOS machine with the same USB stick, an ISO
|
|
|
|
custom-made for your target host will maximise those local cache hits. For hosts
|
|
|
|
that don't differ too much, a single USB stick might be ok, whereas when there
|
|
|
|
are bigger differences, a custom-made USB stick will be considerably faster.
|
2021-03-16 23:01:29 +00:00
|
|
|
|
2022-11-20 22:28:23 +00:00
|
|
|
[nixos-generators]: https://github.com/nix-community/nixos-generators
|
2022-08-13 19:34:46 +00:00
|
|
|
[burn]: https://nixos.org/manual/nixos/stable/index.html#sec-booting-from-usb
|
|
|
|
[formats]: https://github.com/nix-community/nixos-generators/tree/master/formats
|