2020-03-30 00:18:56 +01:00
|
|
|
{ symlinkJoin, lib, rofi-unwrapped, makeWrapper, hicolor-icon-theme, theme ? null, plugins ? [] }:
|
2018-03-11 01:37:59 +00:00
|
|
|
|
2020-03-30 00:18:56 +01:00
|
|
|
symlinkJoin {
|
|
|
|
name = "rofi-${rofi-unwrapped.version}";
|
|
|
|
|
|
|
|
paths = [
|
|
|
|
rofi-unwrapped.out
|
|
|
|
] ++ (lib.forEach plugins (p: p.out));
|
2019-07-08 15:22:13 +01:00
|
|
|
|
2018-03-11 01:37:59 +00:00
|
|
|
buildInputs = [ makeWrapper ];
|
|
|
|
preferLocalBuild = true;
|
2018-06-11 20:30:36 +01:00
|
|
|
passthru.unwrapped = rofi-unwrapped;
|
2020-03-30 00:18:56 +01:00
|
|
|
postBuild = ''
|
|
|
|
rm -rf $out/bin
|
2018-06-11 20:30:36 +01:00
|
|
|
mkdir $out/bin
|
|
|
|
ln -s ${rofi-unwrapped}/bin/* $out/bin
|
2019-12-23 02:37:08 +00:00
|
|
|
|
2018-06-11 20:30:36 +01:00
|
|
|
rm $out/bin/rofi
|
2019-12-23 02:37:08 +00:00
|
|
|
makeWrapper ${rofi-unwrapped}/bin/rofi $out/bin/rofi \
|
|
|
|
--prefix XDG_DATA_DIRS : ${hicolor-icon-theme}/share \
|
2020-03-31 20:01:47 +01:00
|
|
|
${lib.optionalString (plugins != []) ''--prefix XDG_DATA_DIRS : ${lib.concatStringsSep ":" (lib.forEach plugins (p: "${p.out}/share"))}''} \
|
2020-03-30 00:18:56 +01:00
|
|
|
${lib.optionalString (theme != null) ''--add-flags "-theme ${theme}"''} \
|
|
|
|
${lib.optionalString (plugins != []) ''--add-flags "-plugin-path $out/lib/rofi"''}
|
2019-12-23 02:37:08 +00:00
|
|
|
|
|
|
|
rm $out/bin/rofi-theme-selector
|
|
|
|
makeWrapper ${rofi-unwrapped}/bin/rofi-theme-selector $out/bin/rofi-theme-selector \
|
|
|
|
--prefix XDG_DATA_DIRS : $out/share
|
2018-03-11 01:37:59 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = rofi-unwrapped.meta // {
|
|
|
|
priority = (rofi-unwrapped.meta.priority or 0) - 1;
|
|
|
|
};
|
|
|
|
}
|