rofi: add "plugins" option (#2117)
* rofi: add support to plugins * rofi: update package example Co-authored-by: Sumner Evans <me@sumnerevans.com> * rofi: Format package example * rofi: Fix tests Rofi will not try to install plugins using override when tests overlay actual rofi package with empty scirpt * rofi: Refactor Co-authored-by: Sumner Evans <me@sumnerevans.com>
This commit is contained in:
parent
9b7a90daa1
commit
5b08b33e8f
|
@ -207,6 +207,15 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
plugins = mkOption {
|
||||||
|
default = [ ];
|
||||||
|
type = types.listOf types.package;
|
||||||
|
description = ''
|
||||||
|
List of rofi plugins to be installed.
|
||||||
|
'';
|
||||||
|
example = literalExample "[ pkgs.rofi-calc ]";
|
||||||
|
};
|
||||||
|
|
||||||
width = mkOption {
|
width = mkOption {
|
||||||
default = null;
|
default = null;
|
||||||
type = types.nullOr types.int;
|
type = types.nullOr types.int;
|
||||||
|
@ -405,7 +414,14 @@ in {
|
||||||
inherit value;
|
inherit value;
|
||||||
};
|
};
|
||||||
|
|
||||||
home.packages = [ cfg.package ];
|
home.packages = let
|
||||||
|
rofiWithPlugins = cfg.package.override
|
||||||
|
(old: rec { plugins = (old.plugins or [ ]) ++ cfg.plugins; });
|
||||||
|
rofiPackage = if builtins.hasAttr "override" cfg.package then
|
||||||
|
rofiWithPlugins
|
||||||
|
else
|
||||||
|
cfg.package;
|
||||||
|
in [ rofiPackage ];
|
||||||
|
|
||||||
home.file."${cfg.configPath}".text = toRasi {
|
home.file."${cfg.configPath}".text = toRasi {
|
||||||
configuration = ({
|
configuration = ({
|
||||||
|
|
Loading…
Reference in a new issue