summaryrefslogtreecommitdiff
path: root/nix/modules/home/git.nix
blob: 4018a3b30c868185d8d5c2de8bad3e1f6f15df54 (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
{ pkgs, lib, config, super, ... }:
{
  programs.git = {
    enable = lib.mkDefault config.monorepo.profiles.graphics.enable;
    package = pkgs.gitFull;
    lfs.enable = lib.mkDefault config.monorepo.profiles.graphics.enable;
    userName = super.monorepo.vars.fullName;
    userEmail = "${super.monorepo.vars.email}";
    signing = {
      key = super.monorepo.vars.gpgKey;
      signByDefault = true;
    };

    extraConfig = {
      init.defaultBranch = "main";
      credential."mail.${super.monorepo.vars.orgHost}" = {
        username = "${super.monorepo.vars.email}";
        helper = "!f() { test \"$1\" = get && echo \"password=$(cat /run/user/1000/secrets/mail)\"; }; f";
      };

      sendemail = {
        smtpserver = "mail.${super.monorepo.vars.orgHost}";
        smtpuser = "${super.monorepo.vars.email}";
        smtpserverport = 465;
        smtpencryption = "ssl";
      };
    };

    aliases = {
      pl = "pull";
      ps = "push";
      co = "checkout";
      c = "commit";
      a = "add";
      st = "status";
      sw = "switch";
      b = "branch";
    };
  };
}