Commit aff9432b authored by Raphael Robatsch's avatar Raphael Robatsch
Browse files

uwsgi, nixos/librespeed: Replace lib.elem with lib.any for predicate matching

`lib.elem` can only be used for searching for an exact element in a
list. In these two cases, we're matching on the `name` property however,
so we have to use `lib.any` instead. See
https://github.com/NixOS/nixpkgs/commit/4160763d74f6ec3618dccd101ea299161290650d.

Fixes https://hydra.nixos.org/build/311475077
parent 650fadd8
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -338,10 +338,10 @@ in
                proxy_buffering off;
                proxy_request_buffering off;
              ''
              + lib.optionalString (lib.elem "brotli" config.services.nginx.additionalModules) ''
              + lib.optionalString (lib.any (m: m.name == "brotli") config.services.nginx.additionalModules) ''
                brotli off;
              ''
              + lib.optionalString (lib.elem "zstd" config.services.nginx.additionalModules) ''
              + lib.optionalString (lib.any (m: m.name == "zstd") config.services.nginx.additionalModules) ''
                zstd off;
              '';
            };
+2 −2
Original line number Diff line number Diff line
@@ -145,7 +145,7 @@ stdenv.mkDerivation (finalAttrs: {

  # this is a hack to make the php plugin link with session.so (which on nixos is a separate package)
  # the hack works in coordination with ./additional-php-ldflags.patch
  UWSGICONFIG_PHP_LDFLAGS = lib.optionalString (lib.elem "php" needed) (
  UWSGICONFIG_PHP_LDFLAGS = lib.optionalString (lib.any (x: x.name == "php") needed) (
    lib.concatStringsSep "," [
      "-Wl"
      "-rpath=${php-embed.extensions.session}/lib/php/extensions/"
@@ -176,7 +176,7 @@ stdenv.mkDerivation (finalAttrs: {
    runHook postInstall
  '';

  postFixup = lib.optionalString (lib.elem "php" needed) ''
  postFixup = lib.optionalString (lib.any (x: x.name == "php") needed) ''
    wrapProgram $out/bin/uwsgi --set PHP_INI_SCAN_DIR ${php-embed}/lib
  '';