From 547d59ee2c95f0826cd44528bf95768a783d6109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kier=C3=A1n=20Meinhardt?= Date: Sat, 17 Dec 2022 10:03:00 +0100 Subject: [PATCH] feat: reenable ssh agent, gpg did not work --- configs/default.nix | 3 --- configs/ssh.nix | 12 ++++++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/configs/default.nix b/configs/default.nix index 531afaf..d8dcaed 100644 --- a/configs/default.nix +++ b/configs/default.nix @@ -189,12 +189,9 @@ in { 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; }; }; diff --git a/configs/ssh.nix b/configs/ssh.nix index d7ebd81..c735b27 100644 --- a/configs/ssh.nix +++ b/configs/ssh.nix @@ -7,7 +7,19 @@ 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 = {