summaryrefslogtreecommitdiff
path: root/home/git/default.nix
blob: c950a9445cade83a2d462d9cf5a4a8edc93d648c (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
{
  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";
  };
}