Configure nightly toolchain in crane.nix
Get rid of this non-intuitive dependency of cranePkgs.cargoTargets.
This commit is contained in:
parent
2f25e613b2
commit
e4c22456ef
10
crane.nix
10
crane.nix
|
@ -2,8 +2,8 @@
|
|||
, pkgs
|
||||
, lib
|
||||
, crane
|
||||
, rustNightly
|
||||
, rust
|
||||
, rust-bin
|
||||
, nix-gitignore
|
||||
, supportedSystems
|
||||
}:
|
||||
|
@ -11,6 +11,12 @@
|
|||
let
|
||||
inherit (stdenv.hostPlatform) system;
|
||||
|
||||
nightlyVersion = "2023-05-01";
|
||||
rustNightly = pkgs.rust-bin.nightly.${nightlyVersion}.default.override {
|
||||
extensions = [ "rust-src" "rust-analyzer-preview" ];
|
||||
targets = cargoTargets;
|
||||
};
|
||||
|
||||
# For easy cross-compilation in devShells
|
||||
# We are just composing the pkgsCross.*.stdenv.cc together
|
||||
crossPlatforms = let
|
||||
|
@ -91,7 +97,7 @@ let
|
|||
});
|
||||
in crate;
|
||||
in {
|
||||
inherit crossPlatforms cargoTargets cargoCrossEnvs;
|
||||
inherit crossPlatforms cargoTargets cargoCrossEnvs rustNightly;
|
||||
|
||||
nix-actions-cache = buildFor system;
|
||||
}
|
||||
|
|
10
flake.nix
10
flake.nix
|
@ -26,7 +26,6 @@
|
|||
|
||||
outputs = { self, nixpkgs, flake-utils, rust-overlay, crane, ... }: let
|
||||
supportedSystems = flake-utils.lib.defaultSystems;
|
||||
nightlyVersion = "2023-05-01";
|
||||
in flake-utils.lib.eachSystem supportedSystems (system: let
|
||||
pkgs = import nixpkgs {
|
||||
inherit system;
|
||||
|
@ -37,13 +36,8 @@
|
|||
|
||||
inherit (pkgs) lib;
|
||||
|
||||
rustNightly = pkgs.rust-bin.nightly.${nightlyVersion}.default.override {
|
||||
extensions = [ "rust-src" "rust-analyzer-preview" ];
|
||||
targets = cranePkgs.cargoTargets;
|
||||
};
|
||||
|
||||
cranePkgs = pkgs.callPackage ./crane.nix {
|
||||
inherit crane supportedSystems rustNightly;
|
||||
inherit crane supportedSystems;
|
||||
};
|
||||
in {
|
||||
packages = rec {
|
||||
|
@ -55,7 +49,7 @@
|
|||
inputsFrom = [ cranePkgs.nix-actions-cache ];
|
||||
packages = with pkgs; [
|
||||
bashInteractive
|
||||
rustNightly
|
||||
cranePkgs.rustNightly
|
||||
|
||||
cargo-bloat
|
||||
cargo-edit
|
||||
|
|
Loading…
Reference in a new issue