aboutsummaryrefslogtreecommitdiff
path: root/modules/programs/git.nix
blob: 52ae045eb3358e7fab7b79de1a6df39c44832663 (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
{
  config,
  username,
  lib,
  ...
}:

{
  options.nx.programs.git.enable = lib.mkEnableOption "Enable git" // {
    default = true;
  };
  config = lib.mkIf config.nx.programs.git.enable {
    home-manager.users.${username} = {
      programs.git = {
        enable = true;
        signing = {
          key = "A3502B180BC1D41A";
          signByDefault = true;
        };
        ignores = [
          "*~"
          ".DS_Store"
        ];
        settings = {
          user.name = "schererleander";
          user.email = "leander@schererleander.de";
          alias = {
            st = "status";
            co = "checkout";
            br = "branch";
          };
          pull.rebase = true;
          url."git@github.com:".insteadOf = "https://github.com";
        };
      };
      programs.diff-highlight = {
        enable = true;
        enableGitIntegration = true;
      };
    };
  };
}