gcc: init module (#7614)
This commit is contained in:
parent
0cda19d420
commit
6d1fddb13b
1 changed files with 36 additions and 0 deletions
36
modules/programs/gcc.nix
Normal file
36
modules/programs/gcc.nix
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
cfg = config.programs.gcc;
|
||||
|
||||
in
|
||||
{
|
||||
|
||||
meta.maintainers = [ lib.maintainers.bmrips ];
|
||||
|
||||
options.programs.gcc = {
|
||||
enable = lib.mkEnableOption "{command}`gcc`.";
|
||||
package = lib.mkPackageOption pkgs "gcc" { nullable = true; };
|
||||
colors = lib.mkOption {
|
||||
type = with lib.types; attrsOf str;
|
||||
default = { };
|
||||
description = "Settings for {env}`GCC_COLORS`";
|
||||
example = {
|
||||
error = "01;31";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
config = lib.mkIf cfg.enable {
|
||||
home.packages = lib.mkIf (cfg.package != null) [ cfg.package ];
|
||||
home.sessionVariables.GCC_COLORS = lib.mkIf (cfg.colors != { }) (
|
||||
lib.concatStringsSep ":" (lib.mapAttrsToList (n: v: "${n}=${v}") cfg.colors)
|
||||
);
|
||||
};
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue