nix-dotfiles/modules/software/dev/git.nix
2026-01-11 23:47:19 -08:00

65 lines
1.3 KiB
Nix

{ pkgs, config, lib, ... }:
with lib;
let
cfg = config.modules.software.dev.git;
in {
options.modules.software.dev.git = {
enable = mkEnableOption "Enable git. You know what git is";
package = mkOption {
type = types.package;
default = pkgs.gitFull;
example = "pkgs.gitFull";
};
};
config = mkIf cfg.enable {
hm.programs.git = {
enable = true;
package = cfg.package;
settings = {
user.name = ''reidlab'';
user.email = "reidlab325@gmail.com";
alias = {
amend = ''commit --amend --no-edit'';
amendall = ''commit --amend --no-edit --all'';
};
credential.helper = "${cfg.package}/bin/git-credential-libsecret";
push.autoSetupRemote = true;
push.gpgSign = "if-asked";
pull.rebase = true;
init.defaultBranch = "main";
};
signing = {
signByDefault = true;
key = "DAF5EAF6665839FD";
};
ignores = [
# General
"*.direnv"
"*.envrc"
# OS related
".DS_Store?"
".DS_Store"
".CFUserTextEncoding"
".Trash"
".Xauthority"
"thumbs.db"
"Thumbs.db"
"Icon?"
];
};
hm.programs.delta.enable = true;
hm.programs.delta.enableGitIntegration = true;
hm.programs.gh.enable = true;
};
}