{ inputs, config, pkgs, lib, otherHosts, ... }: let forEachOtherHost = f: map f otherHosts; in { services.openssh = { ports = [ 22 ]; settings = { PasswordAuthentication = lib.mkDefault false; AllowUsers = [ config.sidonia.userName ]; UseDns = lib.mkDefault false; X11Forwarding = lib.mkDefault false; PermitRootLogin = lib.mkDefault "no"; }; }; users.users.${config.sidonia.userName}.openssh.authorizedKeys.keys = lib.mkIf config.services.openssh.enable ( lib.concatLists ( forEachOtherHost (remote: with remote.config.sidonia.ssh; lib.optional (pubKey != "") pubKey) ) ); }