@@ -115,6 +115,16 @@ in
115115 '';
116116 };
117117
118+ agentPKCS11Whitelist = mkOption {
119+ type = types.nullOr types.str;
120+ default = null;
121+ example = "\${pkgs.opensc}/lib/opensc-pkcs11.so";
122+ description = ''
123+ A pattern-list of acceptable paths for PKCS#11 shared libraries
124+ that may be used with the -s option to ssh-add.
125+ '';
126+ };
127+
118128 package = mkOption {
119129 type = types.package;
120130 default = pkgs.openssh;
@@ -241,6 +251,7 @@ in
241251 ExecStart =
242252 "${cfg.package}/bin/ssh-agent " +
243253 optionalString (cfg.agentTimeout != null) ("-t ${cfg.agentTimeout} ") +
254+ optionalString (cfg.agentPKCS11Whitelist != null) ("-P ${cfg.agentPKCS11Whitelist} ")
244255 "-a %t/ssh-agent";
245256 StandardOutput = "null";
246257 Type = "forking";