eza: add color option

This commit is contained in:
nyadiia 2024-10-23 16:35:08 -05:00 committed by Robert Helgesson
parent c0e2315987
commit 0c0268a3c8
No known key found for this signature in database
GPG key ID: 96E745BD17AA17ED

View file

@ -59,6 +59,14 @@ with lib;
'';
};
colors = mkOption {
type = types.enum [ null "auto" "always" "never" ];
default = null;
description = ''
Use terminal colors in output ({option}`--color` argument).
'';
};
git = mkOption {
type = types.bool;
default = false;
@ -80,8 +88,9 @@ with lib;
cfg.icons;
in optionals (v != null) [ "--icons" v ];
args = escapeShellArgs
(iconsOption ++ optional cfg.git "--git" ++ cfg.extraOptions);
args = escapeShellArgs (iconsOption
++ optionals (cfg.colors != null) [ "--color" cfg.colors ]
++ optional cfg.git "--git" ++ cfg.extraOptions);
optionsAlias = optionalAttrs (args != "") { eza = "eza ${args}"; };