Skip to content

buildRustPackage is not very nix-ish #11144

@FlorentBecker

Description

@FlorentBecker

Hi, I started developping some rust code on nixos, and I find that while buildRustPackage is great for having all of crates.io available, the experience is not quite on par with, say, that of developping in haskell or ocaml on nix.

Specifically:

  • Documentation is a bit terse (I only found this wiki page: https://nixos.org/wiki/Rust), and it is not clear if it is up to date.
  • In Rust projects with both Rust and C dependencies, having the C dependencies known of nix, and the Rust dependencies known to Cargo is not convenient: Cargo.lock cannot be generated from within a nix-shell because of depsSha256, so one needs the awkward nix-shell -p cargo -p rustc -p
  • C dependencies of Rust dependencies of a project need to be discovered and added manually to default.nix (dependencies are forgotten when going through Cargo-land)
  • When using nix-shell, builds of rust dependencies are not shared between rust projects.

I'm grouping these into one issue because I'm not sure which of these sub-issues can be fixed in buildRustPackage, and what would need something more akin to cabal2nix where rust dependencies of rust packages are made manifest to nix/within nixpkgs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    6.topic: documentationMeta-discussion about documentation and its workflow

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions