summaryrefslogtreecommitdiff
path: root/home/git/default.nix
blob: b0ed3bb7c004aa7f651628a18a11797ad45709b7 (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
{
  pkgs,
  lib,
  ...
}: let
  inherit (lib) optional;
  inherit (pkgs.stdenv.hostPlatform) isDarwin;
in {
  imports = [./ignore.nix ./aliases.nix];

  programs.git = {
    enable = true;

    # Set privacy-respecting user information.
    userName = "Linnnus";
    userEmail = "[email protected]";

    extraConfig = {
      init.defaultBranch = "master";

      help.autoCorrect = "prompt";

      credential = {
        "https://github.com/" = {
          username = "linnnus";
          helper = "${pkgs.gh}/bin/gh auth git-credential";
        };
        helper = (optional isDarwin "osxkeychain") ++ ["cache"];
      };
    };
  };
}