rofi: add theme option

This is helpful when defining a `*.rasi` theme for rofi using
`pkgs.writeText` rather than messing up the impure `~/.config`
directory.
This commit is contained in:
Maximilian Bosch
2018-04-04 15:24:51 +02:00
parent a308118d64
commit 26a4e02e95
3 changed files with 22 additions and 4 deletions
+17
View File
@@ -0,0 +1,17 @@
{ stdenv, rofi-unwrapped, makeWrapper, theme ? null, lib }:
stdenv.mkDerivation {
name = "rofi-${rofi-unwrapped.version}";
buildInputs = [ makeWrapper ];
preferLocalBuild = true;
passthru = { unwrapped = rofi-unwrapped; };
buildCommand = ''
mkdir -p $out/bin
ln -s ${rofi-unwrapped}/bin/rofi $out/bin/rofi
${lib.optionalString (theme != null) ''wrapProgram $out/bin/rofi --add-flags "-theme ${theme}"''}
'';
meta = rofi-unwrapped.meta // {
priority = (rofi-unwrapped.meta.priority or 0) - 1;
};
}