update: modularize users, pam, gnupg, openssh
This commit is contained in:
parent
15d7453ff2
commit
b708969576
9 changed files with 113 additions and 73 deletions
16
nixosModules/services/pam.nix
Normal file
16
nixosModules/services/pam.nix
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{ config, lib, ... }: {
|
||||
options.settings = {
|
||||
services.pam.enable = lib.mkEnableOption "enables PAM";
|
||||
services.pam.sshd.useGoogleAuth = lib.mkEnableOption "use pam_google_authenticator.so module";
|
||||
services.pam.sshd.gnupg = lib.mkEnableOption "enable gnuPG integration";
|
||||
};
|
||||
|
||||
security.pam = lib.mkIf config.settings.services.pam.enable {
|
||||
services.sshd = {
|
||||
name = "sshd";
|
||||
unixAuth = true;
|
||||
googleAuthenticator.enable = config.settings.services.pam.sshd.useGoogleAuth;
|
||||
gnupg.enable = config.settings.services.pam.sshd.gnupg;
|
||||
};
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue