Merge pull request #230764 from Tungsten842/nnn

nnn: add desktop file, fix nerd icons, add option to build with emojis

authored by Sandro and committed by GitHub 9cab0ebc a94d6c48

+18 -4
+18 -4
pkgs/applications/file-managers/nnn/default.nix
··· 1 1 { lib 2 2 , stdenv 3 3 , fetchFromGitHub 4 + , fetchpatch 4 5 , installShellFiles 5 6 , makeWrapper 6 7 , pkg-config ··· 9 10 , readline 10 11 , which 11 12 , musl-fts 12 - # options 13 + # options 13 14 , conf ? null 14 15 , withIcons ? false 15 16 , withNerdIcons ? false 17 + , withEmojis ? false 16 18 }: 17 19 18 20 # Mutually exclusive options 19 - assert withIcons -> withNerdIcons == false; 20 - assert withNerdIcons -> withIcons == false; 21 + assert withIcons -> (withNerdIcons == false && withEmojis == false); 22 + assert withNerdIcons -> (withIcons == false && withEmojis == false); 23 + assert withEmojis -> (withIcons == false && withNerdIcons == false); 21 24 22 25 stdenv.mkDerivation (finalAttrs: { 23 26 pname = "nnn"; ··· 30 33 hash = "sha256-QbKW2wjhUNej3zoX18LdeUHqjNLYhEKyvPH2MXzp/iQ="; 31 34 }; 32 35 36 + patches = [ 37 + # FIXME: remove for next release 38 + (fetchpatch { 39 + url = "https://github.com/jarun/nnn/commit/20e944f5e597239ed491c213a634eef3d5be735e.patch"; 40 + hash = "sha256-RxG3AU8i3lRPCjRVZPnej4m1No/SKtsHwbghj9JQ7RQ="; 41 + }) 42 + ]; 43 + 33 44 configFile = lib.optionalString (conf != null) (builtins.toFile "nnn.h" conf); 34 45 preBuild = lib.optionalString (conf != null) "cp ${finalAttrs.configFile} src/nnn.h"; 35 46 ··· 41 52 42 53 makeFlags = [ "PREFIX=$(out)" ] 43 54 ++ lib.optionals withIcons [ "O_ICONS=1" ] 44 - ++ lib.optionals withNerdIcons [ "O_NERD=1" ]; 55 + ++ lib.optionals withNerdIcons [ "O_NERD=1" ] 56 + ++ lib.optionals withEmojis [ "O_EMOJI=1" ]; 45 57 46 58 binPath = lib.makeBinPath [ file which ]; 59 + 60 + installTargets = [ "install" "install-desktop" ]; 47 61 48 62 postInstall = '' 49 63 installShellCompletion --bash --name nnn.bash misc/auto-completion/bash/nnn-completion.bash