update: modularize users, pam, gnupg, openssh

This commit is contained in:
Veneficium 2024-08-14 21:40:54 +02:00
parent 15d7453ff2
commit b708969576
9 changed files with 113 additions and 73 deletions

View file

@ -0,0 +1,22 @@
{ config, lib, ... }: {
options.settings = {
services.openssh.enable = lib.mkEnableOption "enable openSSH";
services.openssh.usePAM = lib.mkEnableOption "use PAM for ssh authentication";
};
#further move these options into settings
config = lib.mkIf config.settings.services.openssh.enable {
services.openssh = {
enable = true;
ports = [ 12342 ];
settings = {
UsePAM = config.settings.services.openssh.usePAM;
PasswordAuthentication = true;
AllowUsers = null;
X11Forwarding = false;
PermitRootLogin = "prohibit-password";
};
};
};
}