Skip to content

Commit 87c8b3e

Browse files
committed
build: fix cargo build in darwin devShells
Co-authored-by: Andy Fischer <andrew-scott-fischer>
1 parent 350432e commit 87c8b3e

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

nix/default.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
});
4848
in {
4949
inherit
50+
commonArgs
5051
myCrate
5152
myCrateClippy
5253
myCrateCoverage

nix/flake.nix

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,22 @@
4545
inherit pre-commit-check;
4646
});
4747

48-
devShells = forEachSystem (system: {
49-
default = nixpkgs.legacyPackages.${system}.mkShell {
50-
nativeBuildInputs = with nixpkgs.legacyPackages.${system}; [
51-
cargo
52-
clippy
53-
rust-analyzer
54-
rustc
55-
rustfmt
56-
];
48+
devShells = forEachSystem (system: let
49+
pkgs = nixpkgs.legacyPackages.${system};
50+
craneDerivations = pkgs.callPackage ./default.nix {inherit crane;};
51+
in {
52+
default = pkgs.mkShell {
53+
nativeBuildInputs = with pkgs;
54+
[
55+
cargo
56+
clippy
57+
rust-analyzer
58+
rustc
59+
rustfmt
60+
]
61+
++ craneDerivations.commonArgs.nativeBuildInputs;
62+
63+
RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}";
5764

5865
inherit (self.checks.${system}.pre-commit-check) shellHook;
5966
};

0 commit comments

Comments
 (0)