From 2058ec85f6af2b0afd7c2df62c9a88e57c279edf Mon Sep 17 00:00:00 2001 From: Nikita Ursol Date: Mon, 25 Jan 2021 19:14:43 +0200 Subject: [PATCH] rofi: wrap gdk-pixbuf, fixes svg icons --- pkgs/applications/misc/rofi/wrapper.nix | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/misc/rofi/wrapper.nix b/pkgs/applications/misc/rofi/wrapper.nix index 4e69f9cce14..6115544e79f 100644 --- a/pkgs/applications/misc/rofi/wrapper.nix +++ b/pkgs/applications/misc/rofi/wrapper.nix @@ -1,4 +1,4 @@ -{ symlinkJoin, lib, rofi-unwrapped, makeWrapper, hicolor-icon-theme, theme ? null, plugins ? [] }: +{ symlinkJoin, lib, rofi-unwrapped, makeWrapper, wrapGAppsHook, gdk-pixbuf, hicolor-icon-theme, theme ? null, plugins ? [] }: symlinkJoin { name = "rofi-${rofi-unwrapped.version}"; @@ -7,16 +7,23 @@ symlinkJoin { rofi-unwrapped.out ] ++ (lib.forEach plugins (p: p.out)); - buildInputs = [ makeWrapper ]; + nativeBuildInputs = [ makeWrapper wrapGAppsHook ]; + buildInputs = [ gdk-pixbuf ]; + preferLocalBuild = true; passthru.unwrapped = rofi-unwrapped; + + dontWrapGApps = true; + postBuild = '' rm -rf $out/bin mkdir $out/bin ln -s ${rofi-unwrapped}/bin/* $out/bin - rm $out/bin/rofi + + gappsWrapperArgsHook makeWrapper ${rofi-unwrapped}/bin/rofi $out/bin/rofi \ + ''${gappsWrapperArgs[@]} \ --prefix XDG_DATA_DIRS : ${hicolor-icon-theme}/share \ ${lib.optionalString (plugins != []) ''--prefix XDG_DATA_DIRS : ${lib.concatStringsSep ":" (lib.forEach plugins (p: "${p.out}/share"))}''} \ ${lib.optionalString (theme != null) ''--add-flags "-theme ${theme}"''} \