config/modules/base/sshd/default.nix

22 lines
434 B
Nix
Raw Normal View History

2023-04-14 14:12:45 +03:00
{
config,
lib,
myData,
...
}: {
config = {
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
};
};
programs.mosh.enable = true;
2023-07-24 12:31:06 +03:00
programs.ssh.knownHosts = let
2023-09-30 17:06:41 +03:00
sshAttrs = lib.genAttrs ["extraHostNames" "publicKey"] (_: null);
2023-07-24 12:31:06 +03:00
in
2023-10-01 23:14:05 +03:00
lib.mapAttrs (_name: builtins.intersectAttrs sshAttrs) myData.hosts;
2023-04-14 14:12:45 +03:00
};
}