From 65580eea00b47b4171b68dba52ade898d139dd85 Mon Sep 17 00:00:00 2001 From: Artemis Tosini Date: Tue, 7 Jan 2025 23:49:49 +0000 Subject: [PATCH] nginx: Fix cross-OS build nginx uses uname to find the target platform by default. This works fine when building locally or when building on the same OS for most architectures, but breaks when building e.g. Linux to BSD. Explicitly tell the target to the configure script instead. --- pkgs/servers/http/nginx/generic.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/servers/http/nginx/generic.nix b/pkgs/servers/http/nginx/generic.nix index 3f4933500f7b..bc35c18bf402 100644 --- a/pkgs/servers/http/nginx/generic.nix +++ b/pkgs/servers/http/nginx/generic.nix @@ -170,6 +170,9 @@ stdenv.mkDerivation { [ "--with-http_geoip_module" ] ++ lib.optional withStream "--with-stream_geoip_module" ) ++ lib.optional (with stdenv.hostPlatform; isLinux || isFreeBSD) "--with-file-aio" + ++ lib.optional ( + stdenv.buildPlatform != stdenv.hostPlatform + ) "--crossbuild=${stdenv.hostPlatform.uname.system}::${stdenv.hostPlatform.uname.processor}" ++ configureFlags ++ map (mod: "--add-module=${mod.src}") modules;