I’d like to test a patch to sunshine on my current NixOS setup, but given it modifies the projects package-lock.json, I’ve temporarily committed the file into a branch on my fork. However, I can’t seem to override npmDepsHash for the ui derivation nested within the sunshine package:
services.sunshine = {
enable = true;
package = pkgs.sunshine.overrideAttrs (old: {
src = pkgs.fetchFromGitHub {
owner = "ruffsl";
repo = "Sunshine";
rev = "7f15276cf2e6a7d51db202f362afa520dcb71db7";
hash = "sha256-dSBsbFJ5gMUNEKcwvkWqpSrv1may/CofdjqQSuszEwI=";
fetchSubmodules = true;
};
ui = old.ui.overrideAttrs (_: {
npmDepsHash = lib.fakeHash;
postPatch = "";
});
});
};
ruffsl@box ~/nix-config (main)> time sudo nixos-rebuild test --flake .#box --show-trace
building the system configuration...
error: builder for '/nix/store/pkqvrw25kzv9ygs986hpm2r6jpnpbs29-sunshine-ui-2025.628.4510.drv' failed with exit code 1;
last 25 log lines:
> < "node_modules/yallist": {
> < "version": "3.1.1",
> < "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz",
> < "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==",
> < "dev": true,
> < "license": "ISC"
> < },
> 5840,5842c2463,2465
> < "version": "3.25.76",
> < "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz",
> < "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==",
> ---
> > "version": "3.25.67",
> > "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.67.tgz",
> > "integrity": "sha512-idA2YXwpCdqUSKRCACDE6ItZD9TZzy3OZMtpfLoh6oPR47lipysRrJfjzMqFxQ3uJuUPyUeWe1r9vLH33xO/Qw==",
>
> ERROR: npmDepsHash is out of date
>
> The package-lock.json in src is not the same as the in /nix/store/gx0mzsiiibli3bqnd295sl20s3sv75g8-sunshine-ui-2025.628.4510-npm-deps.
>
> To fix the issue:
> 1. Use `lib.fakeHash` as the npmDepsHash value
> 2. Build the derivation and wait for it to fail with a hash mismatch
> 3. Copy the 'got: sha256-' value back into the npmDepsHash field
>
For full logs, run:
nix log /nix/store/pkqvrw25kzv9ygs986hpm2r6jpnpbs29-sunshine-ui-2025.628.4510.drv
error: 1 dependencies of derivation '/nix/store/0z8gqn88pxjawr5phx2axwzscak3wb4q-sunshine-2025.628.4510.drv' failed to build
error: 1 dependencies of derivation '/nix/store/c6yi76fdfv3la5kdb0ss8m0chdy38vmz-ensure-all-wrappers-paths-exist.drv' failed to build
error: 1 dependencies of derivation '/nix/store/q2dzm4gszkrpax4p5b8qvns05dzqzqn3-hwdb.bin.drv' failed to build
error: 1 dependencies of derivation '/nix/store/sjdfjpn124qfr6s5pf1ycsbisbs3xj7v-security-wrapper-sunshine-x86_64-unknown-linux-musl.drv' failed to build
error: 1 dependencies of derivation '/nix/store/x01ijzph56r5088hnh1q5bhgbikgf28q-sunshine-2025.628.4510_fish-completions.drv' failed to build
error: 1 dependencies of derivation '/nix/store/j6l3hzlmc6a7gwdx2r15sxfl833ni7yf-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/v0gkldwh2x2lamwyzsy311y1cqs8wmfi-udev-rules.drv' failed to build
error: 1 dependencies of derivation '/nix/store/2la39wxrg1sqv9m944l0imvrkzw6rdb6-nixos-system-box-25.11.20250921.554be64.drv' failed to build
Command 'nix --extra-experimental-features 'nix-command flakes' build --print-out-paths '/home/ruffsl/Documents/nix-config#nixosConfigurations."box".config.system.build.toplevel' --show-trace --no-link' returned non-zero exit status 1.
________________________________________________________
Executed in 2.61 secs fish external
usr time 4.57 millis 917.00 micros 3.65 millis
sys time 5.53 millis 918.00 micros 4.61 millis
I suspect I’m either incorrectly overriding npmDepsHash, or perhaps encountering a similar upstream issue that may have been fixed in nixos-unstable, which my flake is already using (rev 554be64):
- npmDepsHash override, what am I missing please
- pnpn.fetchDeps: fetchDeps not rebuilding when packages updated for workspace package · Issue #397412 · NixOS/nixpkgs · GitHub
- pnpm.configHook: improve error message when install fails due to hash by gepbird · Pull Request #397491 · NixOS/nixpkgs · GitHub
For completeness, here is the patch I’m attempting to test with: