summaryrefslogtreecommitdiff
path: root/pkgs/development/compilers/rust/rust-src.nix
blob: dfc82e35c01d55210c4f69d87be3d2ee0aae372d (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
31
{
  lib,
  runCommand,
  rustc,
  minimalContent ? true,
}:

runCommand "rust-src" { } ''
  tar -xzf ${rustc.src}
  mv rustc-${rustc.version}-src $out
  rm -rf $out/{${
    lib.concatStringsSep "," (
      [
        "ci"
        "doc"
        "etc"
        "grammar"
        "llvm-project"
        "llvm-emscripten"
        "rtstartup"
        "rustllvm"
        "test"
        "vendor"
      ]
      ++ lib.optionals minimalContent [
        "tools"
        "stdarch"
      ]
    )
  }}
''