Skip to content

Commit a94624f

Browse files
committed
build(nix): use rust-toolchain.toml to depend on the proper rust version
1 parent 7ff2d76 commit a94624f

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

nix/package.nix

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
1-
{
1+
{
22
lib,
33
stdenv,
4-
rustPlatform,
4+
makeRustPlatform,
5+
rust-bin,
56
installShellFiles,
67
}:
78
let
89
cargoToml = builtins.fromTOML (builtins.readFile ../Cargo.toml);
10+
11+
# Get the Rust toolchain from rust-overlay
12+
toolchain = rust-bin.fromRustupToolchainFile ../rust-toolchain.toml;
13+
14+
# Create rustPlatform from the toolchain
15+
rustPlatform = makeRustPlatform {
16+
cargo = toolchain;
17+
rustc = toolchain;
18+
};
919
in
1020
rustPlatform.buildRustPackage {
1121
pname = cargoToml.package.name;

0 commit comments

Comments
 (0)