diff --git a/flake.nix b/flake.nix index 4daa37395949..a6d9fbc0df07 100644 --- a/flake.nix +++ b/flake.nix @@ -18,7 +18,11 @@ libgit2 libz ]; - + lib = nixpkgs.lib; + rustToolchain = fenix.packages.${system}.fromToolchainName { + name = (lib.importTOML ./rust-toolchain.toml).toolchain.channel; + sha256 = "sha256-f/CVA1EC61EWbh0SjaRNhLL0Ypx2ObupbzigZp8NmL4="; + }; in { devShells.default = pkgs.mkShell { @@ -30,14 +34,20 @@ protobuf gnumake mold - (fenix.packages.${system}.fromToolchainFile { - dir = ./.; - sha256 = "sha256-f/CVA1EC61EWbh0SjaRNhLL0Ypx2ObupbzigZp8NmL4="; - }) + (rustToolchain.withComponents [ + "cargo" + "clippy" + "rust-src" + "rustc" + "rustfmt" + "rust-analyzer" + "llvm-tools" + ]) cargo-nextest cargo-llvm-cov taplo curl + gnuplot ## for cargo bench ]; LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath buildInputs; diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 388d16249a95..eb2546003b23 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,2 @@ [toolchain] channel = "nightly-2024-12-25" -components = ["rust-analyzer", "llvm-tools"]