{
config,
lib,
pkgs,
...
}: let
cfg = config.roles.git;
in {
options.roles.git = {
enable = lib.mkEnableOption "enable git";
email = lib.mkOption {
type = lib.types.str;
};
name = lib.mkOption {
type = lib.types.str;
};
gitExtraConfig = lib.mkOption {
type = lib.types.lines;
default = {};
};
enableLazygit = lib.mkEnableOption "enable lazygit";
};
config = {
programs.lazygit = lib.mkIf cfg.enableLazygit {
enable = true;
settings = {
disableStartupPopups = true;
};
};
hm = {
programs.git = lib.mkIf cfg.enable {
enable = true;
package = pkgs.gitAndTools.gitFull;
userEmail = cfg.email;
userName = cfg.name;
extraConfig = cfg.gitExtraConfig;
};
};
};
}