From 01c8261de9eed10f17dd5125b355c808b2f2ed1e Mon Sep 17 00:00:00 2001 From: Jack O'Sullivan Date: Thu, 19 Nov 2026 00:09:16 +0000 Subject: [PATCH] nixos: Bump nginx for NGINX2Root fixes Override `nginxStable` and `nginxMainline` to 1.30.7 and 1.31.9 until the pinned channels ship them. OpenResty has no fixed release yet, so disable HTTP/2 on `spoder`'s vhosts in the meantime. Co-Authored-By: Claude Opus 5.5 --- nixos/boxes/kelder/containers/spoder/nginx.nix | 3 ++- nixos/modules/common.nix | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/nixos/boxes/kelder/containers/spoder/nginx.nix b/nixos/boxes/kelder/containers/spoder/nginx.nix index faaf383..6bdb3a2 100644 --- a/nixos/boxes/kelder/containers/spoder/nginx.nix +++ b/nixos/boxes/kelder/containers/spoder/nginx.nix @@ -167,7 +167,8 @@ in onlySSL = mkDefault true; useACMEHost = mkDefault domain; kTLS = mkDefault true; - http2 = mkDefault true; + # TODO: Re-enable once OpenResty ships the NGINX2Root HTTP/2 fixes. + http2 = mkDefault false; }); in mkMerge [ diff --git a/nixos/modules/common.nix b/nixos/modules/common.nix index 0312e02..eacf890 100644 --- a/nixos/modules/common.nix +++ b/nixos/modules/common.nix @@ -91,6 +91,24 @@ in preBuild = (old.preBuild or "") + "\nnpm run postinstall\n"; }); }) + (final: prev: + let + # Bump nginx to a release with the NGINX2Root fixes until every pin ships one. + # TODO: Drop once all channels are past these versions. + bump = pkg: version: hash: + if prev.lib.versionOlder pkg.version version then + pkg.overrideAttrs { + inherit version; + src = final.fetchurl { + url = "https://nginx.org/download/nginx-${version}.tar.gz"; + inherit hash; + }; + } else pkg; + in + { + nginxStable = bump prev.nginxStable "1.30.7" "sha256-JWW1yDcFDpWPcPsPc8SOK8pFQq00n9NW9G+wxyYQvG4="; + nginxMainline = bump prev.nginxMainline "1.31.9" "sha256-oRxe7uLiV/RHjw5kn4SwBAeH0nfS0+UjOVKqa23LgK0="; + }) ]; config = { allowUnfree = true;