nix-config/programs/git/default.nix

66 lines
1.3 KiB
Nix
Raw Normal View History

2021-04-11 23:31:11 -07:00
{ config, pkgs, ... }:
let
gitConfig = {
core = {
editor = "nvim";
2024-05-18 11:31:35 -07:00
pager = "diff-so-fancy | less --tabs=4 -RFX";
2021-04-11 23:31:11 -07:00
};
2021-09-02 22:13:27 -07:00
init.defaultBranch = "main";
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
};
diff.tool = "nvim";
difftool.nvim = {
cmd = "nvim -d \"$LOCAL\" \"$REMOTE\"";
2021-04-11 23:31:11 -07:00
prompt = false;
};
# url = {
# "git@github.com:" = {
# insteadOf = "https://github.com/";
# };
# };
2022-08-07 22:50:23 -07:00
fetch.prune = true;
2021-04-11 23:31:11 -07:00
pull = {
rebase = true;
};
};
2022-08-07 22:50:23 -07:00
myAliases = {
ci = "commit";
co = "checkout";
main = "checkout main";
master = "checkout master";
};
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;
};
}