Nodejs not pulled from cache.nixos.org

Why does nix build decide to build nodejs instead of using the binary on cache.nixos.org?

[2026-07-30T13:52:59-0500 koadic@laptop:~/project/nix-profile]
$ cat flake.nix 
{
  # inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
  inputs.nixpkgs.url = "github:NixOS/nixpkgs/09fe5f351396dd7db5024907681b203ada99e800";

  outputs = { self, nixpkgs }:
    let
      lib = nixpkgs.lib;
      forAllSystems = lib.genAttrs lib.systems.flakeExposed;
    in {
      packages = forAllSystems (system:
        let
          pkgs = nixpkgs.legacyPackages.${system};
        in {
          default = pkgs.nodejs_24;
        });
    };
}

[2026-07-30T13:53:01-0500 koadic@laptop:~/project/nix-profile]
$ nix build --refresh --dry-run . |& head
fetching git input 'git+file:///home/koadic/project/nix-profile'
warning: Git tree '/home/koadic/project/nix-profile' is dirty
this derivation will be built:
  /nix/store/sdzhfxxqz43r34mhp6nkx2idv5w37y72-nodejs-24.18.0.drv
these 41 paths will be fetched (57.14 MiB download, 210.81 MiB unpacked):
  /nix/store/8l8rbqchv12g48jqxm4s68vzr9cvbyp9-ada-3.4.4
  /nix/store/dddwfz7nph37q3cjky9lhpy9kb90rrrx-bash-interactive-5.3p15
  /nix/store/w5rsmvy2fcp7lrnn6y73zgf1rsjk6wn0-file-5.48
  /nix/store/m1p6gxgxis75rn0d549ny2y8gpxjv9pd-findutils-4.10.0
  /nix/store/xj9dgyqrcq8hrf4mrkvbcp4pa3hgrbhy-gnugrep-3.12

[2026-07-30T13:53:08-0500 koadic@laptop:~/project/nix-profile]
$ nix-store --query --outputs /nix/store/sdzhfxxqz43r34mhp6nkx2idv5w37y72-nodejs-24.18.0.drv
/nix/store/x98gls54ki3fmm2pv2cmi6z8mcda6glk-nodejs-24.18.0

[2026-07-30T13:53:15-0500 koadic@laptop:~/project/nix-profile]
$ curl -sI https://cache.nixos.org/x98gls54ki3fmm2pv2cmi6z8mcda6glk.narinfo
HTTP/2 200 
last-modified: Wed, 15 Jul 2026 08:46:57 GMT
etag: "568fbef6dc1aa5157e84fcfd44720eaf"
x-amz-server-side-encryption: AES256
content-type: text/x-nix-narinfo
server: AmazonS3
via: 1.1 varnish, 1.1 varnish
accept-ranges: bytes
date: Thu, 30 Jul 2026 18:53:20 GMT
age: 92528
x-served-by: cache-iad-kiad7000075-IAD, cache-mia-kfll1870058-MIA
x-cache: HIT, HIT
x-cache-hits: 91, 1
access-control-allow-origin: *
content-length: 686

Snippet to confirm that there’s nothing wrong with my config and that other packages (e.g. angband) are substituted just fine. Only nodejs substitutes (all versions) are ignored:

[2026-07-30T20:57:52-0500 koadic@laptop:~/tmp/yup]
$ nix build github:NixOS/nixpkgs/1559d3daa3ecc813a650b79375ea61b6741b8746#angband --dry-run |& head
fetching github input 'github:NixOS/nixpkgs/1559d3daa3ecc813a650b79375ea61b6741b8746'
these 2 paths will be fetched (23.52 MiB download, 29.38 MiB unpacked):
  /nix/store/v2pycr7vnvmkkv7ysn834qki9lif3ql6-angband-4.2.6
  /nix/store/n8va98nly989aq218bbvm404qaay4r8x-ncurses-abi5-compat-6.6

[2026-07-30T20:58:28-0500 koadic@laptop:~/tmp/yup]
$ nix build github:NixOS/nixpkgs/1559d3daa3ecc813a650b79375ea61b6741b8746#nodejs_22 --dry-run |& head
fetching github input 'github:NixOS/nixpkgs/1559d3daa3ecc813a650b79375ea61b6741b8746'
this derivation will be built:
  /nix/store/kk3vi5vy5yhfxi382v1zkamz3wgdlzs1-nodejs-22.23.2.drv
