summary refs log tree commit diff
path: root/pkgs/tools/misc/lineselect/default.nix
blob: ff3aeedcf93d91e29eb1c81b3a08fb11645d6df2 (plain) (blame)
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
34
35
36
37
{ lib
, buildNpmPackage
, fetchFromGitHub
, makeBinaryWrapper
, nodejs
}:

buildNpmPackage rec {
  pname = "lineselect";
  version = "0.1.6";

  src = fetchFromGitHub {
    owner = "chfritz";
    repo = "lineselect";
    rev = "v${version}";
    hash = "sha256-dCmLD4Wjsdlta2xsFCMj1zWQr4HWCfcWsKVmrTND4Yw=";
  };

  npmDepsHash = "sha256-wBtswfXtJTI7um0HZQk1YygpSggZ4j0/7IBcJiQpOUY=";

  nativeBuildInputs = [
    makeBinaryWrapper
  ];

  postInstall = ''
    makeWrapper ${lib.getExe nodejs} $out/bin/lineselect \
      --set FORCE_COLOR 2 \
      --add-flags $out/lib/node_modules/lineselect/dist/cli.js
  '';

  meta = with lib; {
    description = "Shell utility to interactively select lines from stdin";
    homepage = "https://github.com/chfritz/lineselect";
    license = licenses.mit;
    maintainers = with maintainers; [ figsoda ];
  };
}