naersk
naersk copied to clipboard
Private crate registries
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?
cargo2nix has some private registry support. It may require updating. I'll see if I can pull some examples out of the original creators.
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
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
I ran into the same issue. Would be great if naersk respects config.toml.