aboutsummaryrefslogtreecommitdiff
path: root/tools/snap-index.nix
diff options
context:
space:
mode:
authorJustin Bedo <cu@cua0.org>2019-04-17 19:06:00 +1000
committerJustin Bedo <cu@cua0.org>2019-04-17 19:06:00 +1000
commit0c09091762accf8716ef7853dded34e1c86497aa (patch)
tree55c7d1a10659ae31935c81bf8b46000c0af204a4 /tools/snap-index.nix
parent1996a2de345755b72027481e72ca3c2402bebf8d (diff)
snap: init
Diffstat (limited to 'tools/snap-index.nix')
-rw-r--r--tools/snap-index.nix22
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/snap-index.nix b/tools/snap-index.nix
new file mode 100644
index 0000000..b72ee01
--- /dev/null
+++ b/tools/snap-index.nix
@@ -0,0 +1,22 @@
+{ bionix
+, flags ? null
+}:
+
+ref:
+
+with bionix;
+with lib;
+with types;
+
+assert (matchFiletype "snap-index" { fa = _: true; } ref);
+
+stage {
+ name = "snap-index";
+ buildInputs = [ bionix.snap.app ];
+ buildCommand = ''
+ ln -s ${ref} ref.fa
+ mkdir $out
+ snap-aligner index ref.fa $out -t$NIX_BUILD_CORES ${optionalString (flags != null) flags}
+ '';
+ passthru.multicore = true;
+}