aboutsummaryrefslogtreecommitdiff
path: root/flake.nix
diff options
context:
space:
mode:
authorMichael Davis2023-08-31 23:57:38 +0000
committerGitHub2023-08-31 23:57:38 +0000
commit7cf775d5128e701722290ef29945549c96e79bd1 (patch)
tree8d62a9a56fd3a95ce4966d97d70b834acc755226 /flake.nix
parent48373d4a2b6402dce91ebcdf29b6341fcf0ba302 (diff)
Build flake packages with stable Rust (#8133)
We can continue to use the MSRV for local development and checks while building release executables with the latest stable Rust, as we do in CI.
Diffstat (limited to 'flake.nix')
-rw-r--r--flake.nix19
1 files changed, 10 insertions, 9 deletions
diff --git a/flake.nix b/flake.nix
index 40d0549b..8198d4cd 100644
--- a/flake.nix
+++ b/flake.nix
@@ -121,7 +121,8 @@
then ''$RUSTFLAGS -C link-arg=-fuse-ld=lld -C target-cpu=native -Clink-arg=-Wl,--no-rosegment''
else "$RUSTFLAGS";
rustToolchain = pkgs.pkgsBuildHost.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
- craneLib = (crane.mkLib pkgs).overrideToolchain rustToolchain;
+ craneLibMSRV = (crane.mkLib pkgs).overrideToolchain rustToolchain;
+ craneLibStable = (crane.mkLib pkgs).overrideToolchain pkgs.pkgsBuildHost.rust-bin.stable.latest.default;
commonArgs =
{
inherit stdenv;
@@ -133,13 +134,13 @@
doCheck = false;
meta.mainProgram = "hx";
}
- // craneLib.crateNameFromCargoToml {cargoToml = ./helix-term/Cargo.toml;};
- cargoArtifacts = craneLib.buildDepsOnly commonArgs;
+ // craneLibMSRV.crateNameFromCargoToml {cargoToml = ./helix-term/Cargo.toml;};
+ cargoArtifacts = craneLibMSRV.buildDepsOnly commonArgs;
in {
packages = {
- helix-unwrapped = craneLib.buildPackage (commonArgs
+ helix-unwrapped = craneLibStable.buildPackage (commonArgs
// {
- inherit cargoArtifacts;
+ cargoArtifacts = craneLibStable.buildDepsOnly commonArgs;
postInstall = ''
mkdir -p $out/share/applications $out/share/icons/hicolor/scalable/apps $out/share/icons/hicolor/256x256/apps
cp contrib/Helix.desktop $out/share/applications
@@ -155,20 +156,20 @@
# Build the crate itself
inherit (self.packages.${system}) helix;
- clippy = craneLib.cargoClippy (commonArgs
+ clippy = craneLibMSRV.cargoClippy (commonArgs
// {
inherit cargoArtifacts;
cargoClippyExtraArgs = "--all-targets -- --deny warnings";
});
- fmt = craneLib.cargoFmt commonArgs;
+ fmt = craneLibMSRV.cargoFmt commonArgs;
- doc = craneLib.cargoDoc (commonArgs
+ doc = craneLibMSRV.cargoDoc (commonArgs
// {
inherit cargoArtifacts;
});
- test = craneLib.cargoTest (commonArgs
+ test = craneLibMSRV.cargoTest (commonArgs
// {
inherit cargoArtifacts;
});