From 27e3ff228cb426da8a302557a4cd8cf01f39065e Mon Sep 17 00:00:00 2001 From: Soispha Date: Thu, 20 Jul 2023 21:39:38 +0200 Subject: [PATCH] Build(flake): Make it easier to switch to nightly --- flake.nix | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/flake.nix b/flake.nix index e3a5d47..9ce72bf 100644 --- a/flake.nix +++ b/flake.nix @@ -45,10 +45,13 @@ overlays = [(import rust-overlay)]; }; - #rust-nightly = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default); - rust-stable = pkgs.rust-bin.stable.latest.default; + nightly = true; + rust = + if nightly + then pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default) + else pkgs.rust-bin.stable.latest.default; - craneLib = (crane.mkLib pkgs).overrideToolchain rust-stable; + craneLib = (crane.mkLib pkgs).overrideToolchain rust; nativeBuildInputs = with pkgs; [ pkg-config @@ -79,7 +82,7 @@ statix ltex-ls - rust-stable + rust rust-analyzer cargo-edit cargo-expand