This commit is contained in:
jacekpoz 2024-03-03 02:25:43 +01:00
parent 961deb964c
commit cd8f5e7778

View file

@ -76,18 +76,22 @@ in {
};
})
(mkIf cfg.agent.enable {
programs.ssh.extraConfig = ''
AddKeysToAgent yes
programs.ssh = {
enableAskPassword = true;
askPassword = "${pkgs.libsForQt5.ksshaskpass}/bin/ksshaskpass";
extraConfig = ''
AddKeysToAgent yes
${concatStrings (mapAttrsToList (name: value: ''
Host ${name}
HostName ${value.hostName}
${if value.port != null then "Port ${toString value.port}" else ""}
User ${value.user}
IdentityFile ${value.identityFile}
IdentitiesOnly ${if value.identitiesOnly then "yes" else "no"}
'') cfg.agent.hostAliases)}
'';
${concatStrings (mapAttrsToList (name: value: ''
Host ${name}
HostName ${value.hostName}
${if value.port != null then "Port ${toString value.port}" else ""}
User ${value.user}
IdentityFile ${value.identityFile}
IdentitiesOnly ${if value.identitiesOnly then "yes" else "no"}
'') cfg.agent.hostAliases)}
'';
};
systemd.user.services.ssh-agent = {
enable = true;