From 0c0268a3c80d30b989d0aadbd65f38d4fa27a9a0 Mon Sep 17 00:00:00 2001 From: nyadiia Date: Wed, 23 Oct 2024 16:35:08 -0500 Subject: [PATCH] eza: add color option --- modules/programs/eza.nix | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/modules/programs/eza.nix b/modules/programs/eza.nix index 679f534998ff..f35912b8c822 100644 --- a/modules/programs/eza.nix +++ b/modules/programs/eza.nix @@ -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}"; };