From 1f6fe32adcc288a7c4bd94ef2305df0d98802b7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christina=20S=C3=B8rensen?= Date: Tue, 14 May 2024 15:57:31 +0200 Subject: [PATCH] feat: nightly toolchain MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Christina Sørensen --- flake.nix | 12 +++++++++--- rust-toolchain.toml | 11 +++++++++++ 2 files changed, 20 insertions(+), 3 deletions(-) create mode 100644 rust-toolchain.toml diff --git a/flake.nix b/flake.nix index 029f674..998d52b 100644 --- a/flake.nix +++ b/flake.nix @@ -42,12 +42,18 @@ }: flake-utils.lib.eachDefaultSystem ( system: let - pkgs = nixpkgs.legacyPackages.${system}; + overlays = [(import rust-overlay)]; + + pkgs = (import nixpkgs) { + inherit system overlays; + }; + inherit system; inherit (pkgs) lib; - overlays = [ (import rust-overlay) ]; - craneLib = crane.lib.${system}; + toolchain = pkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml; + + craneLib = (crane.mkLib pkgs).overrideToolchain toolchain; src = craneLib.cleanCargoSource (craneLib.path ./.); # Common arguments can be set here to avoid repeating them later diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 0000000..c94cf2b --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,11 @@ +[toolchain] +channel = "nightly" +components = [ + "rustfmt", + "rustc", + "rust-src", + "rust-analyzer", + "cargo", + "clippy", +] +profile = "minimal"