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
|
, pkgs
|
||||||
, lib
|
, lib
|
||||||
, crane
|
, crane
|
||||||
, rustNightly
|
|
||||||
, rust
|
, rust
|
||||||
|
, rust-bin
|
||||||
, nix-gitignore
|
, nix-gitignore
|
||||||
, supportedSystems
|
, supportedSystems
|
||||||
}:
|
}:
|
||||||
|
@ -11,6 +11,12 @@
|
||||||
let
|
let
|
||||||
inherit (stdenv.hostPlatform) system;
|
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
|
# For easy cross-compilation in devShells
|
||||||
# We are just composing the pkgsCross.*.stdenv.cc together
|
# We are just composing the pkgsCross.*.stdenv.cc together
|
||||||
crossPlatforms = let
|
crossPlatforms = let
|
||||||
|
@ -91,7 +97,7 @@ let
|
||||||
});
|
});
|
||||||
in crate;
|
in crate;
|
||||||
in {
|
in {
|
||||||
inherit crossPlatforms cargoTargets cargoCrossEnvs;
|
inherit crossPlatforms cargoTargets cargoCrossEnvs rustNightly;
|
||||||
|
|
||||||
nix-actions-cache = buildFor system;
|
nix-actions-cache = buildFor system;
|
||||||
}
|
}
|
||||||
|
|
10
flake.nix
10
flake.nix
|
@ -26,7 +26,6 @@
|
||||||
|
|
||||||
outputs = { self, nixpkgs, flake-utils, rust-overlay, crane, ... }: let
|
outputs = { self, nixpkgs, flake-utils, rust-overlay, crane, ... }: let
|
||||||
supportedSystems = flake-utils.lib.defaultSystems;
|
supportedSystems = flake-utils.lib.defaultSystems;
|
||||||
nightlyVersion = "2023-05-01";
|
|
||||||
in flake-utils.lib.eachSystem supportedSystems (system: let
|
in flake-utils.lib.eachSystem supportedSystems (system: let
|
||||||
pkgs = import nixpkgs {
|
pkgs = import nixpkgs {
|
||||||
inherit system;
|
inherit system;
|
||||||
|
@ -37,13 +36,8 @@
|
||||||
|
|
||||||
inherit (pkgs) lib;
|
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 {
|
cranePkgs = pkgs.callPackage ./crane.nix {
|
||||||
inherit crane supportedSystems rustNightly;
|
inherit crane supportedSystems;
|
||||||
};
|
};
|
||||||
in {
|
in {
|
||||||
packages = rec {
|
packages = rec {
|
||||||
|
@ -55,7 +49,7 @@
|
||||||
inputsFrom = [ cranePkgs.nix-actions-cache ];
|
inputsFrom = [ cranePkgs.nix-actions-cache ];
|
||||||
packages = with pkgs; [
|
packages = with pkgs; [
|
||||||
bashInteractive
|
bashInteractive
|
||||||
rustNightly
|
cranePkgs.rustNightly
|
||||||
|
|
||||||
cargo-bloat
|
cargo-bloat
|
||||||
cargo-edit
|
cargo-edit
|
||||||
|
|
Loading…
Reference in a new issue