Unattended installs
An image that boots, installs and reboots with nobody at the keyboard.
The answers file
nixarchy-install --answers <file> takes every answer the wizard asks for.
One key=value per line, parsed rather than sourced, and every missing or
malformed key is named in one pass instead of one per attempt:
device=/dev/vda
# Only for disks without WWN or serial; the default is to refuse them.
allow_unidentified_disk=yes
# or `free`; default `whole`
disk_mode=whole
encrypt=yes
luks_passphrase=correct horse
hostname=nixarchy
username=alice
# from `mkpasswd -m sha-512`; or
password_hash=$6$...
# plaintext, hashed by the installer
password=hunter2
timezone=Europe/London
keymap=us
It holds a password in clear. That is inherent to installing without being asked, and nothing copies it onto the installed machine.
keymap is a Linux console keymap name (de-latin1, fr-latin1, ru), and
the installer derives services.xserver.xkb for the login screen and desktop
from the menu table or systemd’s kbd-model-map. Because Finnish and Swedish
share the console map fi, keymap=fi in an answers file means Finnish (fi);
for Swedish on the desktop, set services.xserver.xkb.layout = "se"; in
configuration.nix afterwards. A console map with no XKB equivalent — including
an older answers file still naming se-lat6 or cz-qwertz — falls back to us
on the desktop and prints a line in the summary saying so.
A disk without a WWN or serial is refused by default. This can happen with
virt-manager, GNOME Boxes, or Proxmox virtio disks; adding a serial to the VM
disk is the preferred fix. If that is unavailable, use
allow_unidentified_disk=yes in the answers file or run the interactive
installer with nixarchy-install --allow-unidentified-disk. The override warns
and checks the disk’s resolved path, byte size, model when present, and
/dev/disk/by-path link when present. It cannot distinguish replacements
that share all available attributes. On the ISO, stop the tty1 wizard with
Ctrl+C, then run that command at a root console; switch to tty2 with
Ctrl+Alt+F2 if tty1 has no prompt. The installer binary is in the ISO’s
system profile (installer/cd.nix).
# starts a comment at the start of a line, or after a value. password,
luks_passphrase and recovery_passphrase are the exception: they are taken
exactly as written, # and trailing spaces included, and one containing a
space followed by # is refused as a probable trailing comment, so a comment
never becomes part of a password.
disk_mode=free installs into the largest free region on the disk and leaves
every existing partition alone — see
dual boot install. If the disk cannot take one, the
install stops. It does not quietly fall back to whole, which would erase
the disk the file asked to preserve.
<file> may also be an https:// URL, which is what makes it unattended
rather than merely unprompted — otherwise somebody had to put the file on the
machine first. Plain http is refused, because of that password. A URL that
cannot be fetched stops the install rather than falling back to asking: an
image that falls back to questions is an image waiting at a prompt nobody is
going to answer.
Telling the image, without building an image
The ISO takes three parameters on the kernel command line:
nixarchy.answers=https://example.com/answers.txt
nixarchy.from=github:you/config
nixarchy.host=laptop
With none of them present it is an ordinary interactive install.
That is how qemu (-append), PXE and cloud metadata all inject parameters, so
a fleet of VMs is a netboot with three arguments and no bespoke image:
qemu-system-x86_64 -cdrom nixarchy-net.iso \
-append "nixarchy.answers=https://example.com/answers.txt"
Combine them and the whole thing is one line: --from says which
configuration, --answers supplies the machine’s secrets, and together they
are an enrolment with nothing typed. See
many machines, one repo.
Scanning a labelled drive is deliberately absent. Omarchy’s ISO watches
for a second drive labelled cidata; nixarchy does not. The kernel command
line covers PXE and VM fleets, which is where unattended installs actually
happen, and the media path is worth adding when somebody with a physical fleet
asks for it rather than before.
The other way, which is often the right one
Unattended provisioning is a NixOS problem with mature NixOS answers, and nixarchy sits on top of whichever you pick:
- disko describes the disk
layout declaratively. nixarchy’s installer already uses it — the same
disk-config.nixyour machine imports is what formatted the disk. - nixos-anywhere installs a flake configuration onto a remote machine over SSH, using disko for the disks. Point it at anything booted into Linux with SSH and it comes back as the system your flake describes — no ISO, no boot medium, nothing to write to a stick.
Add nixarchy as an input to that flake and the machine arrives with the desktop already declared. There is no second step to automate, because the flake is the whole description. How to add the input is on the getting-started page.