aboutsummaryrefslogtreecommitdiffstats
path: root/anissue.nix
diff options
context:
space:
mode:
Diffstat (limited to 'anissue.nix')
-rw-r--r--anissue.nix46
1 files changed, 46 insertions, 0 deletions
diff --git a/anissue.nix b/anissue.nix
new file mode 100644
index 0000000..8df12a3
--- /dev/null
+++ b/anissue.nix
@@ -0,0 +1,46 @@
+{ coreutils
+, fetchFromGitHub
+, findutils
+, gawk
+, git
+, gnused
+, jq
+, lib
+, makeWrapper
+, ncurses
+, nix-gitignore
+, stdenv
+}:
+let
+ # TODO package tree-grepper in Nixpkgs so that it can reuse <nixpkgs>
+ tree-grepper = (import (fetchFromGitHub {
+ owner = "BrianHicks";
+ repo = "tree-grepper";
+ rev = "refs/tags/2.4.1";
+ hash = "sha256-wHqVhx2JFBm+lc3/rruBBlpF2Ylv3/oOFM5CgX5WtKs=";
+ })).default;
+in
+stdenv.mkDerivation {
+ name = "anissue";
+ src = nix-gitignore.gitignoreSource [ ] ./.;
+ nativeBuildInputs = [ makeWrapper ];
+ buildPhase = ":";
+ installPhase = ''
+ mkdir -p $out/{bin,share}
+ for bin in src/*.sh; do
+ cp $bin $out/share/$(basename $bin)
+ wrapProgram $out/share/$(basename $bin) \
+ --set PATH ${lib.makeBinPath [
+ coreutils
+ findutils
+ gawk
+ git
+ gnused
+ jq
+ ncurses
+ tree-grepper
+ ]}
+ done
+ ln -s $out/share/extract.sh $out/bin/anissue
+ '';
+}