these 36 paths will be fetched (54.79 MiB download, 196.48 MiB unpacked):
  /nix/store/8l8rbqchv12g48jqxm4s68vzr9cvbyp9-ada-3.4.4
  /nix/store/dddwfz7nph37q3cjky9lhpy9kb90rrrx-bash-interactive-5.3p15
  /nix/store/w5rsmvy2fcp7lrnn6y73zgf1rsjk6wn0-file-5.48
  /nix/store/m1p6gxgxis75rn0d549ny2y8gpxjv9pd-findutils-4.10.0
  /nix/store/xj9dgyqrcq8hrf4mrkvbcp4pa3hgrbhy-gnugrep-3.12
  /nix/store/25q1byw51v076fk0cbx1f85dlsf946wy-icu4c-78.3

[2026-07-30T20:59:01-0500 koadic@laptop:~/tmp/yup]
$ nix build github:NixOS/nixpkgs/1559d3daa3ecc813a650b79375ea61b6741b8746#nodejs --dry-run |& head
fetching github input 'github:NixOS/nixpkgs/1559d3daa3ecc813a650b79375ea61b6741b8746'
this derivation will be built:
  /nix/store/sdzhfxxqz43r34mhp6nkx2idv5w37y72-nodejs-24.18.0.drv
these 37 paths will be fetched (55.94 MiB download, 200.00 MiB unpacked):
  /nix/store/8l8rbqchv12g48jqxm4s68vzr9cvbyp9-ada-3.4.4
  /nix/store/dddwfz7nph37q3cjky9lhpy9kb90rrrx-bash-interactive-5.3p15
  /nix/store/w5rsmvy2fcp7lrnn6y73zgf1rsjk6wn0-file-5.48
  /nix/store/m1p6gxgxis75rn0d549ny2y8gpxjv9pd-findutils-4.10.0
  /nix/store/xj9dgyqrcq8hrf4mrkvbcp4pa3hgrbhy-gnugrep-3.12
  /nix/store/ppij0kypm8b81lwj9c9yjnw4xdp6c7bi-hdrhistogram_c-0.11.10

[2026-07-30T20:59:08-0500 koadic@laptop:~/tmp/yup]
$ nix-store --query /nix/store/sdzhfxxqz43r34mhp6nkx2idv5w37y72-nodejs-24.18.0.drv
/nix/store/x98gls54ki3fmm2pv2cmi6z8mcda6glk-nodejs-24.18.0

[2026-07-30T20:59:30-0500 koadic@laptop:~/tmp/yup]
$ curl -sI https://cache.nixos.org/x98gls54ki3fmm2pv2cmi6z8mcda6glk.narinfo
HTTP/2 200 
last-modified: Wed, 15 Jul 2026 08:46:57 GMT
etag: "568fbef6dc1aa5157e84fcfd44720eaf"
x-amz-server-side-encryption: AES256
content-type: text/x-nix-narinfo
server: AmazonS3
via: 1.1 varnish, 1.1 varnish
accept-ranges: bytes
age: 118122
date: Fri, 31 Jul 2026 01:59:54 GMT
x-served-by: cache-iad-kiad7000075-IAD, cache-mia-kfll1870072-MIA
x-cache: HIT, HIT
x-cache-hits: 91, 0
access-control-allow-origin: *
content-length: 686


