about summary refs log tree commit diff
path: root/home/git/default.nix
blob: bcf32ac2098ec2471f83c7a858d5927f023891de (plain) (blame)
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
{ lib, config, ... }:

let cfg = config.my.home.git;
in {
  options.my.home.git = with lib; {
    enable = mkEnableOption "git configuration";
  };

  config.programs.git = lib.mkIf cfg.enable {
    enable = true;
    aliases = {
      s = "status --short --branch";
      amend = "commit --amend --no-edit";
    };
    extraConfig = {
      core.whitespace = "trailing-space,space-before-tab";
      color.ui = "true";
      push.default = "simple";
      init.defaultBranch = "main";
      branch.autosetuprebase = "remote";
      branch.sort = "authordate";
    };
    userName = "Franck Cuny";
    userEmail = "franck@fcuny.net";
    extraConfig = {
      "credential \"https://github.com\"" = { username = "fcuny"; };
      "credential \"https://git.fcuny.net\"" = { username = "fcuny"; };
    };
    ignores = [
      "*.elc"
      "*.iml"
      "*.o"
      "*.pyc"
      "*.pyo"
      "*pyc"
      "*~"
      ".DS_Store"
      ".\\#"
      ".dir-locals.el"
      ".direnv/*"
      ".idea"
      ".projectile"
      ".pytest_cache/"
      "/env/*"
      "Icon"
      "TAGS"
      "\\#*\\#"
      "tags"
    ];
  };
}