Files
config/modules/base/sshd/default.nix
2025-12-01 10:49:47 +00:00

33 lines
685 B
Nix

{
lib,
myData,
...
}:
{
config = {
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
PermitRootLogin = "no";
};
};
programs.mosh.enable = true;
programs.ssh = {
knownHosts =
let
filtered = lib.filterAttrs (_key: value: lib.hasAttr "publicKey" value) myData.hosts;
sshAttrs = lib.genAttrs [
"extraHostNames"
"publicKey"
] (_: null);
in
lib.mapAttrs (_name: builtins.intersectAttrs sshAttrs) filtered;
extraConfig = ''
Host git.jakstys.lt
HostName fwminex.jakst.vpn
'';
};
};
}