2024-08-02 22:32:29 -04:00
|
|
|
{
|
|
|
|
config,
|
|
|
|
lib,
|
|
|
|
...
|
|
|
|
}: let
|
2024-11-22 23:25:38 -05:00
|
|
|
inherit (lib) mkForce mkIf;
|
2024-08-02 22:32:29 -04:00
|
|
|
|
|
|
|
cfg = config.roles.server;
|
|
|
|
in {
|
|
|
|
config = mkIf cfg.sshd.enable {
|
|
|
|
services = {
|
|
|
|
openssh = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
PasswordAuthentication = false;
|
2024-11-22 23:25:38 -05:00
|
|
|
PermitRootLogin = mkForce "no";
|
2024-08-02 22:32:29 -04:00
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
users.users.${cfg.user} = {
|
|
|
|
openssh.authorizedKeys.keys = [
|
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPE39uk52+NIDLdHeoSHIEsOUUFRzj06AGn09z4TUOYm matt@OP9"
|
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAICr2+CpqXNMLsjgbrYyIwTKhlVSiIYol1ghBPzLmUpKl matt@binto"
|
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJGbLu+Gb7PiyNgNXMHemaQLnKixebx1/4cdJGna9OQp matt@wim"
|
2024-08-18 23:01:08 -04:00
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAII1bYbOemBJHjm5onaRE52YvGiTAr+bS0l4tCjXSXud9 matt@servivi"
|
2024-08-02 22:32:29 -04:00
|
|
|
];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
# For accurate stack trace
|
|
|
|
_file = ./sshd.nix;
|
|
|
|
}
|