diff options
author | Franck Cuny <franck@fcuny.net> | 2024-10-27 10:46:10 -0700 |
---|---|---|
committer | Franck Cuny <franck@fcuny.net> | 2024-10-27 10:46:10 -0700 |
commit | 19b1e357a39285491cc8a8a4deea2182d3f66957 (patch) | |
tree | 2c5bb57e5f9227fcdfce057aa893655e4df6b6b5 /nix/profiles/home-manager/git.nix | |
parent | centralize more configurations related to darwin (diff) | |
download | world-19b1e357a39285491cc8a8a4deea2182d3f66957.tar.gz |
this may simplify things ?
Diffstat (limited to '')
-rw-r--r-- | nix/profiles/home-manager/git.nix | 50 |
1 files changed, 28 insertions, 22 deletions
diff --git a/nix/profiles/home-manager/git.nix b/nix/profiles/home-manager/git.nix index 149af48..cba49f9 100644 --- a/nix/profiles/home-manager/git.nix +++ b/nix/profiles/home-manager/git.nix @@ -1,14 +1,26 @@ -{ pkgs, config, ... }: -{ +{ pkgs, config, lib, ... }: { programs.git = { enable = true; userName = "Franck Cuny"; aliases = { amend = "commit --amend"; - ll = "log --pretty=\"format:%h %G? %aN %s\""; + ll = ''log --pretty="format:%h %G? %aN %s"''; }; + includes = [ + { + condition = "hasconfig:remote.*.url:git@github.rbx.com:**"; + path = pkgs.writeText "finsitGitConfig" + (lib.generators.toGitINI { user.email = "fcuny@roblox.com"; }); + } + { + condition = "hasconfig:remote.*.url:git@github.com:Roblox/**"; + path = pkgs.writeText "finsitGitConfig" + (lib.generators.toGitINI { user.email = "fcuny@roblox.com"; }); + } + ]; + extraConfig = { core.whitespace = "trailing-space,space-before-tab"; color.ui = "true"; @@ -42,29 +54,23 @@ }; }; - ignores = [ - "*~" - ".direnv" - "__pycache__" - ]; + ignores = [ "*~" ".envrc" ".direnv" "__pycache__" ]; }; - xdg.dataFile."git/commit.template".source = pkgs.writeText "commit.template" '' + xdg.dataFile."git/commit.template".source = + pkgs.writeText "commit.template" '' - # (If applied, this commit will...) <subject> + # (If applied, this commit will...) <subject> - # Explain why this change is being made + # Explain why this change is being made - # --- COMMIT END --- - # Remember to - # Use the imperative mood, present tense: `change' not `changed' nor `changes' - # Do not end the subject line with a period - # Use the body to explain what and why vs. how - # Can use multiple lines with "-" for bullet points in body -''; + # --- COMMIT END --- + # Remember to + # Use the imperative mood, present tense: `change' not `changed' nor `changes' + # Do not end the subject line with a period + # Use the body to explain what and why vs. how + # Can use multiple lines with "-" for bullet points in body + ''; - home.packages = with pkgs; [ - gitAndTools.pre-commit - git-credential-manager - ]; + home.packages = with pkgs; [ gitAndTools.pre-commit git-credential-manager ]; } |