at master 754 B view raw
1{ 2 config, 3 lib, 4 pkgs, 5 ... 6}: 7 8let 9 enable = config.programs.bash.enableLsColors; 10in 11{ 12 options = { 13 programs.bash.enableLsColors = lib.mkEnableOption "extra colors in directory listings" // { 14 default = true; 15 }; 16 programs.bash.lsColorsFile = lib.mkOption { 17 type = lib.types.nullOr lib.types.path; 18 default = null; 19 example = lib.literalExpression "\${pkgs.dircolors-solarized}/ansi-dark"; 20 description = "Alternative colorscheme for ls colors"; 21 }; 22 }; 23 24 config = lib.mkIf enable { 25 programs.bash.promptPluginInit = '' 26 eval "$(${pkgs.coreutils}/bin/dircolors -b ${ 27 lib.optionalString (config.programs.bash.lsColorsFile != null) config.programs.bash.lsColorsFile 28 })" 29 ''; 30 }; 31}