Nix copy --from: … but there is no substituter that can build it

Hi all,

mongodb is not in the binary cache and it’s too heavy to build on my PC. So I want to copy it from another PC where it’s already built.

But I’m getting this error message:

$ nix copy --from ssh://myuser@myhost /nix/store/6dib2b6342aw408x82q7yg08bf16pr93-mongo-4.4.25/
#                                                             got a typo here:    ^^^^^
error: path '/nix/store/6dib2b6342aw408x82q7yg08bf16pr93-mongo-4.4.25' is required, but there is no substituter that can build it

SSH access work and on the host the path exists in the nix store:

$ ls /nix/store/6dib2b6342aw408x82q7yg08bf16pr93-mongodb-4.4.25/
bin  lib  LICENSE-Community.txt  MPL-2  README  THIRD-PARTY-NOTICES

Also, this used to work a week ago. Don’t know what changed since when.

Any ideas?

Oh no, my bad!

I misspelled the path, it’s “mongodb”, not just “mongo” at the end of the path. I copied the command from my notes and somehow got it wrong there.

It was actually more complicated (that’s why I had it in my notes):

sudo -E -s nix copy --no-check-sigs --from ssh://myuser@myhost /nix/store/6dib2b6342aw408x82q7yg08bf16pr93-mongodb-4.4.25/

# now link it to gcroots to avoid future garbage collection:
ln -s /nix/store/6dib2b6342aw408x82q7yg08bf16pr93-mongodb-4.4.25/ /nix/var/nix/gcroots/per-user/myuser/