mirror of
https://github.com/nix-community/home-manager
synced 2024-11-30 06:59:45 +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 {
|
||||
default = [ ];
|
||||
type = types.listOf types.package;
|
||||
|
@ -254,14 +262,15 @@ in {
|
|||
inherit value;
|
||||
};
|
||||
|
||||
home.packages = let
|
||||
programs.rofi.finalPackage = let
|
||||
rofiWithPlugins = cfg.package.override
|
||||
(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
|
||||
else
|
||||
cfg.package;
|
||||
in [ rofiPackage ];
|
||||
|
||||
home.packages = [ cfg.finalPackage ];
|
||||
|
||||
home.file."${cfg.configPath}".text = toRasi {
|
||||
configuration = ({
|
||||
|
|
Loading…
Reference in a new issue