The pitfall of using nixos-install in this script is that the hardware detection can be mis-guided (e.g. swap partition).
A better way is to follow the approach taken by nixos/modules/installer/cd-dvd/iso-image.nix, and use a pure Nix way to create a USB disk image.
Other hopeful benefits are
- A way to create a disk image (of only necessary size) that can be later written into USB drive.
- A way to create a disk image on a non-NixOS Linux or even OS X machine.
The pitfall of using
nixos-installin this script is that the hardware detection can be mis-guided (e.g. swap partition).A better way is to follow the approach taken by
nixos/modules/installer/cd-dvd/iso-image.nix, and use a pure Nix way to create a USB disk image.Other hopeful benefits are