Skip to content

Repository files navigation

CHipCie NixOS Configurations

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 images

Building the console image is as easy as running the following command:

nix build .#console

After a succesful build, the image can be found in result/nixos.img.

Testing the images locally

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 default

The 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.

Formatting

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 writing

nix 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.

Building the docs

Docs live under docs/public/ and are built with zensical. Preview them locally:

pip install zensical
zensical serve

Pushes to main that touch docs/public/ or zensical.toml are deployed automatically to GitHub Pages by .github/workflows/docs.yml.

Releasing and deploying

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:

  1. deploy/proxmox/create-vms.sh — creates the two staging VMs (OVMF/UEFI bios, EFI disk, initial disk imported from a raw image you built).
  2. deploy/proxmox/setup.sh — creates the scoped ci-deploy user, its sudoers rule, and the SSH key that goes in the PROXMOX_SSH_KEY GitHub secret.

About

NixOS configuration for the system image used in FPC and DAPC

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages