diff options
author | Soispha <soispha@vhack.eu> | 2023-08-21 01:21:56 +0200 |
---|---|---|
committer | Soispha <soispha@vhack.eu> | 2023-08-21 01:21:56 +0200 |
commit | 9b3efb4d267991583621fa7b4c80197c14c6fbe7 (patch) | |
tree | 2ab1c55b76295da7b222e3019a853d06aa1980c2 /rust/flake.nix | |
parent | Fix(treewide): Remove language servers as they are managed by neovim (diff) | |
download | flake-templates-9b3efb4d267991583621fa7b4c80197c14c6fbe7.tar.gz flake-templates-9b3efb4d267991583621fa7b4c80197c14c6fbe7.zip |
Fix(rust/flake.nix): Add better interface to switch to nightly
Diffstat (limited to '')
-rw-r--r-- | rust/flake.nix | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/rust/flake.nix b/rust/flake.nix index dc7c778..4512bed 100644 --- a/rust/flake.nix +++ b/rust/flake.nix @@ -50,10 +50,18 @@ overlays = [(import rust-overlay)]; }; - #rust-nightly = pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default); - rust-stable = pkgs.rust-bin.stable.latest.default; + nightly = false; + rust_minimal = + if nightly + then pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.minimal) + else pkgs.rust-bin.stable.latest.minimal; - craneLib = (crane.mkLib pkgs).overrideToolchain rust-stable; + rust_default = + if nightly + then pkgs.rust-bin.selectLatestNightlyWith (toolchain: toolchain.default) + else pkgs.rust-bin.stable.latest.default; + + craneLib = (crane.mkLib pkgs).overrideToolchain rust_minimal; craneBuild = craneLib.buildPackage { src = craneLib.cleanCargoSource ./.; |