about summary refs log tree commit diff stats
path: root/nix-conf
diff options
context:
space:
mode:
authorDavid Morgan <djm_uk@protonmail.com>2022-11-24 16:57:22 +0000
committerDavid Morgan <djm_uk@protonmail.com>2022-11-24 16:57:22 +0000
commit5205cf961f5e75788e38a774ceb13f8c5438cb4d (patch)
treeb6ca4620e917bbb50c7656095b37a02ca73b8700 /nix-conf
parentda3cff54f2be67d4ca64716959acf532a14e08a6 (diff)
downloaddotfiles-5205cf961f5e75788e38a774ceb13f8c5438cb4d.tar.gz
Read git e-mail addresses from a file
Diffstat (limited to 'nix-conf')
-rw-r--r--nix-conf/home/includes/common.nix3
-rw-r--r--nix-conf/home/otm.nix9
2 files changed, 9 insertions, 3 deletions
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";