From e92229f6a68ce35776304e0086fa84c7086c98d6 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Wed, 24 Jan 2024 16:09:42 -0500 Subject: [PATCH] feat(git): change user and email according to remote --- common/home/git/default.nix | 33 ++++++++++++++++++++++++++++++--- 1 file changed, 30 insertions(+), 3 deletions(-) diff --git a/common/home/git/default.nix b/common/home/git/default.nix index 7da51ccd..646b6b98 100644 --- a/common/home/git/default.nix +++ b/common/home/git/default.nix @@ -4,11 +4,38 @@ enable = true; lfs.enable = true; - userName = "matt1432"; - userEmail = "matt@nelim.org"; - includes = [ {path = "${pkgs.dracula-theme}/git-colors";} + + { + condition = "hasconfig:remote.*.url:git@github.com:*/**"; + contents = { + user = { + email = "matt@nelim.org"; + name = "matt1432"; + }; + }; + } + + { + condition = "hasconfig:remote.*.url:git@git.nelim.org:*/**"; + contents = { + user = { + email = "matt@nelim.org"; + name = "matt1432"; + }; + }; + } + + { + condition = "hasconfig:remote.*.url:git@gitlab.info.uqam.ca:*/**"; + contents = { + user = { + email = "gj591944@ens.uqam.ca"; + name = "Mathis Hurtubise"; + }; + }; + } ]; delta = {