Shortly after releasing Determinate Nix Installer, we released nix-installer-action
, a GitHub Action for installing Nix using Determinate Nix Installer, our next-generation installer written in Rust with support for seamlessly uninstalling Nix and more.
This Action has successfully delivered Nix to millions of runners and thus served its purpose quite ably.
Since the launch of Determinate Nix, nix-installer-action
has provided the option of installing Determinate Nix by applying determinate: true
to your YAML configuration.
But nix-installer-action
has an important drawback: its version isn’t synced with the version of Determinate Nix, making it difficult to target Determinate Nix versions in CI runs.
And so today we’re announcing that we’ve created a new Action, determinate-nix-action
that installs Determinate Nix both by default and with a synced version.
That means that you can use, say, Determinate Nix version 3.6.1 by specifying this:
- uses: DeterminateSystems/determinate-nix-action@v3.6.1
Here’s a full example configuration:
on: pull_request: push: branches: [main]
jobs: build-nix-pkg: name: Build Nix package runs-on: ubuntu-latest permissions: id-token: write contents: read steps: - uses: actions/checkout@v4 - uses: DeterminateSystems/determinate-nix-action@v3 - name: Build package using Determinate Nix run: nix build
Note that the permissions
block is necessary if you intend to use private flakes and FlakeHub Cache.
And as an alternative to using v3
, you can pin to a specific release, such as @v3.6.1
(the most recent release as of this writing).
In terms of configuration, determinate-nix-action
provides most of the same parameters that you’re used to from nix-installer-action
—such as extra-conf
for providing custom Nix configuration—leaving behind only those that don’t make sense in this new Action.
If you do opt to pin to a specific version of determinate-nix-action
, we strongly recommend using tools like Dependabot and Renovate to automatically bump the version when necessary, lest you end up running out-of-date versions of Determinate Nix.
If you’d like to target specific versions of Determinate Nix, we do recommend switching to this new Action.
For more on why you should consider pinning your Actions, GitHub has a good primer.
And as with all Actions, you can pin determinate-nix-action
to a specific Git hash, such as 441b9e401ac050c38a07d8313748c5c2d17e8aff
:
- uses: DeterminateSystems/determinate-nix-action@441b9e401ac050c38a07d8313748c5c2d17e8aff
If you’re currently using nix-installer-action
to install Determinate Nix don’t worry: nothing is changing on that end and you can still set determinate: true
to install Determinate Nix:
- uses: DeterminateSystems/nix-installer-action with: determinate: true