From 5205cf961f5e75788e38a774ceb13f8c5438cb4d Mon Sep 17 00:00:00 2001 From: David Morgan Date: Thu, 24 Nov 2022 16:57:22 +0000 Subject: Read git e-mail addresses from a file --- nix-conf/home/includes/common.nix | 3 ++- nix-conf/home/otm.nix | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'nix-conf') diff --git a/nix-conf/home/includes/common.nix b/nix-conf/home/includes/common.nix index 971aa7d..c9bd270 100644 --- a/nix-conf/home/includes/common.nix +++ b/nix-conf/home/includes/common.nix @@ -2,9 +2,9 @@ let hcr = pkgs.callPackage ./scripts/hm-changes-report.nix { inherit config pkgs; }; scr = pkgs.callPackage ./scripts/system-changes-report.nix { inherit config pkgs; }; + email = builtins.readFile "${config.home.homeDirectory}/email.txt"; in { - imports = [ ./zsh.nix ]; @@ -172,6 +172,7 @@ in programs.git = { enable = true; userName = "David Morgan"; + userEmail = email; aliases = { # difftastic logt = "!sh -c 'GIT_EXTERNAL_DIFF=\"difft --background=dark\" git log -p --ext-diff'"; diff --git a/nix-conf/home/otm.nix b/nix-conf/home/otm.nix index 667493c..71c31ab 100644 --- a/nix-conf/home/otm.nix +++ b/nix-conf/home/otm.nix @@ -1,4 +1,8 @@ { config, lib, pkgs, ... }: +let + email = builtins.readFile "${config.home.homeDirectory}/email.txt"; + otmEmail = builtins.readFile "${config.home.homeDirectory}/otm_email.txt"; +in { imports = [ ./includes/darwin.nix @@ -14,9 +18,10 @@ programs.git = { signing.signByDefault = lib.mkForce false; + userEmail = lib.mkForce otmEmail; includes = [ - { path = "~/.gitconfig-personal"; condition = "gitdir:~/src/personal/"; } - { contents = { commit.gpgSign = true; }; condition = "gitdir:~/src/personal/"; } + { contents = { commit.gpgSign = true; user.email = email; }; condition = "gitdir:~/src/personal/"; } + { contents = { commit.gpgSign = true; user.email = email; }; condition = "gitdir:~/dotfiles/"; } ]; extraConfig = { github.user = "david-morgan-otm"; -- cgit 1.4.1-2-gfad0 put class='txt' type='search' size='10' name='q' value=''/>
path: root/README.md
blob: b5fc03ea876976580d9997877b3f5405ab2b8670 (plain) (blame)
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107