-
Notifications
You must be signed in to change notification settings - Fork 27
Expand file tree
/
Copy pathdevshell.nix
More file actions
41 lines (41 loc) · 1.01 KB
/
Copy pathdevshell.nix
File metadata and controls
41 lines (41 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{
pkgs,
fenix ? null,
}:
if pkgs.stdenv.isDarwin then
let
crossPkgs = pkgs.pkgsCross.musl64;
crossToolchain = crossPkgs.stdenv.cc;
rustTargetTriple = "x86_64-unknown-linux-musl";
fenixPackages = fenix.packages.${pkgs.stdenv.hostPlatform.system};
rustToolchain = fenixPackages.stable.withComponents [
"cargo"
"clippy"
"rust-src"
"rustc"
];
rustToolchainWithTarget = fenixPackages.combine [
rustToolchain
fenixPackages.targets.${rustTargetTriple}.stable.rust-std
];
in
pkgs.mkShell {
buildInputs = [
rustToolchainWithTarget
pkgs.rust-analyzer
crossToolchain
];
CARGO_BUILD_TARGET = rustTargetTriple;
CARGO_TARGET_X86_64_UNKNOWN_LINUX_MUSL_LINKER = "${crossToolchain}/bin/${crossPkgs.stdenv.cc.targetPrefix}cc";
}
else
pkgs.mkShell {
buildInputs = [
pkgs.cargo
pkgs.cargo-watch
pkgs.rustc
pkgs.clippy
pkgs.rust-analyzer
];
CNTR_TEST_SHELL = "${pkgs.pkgsStatic.busybox}/bin/sh";
}