mirror of
https://github.com/nix-community/home-manager.git
synced 2025-11-08 19:46:05 +01:00
error: The option `home.sessionVariables.GREP_COLORS' was accessed but has no value defined. Try setting the option. Signed-off-by: Austin Horstman <khaneliman12@gmail.com>
37 lines
776 B
Nix
37 lines
776 B
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
|
|
let
|
|
cfg = config.programs.grep;
|
|
|
|
in
|
|
{
|
|
|
|
meta.maintainers = [ lib.maintainers.bmrips ];
|
|
|
|
options.programs.grep = {
|
|
enable = lib.mkEnableOption "{command}`grep`.";
|
|
package = lib.mkPackageOption pkgs "grep" {
|
|
default = "gnugrep";
|
|
nullable = true;
|
|
};
|
|
colors = lib.mkOption {
|
|
type = with lib.types; attrsOf str;
|
|
default = { };
|
|
description = "Settings for {env}`GREP_COLORS`";
|
|
example.error = "01;31";
|
|
};
|
|
};
|
|
|
|
config = lib.mkIf cfg.enable {
|
|
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
|
home.sessionVariables = lib.mkIf (cfg.colors != { }) {
|
|
GREP_COLORS = lib.concatStringsSep ":" (lib.mapAttrsToList (n: v: "${n}=${v}") cfg.colors);
|
|
};
|
|
};
|
|
|
|
}
|