-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgit.nix
56 lines (56 loc) · 1.42 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
{ pkgs, ... }:
{
programs.git = {
enable = true;
package = pkgs.gitFull;
userName = "Defelo";
userEmail = "mail@defelo.de";
difftastic.enable = true;
signing = {
key = "E7FE2087E4380E64";
signByDefault = true;
};
ignores = [
".direnv"
".devenv"
"result"
"result-*"
"repl-result-*"
];
extraConfig = {
init.defaultBranch = "main";
push.default = "upstream";
rerere.enabled = true;
merge.conflictStyle = "zdiff3";
diff.algorithm = "histogram";
diff.submodule = "log";
diff.sopsdiffer.textconv =
let
conf = builtins.toFile "sops.yaml" (
builtins.toJSON {
creation_rules = [
{ key_groups = [ { pgp = [ "61303BBAD7D1BF74EFA44E3BE7FE2087E4380E64" ]; } ]; }
];
}
);
in
"${pkgs.sops}/bin/sops --config ${conf} -d";
sendemail = {
smtpserver = "mail.defelo.de";
smtpuser = "mail@defelo.de";
smtpencryption = "ssl";
smtpserverport = 465;
annotate = true;
};
credential."smtp://mail.defelo.de:465".helper =
let
helper = pkgs.writeShellScript "git-credential-helper" ''
[[ "$1" = get ]] || exit 1
pw=$(pass email/mail@defelo.de)
echo "password=$pw"
'';
in
''!${helper} "$@"'';
};
};
}