about summary refs log tree commit diff
path: root/nix
diff options
context:
space:
mode:
authorFranck Cuny <franck@fcuny.net>2024-12-16 11:31:47 -0800
committerFranck Cuny <franck@fcuny.net>2024-12-16 11:31:47 -0800
commit658405110808f79484e46827d1d7533646754188 (patch)
treee8e5aea39a14afd8e2fa362c4f4ac2ec1ce7f940 /nix
parentupdate the alias to fetch the kube config (diff)
downloadworld-658405110808f79484e46827d1d7533646754188.tar.gz
configure the git email correctly
The syntax for `hasconfig' was not correct, and as a result the wrong
email was selected. I verified this one is working as expected.
Diffstat (limited to '')
-rw-r--r--nix/users/fcuny/git.nix12
1 files changed, 9 insertions, 3 deletions
diff --git a/nix/users/fcuny/git.nix b/nix/users/fcuny/git.nix
index 6300f36..78b836a 100644
--- a/nix/users/fcuny/git.nix
+++ b/nix/users/fcuny/git.nix
@@ -12,19 +12,25 @@
 
     aliases = { amend = "commit --amend"; };
 
+    # https://stackoverflow.com/questions/74012449/git-includeif-hasconfigremote-url-not-working
+    # to test it's working as expected:
+    # run `git config --get-all user.email' in a repository to check that we get all the possible emails
+    # run `git config --get user.email' in a repository to check which email is selected
     includes = [
       {
-        condition = "hasconfig:remote.*.url:git@github.rbx.com:**";
-        path = pkgs.writeText "finsitGitConfig"
+        condition = "hasconfig:remote.*.url:git@github.rbx.com:*/**";
+        path = pkgs.writeText "username.cfg"
           (lib.generators.toGitINI { user.email = "fcuny@roblox.com"; });
       }
       {
         condition = "hasconfig:remote.*.url:git@github.com:Roblox/**";
-        path = pkgs.writeText "finsitGitConfig"
+        path = pkgs.writeText "username.cfg"
           (lib.generators.toGitINI { user.email = "fcuny@roblox.com"; });
       }
     ];
 
+    ignores = [ ".envrc" ".direnv" ];
+
     extraConfig = {
       core.whitespace = "trailing-space,space-before-tab";
       color.ui = "true";