mirror of
https://github.com/kmein/niveum
synced 2026-03-16 10:11:08 +01:00
feat(gpg): use for ssh, increase ttl
This commit is contained in:
@@ -186,7 +186,17 @@ in {
|
||||
}
|
||||
{programs.command-not-found.enable = true;}
|
||||
{
|
||||
programs.gnupg.agent.enable = true;
|
||||
home-manager.users.me = {
|
||||
services.gpg-agent = rec {
|
||||
enable = true;
|
||||
enableSshSupport = true;
|
||||
enableZshIntegration = true;
|
||||
defaultCacheTtl = 2 * 60 * 60;
|
||||
defaultCacheTtlSsh = defaultCacheTtl;
|
||||
maxCacheTtl = 4 * defaultCacheTtl;
|
||||
maxCacheTtlSsh = maxCacheTtl;
|
||||
};
|
||||
};
|
||||
|
||||
environment.systemPackages = [
|
||||
pkgs.gnupg
|
||||
|
||||
@@ -7,19 +7,7 @@
|
||||
inherit (import <niveum/lib>) sshPort kieran;
|
||||
externalNetwork = import <niveum/lib/external-network.nix>;
|
||||
sshIdentity = name: "${config.users.users.me.home}/.ssh/${name}";
|
||||
ssh-passphrase = lib.strings.fileContents <system-secrets/ssh/passphrase>;
|
||||
in {
|
||||
services.xserver.displayManager.sessionCommands = toString (pkgs.writeScript "ssh-add" ''
|
||||
#!${pkgs.expect}/bin/expect -f
|
||||
spawn ${pkgs.openssh}/bin/ssh-add
|
||||
expect "Enter passphrase for *:"
|
||||
send "${ssh-passphrase}\n";
|
||||
expect "Identity added: *"
|
||||
interact
|
||||
'');
|
||||
|
||||
programs.ssh.startAgent = true;
|
||||
|
||||
users.users.me.openssh.authorizedKeys.keys = kieran.sshKeys pkgs;
|
||||
|
||||
home-manager.users.me.programs.ssh = {
|
||||
|
||||
Reference in New Issue
Block a user