about summary refs log tree commit diff
path: root/src/tools/nix-dev-shell/shell.nix
blob: 6ca8a7c4652d3ffab5dc367d60efe387a5190d27 (plain)
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
{
  pkgs ? import <nixpkgs> { },
}:
let
  inherit (pkgs.lib) lists attrsets;

  x = pkgs.callPackage ./x { };
  inherit (x.passthru) cacert env;
in
pkgs.mkShell {
  name = "rustc-shell";

  inputsFrom = [ x ];
  packages = [
    pkgs.git
    pkgs.nix
    pkgs.glibc.out
    pkgs.glibc.static
    x
    # Get the runtime deps of the x wrapper
  ] ++ lists.flatten (attrsets.attrValues env);

  env = {
    # Avoid creating text files for ICEs.
    RUSTC_ICE = 0;
    SSL_CERT_FILE = cacert;
    # cargo seems to dlopen libcurl, so we need it in the ld library path
    LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath [pkgs.stdenv.cc.cc.lib pkgs.curl]}";
  };
}