blob: 210e0f1e96b8acdd8b0baa4079135a173226539a (
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
|
{ config, lib, ... }:
let
cfg = config.seth.programs.git;
in
{
options.seth.programs.git = {
enable = lib.mkEnableOption "Git configuration settings" // {
default = config.seth.enable;
defaultText = lib.literalExpression "config.seth.enable";
};
gh.enable = lib.mkEnableOption "GitHub CLI support" // {
default = true;
};
};
config = lib.mkIf cfg.enable {
programs = {
gh = lib.mkIf cfg.gh.enable {
enable = true;
settings = {
git_protocol = "https";
editor = "nvim";
prompt = "enabled";
# workaround for https://github.com/nix-community/home-manager/issues/474
version = 1;
};
gitCredentialHelper = {
enable = true;
hosts = [
"https://github.com"
"https://github.example.com"
];
};
};
git = {
enable = true;
difftastic = {
enable = true;
background = "dark";
display = "inline";
};
extraConfig = {
init = {
defaultBranch = "main";
};
};
signing = {
key = "D31BD0D494BBEE86";
signByDefault = true;
};
userEmail = "[email protected]";
userName = "seth";
};
};
};
}
|