A GitHub Action for setting up reproducible Nix environments with packages from specific nixpkgs revisions.
This action uses nixomatic.com to generate Nix flakes on-demand, allowing you to mix and match packages from different nixpkgs revisions in your CI/CD workflows.
- uses: curriedsoftware/nixomatic-action@main
with:
packages: python3@3.13.4 nodejs@24.13.0 jq
run: python --version| Input | Description | Required | Default |
|---|---|---|---|
packages |
Packages to install (space or comma-separated) | Yes | - |
install-nix |
Whether to install Nix. Set to false if Nix is already available. |
No | true |
run |
Script to run inside the Nix environment. If provided, runs the script and exits. If not provided, adds packages to PATH for subsequent steps. | Yes | - |
package- Latest from nixos-unstable (e.g.,jq,ripgrep)package@version- Specific version resolved against nixpkgs-multiverse (e.g.,python3@3.13.4)package:revision- Exact nixpkgs commit hash (e.g.,python3:3b93cf5)
Only versions the index actually has can be pinned, and an unknown one fails the
workflow at evaluation time. Check what a package can be pinned to before using
@version:
$ curl -s 'https://nixomatic.com/versions?p=nodejs'
{"nodejs":["0.10.21","0.12.7","…","24.18.1"]}The answer is always an object keyed by the spec as it was asked for, whether one package was requested or many, and each list is ordered oldest first — an empty one when the package is not in the index at all:
$ curl -s 'https://nixomatic.com/versions?p=jq,hello'
{"hello":["2.8","…","2.12.3"],"jq":["1.3","…","1.8.2"]}Asking about a revision instead gives the one version that revision ships, or
null when it ships none:
$ curl -s 'https://nixomatic.com/versions?p=nodejs:6a55e4c'
{"nodejs:6a55e4c":"20.15.1"}steps:
- uses: actions/checkout@v4
- uses: curriedsoftware/nixomatic-action@main
with:
packages: cowsay jq ripgrep
run: |
cowsay "Hello from nixomatic!"
jq --version
rg --versionsteps:
- uses: actions/checkout@v4
- uses: curriedsoftware/nixomatic-action@main
with:
packages: python3@3.13.4 nodejs@24.13.0
run: |
python3 --version
node --versionsteps:
- uses: actions/checkout@v4
- uses: curriedsoftware/nixomatic-action@main
with:
packages: |
cowsay
jq
ripgrep
run: |
cowsay "Hello from nixomatic!"
jq --version
rg --versionsteps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
- uses: curriedsoftware/nixomatic-action@main
with:
packages: hello
install-nix: false
run: hello- Installs Nix using cachix/install-nix-action (unless
install-nix: false) - Builds a URL with the specified packages pointing to
nixomatic.com - Runs the provided script inside
nix develop(ifrunis specified)