aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--default.nix23
-rw-r--r--tools/fastqc-check.nix10
2 files changed, 29 insertions, 4 deletions
diff --git a/default.nix b/default.nix
index 25834a9..03869bc 100644
--- a/default.nix
+++ b/default.nix
@@ -75,7 +75,28 @@ let
# Export nixpkgs and standard library lib
pkgs = nixpkgs;
lib = nixpkgs.lib // { types = types; shard = callBionix ./lib/shard.nix {};};
- stage = x@{ name, ... }: { multicore = false; } // nixpkgs.stdenvNoCC.mkDerivation (x // {name = "bionix-" + name;});
+ stage = x@{ name, stripStorePaths ? true, ... }:
+ (if stripStorePaths then strip else x: x) ({ multicore = false; } // nixpkgs.stdenvNoCC.mkDerivation (x // {name = "bionix-" + name; }));
+ strip = drv: drv.overrideAttrs (attrs: {
+ buildCommand = attrs.buildCommand + ''
+
+ function rewrite {
+ sed -i 's|/nix/store/[^-]*|/nix/store/00000000000000000000000000000000|g' $1
+ }
+ function rewriteOutput {
+ if [ -f ''${!1} ] ; then
+ rewrite ''${!1}
+ else
+ for f in $(find ''${!1} -type f) ; do
+ rewrite $f
+ done
+ fi
+ }
+ for o in $outputs ; do
+ rewriteOutput $o
+ done
+ '';
+ });
# splitting/joining
splitFile = file: drv: stage {
diff --git a/tools/fastqc-check.nix b/tools/fastqc-check.nix
index d33b987..9b6dd96 100644
--- a/tools/fastqc-check.nix
+++ b/tools/fastqc-check.nix
@@ -9,12 +9,16 @@ input:
stage {
name = "fastqc-check";
- buildInputs = [ bionix.fastqc.fastqc ];
+ buildInputs = [ bionix.fastqc.fastqc pkgs.unzip ];
+ stripStorePaths = false; # we do it explicity for fastqc
+ outputs = [ "out" "zip" ];
buildCommand = ''
- mkdir $out
fastqc \
- -o $out \
+ -o $TMPDIR \
${optionalString (flags != null) flags} \
${input}
+
+ sed "s|$(basename ${input})|input|g" *.html > $out
+ cp *.zip $zip
'';
}