Post

Introduce a Nix-based Cordium Actions runner image

Introduce a Nix-based Cordium Actions runner image

I added a Nix-based runner image for Cordium so that the workspace can preload dependencies and verify tool availability offline, making builds more reproducible and reducing runtime errors.

Add a dedicated Nix runner image workflow

The workflow file cordium-runner-images.yml was updated to include flake.lock and nix-packages.nix as inputs, and a new job now builds the runner image using the Dockerfile.nix. This change isolates the image construction from the regular build steps and makes the dependency list explicit.

Define the runner image with Nix packages

A new Dockerfile.nix creates the image by copying the lock files, running nix to build the tool environment, installing required apt packages, configuring nix for flakes, and setting up a non‑root runner user. The companion nix-packages.nix defines a buildEnv with a comprehensive list of tools such as actionlint, awscli2, cosign, curl, gh, git, go, jq, kubectl, kubernetes-helm, kustomize, nodejs_24, openssh, opentofu, python313, regctl, ripgrep, shellcheck, skopeo, sops, terragnunt, and yq-go.

Validate and document the new runner image

The build.sh script was revised to use Dockerfile.nix, pass the runner context, set appropriate tags, and run a smoke test that checks the runner user ID, tool cache path, presence of all listed binaries, Python modules, and an offline nix derivation. The script also switches from sudo -u runner to runuser for better isolation. Documentation in docs/cordium-ci.md now describes the Nix runner image, the Harbor publisher step, and the need to point the Workspace at the published digest, while the runbooks reference the new image path.

This post is licensed under CC BY 4.0 by the author.