Skip to content

fix(nix): Fixed nix hash for dependencies, added CI job and script for updating dependencies versions#948

Merged
cjpais merged 2 commits intocjpais:mainfrom
xilec:fix/nix-update-hashes
Mar 12, 2026
Merged

fix(nix): Fixed nix hash for dependencies, added CI job and script for updating dependencies versions#948
cjpais merged 2 commits intocjpais:mainfrom
xilec:fix/nix-update-hashes

Conversation

@xilec
Copy link
Copy Markdown
Contributor

@xilec xilec commented Mar 3, 2026

Before Submitting This PR

Please confirm you have done the following:

If this is a feature or change that was previously closed/rejected:

N/A — this is a bug fix.

Human Written Description

Fixes #934

Nix packages pin dependency hashes, so they break whenever Cargo or bun
dependencies are updated. Since Nix expertise isn't common among
contributors, these breakages can sit unnoticed for a while.

To improve this going forward:

  • A non-blocking CI job (continue-on-error) that detects flake.nix
    evaluation failures on every PR and hints at how to fix them.
  • scripts/update-nix-hashes.sh — a script that automatically updates
    outputHashes and bunDeps hash in flake.nix. Works on NixOS, Ubuntu,
    and macOS.

Related Issues/Discussions

Fixes #934

Previous similar fixes: #842, #853

Community Feedback

Issue #934 was reported by a community member (simonkoeck)
experiencing the exact same build failure.

Testing

  • Reverted flake.nix to the broken state (tauri-runtime-2.9.1 hash)
  • Ran ./scripts/update-nix-hashes.sh — script automatically detected
    the version mismatch, updated keys, and resolved all hashes in 3
    iterations
  • Verified nix build .#handy completes successfully with the final
    flake.nix

Screenshots/Videos (if applicable)

N/A

AI Assistance

  • AI was used (please describe below)

If AI was used:

  • Tools used: Claude Code (claude-opus-4-6)
  • How extensively: AI assisted with writing the update-nix-hashes.sh
    script and nix-check.yml CI workflow, and identified the hash
    mismatches in flake.nix. All changes were reviewed and tested
    manually (only on NixOS).

xilec added 2 commits March 3, 2026 10:42
tauri-runtime upgraded from 2.9.1 to 2.10.0 (branch handy-2.10.2)
and bun.lock changed, but flake.nix hashes were not updated.
- scripts/update-nix-hashes.sh: automatically detects outputHashes
  version mismatches against Cargo.lock and fixes hashes via
  iterative nix build. Works on NixOS, Ubuntu, macOS.
- .github/workflows/nix-check.yml: non-blocking PR check that
  catches flake.nix evaluation failures and hints at the script.
- .gitignore: add nix build result symlink.
@xilec xilec changed the title fix(nix): Fixed nix hash for dependencies, added CI checking nix dependencies and added script for auto updating versions of dependencies fix(nix): Fixed nix hash for dependencies, added CI job and script for autoupdating dependencies versions Mar 3, 2026
@xilec xilec changed the title fix(nix): Fixed nix hash for dependencies, added CI job and script for autoupdating dependencies versions fix(nix): Fixed nix hash for dependencies, added CI job and script for updating dependencies versions Mar 4, 2026
@pomarec
Copy link
Copy Markdown

pomarec commented Mar 12, 2026

Running nix build .#handy on xilec:fix/nix-update-hashes works on my nixos

@cjpais
Copy link
Copy Markdown
Owner

cjpais commented Mar 12, 2026

Thanks for confirmation @pomarec

@cjpais cjpais merged commit 5dbe99b into cjpais:main Mar 12, 2026
5 checks passed
@CaptainSpof
Copy link
Copy Markdown

I think, we need to trigger the CI for the update script manually, hashes changed since the PR was made

@CaptainSpof CaptainSpof mentioned this pull request Mar 12, 2026
6 tasks
@CaptainSpof
Copy link
Copy Markdown

Nevermind, the CI action only checks for hashes mismatch. I've run the script locally and created a PR #1016

viktor-silakov pushed a commit to viktor-silakov/Handy that referenced this pull request Mar 18, 2026
…r updating dependencies versions (cjpais#948)

(cherry picked from commit 5dbe99b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Nix build fails: tauri-runtime-2.9.1 hash with no corresponding git dependency

4 participants