26a4e02e95
This is helpful when defining a `*.rasi` theme for rofi using `pkgs.writeText` rather than messing up the impure `~/.config` directory.
17 lines
531 B
Nix
17 lines
531 B
Nix
{ 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;
|
|
};
|
|
}
|