git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #110053 from thiagokokada/add-icons-to-nnn

nnn: add withIcon/withNerdIcon options

commitac2752362cb5195e9695cf8c9cdba1b4a58d78d4 authorSandro <sandro.jaeckel@gmail.com> dateWed 20 Jan 2021, 15:15 (6 years ago) parent62b407f209d2c5
1 file changed+13−6
pkgs/applications/misc/nnn/default.nix+13−6
pkgs/applications/misc/nnn/default.nix+13−6
@@ -1,6 +1,9 @@
1−{ lib, stdenv, fetchFromGitHub, pkg-config, ncurses, readline, conf ? null }:
1+{ lib, stdenv, fetchFromGitHub, pkg-config, ncurses, readline
2+, conf ? null, withIcons ? false, withNerdIcons ? false }:
23
3−with lib;
4+# Mutually exclusive options
5+assert withIcons -> withNerdIcons == false;
6+assert withNerdIcons -> withIcons == false;
47
58stdenv.mkDerivation rec {
69 pname = "nnn";
@@ -13,13 +16,17 @@ stdenv.mkDerivation rec {
1316 sha256 = "1fa7cmwrzn6kx87kms8i98p9azdlwyh2gnif29l340syl9hkr5qy";
1417 };
1518
16− configFile = optionalString (conf != null) (builtins.toFile "nnn.h" conf);
17− preBuild = optionalString (conf != null) "cp ${configFile} src/nnn.h";
19+ configFile = lib.optionalString (conf != null) (builtins.toFile "nnn.h" conf);
20+ preBuild = lib.optionalString (conf != null) "cp ${configFile} src/nnn.h";
1821
1922 nativeBuildInputs = [ pkg-config ];
2023 buildInputs = [ readline ncurses ];
2124
22− makeFlags = [ "DESTDIR=${placeholder "out"}" "PREFIX=" ];
25+ makeFlags = [
26+ "DESTDIR=${placeholder "out"}"
27+ "PREFIX="
28+ ] ++ lib.optional withIcons [ "O_ICONS=1" ]
29+ ++ lib.optional withNerdIcons [ "O_NERD=1" ];
2330
2431 # shell completions
2532 postInstall = ''
@@ -28,7 +35,7 @@ stdenv.mkDerivation rec {
2835 install -Dm555 misc/auto-completion/fish/nnn.fish -t $out/share/fish/vendor_completions.d
2936 '';
3037
31− meta = {
38+ meta = with lib; {
3239 description = "Small ncurses-based file browser forked from noice";
3340 homepage = "https://github.com/jarun/nnn";
3441 license = licenses.bsd2;