Read git e-mail addresses from a file

master
David Morgan 2 months ago
parent da3cff54f2
commit 5205cf961f
Signed by: djm
GPG Key ID: C171251002C200F2

@ -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'";

@ -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";

@ -16,5 +16,7 @@ ln -sf ~/dotfiles/.emacs.d ~/
mkdir ~/.config/nix
echo "extra-experimental-features = nix-command flakes" > ~/.config/nix/nix.conf
echo -n $EMAIL > ~/email.txt
home-manager switch

Loading…
Cancel
Save