chore: refactor system modules

This commit is contained in:
2025-07-05 00:02:39 +02:00
parent d64caa86ec
commit 15a39660eb
56 changed files with 549 additions and 475 deletions

30
system/services/ssh.nix Normal file
View File

@@ -0,0 +1,30 @@
{
lib,
config,
...
}:
with lib; let
cfg = config.system.services.ssh;
in {
options.system.services.ssh = {
enable = mkEnableOption "Enables OpenSSH";
allowedUsers = mkOption {
type = types.listOf types.str;
example = ["alice" "bob"];
default = ["phundrak"];
};
passwordAuthentication = mkOption {
type = types.bool;
example = true;
default = false;
};
};
config.services.openssh = mkIf cfg.enable {
inherit (cfg) enable;
settings = {
AllowUsers = cfg.allowedUsers;
PermitRootLogin = "no";
PasswordAuthentication = cfg.passwordAuthentication;
};
};
}