[2026-07-30T20:59:54-0500 koadic@laptop:~/tmp/yup]
$ curl https://cache.nixos.org/x98gls54ki3fmm2pv2cmi6z8mcda6glk.narinfo
StorePath: /nix/store/x98gls54ki3fmm2pv2cmi6z8mcda6glk-nodejs-24.18.0
URL: nar/0b1da38f2pbj4jsgzlw8xgsaj99nys1iqsz6jaag0blgja009vx8.nar.zst
Compression: zstd
FileHash: sha256:0slwfsi6nfs9ypjrj57i20ls7m805z12vx1b8q557ys1f4zgcvwp
FileSize: 50379
NarHash: sha256:0b1da38f2pbj4jsgzlw8xgsaj99nys1iqsz6jaag0blgja009vx8
NarSize: 858224
References: 6crizgqnh1vmm7ax82y4as6p5f3pcp13-nodejs-slim-24.18.0-npm amzxhrm2v7as6p0mq4xz7lmg4cxdv4lf-nodejs-slim-24.18.0-corepack p8hbhn8hdqz5p3a7y6dvi1y1x8nriybl-nodejs-slim-24.18.0
Deriver: sdzhfxxqz43r34mhp6nkx2idv5w37y72-nodejs-24.18.0.drv
Sig: cache.nixos.org-1:W8Ahdu88nQJcvX40YDmL++vmNamCqcRpOmkbPL5Pe2I1PUDIP5SNDGT8VSONheWA+EmVYO3YzXOKIzPMhk62AA==

Hmm, works ok with this rev from late 2025:

$ nix build github:NixOS/nixpkgs/cad22e7d996aea55ecab064e84834289143e44a0#nodejs --dry-run 
these 27 paths will be fetched (45.43 MiB download, 208.42 MiB unpacked):
  /nix/store/42hsdp2wh69pclsi2flbarql4fls0sm8-acl-2.3.2
  /nix/store/6lnqmp6z002x7i7if04a8y7y4v29pv2k-attr-2.5.2
  /nix/store/lw117lsr8d585xs63kx5k233impyrq7q-bash-5.3p3
  /nix/store/hkbylipx1iiawqdcjv858p501wv81bpm-bash-interactive-5.3p3
  /nix/store/d75200gb22v7p0703h5jrkgg8bqydk5q-coreutils-9.8
  /nix/store/xc0ga87wdclrx54qjaryahkkmkmqi9qz-gcc-15.2.0-lib
  /nix/store/b7kx9bkjsma9wslr1cg0316m5jy450l8-gcc-15.2.0-libgcc
  /nix/store/j193mfi0f921y0kfs8vjc1znnr45ispv-glibc-2.40-66
  /nix/store/ysybzx4slid45akig0q5b89afh32ar6k-gmp-with-cxx-6.3.0
  /nix/store/6nzj1syqhr82l6x6gzg8rvrgd9qlm7dz-icu4c-76.1
  /nix/store/55fckh05snmnaynvf505apr655y68nzc-icu4c-76.1-dev
  /nix/store/kywwgk85nl83mpf10av3bvm2khdlq5ib-libidn2-2.3.8
  /nix/store/hlcdbvwjlzjd2x86fxghzj1gpzplccqw-libunistring-1.4.1
  /nix/store/8a8rwa6b1sp9pxcp490910ci9pl4yq3g-libuv-1.51.0
  /nix/store/2073d0wz3jy20vrrhfp2mxck7qjb3lil-libuv-1.51.0-dev
  /nix/store/ddranxbikfg4jkf3n1m0a0h9qqxj1vf0-ncurses-6.5
  /nix/store/cikdc61gfwvdma6y0p9b5d5d448aqcv6-nodejs-24.12.0
  /nix/store/rfm5m2l26lqkskcvxn5bm5xqh6c8wqr5-openssl-3.6.0
  /nix/store/827b5xq1ghbbdrp1faa4fw32xj1m2p51-openssl-3.6.0-bin
  /nix/store/2ivy0r8ab3bnps5957vfrxcjfcgad661-openssl-3.6.0-dev
  /nix/store/vksayvpb9qm9h32k0qqg67nclrq8sf79-readline-8.3p1
  /nix/store/f6zwd0xdld51287as0sv79kbaf2pcayh-sqlite-3.51.1
  /nix/store/lbm0vi6xqrmvin5a9cj7v69qc5ayg5q0-sqlite-3.51.1-bin
  /nix/store/byl3w16n1zd8rnx040afcyy8zhn996w1-sqlite-3.51.1-dev
  /nix/store/6h39qxzrm4i1fhl538knvyjapcdyasfx-xgcc-15.2.0-libgcc
  /nix/store/c2qsgf2832zi4n29gfkqgkjpvmbmxam6-zlib-1.3.1
  /nix/store/srnvjrr38j7xmpcmjpndd6mw31lsfjrl-zlib-1.3.1-dev

