nixos/bash: configure $LS_COLORS for interactive shells
This commit is contained in:
parent
f14a4d60b7
commit
83c36ee797
|
@ -32,6 +32,10 @@ let
|
||||||
fi
|
fi
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
lsColors = optionalString cfg.enableLsColors ''
|
||||||
|
eval "$(${pkgs.coreutils}/bin/dircolors -b)"
|
||||||
|
'';
|
||||||
|
|
||||||
bashAliases = concatStringsSep "\n" (
|
bashAliases = concatStringsSep "\n" (
|
||||||
mapAttrsFlatten (k: v: "alias ${k}=${escapeShellArg v}")
|
mapAttrsFlatten (k: v: "alias ${k}=${escapeShellArg v}")
|
||||||
(filterAttrs (k: v: v != null) cfg.shellAliases)
|
(filterAttrs (k: v: v != null) cfg.shellAliases)
|
||||||
|
@ -127,6 +131,14 @@ in
|
||||||
type = types.bool;
|
type = types.bool;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enableLsColors = mkOption {
|
||||||
|
default = true;
|
||||||
|
description = ''
|
||||||
|
Enable extra colors in directory listings.
|
||||||
|
'';
|
||||||
|
type = types.bool;
|
||||||
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -156,6 +168,7 @@ in
|
||||||
|
|
||||||
${cfg.promptInit}
|
${cfg.promptInit}
|
||||||
${bashCompletion}
|
${bashCompletion}
|
||||||
|
${lsColors}
|
||||||
${bashAliases}
|
${bashAliases}
|
||||||
|
|
||||||
${cfge.interactiveShellInit}
|
${cfge.interactiveShellInit}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user