Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
install-nix: rename install_hash to install_sha256
  • Loading branch information
Fumesover committed Nov 21, 2026
commit 788d88a082f294f8a32334ef386308cd4458c784
4 changes: 2 additions & 2 deletions .github/workflows/test-per-system.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ jobs:
with:
nix_path: ${{ env.nixpkgs_channel }}
install_url: ${{ steps.latest-installer.outputs.url }}
install_hash: ${{ steps.latest-installer.outputs.sha256 }}
install_sha256: ${{ steps.latest-installer.outputs.sha256 }}
install_options: "--tarball-url-prefix http://localhost:8080"
- run: nix-build tests/test-build.nix

Expand All @@ -108,5 +108,5 @@ jobs:
with:
nix_path: ${{ env.nixpkgs_channel }}
install_url: https://releases.nixos.org/nix/${{ inputs.oldest_installer_version }}/install
install_hash: ${{ inputs.oldest_installer_sha256 }}
install_sha256: ${{ inputs.oldest_installer_sha256 }}
- run: nix-build tests/test-build.nix
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
| Name | Description | Default |
|------|-------------|---------|
| `install_url` | URL to install Nix from. Useful for testing non-stable releases or pinning a specific Nix version (e.g., <https://releases.nixos.org/nix/nix-2.3.7/install>) | `""` |
| `install_hash` | Expected SHA-256 of the installer script. Recommended when `install_url` is set: without it, the custom installer is not verified. Releases publish it next to the installer (e.g., <https://releases.nixos.org/nix/nix-2.3.7/install.sha256>) | Pinned hash of the default installer |
| `install_sha256` | Expected SHA-256 of the installer script. Recommended when `install_url` is set: without it, the custom installer is not verified. Releases publish it next to the installer (e.g., <https://releases.nixos.org/nix/nix-2.3.7/install.sha256>) | Pinned hash of the default installer |
| `install_options` | Additional flags to pass to the Nix installer script | `""` |
| `extra_nix_config` | Additional configuration to append to `/etc/nix/nix.conf` | `""` |
| `nix_path` | Value to set for the `NIX_PATH` environment variable (e.g., `nixpkgs=channel:nixos-unstable`) | `""` |
Expand Down
4 changes: 2 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ inputs:
description: 'Configure Nix to pull from GitHub using the given GitHub token.'
install_url:
description: 'Installation URL that will contain a script to install Nix.'
install_hash:
install_sha256:
description: 'Expected SHA-256 of the installer script. Defaults to the pinned hash of the default installer; with a custom `install_url` and no hash, the installer is not verified.'
install_options:
description: 'Additional installer flags passed to the installer script.'
Expand All @@ -35,7 +35,7 @@ runs:
INPUT_GITHUB_ACCESS_TOKEN: ${{ inputs.github_access_token }}
INPUT_INSTALL_OPTIONS: ${{ inputs.install_options }}
INPUT_INSTALL_URL: ${{ inputs.install_url }}
INPUT_INSTALL_HASH: ${{ inputs.install_hash }}
INPUT_INSTALL_SHA256: ${{ inputs.install_sha256 }}
INPUT_NIX_PATH: ${{ inputs.nix_path }}
INPUT_ENABLE_KVM: ${{ inputs.enable_kvm }}
INPUT_SET_AS_TRUSTED_USER: ${{ inputs.set_as_trusted_user }}
Expand Down
10 changes: 5 additions & 5 deletions install-nix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,17 @@ nix_version=2.36.0
nix_install_sha256=8388dfd4d3c3a0c2dc79f764d453eafcc244255f47c93c1958f4775af22f0353

# Pick the installer and the hash to check it against:
# - default installer: the pinned hash above, unless install_hash overrides it
# - custom install_url: install_hash if set, otherwise the installer is not verified
# - default installer: the pinned hash above, unless install_sha256 overrides it
# - custom install_url: install_sha256 if set, otherwise the installer is not verified
if [[ -n "${INPUT_INSTALL_URL:-}" ]]; then
install_url=$INPUT_INSTALL_URL
expected_sha256=${INPUT_INSTALL_HASH:-}
expected_sha256=${INPUT_INSTALL_SHA256:-}
if [[ -z "$expected_sha256" ]]; then
echo "::warning::install_url is set but install_hash is not, so the installer will not be verified. Set install_hash to the SHA-256 of '$install_url'."
echo "::warning::install_url is set but install_sha256 is not, so the installer will not be verified. Set install_sha256 to the SHA-256 of '$install_url'."
fi
else
install_url="https://releases.nixos.org/nix/nix-${nix_version}/install"
expected_sha256=${INPUT_INSTALL_HASH:-$nix_install_sha256}
expected_sha256=${INPUT_INSTALL_SHA256:-$nix_install_sha256}
fi

while ! curl -sS -o "$workdir/install" -v --fail -L "$install_url"; do
Expand Down