Ok, so the last build that produced outputs was:

The next build (and all later builds) are very fast (usually seconds) and outputs size less than 1MB:

So clearly something dramatically changed between these versions. They’re still producing outputs (albeit much smaller) so it should still pull them from the cache though…

What happens when you do:

nix-store --realise /nix/store/x98gls54ki3fmm2pv2cmi6z8mcda6glk-nodejs-24.18.0

?

Looks like the output is just a symlink farm to nodejs-slim.

I already realised it.

It’s just a symlink farm:

[2026-07-30T22:07:40-0500 koadic@laptop:~/tmp/yup]
$ find /nix/store/x98gls54ki3fmm2pv2cmi6z8mcda6glk-nodejs-24.18.0 -type f

[2026-07-30T22:07:43-0500 koadic@laptop:~/tmp/yup]
$ find /nix/store/x98gls54ki3fmm2pv2cmi6z8mcda6glk-nodejs-24.18.0 -type l | wc -l
2464

If you already realized it, then don’t you have it on your system? I’m confused, I thought you were having trouble getting it substituted.

If you already realized it, then don’t you have it on your system?

Yes I do. By the time I replied to your message I had already realized it while trying to debug it.

I’m confused, I thought you were having trouble getting it substituted.

I’m trying to work out why originally (before I realized it) nix build wanted to build it instead of just downloading it.

It’s working fine for me, not sure what to say:

