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