diff options
| author | Dennis Kobert <dennis@kobert.dev> | 2026-03-10 20:39:54 +0100 |
|---|---|---|
| committer | Dennis Kobert <dennis@kobert.dev> | 2026-03-10 20:39:54 +0100 |
| commit | 3341e1e694ad64c12055c42008c4927c327950de (patch) | |
| tree | 15a9ddbdcd7a4d64fb5263fac9b9653e210b7819 /flake.nix | |
| parent | 334625d069b0adf9d046703daf20215bbc83bc4e (diff) | |
Support config file path, add NixOS module with mode option
Diffstat (limited to 'flake.nix')
| -rw-r--r-- | flake.nix | 14 |
1 files changed, 10 insertions, 4 deletions
@@ -18,15 +18,21 @@ cfg = config.security.pam-any; pam-any = self.packages.${pkgs.stdenv.hostPlatform.system}.default; - pamAnyConfig = builtins.toJSON { - mode = "One"; + pamAnyConfigFile = pkgs.writeText "pam-any-config.json" (builtins.toJSON { + mode = cfg.mode; modules = cfg.modules; - }; + }); in { options.security.pam-any = { enable = lib.mkEnableOption "pam-any parallel authentication"; + mode = lib.mkOption { + type = lib.types.enum [ "One" "All" ]; + default = "One"; + description = "\"One\" succeeds if any module succeeds, \"All\" requires all to succeed."; + }; + modules = lib.mkOption { type = lib.types.attrsOf lib.types.str; default = { @@ -64,7 +70,7 @@ order = cfg.order; control = "sufficient"; modulePath = "${pam-any}/lib/security/pam_any.so"; - args = [ pamAnyConfig ]; + args = [ "${pamAnyConfigFile}" ]; }; }); }; |