[user@host]$ nix-store --realise /nix/store/x98gls54ki3fmm2pv2cmi6z8mcda6glk-nodejs-24.18.0
these 62 paths will be fetched (73.0 MiB download, 253.0 MiB unpacked):
  /nix/store/xmfpij0wr7h2falwx5aymm0h4477s37h-acl-2.4.0
  /nix/store/8l8rbqchv12g48jqxm4s68vzr9cvbyp9-ada-3.4.4
  /nix/store/9wpg7kb02bg1jshj0rm3wp3d77fi4krj-attr-2.6.0
  /nix/store/c9mv5v53f7vy3wd00ah0f77k509mzmn7-bash-5.3p15
  /nix/store/dddwfz7nph37q3cjky9lhpy9kb90rrrx-bash-interactive-5.3p15
  /nix/store/4lxy2qign56dcbcwd202h6f44m2p0fcq-brotli-1.2.0
  /nix/store/xkjdypjdb61dqq0z79fdqd1mjhw3k3vi-brotli-1.2.0-dev
  /nix/store/pyjdn8k7hsfydg6nh53gc75hndknl6nq-brotli-1.2.0-lib
  /nix/store/3i7gmy9m9kmigwpaxsp0507is073klhn-c-ares-1.34.8
  /nix/store/3npsgs0d71wqn51czzbxc19bj1xsm8gv-c-ares-1.34.8
  /nix/store/0zj6s2cz3rklkldys7r6ykc9nq7bgrfw-c-ares-1.34.8-dev
  /nix/store/mp8s10fwm685azvvv1qq7zyf7iajjlj8-coreutils-9.11
  /nix/store/0iv8glcslgfcgn371lbjr5jjw5a6cqir-gcc-15.3.0-lib
  /nix/store/kw26hfd5b653cn2lm6yfh0q7y18d6d9l-gcc-15.3.0-libgcc
  /nix/store/l8si8gnvvq93yzms1jsgh5aixyf9rl5x-glibc-2.42-67
  /nix/store/47p3g10gbqf1dk92x64p5w152q90xf2n-gmp-with-cxx-6.3.0
  /nix/store/xj9dgyqrcq8hrf4mrkvbcp4pa3hgrbhy-gnugrep-3.12
  /nix/store/jp8aa66xzb31cdcrdxra2nnjjn1lnsna-gtest-1.17.0
  /nix/store/hvhjda48m17gfrlb50bfxp0r1r1klmpi-gtest-1.17.0-dev
  /nix/store/ppij0kypm8b81lwj9c9yjnw4xdp6c7bi-hdrhistogram_c-0.11.10
  /nix/store/25q1byw51v076fk0cbx1f85dlsf946wy-icu4c-78.3
  /nix/store/dmqm0zfnjgr80knam6pcdlq2cka02xv8-icu4c-78.3-dev
  /nix/store/03dld0nv8r2m3wpcyp26n8qpxhn6cqry-libev-4.33
  /nix/store/1zpz45w7k0i1j6b4m2z1cc12kbnv1m6y-libidn2-2.3.8
  /nix/store/47wlgfansg09j38cg44dh7rfh0smq8ym-libunistring-1.4.2
  /nix/store/mj4k2ran3jvgni8dgbv9hqf891921qyc-libuv-1.52.1
  /nix/store/v12aws0xnmcaxhv9j032d2gpxlqzb3sw-libuv-1.52.1-dev
  /nix/store/yj7apqxfkhjysgkc70mlwpmys1jyrxbk-llhttp-9.4.2
  /nix/store/7zw2xgj4phwm4w5ibwlgqb1jzlc7f0w9-llhttp-9.4.2-dev
  /nix/store/0wvz9ga48f38xc5rlfiilw7wy91496vv-merve-1.2.2
  /nix/store/41d305g3x8bl0ab5d2hwja7h2r3kq8c5-nbytes-0.1.4
  /nix/store/2y6fj2my9gaai48mv9mgycp9wmb0kv8a-ncurses-6.6
  /nix/store/qbjx1mvg3cb83inb5ziqpa4srhfm52h6-nghttp2-1.69.0
  /nix/store/vzy3vb2ac0z6kdn0m6qmm2cgg88b444f-nghttp2-1.69.0-dev
  /nix/store/5aaj50lfsqqxsxq6ziqab4fqmi5n57dq-nghttp2-1.69.0-lib
  /nix/store/wslzfbf8ib0snpzj4b6157q9bn4vmx9x-nghttp3-1.16.0
  /nix/store/6lzjfzzi5yz15xfi8qw4l75hyk0ybg0i-nghttp3-1.16.0-dev
  /nix/store/cd2wkdkxrgrg9978yx864vx5kbw77mxr-ngtcp2-1.23.0
  /nix/store/7xiij6c9b1vnnlr8n3nrzjmvh7ka43vl-ngtcp2-1.23.0-dev
  /nix/store/x98gls54ki3fmm2pv2cmi6z8mcda6glk-nodejs-24.18.0
  /nix/store/p8hbhn8hdqz5p3a7y6dvi1y1x8nriybl-nodejs-slim-24.18.0
  /nix/store/amzxhrm2v7as6p0mq4xz7lmg4cxdv4lf-nodejs-slim-24.18.0-corepack
  /nix/store/6crizgqnh1vmm7ax82y4as6p5f3pcp13-nodejs-slim-24.18.0-npm
  /nix/store/wn3g9b8f6m2z4ig76lipaijxgkf0pi1m-openssl-3.6.3
  /nix/store/g7xz6l9lp0w3fh0c4xralli79vd2vzpi-openssl-3.6.3-bin
  /nix/store/5iga06c6w0pb6p1srgkxzjvrzgf93j1y-openssl-3.6.3-dev
  /nix/store/zva95q4jh61f9i0cflab5d16wlck9ch5-pcre2-10.47
  /nix/store/d1mw1wmv37v4qp5661x4vb4rvhmaf6vx-readline-8.3p3
  /nix/store/qn2hp5flh5cjppbxkdpw4ygy8s7kyf63-simdjson-4.6.4
  /nix/store/q40zmh73qizzvak0zp38k79lzpx6fg54-simdutf-6.5.0
  /nix/store/518v8ngnb8avchbcm7xzbry6q5y2jhmm-simdutf-9.0.0
  /nix/store/5vsi9mzjw741bqzg23vhzhln98z4p6m9-sqlite-3.53.3
  /nix/store/vh7q8gz4rinjal4pckwyhyvxdx5pisp7-sqlite-3.53.3-bin
  /nix/store/f82py3qn6s6c6zxrjfrp8b8f629x0x5h-sqlite-3.53.3-dev
  /nix/store/kainya428kcn6al4r2wg0n2z91qbl723-uvwasi-0.0.23
  /nix/store/i9hdf87r1r8xkc26gj3h9cp08hx0iqbs-xgcc-15.3.0-libgcc
  /nix/store/78x9i5x1wpqw4kq0h39b8f35abcv156h-zlib-1.3.2
  /nix/store/ydgdz8pf2in3rlb5agwkgr76vfrdf2s5-zlib-1.3.2-dev
  /nix/store/cqrsxwri65bnki3rfhlj75187dj6c5al-zlib-1.3.2-static
  /nix/store/13id30w3rvgj24nnz34f7qrncz48zd7l-zstd-1.5.7
  /nix/store/9544h8pbcr8mw52c5k3bwk9jmg9babw4-zstd-1.5.7-bin
  /nix/store/vm13cagj8s0704qqj4crvca3hsm86jah-zstd-1.5.7-dev
