From edc7468e12be92e926847cb02418e649b02b59dd Mon Sep 17 00:00:00 2001 From: Austin Horstman Date: Thu, 18 Sep 2025 21:12:31 -0500 Subject: [PATCH] yazi: add extraPackages option for wrapper PATH extension Signed-off-by: Austin Horstman --- modules/programs/yazi.nix | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/modules/programs/yazi.nix b/modules/programs/yazi.nix index 96a52b91c..c945447cd 100644 --- a/modules/programs/yazi.nix +++ b/modules/programs/yazi.nix @@ -30,6 +30,22 @@ in 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 { type = types.str; 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 { - home.packages = lib.mkIf (cfg.package != null) [ cfg.package ]; + home.packages = mkIf (cfg.package != null) [ cfg.finalPackage ]; programs = let