Commit fff3693
authored
fix(nix): derive npm deps from lockfile via importNpmLock (#54)
## Problem
Every Dependabot dependency PR fails the `test-nix` check with a Nix
hash mismatch, e.g.:
```
error: hash mismatch for sysdig-vscode-ext-vsix-…-npm-deps
To correct the hash mismatch … use "sha256-…"
```
`vsix.nix` pins a fixed-output `npmDepsHash` derived from
`package-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 `npmDepsHash` with `importNpmLock`, which reads
dependencies directly from `package-lock.json` with no fixed-output
hash:
```nix
npmDeps = importNpmLock { npmRoot = ./.; };
npmConfigHook = importNpmLock.npmConfigHook;
```
After this, dependency bumps no longer touch any Nix hash — `test-nix`
stays green on a plain rebase.
## Verification
Built locally on macOS against `nixpkgs-unstable`:
```
$ nix build .#sysdig-vscode-vsix
…
DONE Packaged: sysdig-vscode-ext-0.2.16.vsix (198 files, 353.03 KB)
```
## Follow-up
Once merged, the open Dependabot PRs just need `@dependabot rebase` to
go green — no per-PR hash edits.1 parent 727ff13 commit fff3693
4 files changed
Lines changed: 7 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
34 | | - | |
35 | | - | |
36 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
80 | 79 | | |
81 | 80 | | |
82 | 81 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
| 4 | + | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
| |||
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
18 | 24 | | |
19 | 25 | | |
20 | 26 | | |
| |||
0 commit comments