nixos/hosts/gerg-desktop/git.nix
Gerg-L 87829596b6
add ssh-agent
make git commit signing add key

set sudo timout to 1m
2024-02-29 11:46:24 -05:00

34 lines
798 B
Nix

_:
{ pkgs, config, ... }:
{
programs.git = {
enable = true;
package = pkgs.gitMinimal;
config = {
user = {
name = "Gerg-L";
email = "GregLeyda@proton.me";
};
init = {
defaultBranch = "master";
};
push = {
autoSetupRemote = true;
};
advice.addIgnoredFile = false;
core.hooksPath = ".githooks";
gpg = {
format = "ssh";
ssh.defaultKeyCommand = pkgs.writeShellScript "git_key" ''
if ssh-add -L | grep -vq '${config.local.keys.gerg_gerg-desktop}'; then
ssh-add -t 1m ~/.ssh/id_ed25519
fi
echo 'key::${config.local.keys.gerg_gerg-desktop}'
'';
};
push.gpgsign = "if-asked";
commit.gpgsign = true;
};
};
#_file
}