Added module for git

This commit is contained in:
Jan-Bulthuis 2024-12-02 00:52:22 +01:00
parent 52c7212155
commit e24066e577
1 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,53 @@
{
config,
lib,
pkgs,
...
}:
with lib;
let
cfg = config.modules.git;
in
{
options.modules.git = {
enable = mkEnableOption "git";
user = mkOption {
type = types.str;
description = "Default user name to use.";
};
email = mkOption {
type = types.str;
description = "Default user email to use.";
};
ignores = mkOption {
type = types.listOf types.str;
default = [ ];
description = "Paths to globally ignore";
};
};
config = mkIf cfg.enable {
home.packages = with pkgs; [
git
lazygit
];
programs.git = {
enable = true;
extraConfig = {
pull = {
rebase = false;
};
};
userName = cfg.user;
userEmail = cfg.email;
ignores = cfg.ignores;
};
};
}