diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2021-11-08 00:52:35 +0000 |
---|---|---|
committer | John Ericson <John.Ericson@Obsidian.Systems> | 2021-11-08 20:38:58 +0000 |
commit | 2c7f62379f7c65d573892ba89eefb5631d721ba8 (patch) | |
tree | 67a0f2dcc2348e744ec8e9a677337269e9ee1f52 /pkgs/development/compilers/rust | |
parent | 1d62b00a5467b9275273002364a01cdf17fd4027 (diff) |
rustcSrc: Reduce duplication
Diffstat (limited to 'pkgs/development/compilers/rust')
-rw-r--r-- | pkgs/development/compilers/rust/rust-src.nix | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/pkgs/development/compilers/rust/rust-src.nix b/pkgs/development/compilers/rust/rust-src.nix index 489795ecec47a..4239e92b03638 100644 --- a/pkgs/development/compilers/rust/rust-src.nix +++ b/pkgs/development/compilers/rust/rust-src.nix @@ -1,4 +1,4 @@ -{ stdenv, rustc, minimalContent ? true }: +{ lib, stdenv, rustc, minimalContent ? true }: stdenv.mkDerivation { name = "rust-src"; @@ -6,9 +6,20 @@ stdenv.mkDerivation { phases = [ "unpackPhase" "installPhase" ]; installPhase = '' mv src $out - rm -rf $out/{${if minimalContent - then "ci,doc,etc,grammar,llvm-project,llvm-emscripten,rtstartup,rustllvm,test,tools,vendor,stdarch" - else "ci,doc,etc,grammar,llvm-project,llvm-emscripten,rtstartup,rustllvm,test,vendor" - }} + rm -rf $out/{${lib.concatStringsSep "," ([ + "ci" + "doc" + "etc" + "grammar" + "llvm-project" + "llvm-emscripten" + "rtstartup" + "rustllvm" + "test" + "vendor" + ] ++ lib.optionals minimalContent [ + "tools" + "stdarch" + ])}} ''; } |