diff --git a/pkgs/applications/file-managers/nnn/default.nix b/pkgs/applications/file-managers/nnn/default.nix index 6b7e8f9c6421..af4064abbec1 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" '';