1
0
mirror of https://github.com/kmein/niveum synced 2026-03-16 10:11:08 +01:00

feat: reenable ssh agent, gpg did not work

This commit is contained in:
2022-12-17 10:03:00 +01:00
parent bc8a035451
commit 547d59ee2c
2 changed files with 12 additions and 3 deletions

View File

@@ -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;
};
};

View File

@@ -7,7 +7,19 @@
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 = {