about summary refs log tree commit diff
path: root/nixos/modules/programs/zsh
diff options
context:
space:
mode:
authorAcid Bong <acid-bong@cock.lt>2023-08-12 20:22:58 +0300
committerAcid Bong <acid-bong@cock.lt>2023-08-12 20:53:05 +0300
commitc76bb0d58e85f555067547d7ca487dc733549863 (patch)
treee079f5db9c41c8c6a3f03282f411af791470ee9e /nixos/modules/programs/zsh
parentaefe566f73164776003ef5ef78003b5f9ccd7c4f (diff)
downloadnixlib-c76bb0d58e85f555067547d7ca487dc733549863.tar
nixlib-c76bb0d58e85f555067547d7ca487dc733549863.tar.gz
nixlib-c76bb0d58e85f555067547d7ca487dc733549863.tar.bz2
nixlib-c76bb0d58e85f555067547d7ca487dc733549863.tar.lz
nixlib-c76bb0d58e85f555067547d7ca487dc733549863.tar.xz
nixlib-c76bb0d58e85f555067547d7ca487dc733549863.tar.zst
nixlib-c76bb0d58e85f555067547d7ca487dc733549863.zip
nixos/zsh: add enableLsColors
Borrowed from nixos/bash/ls-colors module
Diffstat (limited to 'nixos/modules/programs/zsh')
-rw-r--r--nixos/modules/programs/zsh/zsh.nix13
1 files changed, 13 insertions, 0 deletions
diff --git a/nixos/modules/programs/zsh/zsh.nix b/nixos/modules/programs/zsh/zsh.nix
index 6bb21cb3ef66..cad639f299c8 100644
--- a/nixos/modules/programs/zsh/zsh.nix
+++ b/nixos/modules/programs/zsh/zsh.nix
@@ -159,6 +159,14 @@ in
         type = types.bool;
       };
 
+      enableLsColors = mkOption {
+        default = true;
+        description = lib.mdDoc ''
+          Enable extra colors in directory listings (used by `ls` and `tree`).
+        '';
+        type = types.bool;
+      };
+
     };
 
   };
@@ -263,6 +271,11 @@ in
 
         ${cfg.interactiveShellInit}
 
+        ${optionalString cfg.enableLsColors ''
+          # Extra colors for directory listings.
+          eval "$(${pkgs.coreutils}/bin/dircolors -b)"
+        ''}
+
         # Setup aliases.
         ${zshAliases}