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