aboutsummaryrefslogtreecommitdiffstats
path: root/anissue.nix
blob: 95d7cf822c3ff5497538f5c3465d0d6322374206 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{ coreutils
, docopts
, fetchFromGitHub
, findutils
, gawk
, git
, gnugrep
, gnused
, jq
, lib
, makeWrapper
, ncurses
, nix-gitignore
, stdenv
}:
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) \
        --argv0 ''' \
        --set PATH ${lib.makeBinPath [
          git
        ]}
    done
    ln -s $out/share/anissue.sh $out/bin/anissue
  '';
}