nix-config/programs/git/default.nix

83 lines
1.7 KiB
Nix
Raw Normal View History

2021-04-11 23:31:11 -07:00
{ config, pkgs, ... }:
let
gitConfig = {
core = {
editor = "nvim";
pager = "delta";
2021-04-11 23:31:11 -07:00
};
delta = {
"line-numbers" = true;
"hyperlinks" = true;
"side-by-side" = true;
};
diff = {
colorMoved = "default";
tool = "nvim";
};
difftool.nvim = {
cmd = "nvim -d \"$LOCAL\" \"$REMOTE\"";
prompt = false;
};
fetch.prune = true;
2021-09-02 22:13:27 -07:00
init.defaultBranch = "main";
interactive = {
diffFilter = "delta --color-only";
};
merge.conflictstyle = "diff3";
merge.tool = "nvim";
mergetool.nvim = {
cmd = "nvim -d -c \"wincmd l\" -c \"norm ]c\" \"$LOCAL\" \"$MERGED\" \"$REMOTE\"";
2021-04-11 23:31:11 -07:00
prompt = false;
keepBackup = false;
2021-04-11 23:31:11 -07:00
};
# url = {
# "git@github.com:" = {
# insteadOf = "https://github.com/";
# };
# };
2021-04-11 23:31:11 -07:00
pull = {
rebase = true;
};
};
2022-08-07 22:50:23 -07:00
myAliases = {
ci = "commit";
cim = "commit -m";
cia = "commit -am";
2022-08-07 22:50:23 -07:00
co = "checkout";
cob = "checkout -b";
di = "diff";
gpo = "push origin";
2022-08-07 22:50:23 -07:00
main = "checkout main";
master = "checkout master";
st = "status";
2022-08-07 22:50:23 -07:00
};
myIgnores = [
2024-05-18 11:31:35 -07:00
"*~"
".DS_Store"
"*.bloop"
".direnv/"
".idea/"
".mypy_cache"
"*.metals"
"*.metals.sbt"
"*metals.sbt"
"*.envrc" # there is lorri, nix-direnv & simple direnv; let people decide
"*hie.yaml" # ghcide files
"*.mill-version" # used by metals
"*.vscode"
"*.python-version"
"result"
];
2022-08-07 22:50:23 -07:00
in
{
programs.git = {
enable = true;
userEmail = "code@softinio.com";
userName = "Salar Rahmanian";
aliases = myAliases;
ignores = myIgnores;
2021-04-11 23:31:11 -07:00
extraConfig = gitConfig;
};
}