mirror of
https://github.com/nix-community/home-manager
synced 2024-11-27 05:29:46 +01:00
rofi: add finalPackage option (#2649)
This makes it possible to use the customized rofi binary in Sway keybindings for instance.
This commit is contained in:
parent
9bceb8292e
commit
b59752b9ff
1 changed files with 15 additions and 6 deletions
|
@ -115,6 +115,14 @@ in {
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
finalPackage = mkOption {
|
||||||
|
type = types.package;
|
||||||
|
readOnly = true;
|
||||||
|
description = ''
|
||||||
|
Resulting customized rofi package.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
plugins = mkOption {
|
plugins = mkOption {
|
||||||
default = [ ];
|
default = [ ];
|
||||||
type = types.listOf types.package;
|
type = types.listOf types.package;
|
||||||
|
@ -254,14 +262,15 @@ in {
|
||||||
inherit value;
|
inherit value;
|
||||||
};
|
};
|
||||||
|
|
||||||
home.packages = let
|
programs.rofi.finalPackage = let
|
||||||
rofiWithPlugins = cfg.package.override
|
rofiWithPlugins = cfg.package.override
|
||||||
(old: rec { plugins = (old.plugins or [ ]) ++ cfg.plugins; });
|
(old: rec { plugins = (old.plugins or [ ]) ++ cfg.plugins; });
|
||||||
rofiPackage = if builtins.hasAttr "override" cfg.package then
|
in if builtins.hasAttr "override" cfg.package then
|
||||||
rofiWithPlugins
|
rofiWithPlugins
|
||||||
else
|
else
|
||||||
cfg.package;
|
cfg.package;
|
||||||
in [ rofiPackage ];
|
|
||||||
|
home.packages = [ cfg.finalPackage ];
|
||||||
|
|
||||||
home.file."${cfg.configPath}".text = toRasi {
|
home.file."${cfg.configPath}".text = toRasi {
|
||||||
configuration = ({
|
configuration = ({
|
||||||
|
|
Loading…
Reference in a new issue