-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
53 lines (44 loc) · 1.21 KB
/
default.nix
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, installShellFiles
, makeWrapper
, pkg-config
, file
, ncurses
, readline
, which
, pcre
# options
, conf ? null
, withPcre ? false
, extraMakeFlags ? [ ]
}:
stdenv.mkDerivation (finalAttrs: {
pname = "nnn";
version = "4.9";
src = ./.;
configFile = lib.optionalString (conf != null) (builtins.toFile "nnn.h" conf);
preBuild = lib.optionalString (conf != null) "cp ${finalAttrs.configFile} src/nnn.h";
nativeBuildInputs = [ installShellFiles makeWrapper pkg-config ];
buildInputs = [ readline ncurses ]
++ lib.optional withPcre pcre;
makeFlags = [ "PREFIX=$(out)" ]
++ lib.optionals withPcre [ "O_PCRE=1" ]
++ extraMakeFlags;
binPath = lib.makeBinPath [ file which ];
installTargets = [ "install" ];
postInstall = ''
wrapProgram $out/bin/nnn --prefix PATH : "$binPath"
'';
meta = with lib; {
description = "Small ncurses-based file browser forked from noice";
homepage = "https://github.com/jarun/nnn";
changelog = "https://github.com/jarun/nnn/blob/v${version}/CHANGELOG";
license = licenses.bsd2;
platforms = platforms.all;
maintainers = with maintainers; [ jfrankenau Br1ght0ne ];
mainProgram = "nnn";
};
})