about summary refs log tree commit diff stats
path: root/rust/flake.nix
diff options
context:
space:
mode:
authorSoispha <soispha@vhack.eu>2023-08-21 01:21:56 +0200
committerSoispha <soispha@vhack.eu>2023-08-21 01:21:56 +0200
commit9b3efb4d267991583621fa7b4c80197c14c6fbe7 (patch)
tree2ab1c55b76295da7b222e3019a853d06aa1980c2 /rust/flake.nix
parentFix(treewide): Remove language servers as they are managed by neovim (diff)
downloadflake-templates-9b3efb4d267991583621fa7b4c80197c14c6fbe7.tar.gz
flake-templates-9b3efb4d267991583621fa7b4c80197c14c6fbe7.zip
Fix(rust/flake.nix): Add better interface to switch to nightly
Diffstat (limited to 'rust/flake.nix')
-rw-r--r--rust/flake.nix14
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 ./.;