aboutsummaryrefslogtreecommitdiff
path: root/default.nix
diff options
context:
space:
mode:
authorl-d-s <distefano.l@wehi.edu.au>2019-06-06 09:34:15 +1000
committerl-d-s <distefano.l@wehi.edu.au>2019-06-06 09:34:15 +1000
commit2806b4fcdf8af8173c005525037d550d35f00a9f (patch)
tree765ada4db1d4327611fa33db4c5c1e319f664bae /default.nix
parent22e61f4fbdc0fc698a25fbe9aa64ebb4da1e32a8 (diff)
parenta7b06b941b30feaf8b3b0e0ad1bc986d58d9f9ac (diff)
Merge branch 'master' of https://github.com/PapenfussLab/bionix
Diffstat (limited to 'default.nix')
-rw-r--r--default.nix11
1 files changed, 8 insertions, 3 deletions
diff --git a/default.nix b/default.nix
index 43a2332..54d0215 100644
--- a/default.nix
+++ b/default.nix
@@ -78,8 +78,8 @@ let
lib = nixpkgs.lib // { types = types; shard = callBionix ./lib/shard.nix {};};
stage = x@{ name, stripStorePaths ? true, multicore ? false, ... }:
(if stripStorePaths then strip else x: x) (nixpkgs.stdenvNoCC.mkDerivation (x // {name = "bionix-" + name; inherit multicore;}));
- strip = drv: drv.overrideAttrs (attrs: {
- buildCommand = attrs.buildCommand + ''
+ strip = drv: let
+ stripCommand = ''
function rewrite {
sed -i 's|/nix/store/[^-]*|/nix/store/00000000000000000000000000000000|g' $1
@@ -97,7 +97,12 @@ let
rewriteOutput $o
done
'';
- });
+ in drv.overrideAttrs (attrs:
+ if attrs ? buildCommand then
+ {buildCommand = attrs.buildCommand + stripCommand;}
+ else
+ { fixupPhase = (if attrs ? fixupPhase then attrs.fixupPhase else "") + stripCommand; }
+ );
# splitting/joining
splitFile = file: drv: stage {