diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix index cb914220e4be..0b8bacdc4407 100644 --- a/nixos/tests/all-tests.nix +++ b/nixos/tests/all-tests.nix @@ -1729,6 +1729,10 @@ in imports = [ ./varnish.nix ]; _module.args.package = pkgs.varnish77; }; + varnish80 = runTest { + imports = [ ./varnish.nix ]; + _module.args.package = pkgs.varnish80; + }; vault = runTest ./vault.nix; vault-agent = runTest ./vault-agent.nix; vault-dev = runTest ./vault-dev.nix; diff --git a/pkgs/servers/varnish/default.nix b/pkgs/servers/varnish/default.nix index c60e02ff5963..6d50f051655a 100644 --- a/pkgs/servers/varnish/default.nix +++ b/pkgs/servers/varnish/default.nix @@ -68,26 +68,32 @@ let buildFlags = [ "localstatedir=/var/run" ]; patches = - lib.optionals (stdenv.isDarwin && lib.versionAtLeast version "7.7") [ - # Fix VMOD section attribute on macOS - # Unreleased commit on master - (fetchpatch2 { - url = "https://github.com/varnishcache/varnish-cache/commit/a95399f5b9eda1bfdba6ee6406c30a1ed0720167.patch"; - hash = "sha256-T7DIkmnq0O+Cr9DTJS4/rOtg3J6PloUo8jHMWoUZYYk="; - }) - # Fix endian.h compatibility on macOS - # PR: https://github.com/varnishcache/varnish-cache/pull/4339 - ./patches/0001-fix-endian-h-compatibility-on-macos.patch - ] + lib.optionals + (stdenv.isDarwin && lib.versionAtLeast version "7.7" && lib.versionOlder version "8.0") + [ + # Fix VMOD section attribute on macOS + # Unreleased commit on master + (fetchpatch2 { + url = "https://github.com/varnishcache/varnish-cache/commit/a95399f5b9eda1bfdba6ee6406c30a1ed0720167.patch"; + hash = "sha256-T7DIkmnq0O+Cr9DTJS4/rOtg3J6PloUo8jHMWoUZYYk="; + }) + # Fix endian.h compatibility on macOS + # PR: https://github.com/varnishcache/varnish-cache/pull/4339 + ./patches/0001-fix-endian-h-compatibility-on-macos.patch + ] ++ lib.optionals (stdenv.isDarwin && lib.versionOlder version "7.6") [ # Fix duplicate OS_CODE definitions on macOS # PR: https://github.com/varnishcache/varnish-cache/pull/4347 ./patches/0002-fix-duplicate-os-code-definitions-on-macos.patch ]; - postPatch = '' - substituteInPlace bin/varnishtest/vtc_main.c --replace-fail /bin/rm "${coreutils}/bin/rm" - ''; + postPatch = + lib.optionalString (lib.versionOlder version "8.0") '' + substituteInPlace bin/varnishtest/vtc_main.c --replace-fail /bin/rm "${coreutils}/bin/rm" + '' + + lib.optionalString (lib.versionAtLeast version "8.0") '' + substituteInPlace bin/varnishtest/vtest2/src/vtc_main.c --replace-fail /bin/rm "${coreutils}/bin/rm" + ''; postConfigure = lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' # prevent cache invalidation @@ -144,6 +150,7 @@ let knownVulnerabilities = lib.optionals (lib.versions.major version == "7") [ "VSV00018: https://vinyl-cache.org/security/VSV00018.html" ]; + broken = stdenv.isDarwin && version == "8.0.1"; # https://github.com/NixOS/nixpkgs/issues/495368 }; }; in @@ -158,4 +165,9 @@ in version = "7.7.3"; hash = "sha256-6W7q/Ez+KlWO0vtU8eIr46PZlfRvjADaVF1YOq74AjY="; }; + # EOL 2026-09-15 + varnish80 = common { + version = "8.0.1"; + hash = "sha256-n1oi1YrNvqw3GhY9683TYSG+XuS8hKoYfrfNDDGP5oI="; + }; } diff --git a/pkgs/servers/varnish/modules.nix b/pkgs/servers/varnish/modules.nix index fbbaea22e679..3dc5943fb152 100644 --- a/pkgs/servers/varnish/modules.nix +++ b/pkgs/servers/varnish/modules.nix @@ -22,7 +22,7 @@ let src = fetchFromGitHub { owner = "varnish"; repo = "varnish-modules"; - rev = version; + tag = version; inherit hash; }; @@ -59,4 +59,8 @@ in version = "0.26.0"; hash = "sha256-xKMOkqm6/GoBve0AhPqyVMQv/oh5Rtj6uCeg/yId7BU="; }; + modules27 = common { + version = "0.27.0"; + hash = "sha256-1hE+AKsC6Td+Al7LFN6bgPicU8dtWd3A8PP7VKZLvYM="; + }; } diff --git a/pkgs/servers/varnish/packages.nix b/pkgs/servers/varnish/packages.nix index 2ba8bc689fcd..7167ca143741 100644 --- a/pkgs/servers/varnish/packages.nix +++ b/pkgs/servers/varnish/packages.nix @@ -3,6 +3,7 @@ callPackage, varnish60, varnish77, + varnish80, lib, }: { @@ -24,4 +25,8 @@ varnish = varnish77; modules = (callPackages ./modules.nix { inherit varnish; }).modules26; }; + varnish80Packages = lib.recurseIntoAttrs rec { + varnish = varnish80; + modules = (callPackages ./modules.nix { inherit varnish; }).modules27; + }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c8c01ff0d16a..f5dbf691ed61 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -3600,10 +3600,12 @@ with pkgs; inherit (callPackages ../servers/varnish { }) varnish60 varnish77 + varnish80 ; inherit (callPackages ../servers/varnish/packages.nix { }) varnish60Packages varnish77Packages + varnish80Packages ; varnishPackages = varnish77Packages; varnish = varnishPackages.varnish;