1
0
Fork 0
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:
Nicolas Berbiche 2022-01-17 18:21:40 -05:00 committed by GitHub
parent 9bceb8292e
commit b59752b9ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 = ({