copying path '/nix/store/kw26hfd5b653cn2lm6yfh0q7y18d6d9l-gcc-15.3.0-libgcc' from 'https://cache.nixos.org'...
copying path '/nix/store/i9hdf87r1r8xkc26gj3h9cp08hx0iqbs-xgcc-15.3.0-libgcc' from 'https://cache.nixos.org'...
copying path '/nix/store/cqrsxwri65bnki3rfhlj75187dj6c5al-zlib-1.3.2-static' from 'https://cache.nixos.org'...
copying path '/nix/store/47wlgfansg09j38cg44dh7rfh0smq8ym-libunistring-1.4.2' from 'https://cache.nixos.org'...
copying path '/nix/store/1zpz45w7k0i1j6b4m2z1cc12kbnv1m6y-libidn2-2.3.8' from 'https://cache.nixos.org'...
copying path '/nix/store/l8si8gnvvq93yzms1jsgh5aixyf9rl5x-glibc-2.42-67' from 'https://cache.nixos.org'...
copying path '/nix/store/xmfpij0wr7h2falwx5aymm0h4477s37h-acl-2.4.0' from 'https://cache.nixos.org'...
copying path '/nix/store/9wpg7kb02bg1jshj0rm3wp3d77fi4krj-attr-2.6.0' from 'https://cache.nixos.org'...
copying path '/nix/store/c9mv5v53f7vy3wd00ah0f77k509mzmn7-bash-5.3p15' from 'https://cache.nixos.org'...
copying path '/nix/store/pyjdn8k7hsfydg6nh53gc75hndknl6nq-brotli-1.2.0-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/3i7gmy9m9kmigwpaxsp0507is073klhn-c-ares-1.34.8' from 'https://cache.nixos.org'...
copying path '/nix/store/3npsgs0d71wqn51czzbxc19bj1xsm8gv-c-ares-1.34.8' from 'https://cache.nixos.org'...
copying path '/nix/store/0iv8glcslgfcgn371lbjr5jjw5a6cqir-gcc-15.3.0-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/03dld0nv8r2m3wpcyp26n8qpxhn6cqry-libev-4.33' from 'https://cache.nixos.org'...
copying path '/nix/store/yj7apqxfkhjysgkc70mlwpmys1jyrxbk-llhttp-9.4.2' from 'https://cache.nixos.org'...
copying path '/nix/store/mj4k2ran3jvgni8dgbv9hqf891921qyc-libuv-1.52.1' from 'https://cache.nixos.org'...
copying path '/nix/store/2y6fj2my9gaai48mv9mgycp9wmb0kv8a-ncurses-6.6' from 'https://cache.nixos.org'...
copying path '/nix/store/wslzfbf8ib0snpzj4b6157q9bn4vmx9x-nghttp3-1.16.0' from 'https://cache.nixos.org'...
copying path '/nix/store/5aaj50lfsqqxsxq6ziqab4fqmi5n57dq-nghttp2-1.69.0-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/wn3g9b8f6m2z4ig76lipaijxgkf0pi1m-openssl-3.6.3' from 'https://cache.nixos.org'...
copying path '/nix/store/78x9i5x1wpqw4kq0h39b8f35abcv156h-zlib-1.3.2' from 'https://cache.nixos.org'...
copying path '/nix/store/zva95q4jh61f9i0cflab5d16wlck9ch5-pcre2-10.47' from 'https://cache.nixos.org'...
copying path '/nix/store/v12aws0xnmcaxhv9j032d2gpxlqzb3sw-libuv-1.52.1-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/7zw2xgj4phwm4w5ibwlgqb1jzlc7f0w9-llhttp-9.4.2-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/4lxy2qign56dcbcwd202h6f44m2p0fcq-brotli-1.2.0' from 'https://cache.nixos.org'...
copying path '/nix/store/6lzjfzzi5yz15xfi8qw4l75hyk0ybg0i-nghttp3-1.16.0-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/0zj6s2cz3rklkldys7r6ykc9nq7bgrfw-c-ares-1.34.8-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/xj9dgyqrcq8hrf4mrkvbcp4pa3hgrbhy-gnugrep-3.12' from 'https://cache.nixos.org'...
copying path '/nix/store/5vsi9mzjw741bqzg23vhzhln98z4p6m9-sqlite-3.53.3' from 'https://cache.nixos.org'...
copying path '/nix/store/ppij0kypm8b81lwj9c9yjnw4xdp6c7bi-hdrhistogram_c-0.11.10' from 'https://cache.nixos.org'...
copying path '/nix/store/vh7q8gz4rinjal4pckwyhyvxdx5pisp7-sqlite-3.53.3-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/ydgdz8pf2in3rlb5agwkgr76vfrdf2s5-zlib-1.3.2-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/xkjdypjdb61dqq0z79fdqd1mjhw3k3vi-brotli-1.2.0-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/kainya428kcn6al4r2wg0n2z91qbl723-uvwasi-0.0.23' from 'https://cache.nixos.org'...
copying path '/nix/store/jp8aa66xzb31cdcrdxra2nnjjn1lnsna-gtest-1.17.0' from 'https://cache.nixos.org'...
copying path '/nix/store/47p3g10gbqf1dk92x64p5w152q90xf2n-gmp-with-cxx-6.3.0' from 'https://cache.nixos.org'...
copying path '/nix/store/25q1byw51v076fk0cbx1f85dlsf946wy-icu4c-78.3' from 'https://cache.nixos.org'...
copying path '/nix/store/0wvz9ga48f38xc5rlfiilw7wy91496vv-merve-1.2.2' from 'https://cache.nixos.org'...
copying path '/nix/store/41d305g3x8bl0ab5d2hwja7h2r3kq8c5-nbytes-0.1.4' from 'https://cache.nixos.org'...
copying path '/nix/store/qn2hp5flh5cjppbxkdpw4ygy8s7kyf63-simdjson-4.6.4' from 'https://cache.nixos.org'...
copying path '/nix/store/q40zmh73qizzvak0zp38k79lzpx6fg54-simdutf-6.5.0' from 'https://cache.nixos.org'...
copying path '/nix/store/518v8ngnb8avchbcm7xzbry6q5y2jhmm-simdutf-9.0.0' from 'https://cache.nixos.org'...
copying path '/nix/store/13id30w3rvgj24nnz34f7qrncz48zd7l-zstd-1.5.7' from 'https://cache.nixos.org'...
copying path '/nix/store/qbjx1mvg3cb83inb5ziqpa4srhfm52h6-nghttp2-1.69.0' from 'https://cache.nixos.org'...
copying path '/nix/store/g7xz6l9lp0w3fh0c4xralli79vd2vzpi-openssl-3.6.3-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/cd2wkdkxrgrg9978yx864vx5kbw77mxr-ngtcp2-1.23.0' from 'https://cache.nixos.org'...
copying path '/nix/store/hvhjda48m17gfrlb50bfxp0r1r1klmpi-gtest-1.17.0-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/d1mw1wmv37v4qp5661x4vb4rvhmaf6vx-readline-8.3p3' from 'https://cache.nixos.org'...
copying path '/nix/store/mp8s10fwm685azvvv1qq7zyf7iajjlj8-coreutils-9.11' from 'https://cache.nixos.org'...
copying path '/nix/store/f82py3qn6s6c6zxrjfrp8b8f629x0x5h-sqlite-3.53.3-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/8l8rbqchv12g48jqxm4s68vzr9cvbyp9-ada-3.4.4' from 'https://cache.nixos.org'...
copying path '/nix/store/9544h8pbcr8mw52c5k3bwk9jmg9babw4-zstd-1.5.7-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/7xiij6c9b1vnnlr8n3nrzjmvh7ka43vl-ngtcp2-1.23.0-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/5iga06c6w0pb6p1srgkxzjvrzgf93j1y-openssl-3.6.3-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/dddwfz7nph37q3cjky9lhpy9kb90rrrx-bash-interactive-5.3p15' from 'https://cache.nixos.org'...
copying path '/nix/store/vzy3vb2ac0z6kdn0m6qmm2cgg88b444f-nghttp2-1.69.0-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/vm13cagj8s0704qqj4crvca3hsm86jah-zstd-1.5.7-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/dmqm0zfnjgr80knam6pcdlq2cka02xv8-icu4c-78.3-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/p8hbhn8hdqz5p3a7y6dvi1y1x8nriybl-nodejs-slim-24.18.0' from 'https://cache.nixos.org'...
copying path '/nix/store/amzxhrm2v7as6p0mq4xz7lmg4cxdv4lf-nodejs-slim-24.18.0-corepack' from 'https://cache.nixos.org'...
copying path '/nix/store/6crizgqnh1vmm7ax82y4as6p5f3pcp13-nodejs-slim-24.18.0-npm' from 'https://cache.nixos.org'...
copying path '/nix/store/x98gls54ki3fmm2pv2cmi6z8mcda6glk-nodejs-24.18.0' from 'https://cache.nixos.org'...
warning: you did not specify '--add-root'; the result might be removed by the garbage collector
/nix/store/x98gls54ki3fmm2pv2cmi6z8mcda6glk-nodejs-24.18.0
~~~

nix-store --realise …

This thread is not about trying to realize nodejs. I have never had any issue with nix-store --realise. AFAIK that command works and has always worked as you would expect.

Please take another look at the question in the opening post. This thread is about why nix build is not using the substituter.

That is why does nix build report:

this derivation will be built:
  /nix/store/sdzhfxxqz43r34mhp6nkx2idv5w37y72-nodejs-24.18.0.drv

Instead of using the object in the cache that the subsequent commands confirm is available.

I think you’re answering a question I never asked, but if I’m wrong please elaborate.

Ah I see, I broadened the question to “why is nix not substituting this path” instead of the narrowly focused why is nix build specifically doing whatever. Sorry!

Good luck! Clearly some part of nix can substitute this, no idea why the nix3 style command would give an issue.

1 Like

The following commands check whether allowSubstitutes is set or not.

null means it’s not explicity set (the default is true):

$ nix derivation show github:NixOS/nixpkgs/1559d3daa3ecc813a650b79375ea61b6741b8746#nodejs-slim | jq '.[].env.allowSubstitutes'
null

$ nix derivation show github:NixOS/nixpkgs/1559d3daa3ecc813a650b79375ea61b6741b8746#angband | jq '.[].env.allowSubstitutes'
null

If it’s set to an zero-length string (like with nodejs) it’s interpreted as false:

$ nix derivation show github:NixOS/nixpkgs/1559d3daa3ecc813a650b79375ea61b6741b8746#nodejs | jq '.[].env.allowSubstitutes'
""

Hmm, someone flagged the solution I posted that I got from DeepSeek (and attributed as such) and the post was hidden…

Apparently there’s some policy against good answers if they came from AI:

Anyways, allowSubstitutes:false sucks. Ask DeepSeek to find out why and workarounds.

1 Like

I think that the reason is precisely symlinking. According to your bisect here, nodejs used to be a heavy package and then it was refactored to be a symlink to some underlying components (nodejs-slim probably).

Symlinked derivations themselves are not substituted by default (see e.g. nixpkgs/pkgs/build-support/trivial-builders/default.nix at b5a1961b9c902670dc7fb9beced49f2e64ace761 · NixOS/nixpkgs · GitHub because it’s trivial to build them locally), but the underlying heavy package (nodejs-slim) should still be substituted. That’s my guess, untested.