add ssh-agent

make git commit signing add key

set sudo timout to 1m
This commit is contained in:
Gerg-L 2024-02-28 21:43:37 -05:00
parent 264bae45fe
commit 87829596b6
Signed by: gerg-l
SSH key fingerprint: SHA256:FPYDHIkvMocr4wdmZXpgpJjsb2Tw6rASs2ISPbOb0KI
3 changed files with 18 additions and 2 deletions

View file

@ -8,7 +8,6 @@ _:
user = {
name = "Gerg-L";
email = "GregLeyda@proton.me";
signingkey = "~/.ssh/id_ed25519.pub";
};
init = {
defaultBranch = "master";
@ -18,7 +17,15 @@ _:
};
advice.addIgnoredFile = false;
core.hooksPath = ".githooks";
gpg.format = "ssh";
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;
};

View file

@ -47,6 +47,14 @@ _:
};
};
programs.ssh = {
startAgent = true;
agentTimeout = "1m";
extraConfig = ''
AddKeysToAgent yes
'';
};
i18n.defaultLocale = "en_US.UTF-8";
#time settings

View file

@ -49,6 +49,7 @@
enable = true;
execWheelOnly = true;
extraConfig = ''
Defaults timestamp_timeout=1
Defaults env_keep += "EDITOR VISUAL PAGER SYSTEMD_PAGERSECURE MANPAGER"
Defaults lecture = never
'';