1
0
Fork 0
forked from irl/nix-configs
irl-nix-configs/modules/home-manager/git/git.nix

41 lines
815 B
Nix

{
config,
lib,
pkgs,
...
}:
let
cfg = config.feature.git;
in
{
options.feature.git.enable = lib.mkEnableOption "Set up git";
config = {
programs.git = {
delta.enable = true;
enable = true;
extraConfig = {
diff = {
algorithm = "histogram";
};
init = {
defaultBranch = "main";
};
rebase = {
autosquash = true;
autostash = true;
};
url = {
"git@github.com:".pushInsteadOf = "https://github.com/";
"git@gitlab.com:".pushInsteadOf = "https://gitlab.com/";
"git@guardianproject.dev:".pushInsteadOf = "https://guardianproject.dev/";
};
user = {
name = "irl";
email = "iain@learmonth.me";
};
};
};
};
}