-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitconfig.nix
41 lines (30 loc) · 919 Bytes
/
gitconfig.nix
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
# This module sets up Git such that it does not complain about missing identity.
{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.my.programs.git;
# workstation.nix includes gitFull which overrides our default choice of git-minimal
addGitPackage = ! config.my.workstation.enabled;
in {
options.my.programs.git = {
userName = mkOption {
default = "Stefan Majewsky";
description = "value of user.name in /etc/gitconfig";
type = types.str;
};
userEMail = mkOption {
default = "[email protected]";
description = "value of user.email in /etc/gitconfig";
type = types.str;
};
};
config = {
environment.systemPackages = optionals addGitPackage [ pkgs.git ];
# silence Git's complaints about missing identity
environment.etc."gitconfig".text = ''
[user]
name = ${cfg.userName}
email = ${cfg.userEMail}
'';
};
}