rp5: move things in separate configs, to be reused

This commit is contained in:
Christoph Hollizeck 2024-11-25 23:02:09 +01:00
parent ac0fd3094c
commit 09a34fac3f
Signed by: Daholli
GPG key ID: 249300664F2AF2C7
4 changed files with 92 additions and 67 deletions

View file

@ -0,0 +1,29 @@
{
lib,
config,
namespace,
...
}:
let
cfg = config.${namespace}.services.openssh;
inherit (lib) mkIf mkEnableOption;
in
{
options.${namespace}.services.openssh = {
enable = mkEnableOption "Enable SSH";
};
config = mkIf cfg.enable {
services.openssh = {
enable = true;
settings = {
PasswordAuthentication = false;
KbdInteractiveAuthentication = false;
};
};
services.fail2ban = {
enable = true;
};
};
}