summaryrefslogtreecommitdiff
path: root/home/git/default.nix
blob: cf6419c55f1115a936906e2b3144de9b74678118 (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
{pkgs,lib,...}: let inherit (lib.modules) mkIf;
inherit (pkgs.stdenv.hostPlatform) isDarwin;
in {
  programs.git = {
    enable = true;

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

    extraConfig.credential.helper = mkIf isDarwin [ "osxkeychain" ];
  };

  programs.git-credential-lastpass.enable = !isDarwin;

  home.shellAliases = {
    gs = "git status";
    gd = "git diff";
    gc = "git commit";
    ga = "git add";
    gan = "git add -N";
    gap = "git add --patch";
  };
}