nixos-configuration/modules/server/default.nix
Vinzenz Schroeter c022eb979b fix ssh
2023-09-11 19:17:32 +02:00

52 lines
849 B
Nix

{
config,
pkgs,
lib,
...
}: let
cfg = config.my.server;
in {
imports = [];
options.my.server = {
enable = lib.mkEnableOption "server role";
};
config = lib.mkIf cfg.enable {
services = {
# Enable the OpenSSH daemon.
openssh = {
enable = true;
settings = {
# PermitRootLogin = "no"; # this is managed through authorized keys
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
};
};
};
programs = {
git.enable = true;
zsh.enable = true;
};
networking.firewall = {
enable = true;
allowedTCPPortRanges = [
{
# ssh
from = 22;
to = 22;
}
];
};
environment = {
systemPackages = with pkgs; [
ncdu
];
};
};
}