Files
nix/hosts/common/configs/user/console/git/default.nix
Nikolaos Karaolidis 79ff5a55e2 Add more sas tooling
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
2025-01-09 16:30:02 +00:00

49 lines
1022 B
Nix

{
user ? throw "user argument is required",
home ? throw "home argument is required",
}:
{
config,
lib,
pkgs,
...
}:
let
userConfig = config.users.users.${user};
in
{
home-manager.users.${user} = {
programs.git = {
enable = true;
lfs.enable = true;
userName = userConfig.fullName;
userEmail = userConfig.email;
signing = {
signByDefault = true;
key = null;
};
extraConfig = {
credential.helper = "store";
push.autoSetupRemote = true;
core.fsmonitor = true;
feature.manyFiles = true;
fetch.writeCommitGraph = true;
http.cookiefile = "${home}/.config/git/cookies";
advice.detachedHead = false;
};
hooks = {
commit-msg = lib.meta.getExe (
pkgs.writeShellApplication {
name = "git-commit-msg-hook";
runtimeInputs = with pkgs; [ git ];
text = builtins.readFile ./commit-msg.sh;
}
);
};
};
};
}