diff options
| author | Franck Cuny <franck@fcuny.net> | 2022-05-18 20:21:34 -0700 |
|---|---|---|
| committer | Franck Cuny <franck@fcuny.net> | 2022-05-18 20:21:34 -0700 |
| commit | 579c203d12e6e095ec59e655d3d58747f450838b (patch) | |
| tree | 33f7bb274ffba3e3a0a2dbde2c88d29e7087bed3 /home/git/default.nix | |
| parent | nix: bump dependencies (diff) | |
| download | infra-579c203d12e6e095ec59e655d3d58747f450838b.tar.gz | |
feat(git): add a template for commit messages
In order to write good commit message, having a reminder of how to write
them is useful. This template provides some guidance to categorize the
change and how to phrase the description.
Diffstat (limited to '')
| -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; }; }; } |
