naersk icon indicating copy to clipboard operation
naersk copied to clipboard

Private crate registries

Open LukeMathWalker opened this issue 4 years ago • 4 comments

Hey! I am starting to play around with nix to build Rust projects and I am experimenting on a crate that pulls in some dependencies from a private crate registry. This leads to a failure when doing nix flake check:

Caused by:
       >   no index found for registry: `truelayer-rustlayer`
       > [naersk] cargo returned with exit code 101, exiting

I imagine this is perhaps related to naersk ignoring .cargo/config.toml?

LukeMathWalker avatar Aug 04 '21 20:08 LukeMathWalker

cargo2nix has some private registry support. It may require updating. I'll see if I can pull some examples out of the original creators.

psionic-k avatar Nov 30 '21 06:11 psionic-k

You can add a config.toml to your naersk build by creating a file at .cargo/config. https://github.com/nix-community/naersk/blob/aec8bd9ec208dc25cfc4967defded585f364f856/default.nix#L30

Anderssorby avatar Dec 08 '21 16:12 Anderssorby

But it seems naersk doesn't support this yet. We need to update this https://github.com/nix-community/naersk/blob/aec8bd9ec208dc25cfc4967defded585f364f856/build.nix#L433-L449

Anderssorby avatar Dec 08 '21 16:12 Anderssorby

I ran into the same issue. Would be great if naersk respects config.toml.

secana avatar Feb 22 '24 14:02 secana