From bc8a035451bfec6f69ab9b0be687eeefe349e1bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Tue, 13 Dec 2022 14:38:14 +0100 Subject: [PATCH] feat(gpg): use for ssh, increase ttl --- configs/default.nix | 12 +++++++++++- configs/ssh.nix | 12 ------------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/configs/default.nix b/configs/default.nix index ce7d950..531afaf 100644 --- a/configs/default.nix +++ b/configs/default.nix @@ -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 diff --git a/configs/ssh.nix b/configs/ssh.nix index c735b27..d7ebd81 100644 --- a/configs/ssh.nix +++ b/configs/ssh.nix @@ -7,19 +7,7 @@ inherit (import ) sshPort kieran; externalNetwork = import ; sshIdentity = name: "${config.users.users.me.home}/.ssh/${name}"; - ssh-passphrase = lib.strings.fileContents ; 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 = {