diff options
author | David Morgan <djm_uk@protonmail.com> | 2022-11-24 16:57:22 +0000 |
---|---|---|
committer | David Morgan <djm_uk@protonmail.com> | 2022-11-24 16:57:22 +0000 |
commit | 5205cf961f5e75788e38a774ceb13f8c5438cb4d (patch) | |
tree | b6ca4620e917bbb50c7656095b37a02ca73b8700 /nix-conf | |
parent | da3cff54f2be67d4ca64716959acf532a14e08a6 (diff) | |
download | dotfiles-5205cf961f5e75788e38a774ceb13f8c5438cb4d.tar.gz |
Read git e-mail addresses from a file
Diffstat (limited to 'nix-conf')
-rw-r--r-- | nix-conf/home/includes/common.nix | 3 | ||||
-rw-r--r-- | nix-conf/home/otm.nix | 9 |
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"; |