···11+# This module provides configuration for the OATH PAM modules.
22+33+{ config, lib, pkgs, ... }:
44+55+with lib;
66+77+{
88+ options = {
99+1010+ security.pam.oath = {
1111+ enable = mkOption {
1212+ type = types.bool;
1313+ default = false;
1414+ description = ''
1515+ Enable the OATH (one-time password) PAM module.
1616+ '';
1717+ };
1818+1919+ digits = mkOption {
2020+ type = types.enum [ 6 7 8 ];
2121+ default = 6;
2222+ description = ''
2323+ Specify the length of the one-time password in number of
2424+ digits.
2525+ '';
2626+ };
2727+2828+ window = mkOption {
2929+ type = types.int;
3030+ default = 5;
3131+ description = ''
3232+ Specify the number of one-time passwords to check in order
3333+ to accommodate for situations where the system and the
3434+ client are slightly out of sync (iteration for HOTP or time
3535+ steps for TOTP).
3636+ '';
3737+ };
3838+3939+ usersFile = mkOption {
4040+ type = types.path;
4141+ default = "/etc/users.oath";
4242+ description = ''
4343+ Set the path to file where the user's credentials are
4444+ stored. This file must not be world readable!
4545+ '';
4646+ };
4747+ };
4848+4949+ };
5050+}