-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgit.nix
68 lines (64 loc) · 1.73 KB
/
git.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
let
user = import ./env.nix;
in
{
programs.git = {
enable = true;
userName = user.git.personal.name;
userEmail = user.git.personal.email;
delta.enable = true;
#difftastic.enable = true;
iniContent = {
commit.gpgSign = true;
gpg = {
format = "ssh";
ssh.allowedSignersFile = "~/.ssh/allowed_signers";
};
pull.rebase = true;
pull.ff = "only";
init.defaultBranch = "main";
user = {
name = user.git.personal.name;
email = user.git.personal.email;
signingkey = user.git.personal.signingkey;
};
};
lfs.enable = true;
aliases = {
gg = "log --graph --abbrev-commit --decorate --date=relative --oneline --all";
};
extraConfig = {
remote."origin".prune = true;
credential.helper = "/usr/local/share/gcm-core/git-credential-manager";
credential = {
"https://dev.azure.com" = { useHttpPath = true; };
"https://gh.stackoverflow.com" = { gitHubAuthModes = "oauth"; provider = "github"; };
};
merge.tool = "code";
mergetool."code".cmd = "code --wait --merge $REMOTE $LOCAL $BASE $MERGED";
rebase.autosquash = true;
};
includes = [
{
condition = "gitdir:~/repositories/";
contents = {
user = {
name = user.git.personal.name;
email = user.git.personal.email;
signingkey = user.git.personal.signingkey;
};
};
}
{
condition = "gitdir:~/workspace/";
contents = {
user = {
name = user.git.work.name;
email = user.git.work.email;
signingkey = user.git.work.signingkey;
};
};
}
];
};
}