export NIX_SSL_CERT_FILE=/etc/nixos/certs/amentum-bundle.crt export SSL_CERT_FILE=/etc/nixos/certs/amentum-bundle.crt nix-channel --update nixos-rebuild switch --flake ./#
sudo nixos-rebuild boot --flake ./#wsl sudo nixos-rebuild boot --flake .#wsl
sudo nixos-rebuild list-generations nixos-rebuild list-generations
sudo nix-env -p /nix/var/nix/profiles/system --switch-generation 16
nix eval .#nixosConfigurations.wsl.config.system.stateVersion
sudo nixos-rebuild dry-build --flake .#wsl sudo nixos-rebuild dry-build --flake .#vm
This repository includes a .devcontainer that installs single-user Nix and enables nix-command and flakes inside the container.
- Open
/home/runner/work/nixos/nixosin VS Code or a compatible devcontainer client. - Reopen the workspace in the devcontainer.
- Wait for the image build and post-create setup to finish.
- Run Nix commands such as:
nix --version
nix flake show .
nix build .#packages.x86_64-linux.installer-isoBuild the bootable installer ISO directly from this flake:
nix build .#packages.x86_64-linux.installer-iso
ls -lh result/iso/*.isoThe live ISO includes a copy of this flake at /etc/nixos, so you can install from the checked-out configuration after booting the image.
The Build installer ISO workflow runs on pushes to flakes, pull requests targeting flakes, and manual workflow_dispatch runs. Open the workflow run in GitHub Actions and download the installer-iso artifact to get the generated .iso.
- Attach the
.isoto a VM or write it to removable media for a physical machine. - Boot the system from the ISO, preferably in UEFI mode when targeting the existing
vmorvmguilayouts. - Log in to the live environment as root, then work from
/etc/nixos.
Review hosts/<host> and any disk or hardware-specific settings before running destructive install commands. In particular, adjust partitioning, filesystems, boot mode, and hardware modules for the machine you are installing onto.
Example placeholder partitioning and mounting flow:
parted /dev/sdX -- mklabel gpt
parted /dev/sdX -- mkpart ESP fat32 1MiB 512MiB
parted /dev/sdX -- set 1 esp on
parted /dev/sdX -- mkpart primary 512MiB 100%
mkfs.fat -F 32 /dev/sdX1
mkfs.btrfs -f /dev/sdX2
mount /dev/sdX2 /mnt
mkdir -p /mnt/boot
mount /dev/sdX1 /mnt/bootOnce the target disk layout is ready, install one of the flake hosts from the copy bundled into the ISO:
cd /etc/nixos
nix flake show /etc/nixos
nixos-install --flake /etc/nixos#vm
# or
nixos-install --flake /etc/nixos#vmguiIf you need a different machine profile, update the flake in /etc/nixos (or clone a fresh copy elsewhere) before running nixos-install.
gpg --full-generate-key gpg --list-secret-keys --keyid-format LONG pass init 3B2F8BDE7B14AEE6
gh auth login gh auth setup-git