Skip to content

Getting Started

This guide walks you through using Junix to turn Nix build logs into JUnit XML reports for your CI pipeline.

What You Need

  • Python 3.10+
  • Nix with flakes enabled
  • A flake with packages or checks to build

Installation

Install Junix with your preferred method:

# With pipx
pipx install junix

# With uv
uv tool install junix

# With Nix
nix profile install gitlab:moduon/junix

Verify it works:

junix --help

Your First Report

Translate an existing build

If you already have Nix build output, pipe it through Junix:

nix build --log-format internal-json -v --print-build-logs --no-link .#hello 2>&1 | junix translate -o nix-report.xml

This produces a nix-report.xml file you can upload to your CI system.

Build and report in one step

Let Junix drive the build:

junix build .#hello -o nix-report.xml

Check all flake checks

For flakes with checks outputs:

junix check -o nix-report.xml

Viewing the Report

In GitLab CI

Add the report as a test artifact:

test:
    script:
        - junix check -o report.xml
    artifacts:
        reports:
            junit: report.xml

GitLab will display build results in the merge request UI.

In Jenkins

Use the JUnit plugin to publish report.xml.

Locally

Open the XML in any JUnit viewer, or use xmllint to validate:

xmllint --noout nix-report.xml

Next Steps