crate2nix
crate2nix copied to clipboard
Specify the toolchain used to build the main project
Is there an idiomatic method for specifying the toolchain used for generateCargoNix
? Currently I'm using an overlay with oxalica/rust-overlay
:
overlays = [
(import rust-overlay)
(self: super: let
toolchain = super.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
in {
rustc = toolchain;
})
];
pkgs = import nixpkgs { inherit system overlays; };
That looks pretty good to me!
Would you mind contributing it to the README.md? It is a bit outdated.
That looks pretty good to me!
Would you mind contributing it to the README.md? It is a bit outdated.
Do you want to move the Flake section up to the top? I don't have numbers but I feel like Flake is the more common usage here. I can also add a template using thje example here.
Heyo @vleni,
Yes, I just recently added some information about flake usage. I want to export something nice since ages there but haven't come around to doing it yet.
Feel free to search the README.md for references to flakes and consolidate them in a Flake section in the beginning and then maybe a separate nix-env section?
Not sure how much time you are willing to spend on this, so if you just keep it short and just add a new section that is also fine.
Heyo @vleni,
Yes, I just recently added some information about flake usage. I want to export something nice since ages there but haven't come around to doing it yet.
Feel free to search the README.md for references to flakes and consolidate them in a Flake section in the beginning and then maybe a separate nix-env section?
Not sure how much time you are willing to spend on this, so if you just keep it short and just add a new section that is also fine.
I added one self-contained flake example in https://github.com/nix-community/crate2nix/pull/306. It doesn't involve any installation so I put it in its own section.
Heyo @vleni !
BTW, feel free to add yourself to the Changelog and thanks again!
@kolloch I think there's a problem: https://github.com/oxalica/rust-overlay/issues/143
The developer of rust-overlay says we should not override nixpkgs