forked from nix-community/nix-environments
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshell.nix
32 lines (30 loc) · 826 Bytes
/
shell.nix
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
{ pkgs ? import <nixpkgs> { }
, extraPkgs ? [ ]
}:
let
# Target the LLVM version that rustc is built with for LTO.
llvmPackages0 = pkgs.rustc.llvmPackages;
# Force the use of lld and other llvm tools for LTO
llvmPackages = llvmPackages0.override {
bootBintoolsNoLibc = null;
bootBintools = null;
};
# LTO requires LLVM bintools including ld.lld and llvm-ar.
buildStdenv = pkgs.overrideCC llvmPackages.stdenv (llvmPackages.stdenv.cc.override {
bintools = pkgs.buildPackages.rustc.llvmPackages.bintools;
});
in
buildStdenv.mkDerivation {
name = "env";
nativeBuildInputs = [
pkgs.bashInteractive
pkgs.mercurial
pkgs.rustc
pkgs.cargo
pkgs.unzip
pkgs.m4
pkgs.pkg-config
pkgs.python3
] ++ pkgs.lib.optional (!pkgs.stdenv.isDarwin) pkgs.libnotify
++ extraPkgs;
}