diff options
Diffstat (limited to 'home/git/default.nix')
-rw-r--r-- | home/git/default.nix | 84 |
1 files changed, 44 insertions, 40 deletions
diff --git a/home/git/default.nix b/home/git/default.nix index bcf32ac..3dc2dd0 100644 --- a/home/git/default.nix +++ b/home/git/default.nix @@ -6,46 +6,50 @@ in { enable = mkEnableOption "git configuration"; }; - config.programs.git = lib.mkIf cfg.enable { - enable = true; - aliases = { - s = "status --short --branch"; - amend = "commit --amend --no-edit"; + config = lib.mkIf cfg.enable { + programs.git = { + enable = true; + aliases = { + s = "status --short --branch"; + amend = "commit --amend --no-edit"; + }; + extraConfig = { + core.whitespace = "trailing-space,space-before-tab"; + color.ui = "true"; + push.default = "simple"; + init.defaultBranch = "main"; + branch.autosetuprebase = "remote"; + branch.sort = "authordate"; + commit.template = "${config.xdg.dataHome}/git/commit.template"; + }; + userName = "Franck Cuny"; + userEmail = "franck@fcuny.net"; + extraConfig = { + "credential \"https://github.com\"" = { username = "fcuny"; }; + "credential \"https://git.fcuny.net\"" = { username = "fcuny"; }; + }; + ignores = [ + "*.elc" + "*.iml" + "*.o" + "*.pyc" + "*.pyo" + "*pyc" + "*~" + ".DS_Store" + ".\\#" + ".dir-locals.el" + ".direnv/*" + ".idea" + ".projectile" + ".pytest_cache/" + "/env/*" + "Icon" + "TAGS" + "\\#*\\#" + "tags" + ]; }; - extraConfig = { - core.whitespace = "trailing-space,space-before-tab"; - color.ui = "true"; - push.default = "simple"; - init.defaultBranch = "main"; - branch.autosetuprebase = "remote"; - branch.sort = "authordate"; - }; - userName = "Franck Cuny"; - userEmail = "franck@fcuny.net"; - extraConfig = { - "credential \"https://github.com\"" = { username = "fcuny"; }; - "credential \"https://git.fcuny.net\"" = { username = "fcuny"; }; - }; - ignores = [ - "*.elc" - "*.iml" - "*.o" - "*.pyc" - "*.pyo" - "*pyc" - "*~" - ".DS_Store" - ".\\#" - ".dir-locals.el" - ".direnv/*" - ".idea" - ".projectile" - ".pytest_cache/" - "/env/*" - "Icon" - "TAGS" - "\\#*\\#" - "tags" - ]; + xdg.dataFile."git/commit.template" = { source = ./commit.template; }; }; } |