initial commit

This commit is contained in:
2025-05-12 23:25:39 -03:00
parent bf178e3caa
commit dc6f6894e6
95 changed files with 3922 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
{
config,
...
}:
let
# FIXME(starter): if you are not defining ports in your "soft" nix-secrets, you can
# replace the following line with: sshPort = 22;
# and substitute 22 with a custom port number if needed.
sshPort = 22;
in
{
services.openssh = {
enable = true;
ports = [ sshPort ];
settings = {
# Harden
PasswordAuthentication = false;
PermitRootLogin = "no";
# Automatically remove stale sockets
StreamLocalBindUnlink = "yes";
# Allow forwarding ports to everywhere
GatewayPorts = "clientspecified";
};
hostKeys = [
{
path = "/etc/ssh/ssh_host_ed25519_key";
type = "ed25519";
}
];
};
networking.firewall.allowedTCPPorts = [ sshPort ];
}