@grhmc So, Rust based packages in nixos - if I want to replace the *source* to the rustup package (ie. have it built from a test branch of my own) how do I express that in nix without just copying the package into my config and hacking at it? (I am still very junior nix-wise)
2
2
I might need to know more about how exactly you are getting rustup, but here for example I can override the source of the rustup package from nixpkgs: rustup.overrideAttrs (old_attrs: { src = path/to/local/rustup/src; }) Or you can use `fetchGit` instead of a local path πŸ˜€
2
Replying to @basile_henry @grhmc
I would be fetching from a branch in a repo, so fetchGit for sure; isn't there a cargo sha thing too though? I'm not sure, I should probably seek out the computed derivation and look I guess; but I don't know how :D

Jun 6, 2022 Β· 12:30 PM UTC

1
Replying to @dsilverstone @grhmc
Yeah it looks like `buildRustPackage` requires a `cargoLock` that can't be overridden easily. Look at "Importing a Cargo.lock file" section: nixos.org/manual/nixpkgs/sta… So it might be easier to copy/paste the whole `buildRustPackage` instead of overriding: github.com/NixOS/nixpkgs/blo… 🀞
1
Yeah I figure both `src` and `cargoSha256` would need to be overridden, and if the latter isn't easy to do, then the copy-pasta approach may be necessary. Ugh