Nix-copy-closure still wants to re-build on remote system from home-manager or nix-env

So I was finding that on my work laptop, due to differing dns configuration, there was one particular dependency that was failing to resolve.

So I though I’d copy the offending closure over from my personal laptop:

NIX_SSHOPTS="PATH=\$HOME/.nix-profile/bin:/nix/var/nix/profiles/default/bin:/usr/local/bin:\$PATH"  nix-copy-closure --to ldeck@foo.local --include-outputs -v /nix/store/r1hjn3sz981lk7nigk7dzhj917hqa3yd-emacs-visual-fill-column-20220426.2045.drv
no such identity: /Users/ldeck/.ssh/id_rsa: No such file or directory
no such identity: /Users/ldeck/.ssh/id_ecdsa: No such file or directory
no such identity: /Users/ldeck/.ssh/id_dsa: No such file or directory
(ldeck@foo.local) Password:
copying 28 paths...
copying path '/nix/store/2d8r0hb31c2hkp51mk8qbdz0qsg1rrfr-setup-hook.sh' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/3fqh3qjibvahk0gqzpc8wi8nw9h1pnbs-apple-framework-GSS.drv' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/7mkb725jvvkx98is9b1jm782k91gy6b2-disable-graphviz-0.46.1.patch' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/znvl3v02hy8ffkhwc6m9z1q5pj8j6ppj-setup-hook.sh' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/b8lccgszlkjylpf0j2j3jngf4dvc0q2y-setup-hook.sh.drv' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/vndnczm832vi8m6ihqn424aly9g63xmb-gvc-compat.patch' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/y7vbblg5nxfyj5i8ad94jsnzpms53jz0-vala-0.54.8.tar.xz.drv' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/4cb6m1k4s418y0np7gy3lsk225bnaxk8-vala-0.54.8.drv' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/4jj63z4v1xp13rh2md053dccq920hd45-elpa2nix.el' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/536f2w56n3z453l6kpi4i44fx688nm0r-jansson-2.13.1.tar.gz.drv' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/6qr0pk620aagpfdylzwzj52ba21fjd89-melpa2nix.el' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/7v6xff4kcrb696dyzbgywy3myv63fwsj-emacs-funcs.sh' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/9azfm9mgd9qgfl8fnr9kjc6wzd1kmpd8-source.drv' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/9b86xyzww515h861l0nyiwrhf6vm9gax-jansson-2.13.1.drv' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/azmjw6bpmqs166mj15f1xizb9qzynrjz-librsvg-2.54.0.tar.xz.drv' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/by8saijmx018vsddy60l4d9lwax389n9-gdk-pixbuf-2.42.8.tar.xz.drv' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/d27sbrxkvg9fi6nix3jqhql6zb1fi8dg-visual-fill-column-recipe.drv' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/jnw3f8v8j377wbd3w94lly90lj18j8qk-source.drv' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/khc2pffr9zp3nbyvy3b8cn2nvq9inqww-sigtool-0.1.2.drv' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/znxr6xcwkdcqgdaknidfsrq3h2azz9mq-installed-tests-path.patch' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/v70ldypc9a6bj2wvxjcgc5v9l5604wli-gdk-pixbuf-2.42.8.drv' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/mch6fpxra5fr49vqd0jmr08b9xw9iyr5-librsvg-2.54.0.drv' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/n47gj3cwfgp5h67xw533bmddpivjlfhw-site-start.el' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/rrc8cb27bfnxnq1hr3svdd9qmnjq2br5-setup-hook.sh.drv' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/x88sjmsv9sqm0dq2zfd7jdq1d9x9v2y7-source.drv' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/vgv1p5mwip5dvzn6c9bsrpgh4cc565qp-emacs-28.1.drv' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/vp4h5ji0yxcmyb7xp365p9hahhs21fya-visual-fill-column-cdfe574.drv' to 'ssh://ldeck@foo.local'...
copying path '/nix/store/r1hjn3sz981lk7nigk7dzhj917hqa3yd-emacs-visual-fill-column-20220426.2045.drv' to 'ssh://ldeck@foo.local'...

But then when running ./switch.sh for my home manager config on my work computer, it still wanted to build… and fail to resolve… on my work machine. See log below.

Do I need to do any further steps to ensure they’re registered with the remote nix store after nix-copy-closure

log:

building '/nix/store/vp4h5ji0yxcmyb7xp365p9hahhs21fya-visual-fill-column-cdfe574.drv'...
exporting https://codeberg.org/joostkremers/visual-fill-column.git (rev cdfe574a51c4fc3519536fa3b169b01d5482d5df) into /nix/store/vzclzgb7kbjjm81zcp2awyxnsbsh2w12-visual-fill-column-cdfe574
Initialized empty Git repository in /nix/store/vzclzgb7kbjjm81zcp2awyxnsbsh2w12-visual-fill-column-cdfe574/.git/
fatal: unable to update url base from redirection:
  asked for: https://codeberg.org/joostkremers/visual-fill-column.git/info/refs?service=git-upload-pack
   redirect: https://codeberg.org/joostkremers/visual-fill-column.git/info/refs?X-OpenDNS-Session=_e10140cb06969043f30942a030f2ad6f1b2c9270f957_ozWcqZH5_service=git-upload-pack
fatal: unable to update url base from redirection:
  asked for: https://codeberg.org/joostkremers/visual-fill-column.git/info/refs?service=git-upload-pack
   redirect: https://codeberg.org/joostkremers/visual-fill-column.git/info/refs?X-OpenDNS-Session=_ef86a2ac00486043900a8b0076341bd970489270f95e_Y7cQw4qO_service=git-upload-pack
fatal: unable to update url base from redirection:
  asked for: https://codeberg.org/joostkremers/visual-fill-column.git/info/refs?service=git-upload-pack
   redirect: https://codeberg.org/joostkremers/visual-fill-column.git/info/refs?X-OpenDNS-Session=_a0f976450608d0433e0860309f1be40bdd5e9270f94c_Dy4YRGu9_service=git-upload-pack
Unable to checkout cdfe574a51c4fc3519536fa3b169b01d5482d5df from https://codeberg.org/joostkremers/visual-fill-column.git.
error: builder for '/nix/store/vp4h5ji0yxcmyb7xp365p9hahhs21fya-visual-fill-column-cdfe574.drv' failed with exit code 1;
       last 10 log lines:
       > fatal: unable to update url base from redirection:

Any suggestions?

Are you sure the outputs have been built on your local machine? You supplied --include-outputs, but no outputs were copied, so it seems that they’ve never been built in the first place. nix-copy-closure doesn’t start realizing anything to my knowledge.