Commit 814ade802c65
Changed files (1)
home
common
shell
home/common/shell/openssh.nix
@@ -54,12 +54,27 @@ in
"*.redhat.com".identityFile = "~/.ssh/id_ed25519_sk";
};
# Special case for aomi and okinawa: no FIDO2 homelab key, use regular ed25519
- nonFido2Overrides = lib.optionalAttrs (isAomi || isOkinawa) {
- "kerkouane.vpn" = {
- identityFile = "~/.ssh/id_ed25519";
- identitiesOnly = true;
- };
- };
+ # Override all homelab machine entries (generated by libx.sshConfigs and shpool aliases)
+ nonFido2Overrides =
+ let
+ # Get all host identifiers from all machines
+ allHostIds = lib.flatten (
+ lib.attrValues (
+ builtins.mapAttrs (
+ _: machine:
+ builtins.filter (
+ x: (lib.hasSuffix ".home" x) || (lib.hasSuffix ".vpn" x) || (lib.hasSuffix ".sbr.pm" x)
+ ) (libx.sshHostIdentifier machine)
+ ) globals.machines
+ )
+ );
+ # Override both the host entry and its shpool alias
+ mkOverride = id: lib.nameValuePair id { identityFile = "~/.ssh/id_ed25519"; };
+ mkShpoolOverride = id: lib.nameValuePair "${id}/*" { identityFile = "~/.ssh/id_ed25519"; };
+ in
+ lib.optionalAttrs (isAomi || isOkinawa) (
+ builtins.listToAttrs (map mkOverride allHostIds ++ map mkShpoolOverride allHostIds)
+ );
in
lib.recursiveUpdate
(