nix-community / crate2nix

rebuild only changed crates in CI with crate2nix and nix
https://nix-community.github.io/crate2nix/
Apache License 2.0
338 stars 82 forks source link

Specify the toolchain used to build the main project #305

Open lenianiva opened 9 months ago

lenianiva commented 9 months ago

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; };
kolloch commented 9 months ago

That looks pretty good to me!

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

lenianiva commented 9 months ago

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.

kolloch commented 9 months ago

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.

lenianiva commented 9 months ago

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.

kolloch commented 8 months ago

Heyo @vleni !

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

lenianiva commented 8 months ago

@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