mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-29 09:02:46 +00:00
b12dfd0757
This adds the hicolor theme to XDG_DATA_DIRS for rofi and moves all wrapping to rofi/wrapper.nix. The wrapper will now always be generated, even when a theme is not provided.
31 lines
887 B
Nix
31 lines
887 B
Nix
{ stdenv, rofi-unwrapped, makeWrapper, hicolor-icon-theme, theme ? null }:
|
|
|
|
stdenv.mkDerivation {
|
|
pname = "rofi";
|
|
version = rofi-unwrapped.version;
|
|
|
|
buildInputs = [ makeWrapper ];
|
|
preferLocalBuild = true;
|
|
passthru.unwrapped = rofi-unwrapped;
|
|
buildCommand = ''
|
|
mkdir $out
|
|
ln -s ${rofi-unwrapped}/* $out
|
|
rm $out/bin
|
|
mkdir $out/bin
|
|
ln -s ${rofi-unwrapped}/bin/* $out/bin
|
|
|
|
rm $out/bin/rofi
|
|
makeWrapper ${rofi-unwrapped}/bin/rofi $out/bin/rofi \
|
|
--prefix XDG_DATA_DIRS : ${hicolor-icon-theme}/share \
|
|
${if theme != null then ''--add-flags "-theme ${theme}"'' else ""}
|
|
|
|
rm $out/bin/rofi-theme-selector
|
|
makeWrapper ${rofi-unwrapped}/bin/rofi-theme-selector $out/bin/rofi-theme-selector \
|
|
--prefix XDG_DATA_DIRS : $out/share
|
|
'';
|
|
|
|
meta = rofi-unwrapped.meta // {
|
|
priority = (rofi-unwrapped.meta.priority or 0) - 1;
|
|
};
|
|
}
|