crate2nix icon indicating copy to clipboard operation
crate2nix copied to clipboard

Specify the toolchain used to build the main project

Open lenianiva opened this issue 1 year ago • 6 comments

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; };

lenianiva avatar Oct 20 '23 23:10 lenianiva

That looks pretty good to me!

Would you mind contributing it to the README.md? It is a bit outdated.

kolloch avatar Oct 22 '23 17:10 kolloch

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.

lenianiva avatar Oct 22 '23 17:10 lenianiva

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.

kolloch avatar Oct 23 '23 11:10 kolloch

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.

lenianiva avatar Oct 23 '23 18:10 lenianiva

Heyo @vleni !

BTW, feel free to add yourself to the Changelog and thanks again!

kolloch avatar Oct 28 '23 06:10 kolloch

@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

lenianiva avatar Nov 08 '23 06:11 lenianiva