summaryrefslogtreecommitdiff
path: root/profiles/core/git.nix
blob: a09552f40b87f7d7dac9337014239238fd1e6a10 (plain)
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
{
  config,
  lib,
  ...
}:
with lib; {
  hm = {
    programs.git = {
      enable = true;
      userName = my.realName;
      userEmail = my.email;
      extraConfig = {
        worktree.guessRemote = true;
        mergetool.fugitive.cmd = "vim -f -c \"Gdiff\" \"$MERGED\"";
        merge.tool = "fugitive";
        gpg.format = "ssh";
        user.signingKey = "${config.my.home}/.ssh/id_ed25519_sk.pub";
        commit.gpgsign = false;
      };

      includes = let
        no-reply-email = {
          user = {
            email = "59492084+ivi-vink@users.noreply.github.com";
          };
        };
      in [
        {
          condition = "hasconfig:remote.*.url:git@github.com:**/**";
          contents = no-reply-email;
        }
        {
          condition = "hasconfig:remote.*.url:https://github.com/**/**";
          contents = no-reply-email;
        }
      ];

      ignores = [
        "/.direnv/"
        "/.envrc"
        "/.env"
        ".vimsession.vim"
        "tfplan"
        "plan"
      ];
    };
  };
}