fix(nix): derive npm deps from lockfile via importNpmLock#54
Merged
Conversation
Replace the pinned npmDepsHash with importNpmLock so the Nix build reads dependencies straight from package-lock.json. Dependency bumps (Dependabot) no longer break test-nix with a hash mismatch and no manual hash update is required. Verified locally: nix build .#sysdig-vscode-vsix packages the vsix successfully.
tembleking
requested changes
Jun 18, 2026
tembleking
left a comment
Member
There was a problem hiding this comment.
Nice, can you also remove this part if it's not needed anymore?
Lines 35 to 36 in 727ff13
With importNpmLock there is no fixed-output hash to maintain, so remove the rehash-npm-nix just recipe, its pre-commit hook, its call in just update, and the now-unused prefetch-npm-deps devShell package.
Contributor
Author
|
Good catch @tembleking — done in 332ee45. Since there is no longer a fixed-output hash to maintain, I removed the whole rehash machinery, not just the recipe:
Re-verified locally: |
tembleking
approved these changes
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Every Dependabot dependency PR fails the
test-nixcheck with a Nix hash mismatch, e.g.:vsix.nixpins a fixed-outputnpmDepsHashderived frompackage-lock.json. Any lockfile change (i.e. every dependency bump) changes that hash, so the build fails until the hash is manually updated — something Dependabot cannot do. This blocks PRs #40, #41, #42, #44, #46 and every future bump.Fix
Replace the pinned
npmDepsHashwithimportNpmLock, which reads dependencies directly frompackage-lock.jsonwith no fixed-output hash:After this, dependency bumps no longer touch any Nix hash —
test-nixstays green on a plain rebase.Verification
Built locally on macOS against
nixpkgs-unstable:Follow-up
Once merged, the open Dependabot PRs just need
@dependabot rebaseto go green — no per-PR hash edits.