summary refs log tree commit diff
path: root/pkgs/applications/file-managers
diff options
context:
space:
mode:
authorFabián Heredia Montiel <303897+fabianhjr@users.noreply.github.com>2023-09-13 23:24:14 -0500
committerGitHub <noreply@github.com>2023-09-13 23:24:14 -0500
commitdeb0f580be4ff8aded62f6ba21b9259559f5237e (patch)
treecc9120eefc46cc249a757427cbb64934de2e235f /pkgs/applications/file-managers
parent1a78023696bb3bf03ba7ff6b0d56dae0c4948402 (diff)
parent5049680bc864c579f7b5c854ab642b34a2783036 (diff)
Merge pull request #253767 from Anomalocaridid/nnn
nnn: add plugins, quitcd, and pcre and extra make flags build options
Diffstat (limited to 'pkgs/applications/file-managers')
-rw-r--r--pkgs/applications/file-managers/nnn/default.nix14
1 files changed, 12 insertions, 2 deletions
diff --git a/pkgs/applications/file-managers/nnn/default.nix b/pkgs/applications/file-managers/nnn/default.nix
index 6b7e8f9c6421a..af4064abbec16 100644
--- a/pkgs/applications/file-managers/nnn/default.nix
+++ b/pkgs/applications/file-managers/nnn/default.nix
@@ -10,11 +10,14 @@
 , readline
 , which
 , musl-fts
+, pcre
   # options
 , conf ? null
 , withIcons ? false
 , withNerdIcons ? false
 , withEmojis ? false
+, withPcre ? false
+, extraMakeFlags ? [ ]
 }:
 
 # Mutually exclusive options
@@ -44,7 +47,9 @@ stdenv.mkDerivation (finalAttrs: {
   preBuild = lib.optionalString (conf != null) "cp ${finalAttrs.configFile} src/nnn.h";
 
   nativeBuildInputs = [ installShellFiles makeWrapper pkg-config ];
-  buildInputs = [ readline ncurses ] ++ lib.optional stdenv.hostPlatform.isMusl musl-fts;
+  buildInputs = [ readline ncurses ]
+    ++ lib.optional stdenv.hostPlatform.isMusl musl-fts
+    ++ lib.optional withPcre pcre;
 
   env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isMusl "-I${musl-fts}/include";
   NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isMusl "-lfts";
@@ -52,7 +57,9 @@ stdenv.mkDerivation (finalAttrs: {
   makeFlags = [ "PREFIX=$(out)" ]
     ++ lib.optionals withIcons [ "O_ICONS=1" ]
     ++ lib.optionals withNerdIcons [ "O_NERD=1" ]
-    ++ lib.optionals withEmojis [ "O_EMOJI=1" ];
+    ++ lib.optionals withEmojis [ "O_EMOJI=1" ]
+    ++ lib.optionals withPcre [ "O_PCRE=1" ]
+    ++ extraMakeFlags;
 
   binPath = lib.makeBinPath [ file which ];
 
@@ -63,6 +70,9 @@ stdenv.mkDerivation (finalAttrs: {
     installShellCompletion --fish misc/auto-completion/fish/nnn.fish
     installShellCompletion --zsh misc/auto-completion/zsh/_nnn
 
+    cp -r plugins $out/share
+    cp -r misc/quitcd $out/share/quitcd
+
     wrapProgram $out/bin/nnn --prefix PATH : "$binPath"
   '';