emojipick: init at 2021-01-27 (#158187)
This commit is contained in:
parent
57031087a7
commit
ab34433bc0
2 changed files with 73 additions and 0 deletions
71
pkgs/applications/misc/emojipick/default.nix
Normal file
71
pkgs/applications/misc/emojipick/default.nix
Normal file
|
@ -0,0 +1,71 @@
|
|||
{ stdenvNoCC
|
||||
, fetchFromGitHub
|
||||
, lib
|
||||
, python3
|
||||
, xclip
|
||||
, libnotify
|
||||
, dmenu
|
||||
, rofi
|
||||
, emojipick-use-rofi ? false
|
||||
, emojipick-copy-to-clipboard ? true
|
||||
, emojipick-show-notifications ? true
|
||||
, emojipick-print-emoji ? true
|
||||
, emojipick-font-family ? "Noto Color Emoji"
|
||||
, emojipick-font-size ? "18"
|
||||
}:
|
||||
|
||||
let
|
||||
boolToInt = b: if b then "1" else "0"; # Convert boolean to integer string
|
||||
in
|
||||
stdenvNoCC.mkDerivation {
|
||||
pname = "emojipick";
|
||||
version = "2021-01-27";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "thingsiplay";
|
||||
repo = "emojipick";
|
||||
rev = "20210127";
|
||||
sha256 = "1kib3cyx6z9v9qw6yrfx5sklanpk5jbxjc317wi7i7ljrg0vdazp";
|
||||
};
|
||||
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
|
||||
# Patch configuration
|
||||
# notify-send has to be patched in a bash file
|
||||
postPatch = ''
|
||||
substituteInPlace emojipick \
|
||||
--replace "use_rofi=0" "use_rofi=${boolToInt emojipick-use-rofi}" \
|
||||
--replace "copy_to_clipboard=1" "copy_to_clipboard=${boolToInt emojipick-copy-to-clipboard}" \
|
||||
--replace "show_notification=1" "show_notification=${boolToInt emojipick-show-notifications}" \
|
||||
--replace "print_emoji=1" "print_emoji=${boolToInt emojipick-print-emoji}" \
|
||||
--replace "font_family='\"Noto Color Emoji\"'" "font_family='\"${emojipick-font-family}\"'" \
|
||||
--replace 'font_size="18"' 'font_size="${emojipick-font-size}"' \
|
||||
${lib.optionalString emojipick-use-rofi "--replace 'rofi ' '${rofi}/bin/rofi '"} \
|
||||
--replace notify-send ${libnotify}/bin/notify-send
|
||||
'';
|
||||
|
||||
buildInputs = [
|
||||
python3
|
||||
xclip
|
||||
libnotify
|
||||
] ++ (if emojipick-use-rofi then [rofi] else [dmenu]);
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
mkdir -p $out/bin
|
||||
cp ./emojipick $out/bin
|
||||
cp ./emojiget.py $out/bin
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
description = "Get a selection of emojis with dmenu or rofi";
|
||||
homepage = "https://github.com/thingsiplay/emojipick";
|
||||
license = licenses.mit;
|
||||
maintainers = with maintainers; [ alexnortung ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
|
@ -23601,6 +23601,8 @@ with pkgs;
|
|||
inherit (nodePackages) svgo;
|
||||
};
|
||||
|
||||
emojipick = callPackage ../applications/misc/emojipick { };
|
||||
|
||||
encode-sans = callPackage ../data/fonts/encode-sans { };
|
||||
|
||||
envypn-font = callPackage ../data/fonts/envypn-font
|
||||
|
|
Loading…
Reference in a new issue