From 37a0834aa0808330725a01018b89be6ab027001e Mon Sep 17 00:00:00 2001 From: Soispha Date: Tue, 7 Nov 2023 20:48:06 +0100 Subject: [PATCH] build(flake): Use the minimal rust distribution for builds --- flake.nix | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/flake.nix b/flake.nix index 6f383c7..0feeb81 100644 --- a/flake.nix +++ b/flake.nix @@ -52,8 +52,17 @@ extensions = ["rustc-codegen-cranelift-preview"]; } else pkgs.rust-bin.stable.latest.default; + rust_min = + if nightly + then + (pkgs.rust-bin.selectLatestNightlyWith (toolchain: + toolchain.minimal)) + .override { + extensions = ["rustc-codegen-cranelift-preview"]; + } + else pkgs.rust-bin.stable.latest.minimal; - craneLib = (crane.mkLib pkgs).overrideToolchain rust; + craneLib = (crane.mkLib pkgs).overrideToolchain rust_min; nativeBuildInputs = with pkgs; [ pkg-config