refactor(home): extract git config to its own file
This commit is contained in:
47
programs/git.nix
Normal file
47
programs/git.nix
Normal file
@@ -0,0 +1,47 @@
|
||||
{ pkgs, ... }:
|
||||
|
||||
{
|
||||
programs.git = {
|
||||
enable = true;
|
||||
package = pkgs.gitAndTools.gitFull;
|
||||
|
||||
userEmail = "pierre@front-commerce.com";
|
||||
userName = "Pierre Martin";
|
||||
|
||||
aliases = {
|
||||
co = "checkout";
|
||||
mr = "!sh -c 'git fetch $1 merge-requests/$2/head:mr-$1-$2 && git checkout mr-$1-$2' -";
|
||||
};
|
||||
|
||||
ignores = [
|
||||
".DS_Store"
|
||||
".svn"
|
||||
"*~"
|
||||
"*.swp"
|
||||
"*.rbc"
|
||||
".watsonrc"
|
||||
".idea"
|
||||
".vscode"
|
||||
];
|
||||
|
||||
extraConfig = {
|
||||
# see https://github.com/dandavison/delta#get-started
|
||||
core.pager = "delta";
|
||||
interactive.diffFilter = "delta --color-only";
|
||||
delta.navigate = true;
|
||||
merge.conflictstyle = "diff3";
|
||||
diff.colorMoved = "default";
|
||||
|
||||
merge.tool = "meld";
|
||||
diff.algorithm = "patience";
|
||||
pull.ff = "only";
|
||||
credential.helper = "store";
|
||||
init.defaultBranch = "main";
|
||||
|
||||
# see https://betterprogramming.pub/8-advanced-git-commands-university-wont-teach-you-fe63b483d34b
|
||||
help.autocorrect = 1;
|
||||
fetch.prune = true;
|
||||
push.autoSetupRemote = true;
|
||||
};
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user