1
0
Fork 0
mirror of https://github.com/nix-community/home-manager.git synced 2025-11-08 19:46:05 +01:00

yazi: add extraPackages option for wrapper PATH extension

Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
This commit is contained in:
Austin Horstman 2025-09-18 21:12:31 -05:00
parent d5fb6ebc4f
commit edc7468e12

View file

@ -30,6 +30,22 @@ in
package = lib.mkPackageOption pkgs "yazi" { nullable = true; }; package = lib.mkPackageOption pkgs "yazi" { nullable = true; };
extraPackages = mkOption {
type = with types; listOf package;
default = [ ];
example = literalExpression ''
with pkgs; [
glow
ouch
]
'';
description = ''
Extra packages to make available to yazi.
These packages will be added to the yazi wrapper's PATH.
'';
};
shellWrapperName = lib.mkOption { shellWrapperName = lib.mkOption {
type = types.str; type = types.str;
default = "yy"; default = "yy";
@ -178,10 +194,26 @@ in
} }
''; '';
}; };
finalPackage = mkOption {
type = types.package;
readOnly = true;
visible = false;
default =
let
yaziWithExtraPackages = cfg.package.override (old: {
extraPackages = (old.extraPackages or [ ]) ++ cfg.extraPackages;
});
in
if cfg.package ? override && cfg.extraPackages != [ ] then yaziWithExtraPackages else cfg.package;
description = ''
The yazi package with extraPackages applied.
'';
};
}; };
config = mkIf cfg.enable { config = mkIf cfg.enable {
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ]; home.packages = mkIf (cfg.package != null) [ cfg.finalPackage ];
programs = programs =
let let