aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/nixos/modules/security/oath.nix
diff options
context:
space:
mode:
authorKatharina Fey <kookie@spacekookie.de>2019-10-05 12:43:18 +0000
committerKatharina Fey <kookie@spacekookie.de>2019-10-05 12:44:52 +0000
commitcf85056ba64caf3267d43255ef4a1243e9c8ee3b (patch)
tree3051519e9c8275b870aac43f80af875715c9d124 /nixpkgs/nixos/modules/security/oath.nix
parent1148b1d122bc03e9a3665856c9b7bb96bd4e3994 (diff)
parent2436c27541b2f52deea3a4c1691216a02152e729 (diff)
Add 'nixpkgs/' from commit '2436c27541b2f52deea3a4c1691216a02152e729'
git-subtree-dir: nixpkgs git-subtree-mainline: 1148b1d122bc03e9a3665856c9b7bb96bd4e3994 git-subtree-split: 2436c27541b2f52deea3a4c1691216a02152e729
Diffstat (limited to 'nixpkgs/nixos/modules/security/oath.nix')
-rw-r--r--nixpkgs/nixos/modules/security/oath.nix50
1 files changed, 50 insertions, 0 deletions
diff --git a/nixpkgs/nixos/modules/security/oath.nix b/nixpkgs/nixos/modules/security/oath.nix
new file mode 100644
index 00000000000..93bdc851117
--- /dev/null
+++ b/nixpkgs/nixos/modules/security/oath.nix
@@ -0,0 +1,50 @@
+# This module provides configuration for the OATH PAM modules.
+
+{ lib, ... }:
+
+with lib;
+
+{
+ options = {
+
+ security.pam.oath = {
+ enable = mkOption {
+ type = types.bool;
+ default = false;
+ description = ''
+ Enable the OATH (one-time password) PAM module.
+ '';
+ };
+
+ digits = mkOption {
+ type = types.enum [ 6 7 8 ];
+ default = 6;
+ description = ''
+ Specify the length of the one-time password in number of
+ digits.
+ '';
+ };
+
+ window = mkOption {
+ type = types.int;
+ default = 5;
+ description = ''
+ Specify the number of one-time passwords to check in order
+ to accommodate for situations where the system and the
+ client are slightly out of sync (iteration for HOTP or time
+ steps for TOTP).
+ '';
+ };
+
+ usersFile = mkOption {
+ type = types.path;
+ default = "/etc/users.oath";
+ description = ''
+ Set the path to file where the user's credentials are
+ stored. This file must not be world readable!
+ '';
+ };
+ };
+
+ };
+}