This repo contains the NixOS configuration for CHipCie images, used in prorgramming contests such as FPC, DAPC and NWERC.
This configuration is kickstarted by this post on the Nix community forum.
Building the console image is as easy as running the following command:
nix build .#consoleAfter a succesful build, the image can be found in result/nixos.img.
Images are UEFI-only (no legacy BIOS boot), so qemu needs OVMF firmware. Use the following command to do so:
OVMF_CODE=$(nix eval --raw nixpkgs#OVMF.fd)/FV/OVMF_CODE.fd
qemu-system-x86_64 -drive if=pflash,format=raw,unit=0,readonly=on,file="$OVMF_CODE" -drive file=result/nixos.img,index=0,media=disk,format=raw -m 4G -smp 4 -enable-kvm -vga virtio -display defaultThe image can also be tested in Proxmox: import result/nixos.img as a VM disk (qm importdisk, or attach it directly), set the VM's BIOS to OVMF, and boot — no ISO/CD-ROM step needed since it's a bootable disk image, not installation media.
Nix files are formatted with nixfmt (RFC 166
style), orchestrated by treefmt.
Config lives in treefmt.nix.
just fmt # format in place
just fmt-check # what CI checks, without writingnix flake check runs the same check, so a PR with unformatted Nix fails
.github/workflows/check.yml.
.git-blame-ignore-revs lists the one repo-wide reformat commit. GitHub's
blame view honours it automatically; for local git blame, run just setup-blame once per clone.
Docs live under docs/public/ and are built with zensical. Preview them locally:
pip install zensical
zensical servePushes to main that touch docs/public/ or zensical.toml are deployed automatically to GitHub Pages by .github/workflows/docs.yml.
Releases are built by manually running the Release image workflow (Actions tab > "Release image" > Run workflow), which lets you pick the image, a version, whether it's a prerelease, and whether to deploy the result to that image's Proxmox staging VM afterwards. See .github/workflows/build-image.yml for the required repository variables/secrets.
One-time setup on the Proxmox host, in order:
deploy/proxmox/create-vms.sh— creates the two staging VMs (OVMF/UEFI bios, EFI disk, initial disk imported from a raw image you built).deploy/proxmox/setup.sh— creates the scopedci-deployuser, its sudoers rule, and the SSH key that goes in thePROXMOX_SSH_KEYGitHub secret.