diff --git a/nixos/modules/config/i18n.nix b/nixos/modules/config/i18n.nix index 1e6c35a4ea31..6d8a7289b238 100644 --- a/nixos/modules/config/i18n.nix +++ b/nixos/modules/config/i18n.nix @@ -30,12 +30,12 @@ in glibcLocales = lib.mkOption { type = lib.types.path; default = pkgs.glibcLocales.override { - allLocales = lib.any (x: x == "all") config.i18n.supportedLocales; + allLocales = lib.elem "all" config.i18n.supportedLocales; locales = config.i18n.supportedLocales; }; defaultText = lib.literalExpression '' pkgs.glibcLocales.override { - allLocales = lib.any (x: x == "all") config.i18n.supportedLocales; + allLocales = lib.elem "all" config.i18n.supportedLocales; locales = config.i18n.supportedLocales; } ''; @@ -149,7 +149,7 @@ in ( !( (lib.subtractLists config.i18n.supportedLocales aggregatedLocales) == [ ] - || lib.any (x: x == "all") config.i18n.supportedLocales + || lib.elem "all" config.i18n.supportedLocales ) ) '' diff --git a/nixos/modules/services/audio/mpdscribble.nix b/nixos/modules/services/audio/mpdscribble.nix index 967853ffc85c..39dab7105968 100644 --- a/nixos/modules/services/audio/mpdscribble.nix +++ b/nixos/modules/services/audio/mpdscribble.nix @@ -130,7 +130,7 @@ in passwordFile = lib.mkOption { default = if localMpd then - (lib.findFirst (c: lib.any (x: x == "read") c.permissions) { + (lib.findFirst (c: lib.elem "read" c.permissions) { passwordFile = null; } mpdCfg.credentials).passwordFile else diff --git a/nixos/modules/services/monitoring/prometheus/exporters/node.nix b/nixos/modules/services/monitoring/prometheus/exporters/node.nix index c543ac9a206e..2c4a82f0e044 100644 --- a/nixos/modules/services/monitoring/prometheus/exporters/node.nix +++ b/nixos/modules/services/monitoring/prometheus/exporters/node.nix @@ -13,11 +13,11 @@ let types concatStringsSep concatMapStringsSep - any + elem optionals ; - collectorIsEnabled = final: any (collector: (final == collector)) cfg.enabledCollectors; - collectorIsDisabled = final: any (collector: (final == collector)) cfg.disabledCollectors; + collectorIsEnabled = final: elem final cfg.enabledCollectors; + collectorIsDisabled = final: elem final cfg.disabledCollectors; in { port = 9100; diff --git a/nixos/modules/services/networking/ifstate.nix b/nixos/modules/services/networking/ifstate.nix index ddd95d33d131..41997a039ec0 100644 --- a/nixos/modules/services/networking/ifstate.nix +++ b/nixos/modules/services/networking/ifstate.nix @@ -198,7 +198,7 @@ in { assertion = initrdCfg.package.passthru.features.withWireguard - || !(builtins.any (kind: kind == "wireguard") initrdInterfaceTypes); + || !(builtins.elem "wireguard" initrdInterfaceTypes); message = "IfState initrd package is configured without the `wireguard` feature, but wireguard interfaces are configured. Please see the `boot.initrd.network.ifstate.package` option."; } { diff --git a/nixos/modules/services/web-apps/dolibarr.nix b/nixos/modules/services/web-apps/dolibarr.nix index 0a669ccad2a7..2ed5bbccd6e2 100644 --- a/nixos/modules/services/web-apps/dolibarr.nix +++ b/nixos/modules/services/web-apps/dolibarr.nix @@ -6,9 +6,9 @@ }: let inherit (lib) - any boolToString concatStringsSep + elem isBool isString mapAttrsToList @@ -46,7 +46,7 @@ let toStr = k: v: - if (any (str: k == str) secretKeys) then + if (elem k secretKeys) then v else if isString v then "'${v}'" diff --git a/nixos/modules/services/web-apps/librespeed.nix b/nixos/modules/services/web-apps/librespeed.nix index 1ffc382a3d8e..2f7658339751 100644 --- a/nixos/modules/services/web-apps/librespeed.nix +++ b/nixos/modules/services/web-apps/librespeed.nix @@ -338,10 +338,10 @@ in proxy_buffering off; proxy_request_buffering off; '' - + lib.optionalString (lib.any (m: m.name == "brotli") config.services.nginx.additionalModules) '' + + lib.optionalString (lib.elem "brotli" config.services.nginx.additionalModules) '' brotli off; '' - + lib.optionalString (lib.any (m: m.name == "zstd") config.services.nginx.additionalModules) '' + + lib.optionalString (lib.elem "zstd" config.services.nginx.additionalModules) '' zstd off; ''; }; diff --git a/nixos/modules/system/boot/kernel_config.nix b/nixos/modules/system/boot/kernel_config.nix index 8ca9c96006a4..2cf34e899cae 100644 --- a/nixos/modules/system/boot/kernel_config.nix +++ b/nixos/modules/system/boot/kernel_config.nix @@ -6,7 +6,7 @@ let locs: defs: if defs == [ ] then abort "This case should never happen." - else if any (x: x == false) (getValues defs) then + else if elem false (getValues defs) then false else true; diff --git a/nixos/tests/kubernetes/base.nix b/nixos/tests/kubernetes/base.nix index ff943ef17763..8a6756b8f9e5 100644 --- a/nixos/tests/kubernetes/base.nix +++ b/nixos/tests/kubernetes/base.nix @@ -18,9 +18,7 @@ let }: let masterName = head ( - filter (machineName: any (role: role == "master") machines.${machineName}.roles) ( - attrNames machines - ) + filter (machineName: lib.elem "master" machines.${machineName}.roles) (attrNames machines) ); master = machines.${masterName}; extraHosts = '' diff --git a/nixos/tests/sftpgo.nix b/nixos/tests/sftpgo.nix index c2090c8bb180..6d18c1c5581f 100644 --- a/nixos/tests/sftpgo.nix +++ b/nixos/tests/sftpgo.nix @@ -25,7 +25,7 @@ let groupName: # users.users attrset user: - lib.any (x: x == user.name) config.users.groups.${groupName}.members; + lib.elem user.name config.users.groups.${groupName}.members; # Generates a valid SFTPGo user configuration for a given user # Will be converted to JSON and loaded on application startup. diff --git a/pkgs/applications/audio/zynaddsubfx/default.nix b/pkgs/applications/audio/zynaddsubfx/default.nix index da5abd1baccb..9cde53585717 100644 --- a/pkgs/applications/audio/zynaddsubfx/default.nix +++ b/pkgs/applications/audio/zynaddsubfx/default.nix @@ -48,7 +48,7 @@ ctestCheckHook, }: -assert builtins.any (g: guiModule == g) [ +assert builtins.elem guiModule [ "fltk" "ntk" "zest" diff --git a/pkgs/applications/editors/jupyter/kernel.nix b/pkgs/applications/editors/jupyter/kernel.nix index 4496b943997b..2a72d84c47f7 100644 --- a/pkgs/applications/editors/jupyter/kernel.nix +++ b/pkgs/applications/editors/jupyter/kernel.nix @@ -62,7 +62,7 @@ in "logo64" "extraPaths" ]; - kernel = lib.filterAttrs (n: v: (lib.any (x: x == n) allowedKernelKeys)) unfilteredKernel; + kernel = lib.filterAttrs (n: v: (lib.elem n allowedKernelKeys)) unfilteredKernel; config = builtins.toJSON ( kernel // { diff --git a/pkgs/by-name/ca/calibre/package.nix b/pkgs/by-name/ca/calibre/package.nix index eaad1cb706c1..157633ae5fa7 100644 --- a/pkgs/by-name/ca/calibre/package.nix +++ b/pkgs/by-name/ca/calibre/package.nix @@ -142,14 +142,12 @@ stdenv.mkDerivation (finalAttrs: { # the following are distributed with calibre, but we use upstream instead odfpy ] - ++ - lib.optionals (lib.lists.any (p: p == stdenv.hostPlatform.system) pyqt6-webengine.meta.platforms) - [ - # much of calibre's functionality is usable without a web - # browser, so we enable building on platforms which qtwebengine - # does not support by simply omitting qtwebengine. - pyqt6-webengine - ] + ++ lib.optionals (lib.lists.elem stdenv.hostPlatform.system pyqt6-webengine.meta.platforms) [ + # much of calibre's functionality is usable without a web + # browser, so we enable building on platforms which qtwebengine + # does not support by simply omitting qtwebengine. + pyqt6-webengine + ] ++ lib.optional unrarSupport unrardll )) piper-tts diff --git a/pkgs/by-name/di/distrho-ports/package.nix b/pkgs/by-name/di/distrho-ports/package.nix index f0271b3555ad..366b6960f415 100644 --- a/pkgs/by-name/di/distrho-ports/package.nix +++ b/pkgs/by-name/di/distrho-ports/package.nix @@ -52,7 +52,7 @@ stdenv.mkDerivation { env.NIX_CFLAGS_COMPILE = toString [ "-fpermissive" ]; - postFixup = lib.optionalString (lib.any (x: x == "vitalium") plugins || plugins == [ ]) '' + postFixup = lib.optionalString (lib.elem "vitalium" plugins || plugins == [ ]) '' for file in \ $out/lib/lv2/vitalium.lv2/vitalium.so \ $out/lib/vst/vitalium.so \ diff --git a/pkgs/by-name/in/inspircd/package.nix b/pkgs/by-name/in/inspircd/package.nix index 6245b34a2a7d..1980e8707107 100644 --- a/pkgs/by-name/in/inspircd/package.nix +++ b/pkgs/by-name/in/inspircd/package.nix @@ -24,7 +24,7 @@ let # libcs in nixpkgs (musl and glibc). compatible = lib: drv: - lib.any (lic: lic == (drv.meta.license or { })) [ + lib.elem (drv.meta.license or { }) [ lib.licenses.mit # musl lib.licenses.lgpl2Plus # glibc ]; diff --git a/pkgs/by-name/li/libvgm/package.nix b/pkgs/by-name/li/libvgm/package.nix index 6c39efabcb72..d500f0d9a8e5 100644 --- a/pkgs/by-name/li/libvgm/package.nix +++ b/pkgs/by-name/li/libvgm/package.nix @@ -106,9 +106,7 @@ stdenv.mkDerivation (finalAttrs: { description = "More modular rewrite of most components from VGMPlay"; homepage = "https://github.com/ValleyBell/libvgm"; license = - if - (enableEmulation && (withAllEmulators || (lib.lists.any (core: core == "WSWAN_ALL") emulators))) - then + if (enableEmulation && (withAllEmulators || (lib.lists.elem "WSWAN_ALL" emulators))) then lib.licenses.unfree # https://github.com/ValleyBell/libvgm/issues/43 else lib.licenses.gpl2Only; diff --git a/pkgs/by-name/ot/otb/package.nix b/pkgs/by-name/ot/otb/package.nix index 4de37605c62c..5febf925ebfc 100644 --- a/pkgs/by-name/ot/otb/package.nix +++ b/pkgs/by-name/ot/otb/package.nix @@ -59,7 +59,7 @@ let # https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/issues/2454#note_112821 "fftw" ]; - itkIsInDepsToRemove = dep: builtins.any (d: d == dep.name) itkDepsToRemove; + itkIsInDepsToRemove = dep: builtins.elem dep.name itkDepsToRemove; # remove after https://gitlab.orfeo-toolbox.org/orfeotoolbox/otb/-/issues/2451 otbSwig = swig.overrideAttrs (oldArgs: { diff --git a/pkgs/by-name/sl/sleek-grub-theme/package.nix b/pkgs/by-name/sl/sleek-grub-theme/package.nix index 186993f6fbd2..e7ae9353fbb4 100644 --- a/pkgs/by-name/sl/sleek-grub-theme/package.nix +++ b/pkgs/by-name/sl/sleek-grub-theme/package.nix @@ -6,7 +6,7 @@ withStyle ? "light", # use override to specify one of "dark" / "orange" / "bigSur" }: -assert builtins.any (s: withStyle == s) [ +assert builtins.elem withStyle [ "light" "dark" "orange" diff --git a/pkgs/by-name/uw/uwsgi/package.nix b/pkgs/by-name/uw/uwsgi/package.nix index 61d4fa0a49d9..593835879c79 100644 --- a/pkgs/by-name/uw/uwsgi/package.nix +++ b/pkgs/by-name/uw/uwsgi/package.nix @@ -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 (builtins.any (x: x.name == "php") needed) ( + UWSGICONFIG_PHP_LDFLAGS = lib.optionalString (lib.elem "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 (builtins.any (x: x.name == "php") needed) '' + postFixup = lib.optionalString (lib.elem "php" needed) '' wrapProgram $out/bin/uwsgi --set PHP_INI_SCAN_DIR ${php-embed}/lib ''; diff --git a/pkgs/development/interpreters/python/pypy/default.nix b/pkgs/development/interpreters/python/pypy/default.nix index c030a464e133..7c8ef2fbfb80 100644 --- a/pkgs/development/interpreters/python/pypy/default.nix +++ b/pkgs/development/interpreters/python/pypy/default.nix @@ -116,7 +116,7 @@ stdenv.mkDerivation rec { ] ++ lib.optionals - (lib.any (l: l == optimizationLevel) [ + (lib.elem optimizationLevel [ "0" "1" "2" diff --git a/pkgs/development/ruby-modules/testing/stubs.nix b/pkgs/development/ruby-modules/testing/stubs.nix index b0258988888f..614dcd822f4a 100644 --- a/pkgs/development/ruby-modules/testing/stubs.nix +++ b/pkgs/development/ruby-modules/testing/stubs.nix @@ -14,7 +14,7 @@ let builtins.toJSON ( lib.filterAttrs ( n: v: - builtins.any (x: x == n) [ + builtins.elem n [ "name" "system" ] diff --git a/pkgs/os-specific/linux/zfs/generic.nix b/pkgs/os-specific/linux/zfs/generic.nix index 457d4cb144e6..9513e3e7a85d 100644 --- a/pkgs/os-specific/linux/zfs/generic.nix +++ b/pkgs/os-specific/linux/zfs/generic.nix @@ -57,7 +57,7 @@ let let inherit (lib) - any + elem optionalString optionals optional @@ -66,11 +66,11 @@ let smartmon = smartmontools.override { inherit enableMail; }; - buildKernel = any (n: n == configFile) [ + buildKernel = elem configFile [ "kernel" "all" ]; - buildUser = any (n: n == configFile) [ + buildUser = elem configFile [ "user" "all" ]; diff --git a/pkgs/servers/web-apps/wordpress/packages/default.nix b/pkgs/servers/web-apps/wordpress/packages/default.nix index 5fafdd153413..c7630cbeb1a5 100644 --- a/pkgs/servers/web-apps/wordpress/packages/default.nix +++ b/pkgs/servers/web-apps/wordpress/packages/default.nix @@ -43,7 +43,7 @@ let license, ... }@args: - assert lib.any (x: x == type) [ + assert lib.elem type [ "plugin" "theme" "language" diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix index b27e59860e39..d00df6ff4139 100644 --- a/pkgs/stdenv/generic/make-derivation.nix +++ b/pkgs/stdenv/generic/make-derivation.nix @@ -426,7 +426,7 @@ let concretizeFlagImplications = flag: impliesFlags: list: - if any (x: x == flag) list then (list ++ impliesFlags) else list; + if builtins.elem flag list then (list ++ impliesFlags) else list; hardeningDisable' = unique ( pipe hardeningDisable [ diff --git a/pkgs/tools/networking/maubot/plugins/generated.nix b/pkgs/tools/networking/maubot/plugins/generated.nix index dbaee26f8853..9e7bf10ac8c3 100644 --- a/pkgs/tools/networking/maubot/plugins/generated.nix +++ b/pkgs/tools/networking/maubot/plugins/generated.nix @@ -69,7 +69,7 @@ lib.flip builtins.mapAttrs json ( ); in spdxLicenses.${spdx}; - broken = builtins.any (x: x == null) reqDeps; + broken = builtins.elem null reqDeps; }; } // lib.optionalAttrs (entry.isPoetry or false) {