I’m new to Nix and I took my quite some time to figure out how to use an Nginx module.
my suggestion is to add an example, like this:
services.nginx = {
enable = true;
user = "root"; # to allow PAM authentication via /etc/shadow
package = (pkgs.nginx.override { modules = [ pkgs.nginxModules.pam ]; });
...
};
in the nginx chapter of the documentation