fix: add ssh keys to agent for all hosts
This commit is contained in:
@@ -18,20 +18,25 @@ in
|
||||
enable = true;
|
||||
enableDefaultConfig = false;
|
||||
|
||||
matchBlocks = lib.genAttrs hostsWithKeys (
|
||||
matchBlocks =
|
||||
lib.genAttrs hostsWithKeys (
|
||||
hostname:
|
||||
let
|
||||
hostConfig = outputs.nixosConfigurations.${hostname}.config;
|
||||
publicHostname = hostConfig.ssh.publicHostname;
|
||||
targetUser = hostConfig.ssh.username;
|
||||
inherit (hostConfig.ssh) publicHostname username;
|
||||
in
|
||||
{
|
||||
host = hostname;
|
||||
user = targetUser;
|
||||
user = username;
|
||||
}
|
||||
// lib.optionalAttrs (publicHostname != "") {
|
||||
hostname = publicHostname;
|
||||
}
|
||||
);
|
||||
)
|
||||
// {
|
||||
"*" = {
|
||||
addKeysToAgent = "yes";
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user