diff options
author | Maximilian Bosch <maximilian@mbosch.me> | 2020-02-05 09:08:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-05 09:08:41 +0100 |
commit | 87d4951a82e77405a2f87b8aea3e2adaf488de36 (patch) | |
tree | fd2c1893b7b192c300743fcf287f8c3f109428f1 /nixos | |
parent | bf474ab2cd3d781c95fe04f60ba7bc44b8207040 (diff) | |
parent | 83c36ee797450dcac617de0b0f6fd44e8d839caa (diff) |
Merge pull request #78660 from buckley310/dircolors
nixos/bash: configure $LS_COLORS for interactive shells
Diffstat (limited to 'nixos')
-rw-r--r-- | nixos/modules/programs/bash/bash.nix | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/nixos/modules/programs/bash/bash.nix b/nixos/modules/programs/bash/bash.nix index 366c07c0a3528..be964ce7f3f9a 100644 --- a/nixos/modules/programs/bash/bash.nix +++ b/nixos/modules/programs/bash/bash.nix @@ -32,6 +32,10 @@ let fi ''; + lsColors = optionalString cfg.enableLsColors '' + eval "$(${pkgs.coreutils}/bin/dircolors -b)" + ''; + bashAliases = concatStringsSep "\n" ( mapAttrsFlatten (k: v: "alias ${k}=${escapeShellArg v}") (filterAttrs (k: v: v != null) cfg.shellAliases) @@ -127,6 +131,14 @@ in type = types.bool; }; + enableLsColors = mkOption { + default = true; + description = '' + Enable extra colors in directory listings. + ''; + type = types.bool; + }; + }; }; @@ -156,6 +168,7 @@ in ${cfg.promptInit} ${bashCompletion} + ${lsColors} ${bashAliases} ${cfge.interactiveShellInit} |