Files
nix/users/configs/console/git/default.nix
Nikolaos Karaolidis 9dfbe1203d Add syncthing base
Signed-off-by: Nikolaos Karaolidis <nick@karaolidis.com>
2024-07-08 15:56:42 +03:00

45 lines
860 B
Nix

{
user ? throw "user argument is required",
}:
{
config,
lib,
pkgs,
...
}:
let
hmConfig = config.home-manager.users.${user.name};
in
{
home-manager.users.${user.name} = {
programs.git = {
enable = true;
lfs.enable = true;
userName = user.fullName;
userEmail = user.email;
signing = {
signByDefault = true;
key = null;
};
extraConfig = {
credential.helper = "store";
push.autoSetupRemote = true;
};
hooks = {
commit-msg = lib.meta.getExe (
pkgs.writeShellApplication {
name = "git-commit-msg-hook";
runtimeInputs = with pkgs; [ git ];
text = builtins.readFile ./commit-msg.sh;
}
);
};
};
sops.secrets."git".path = "${hmConfig.xdg.configHome}/git/credentials";
};
}