Add git and gpg configs

Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
This commit is contained in:
2024-06-19 17:49:37 +03:00
parent e8cbbe07b2
commit 8a6045d6ce
4 changed files with 76 additions and 1 deletions

View File

@@ -1,6 +1,23 @@
{ pkgs, ... }:
{
programs.git = {
enable = true;
lfs.enable = true;
signing = {
signByDefault = true;
key = null;
};
extraConfig.credential.helper = "store";
hooks = {
commit-msg = pkgs.writeScript "git-commit-msg" ''
#!${pkgs.runtimeShell}
git interpret-trailers --if-exists doNothing --trailer \
"Signed-off-by: $(git config user.name) <$(git config user.email)>" \
--in-place "$1"
'';
};
};
}