Generate the host configuration

The second phase generates a fresh, self-contained NixOS flake repository for this one machine, and places it on the freshly mounted target at /mnt/home/<user>/nixos.

This is a key idea in the sway-home design: sway-home itself holds no per-host configuration. It is a shared library of NixOS modules. Each machine you own gets its own small repo that depends on sway-home as a pinned flake input and calls sway-home.lib.mkHost. That per-host repo holds only this machine’s disko.nix (disk layout), hardware.nix (detected hardware, no filesystems – disko owns those), and config.nix (your overrides).

Run it from the menu, or directly:

[bash]: Run this on your workstation:
setup host

Answer the prompts

== Generate a per-host NixOS config ==

? Hostname (nixos)
? Primary username
? Time zone (America/Denver)
? Select profiles to enable (space toggles, enter confirms; none = minimal server):
> [ ] dotfiles - Shell/CLI home environment (bashrc, ~/.config dotfiles, emacs, CLI tools) -- no GUI
  [ ] sway - Sway desktop (greetd login, sway, fonts, firefox; implies dotfiles)
  [ ] sound - PipeWire audio
  [ ] podman - Podman containers (Docker-compatible)
  [ ] flatpak - Flatpak + Flathub remote
  [ ] libvirt - libvirt/KVM virtualization (the `vm` command, virt-manager)
  • Hostname – the name of this machine (default nixos).
  • Primary username – your login account (required).
  • Time zone – an IANA time zone like America/Denver.
  • Profiles – a multi-select of optional subsystems to switch on. Press space to toggle each, enter to confirm. Selecting nothing gives a bare minimal server (sshd plus your user, no desktop); sway adds the full desktop. Whatever you pick is written into config.nix as a my.profiles.<name>.enable toggle, and the rest are left there as commented examples. Nothing here is permanent – you can enable or disable any profile later. See the Profiles chapter.

Review

The SSH public keys currently authorized on the ISO (the ones you baked in when you built it) are seeded into the new config.nix, so the installed machine stays reachable over SSH – sshd is key-only.

================ Review =================
Hostname:      box
Username:      ryan
Profiles:      (none -- minimal server, sshd only)
Time zone:     America/Denver
System:        x86_64-linux
SSH keys:      1 (seeded from ISO)
sway-home:     github:EnigmaCurry/sway-home
Host repo:     /mnt/home/ryan/nixos
=========================================

? Generate this host config? (Y/n)

After you confirm, it:

  1. Detects the hardware with nixos-generate-config --no-filesystems (disko owns the filesystems, so they are intentionally excluded).
  2. Writes the repo: flake.nix, config.nix, hardware.nix, a copy of disko.nix from the previous phase, a Justfile, and a .gitignore.
  3. Runs git init, resolves and pins sway-home into flake.lock, and commits.

The repo is left root-owned for now; the Install phase fixes its ownership once your user account exists in the installed system.

warning

If no SSH keys were found on the ISO, the review shows NONE FOUND and you must add at least one key to config.nix before installing, or you will be locked out of the headless machine after reboot (sshd is key-only).

// settings
theme:
fx: