Files
nix/users/common/configs/git/default.nix
2024-06-19 17:49:37 +03:00

24 lines
491 B
Nix

{ 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"
'';
};
};
}