nixpkgs-suyu/pkgs/applications/misc/rofi/wrapper.nix
Maximilian Bosch 26a4e02e95
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.
2018-04-04 15:24:51 +02:00

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;
};
}