2024-10-01 09:46:18 +04:00
|
|
|
{ config, lib, ... }:
|
|
|
|
with lib;
|
|
|
|
let cfg = config.modules.server;
|
2024-04-03 16:50:45 +04:00
|
|
|
in {
|
2024-10-01 09:46:18 +04:00
|
|
|
imports = [ ];
|
2024-04-03 16:50:45 +04:00
|
|
|
|
2024-10-01 09:46:18 +04:00
|
|
|
options.modules.server = { isServer = mkEnableOption false; };
|
2024-04-03 16:50:45 +04:00
|
|
|
|
|
|
|
config = mkIf cfg.isServer {
|
|
|
|
# we need this if you say otherwise ill throw you
|
|
|
|
# into a wall
|
|
|
|
services.openssh = {
|
|
|
|
enable = true;
|
|
|
|
settings = {
|
|
|
|
# disable this NEVER enable it
|
|
|
|
PermitRootLogin = "no";
|
|
|
|
# its so easy to use keys your grandmother could use it
|
|
|
|
PasswordAuthentication = false;
|
2024-10-01 09:46:18 +04:00
|
|
|
ports = [ 69 ];
|
2024-04-03 16:50:45 +04:00
|
|
|
openFirewall = true;
|
|
|
|
};
|
|
|
|
};
|
2024-10-01 09:46:18 +04:00
|
|
|
|
|
|
|
users.users.sako.openssh.authorizedKeys.keys = [
|
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIPGAwG2Fqs3xNF/6/9GdznH/jUIqxW3aTYvmteuq9odZ sako@sakotop"
|
2024-12-12 16:48:14 +04:00
|
|
|
"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDjPSt4TykAJgafU9Trk7sr9wzXhBZxawDIZir0CPyDN sako@sakopc"
|
2024-10-01 09:46:18 +04:00
|
|
|
];
|
2024-04-03 16:50:45 +04:00
|
|
|
};
|
2023-07-30 20:54:50 +04:00
|
|
|
}
|