nginx: let modules override the nginx derivation

A module that brings cmake needs dontUseCmakeConfigure set on nginx,
which the existing per-module attributes can't express.

Assisted-by: Claude:claude-fable-5-1
This commit is contained in:
Ilan Joselevich
2026-09-21 14:49:16 +02:00
parent bf651830a9
commit 315b3cde54

View File

@@ -68,12 +68,19 @@ let
throw "Module ${mod.name} does not support nginx version ${nginxVersion}!"
);
# Modules can adjust the nginx derivation through passthru.forNginx.
mkDerivation =
args:
lib.foldl (drv: mod: drv.overrideAttrs mod.forNginx) (stdenv.mkDerivation args) (
lib.filter (mod: mod ? forNginx) modules
);
in
assert lib.assertMsg (lib.unique moduleNames == moduleNames)
"nginx: duplicate modules: ${lib.concatStringsSep ", " moduleNames}. A common cause for this is that services.nginx.additionalModules adds a module which the nixos module itself already adds.";
stdenv.mkDerivation {
mkDerivation {
inherit pname version nginxVersion;
outputs = [