diff --git a/lib/generators.nix b/lib/generators.nix index 28b2e39bf646..b77cca75010f 100644 --- a/lib/generators.nix +++ b/lib/generators.nix @@ -378,7 +378,7 @@ rec { attr = let attrFilter = name: value: name != "_module" && value != null; in ind: x: libStr.concatStringsSep "\n" (lib.flatten (lib.mapAttrsToList - (name: value: lib.optional (attrFilter name value) [ + (name: value: lib.optionals (attrFilter name value) [ (key "\t${ind}" name) (expr "\t${ind}" value) ]) x)); diff --git a/nixos/modules/hardware/video/nvidia.nix b/nixos/modules/hardware/video/nvidia.nix index 25cab0611975..cee230ac41cb 100644 --- a/nixos/modules/hardware/video/nvidia.nix +++ b/nixos/modules/hardware/video/nvidia.nix @@ -261,7 +261,7 @@ in in optional primeEnabled { name = igpuDriver; display = offloadCfg.enable; - modules = optional (igpuDriver == "amdgpu") [ pkgs.xorg.xf86videoamdgpu ]; + modules = optionals (igpuDriver == "amdgpu") [ pkgs.xorg.xf86videoamdgpu ]; deviceSection = '' BusID "${igpuBusId}" ${optionalString (syncCfg.enable && igpuDriver != "amdgpu") ''Option "AccelMethod" "none"''} diff --git a/nixos/modules/services/misc/ethminer.nix b/nixos/modules/services/misc/ethminer.nix index 909c49866e54..c9b2e24b8bf1 100644 --- a/nixos/modules/services/misc/ethminer.nix +++ b/nixos/modules/services/misc/ethminer.nix @@ -85,7 +85,7 @@ in config = mkIf cfg.enable { systemd.services.ethminer = { - path = optional (cfg.toolkit == "cuda") [ pkgs.cudaPackages.cudatoolkit ]; + path = optionals (cfg.toolkit == "cuda") [ pkgs.cudaPackages.cudatoolkit ]; description = "ethminer ethereum mining service"; wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; diff --git a/nixos/modules/services/misc/podgrab.nix b/nixos/modules/services/misc/podgrab.nix index 10c7bc96b8f0..c0a124718505 100644 --- a/nixos/modules/services/misc/podgrab.nix +++ b/nixos/modules/services/misc/podgrab.nix @@ -36,7 +36,7 @@ in }; serviceConfig = { DynamicUser = true; - EnvironmentFile = lib.optional (cfg.passwordFile != null) [ + EnvironmentFile = lib.optionals (cfg.passwordFile != null) [ cfg.passwordFile ]; ExecStart = "${pkgs.podgrab}/bin/podgrab"; diff --git a/nixos/modules/services/networking/hostapd.nix b/nixos/modules/services/networking/hostapd.nix index ec1a7a58b1e0..63bb44256dd6 100644 --- a/nixos/modules/services/networking/hostapd.nix +++ b/nixos/modules/services/networking/hostapd.nix @@ -199,7 +199,7 @@ in environment.systemPackages = [ pkgs.hostapd ]; - services.udev.packages = optional (cfg.countryCode != null) [ pkgs.crda ]; + services.udev.packages = optionals (cfg.countryCode != null) [ pkgs.crda ]; systemd.services.hostapd = { description = "hostapd wireless AP"; diff --git a/nixos/modules/services/security/tor.nix b/nixos/modules/services/security/tor.nix index 730802d92cfa..b85b78f269a1 100644 --- a/nixos/modules/services/security/tor.nix +++ b/nixos/modules/services/security/tor.nix @@ -816,13 +816,13 @@ in always create a container/VM with a separate Tor daemon instance. '' ++ flatten (mapAttrsToList (n: o: - optional (o.settings.HiddenServiceVersion == 2) [ + optionals (o.settings.HiddenServiceVersion == 2) [ (optional (o.settings.HiddenServiceExportCircuitID != null) '' HiddenServiceExportCircuitID is used in the HiddenService: ${n} but this option is only for v3 hidden services. '') ] ++ - optional (o.settings.HiddenServiceVersion != 2) [ + optionals (o.settings.HiddenServiceVersion != 2) [ (optional (o.settings.HiddenServiceAuthorizeClient != null) '' HiddenServiceAuthorizeClient is used in the HiddenService: ${n} but this option is only for v2 hidden services. diff --git a/nixos/modules/services/web-apps/netbox.nix b/nixos/modules/services/web-apps/netbox.nix index 2826e57f2c77..f09a8dfc5b21 100644 --- a/nixos/modules/services/web-apps/netbox.nix +++ b/nixos/modules/services/web-apps/netbox.nix @@ -46,7 +46,7 @@ let ''; })).override { plugins = ps: ((cfg.plugins ps) - ++ optional cfg.enableLdap [ ps.django-auth-ldap ]); + ++ optionals cfg.enableLdap [ ps.django-auth-ldap ]); }; netboxManageScript = with pkgs; (writeScriptBin "netbox-manage" '' #!${stdenv.shell} diff --git a/pkgs/applications/audio/chuck/default.nix b/pkgs/applications/audio/chuck/default.nix index a6509256881b..21d58eccb741 100644 --- a/pkgs/applications/audio/chuck/default.nix +++ b/pkgs/applications/audio/chuck/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation rec { buildInputs = [ libsndfile ] ++ lib.optional (!stdenv.isDarwin) alsa-lib - ++ lib.optional stdenv.isDarwin [ AppKit Carbon CoreAudio CoreMIDI CoreServices Kernel ]; + ++ lib.optionals stdenv.isDarwin [ AppKit Carbon CoreAudio CoreMIDI CoreServices Kernel ]; patches = [ ./darwin-limits.patch ]; diff --git a/pkgs/applications/audio/grandorgue/default.nix b/pkgs/applications/audio/grandorgue/default.nix index 954a2265312e..5940e353042c 100644 --- a/pkgs/applications/audio/grandorgue/default.nix +++ b/pkgs/applications/audio/grandorgue/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { buildInputs = [ fftwFloat alsa-lib zlib wavpack wxGTK31 udev ] ++ lib.optional jackaudioSupport libjack2; - cmakeFlags = lib.optional (!jackaudioSupport) [ + cmakeFlags = lib.optionals (!jackaudioSupport) [ "-DRTAUDIO_USE_JACK=OFF" "-DRTMIDI_USE_JACK=OFF" ] ++ lib.optional (!includeDemo) "-DINSTALL_DEMO=OFF"; diff --git a/pkgs/applications/audio/snapcast/default.nix b/pkgs/applications/audio/snapcast/default.nix index bbaa3fe839b1..612d18f13571 100644 --- a/pkgs/applications/audio/snapcast/default.nix +++ b/pkgs/applications/audio/snapcast/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { aixlog popl soxr ] ++ lib.optional pulseaudioSupport libpulseaudio ++ lib.optional stdenv.isLinux alsa-lib - ++ lib.optional stdenv.isDarwin [darwin.apple_sdk.frameworks.IOKit darwin.apple_sdk.frameworks.AudioToolbox]; + ++ lib.optionals stdenv.isDarwin [darwin.apple_sdk.frameworks.IOKit darwin.apple_sdk.frameworks.AudioToolbox]; TARGET=lib.optionalString stdenv.isDarwin "MACOS"; diff --git a/pkgs/applications/blockchains/polkadot/default.nix b/pkgs/applications/blockchains/polkadot/default.nix index 92342bfda785..22d2f05112ca 100644 --- a/pkgs/applications/blockchains/polkadot/default.nix +++ b/pkgs/applications/blockchains/polkadot/default.nix @@ -34,7 +34,7 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "sha256-mI8VvTlM9ynstDBC0ubQkzg3D2ZXuWqJGS/Y23D6dU0="; - buildInputs = lib.optional stdenv.isDarwin [ Security ]; + buildInputs = lib.optionals stdenv.isDarwin [ Security ]; nativeBuildInputs = [ clang ]; diff --git a/pkgs/applications/editors/rstudio/default.nix b/pkgs/applications/editors/rstudio/default.nix index 50f69300aa04..70e69503749b 100644 --- a/pkgs/applications/editors/rstudio/default.nix +++ b/pkgs/applications/editors/rstudio/default.nix @@ -85,7 +85,7 @@ in makeWrapper pandoc nodejs - ] ++ lib.optional (!server) [ + ] ++ lib.optionals (!server) [ copyDesktopItems ]; @@ -118,7 +118,7 @@ in "-DQUARTO_ENABLED=FALSE" "-DPANDOC_VERSION=${pandoc.version}" "-DCMAKE_INSTALL_PREFIX=${placeholder "out"}/lib/rstudio" - ] ++ lib.optional (!server) [ + ] ++ lib.optionals (!server) [ "-DQT_QMAKE_EXECUTABLE=${qmake}/bin/qmake" ]; diff --git a/pkgs/applications/editors/vim/configurable.nix b/pkgs/applications/editors/vim/configurable.nix index d5dd00b4aa60..11ddddaefc24 100644 --- a/pkgs/applications/editors/vim/configurable.nix +++ b/pkgs/applications/editors/vim/configurable.nix @@ -109,7 +109,7 @@ in stdenv.mkDerivation rec { ++ lib.optionals luaSupport [ "--with-lua-prefix=${lua}" "--enable-luainterp" - ] ++ lib.optional lua.pkgs.isLuaJIT [ + ] ++ lib.optionals lua.pkgs.isLuaJIT [ "--with-luajit" ] ++ lib.optionals pythonSupport [ diff --git a/pkgs/applications/editors/vscode/generic.nix b/pkgs/applications/editors/vscode/generic.nix index 71c0f3bb55e3..f8808e033ed4 100644 --- a/pkgs/applications/editors/vscode/generic.nix +++ b/pkgs/applications/editors/vscode/generic.nix @@ -66,7 +66,7 @@ let buildInputs = [ libsecret libXScrnSaver libxshmfence ] ++ lib.optionals (!stdenv.isDarwin) ([ at-spi2-atk ] ++ atomEnv.packages); - runtimeDependencies = lib.optional stdenv.isLinux [ (lib.getLib systemd) fontconfig.lib libdbusmenu ]; + runtimeDependencies = lib.optionals stdenv.isLinux [ (lib.getLib systemd) fontconfig.lib libdbusmenu ]; nativeBuildInputs = [ unzip ] ++ lib.optionals stdenv.isLinux [ diff --git a/pkgs/applications/emulators/retroarch/cores.nix b/pkgs/applications/emulators/retroarch/cores.nix index 57ae88dbd42c..1224aa74f29c 100644 --- a/pkgs/applications/emulators/retroarch/cores.nix +++ b/pkgs/applications/emulators/retroarch/cores.nix @@ -676,7 +676,7 @@ in description = "Fast MegaDrive/MegaCD/32X emulator"; license = "MAME"; dontConfigure = true; - makeFlags = lib.optional stdenv.hostPlatform.isAarch64 [ "platform=aarch64" ]; + makeFlags = lib.optionals stdenv.hostPlatform.isAarch64 [ "platform=aarch64" ]; }; play = mkLibRetroCore { diff --git a/pkgs/applications/file-managers/nnn/default.nix b/pkgs/applications/file-managers/nnn/default.nix index 85c372f00406..05f65df87b95 100644 --- a/pkgs/applications/file-managers/nnn/default.nix +++ b/pkgs/applications/file-managers/nnn/default.nix @@ -40,8 +40,8 @@ stdenv.mkDerivation rec { NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isMusl "-lfts"; makeFlags = [ "PREFIX=${placeholder "out"}" ] - ++ lib.optional withIcons [ "O_ICONS=1" ] - ++ lib.optional withNerdIcons [ "O_NERD=1" ]; + ++ lib.optionals withIcons [ "O_ICONS=1" ] + ++ lib.optionals withNerdIcons [ "O_NERD=1" ]; binPath = lib.makeBinPath [ file which ]; diff --git a/pkgs/applications/gis/gmt/default.nix b/pkgs/applications/gis/gmt/default.nix index c6e0846e54dc..3cc04e374440 100644 --- a/pkgs/applications/gis/gmt/default.nix +++ b/pkgs/applications/gis/gmt/default.nix @@ -47,7 +47,7 @@ stdenv.mkDerivation rec { "-DGMT_INSTALL_MODULE_LINKS:BOOL=FALSE" "-DLICENSE_RESTRICTED=LGPL" # "GPL" and "no" also valid ] ++ (with stdenv; - lib.optional (!isDarwin) [ + lib.optionals (!isDarwin) [ "-DFFTW3_ROOT=${fftwSinglePrec.dev}" "-DLAPACK_LIBRARY=${lapack}/lib/liblapack.so" "-DBLAS_LIBRARY=${blas}/lib/libblas.so" diff --git a/pkgs/applications/graphics/kcc/default.nix b/pkgs/applications/graphics/kcc/default.nix index bbbd4ed351bc..2f481252d881 100644 --- a/pkgs/applications/graphics/kcc/default.nix +++ b/pkgs/applications/graphics/kcc/default.nix @@ -23,7 +23,7 @@ mkDerivationWith python3Packages.buildPythonApplication rec { raven ]; - qtWrapperArgs = lib.optional archiveSupport [ "--prefix" "PATH" ":" "${ lib.makeBinPath [ p7zip ] }" ]; + qtWrapperArgs = lib.optionals archiveSupport [ "--prefix" "PATH" ":" "${ lib.makeBinPath [ p7zip ] }" ]; postFixup = '' wrapProgram $out/bin/kcc "''${qtWrapperArgs[@]}" diff --git a/pkgs/applications/misc/audio/sox/default.nix b/pkgs/applications/misc/audio/sox/default.nix index d82658f529e4..9ddcdc92c5bd 100644 --- a/pkgs/applications/misc/audio/sox/default.nix +++ b/pkgs/applications/misc/audio/sox/default.nix @@ -47,7 +47,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ autoreconfHook autoconf-archive - ] ++ lib.optional enableOpusfile [ + ] ++ lib.optionals enableOpusfile [ # configure.ac uses pkg-config only to locate libopusfile pkg-config ]; diff --git a/pkgs/applications/misc/blender/default.nix b/pkgs/applications/misc/blender/default.nix index c6f16733cc21..e6bdd340c979 100644 --- a/pkgs/applications/misc/blender/default.nix +++ b/pkgs/applications/misc/blender/default.nix @@ -127,7 +127,7 @@ stdenv.mkDerivation rec { # Clang doesn't support "-export-dynamic" ++ optional stdenv.cc.isClang "-DPYTHON_LINKFLAGS=" ++ optional jackaudioSupport "-DWITH_JACK=ON" - ++ optional cudaSupport [ + ++ optionals cudaSupport [ "-DWITH_CYCLES_CUDA_BINARIES=ON" "-DWITH_CYCLES_DEVICE_OPTIX=ON" "-DOPTIX_ROOT_DIR=${optix}" diff --git a/pkgs/applications/networking/browsers/links2/default.nix b/pkgs/applications/networking/browsers/links2/default.nix index e01131e193e0..4dc06cd466b5 100644 --- a/pkgs/applications/networking/browsers/links2/default.nix +++ b/pkgs/applications/networking/browsers/links2/default.nix @@ -20,7 +20,7 @@ stdenv.mkDerivation rec { [ libev librsvg libpng libjpeg libtiff openssl xz bzip2 zlib ] ++ optionals stdenv.isLinux [ gpm ] ++ optionals enableX11 [ libX11 libXau libXt ] - ++ optional enableDirectFB [ directfb ]; + ++ optionals enableDirectFB [ directfb ]; nativeBuildInputs = [ pkg-config bzip2 ]; diff --git a/pkgs/applications/networking/cluster/hadoop/default.nix b/pkgs/applications/networking/cluster/hadoop/default.nix index 365cac59f41a..ebe21a2da45e 100644 --- a/pkgs/applications/networking/cluster/hadoop/default.nix +++ b/pkgs/applications/networking/cluster/hadoop/default.nix @@ -37,7 +37,7 @@ let doCheck = true; nativeBuildInputs = [ makeWrapper ] - ++ optional (stdenv.isLinux && (nativeLibs != [ ] || libPatches != "")) [ autoPatchelfHook ]; + ++ optionals (stdenv.isLinux && (nativeLibs != [ ] || libPatches != "")) [ autoPatchelfHook ]; buildInputs = [ openssl ] ++ nativeLibs; installPhase = '' diff --git a/pkgs/applications/networking/firehol/default.nix b/pkgs/applications/networking/firehol/default.nix index 145fae2553a2..81c82dcbe1b0 100644 --- a/pkgs/applications/networking/firehol/default.nix +++ b/pkgs/applications/networking/firehol/default.nix @@ -43,7 +43,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--localstatedir=/var" "--disable-doc" "--disable-man" "--disable-update-ipsets" ] ++ - lib.optional onlyQOS [ "--disable-firehol" ]; + lib.optionals onlyQOS [ "--disable-firehol" ]; meta = with lib; { description = "A firewall for humans"; diff --git a/pkgs/applications/networking/instant-messengers/pantalaimon/default.nix b/pkgs/applications/networking/instant-messengers/pantalaimon/default.nix index 41eef4e20457..49114903a59a 100644 --- a/pkgs/applications/networking/instant-messengers/pantalaimon/default.nix +++ b/pkgs/applications/networking/instant-messengers/pantalaimon/default.nix @@ -34,7 +34,7 @@ buildPythonApplication rec { peewee prompt-toolkit setuptools - ] ++ lib.optional enableDbusUi [ + ] ++ lib.optionals enableDbusUi [ dbus-python notify2 pygobject3 diff --git a/pkgs/applications/networking/irc/convos/default.nix b/pkgs/applications/networking/irc/convos/default.nix index 7b2a8c3f2470..30aac1cb1178 100644 --- a/pkgs/applications/networking/irc/convos/default.nix +++ b/pkgs/applications/networking/irc/convos/default.nix @@ -16,7 +16,7 @@ perlPackages.buildPerlPackage rec { }; nativeBuildInputs = [ makeWrapper ] - ++ optional stdenv.isDarwin [ shortenPerlShebang ]; + ++ optionals stdenv.isDarwin [ shortenPerlShebang ]; buildInputs = with perlPackages; [ CryptPassphrase CryptPassphraseArgon2 CryptPassphraseBcrypt diff --git a/pkgs/applications/networking/mailreaders/alot/default.nix b/pkgs/applications/networking/mailreaders/alot/default.nix index d8a4d1066ecb..889b893ea9cf 100644 --- a/pkgs/applications/networking/mailreaders/alot/default.nix +++ b/pkgs/applications/networking/mailreaders/alot/default.nix @@ -15,7 +15,7 @@ with python3.pkgs; buildPythonApplication rec { outputs = [ "out" - ] ++ lib.optional withManpage [ + ] ++ lib.optionals withManpage [ "man" ]; diff --git a/pkgs/applications/networking/mailreaders/meli/default.nix b/pkgs/applications/networking/mailreaders/meli/default.nix index f998a4366b39..e3da77531a11 100644 --- a/pkgs/applications/networking/mailreaders/meli/default.nix +++ b/pkgs/applications/networking/mailreaders/meli/default.nix @@ -31,7 +31,7 @@ rustPlatform.buildRustPackage rec { checkInputs = [ file ]; - buildFeatures = lib.optional withNotmuch [ "notmuch" ]; + buildFeatures = lib.optionals withNotmuch [ "notmuch" ]; postInstall = '' mkdir -p $out/share/man/man1 diff --git a/pkgs/applications/networking/mpop/default.nix b/pkgs/applications/networking/mpop/default.nix index 21d9d19e03b3..7e8960382745 100644 --- a/pkgs/applications/networking/mpop/default.nix +++ b/pkgs/applications/networking/mpop/default.nix @@ -25,11 +25,11 @@ stdenv.mkDerivation rec { gnutls gsasl libidn - ] ++ lib.optional stdenv.isDarwin [ + ] ++ lib.optionals stdenv.isDarwin [ Security ]; - configureFlags = lib.optional stdenv.isDarwin [ + configureFlags = lib.optionals stdenv.isDarwin [ "--with-macosx-keyring" ]; diff --git a/pkgs/applications/networking/sync/lsyncd/default.nix b/pkgs/applications/networking/sync/lsyncd/default.nix index 3e52d664d526..ed4de44049d3 100644 --- a/pkgs/applications/networking/sync/lsyncd/default.nix +++ b/pkgs/applications/networking/sync/lsyncd/default.nix @@ -27,7 +27,7 @@ stdenv.mkDerivation rec { # Special flags needed on Darwin: # https://github.com/axkibe/lsyncd/blob/42413cabbedca429d55a5378f6e830f191f3cc86/INSTALL#L51 - cmakeFlags = lib.optional stdenv.isDarwin [ "-DWITH_INOTIFY=OFF" "-DWITH_FSEVENTS=ON" ]; + cmakeFlags = lib.optionals stdenv.isDarwin [ "-DWITH_INOTIFY=OFF" "-DWITH_FSEVENTS=ON" ]; dontUseCmakeBuildDir = true; diff --git a/pkgs/applications/networking/znc/default.nix b/pkgs/applications/networking/znc/default.nix index e5aec9117068..f73bb1c4bf73 100644 --- a/pkgs/applications/networking/znc/default.nix +++ b/pkgs/applications/networking/znc/default.nix @@ -36,8 +36,8 @@ stdenv.mkDerivation rec { (lib.enableFeature withTcl "tcl") (lib.withFeatureAs withTcl "tcl" "${tcl}/lib") (lib.enableFeature withCyrus "cyrus") - ] ++ optional (!withIPv6) [ "--disable-ipv6" ] - ++ optional withDebug [ "--enable-debug" ]; + ] ++ optionals (!withIPv6) [ "--disable-ipv6" ] + ++ optionals withDebug [ "--enable-debug" ]; enableParallelBuilding = true; diff --git a/pkgs/applications/radio/rtl-sdr/default.nix b/pkgs/applications/radio/rtl-sdr/default.nix index e7fbb50cfd08..d8180750c7a1 100644 --- a/pkgs/applications/radio/rtl-sdr/default.nix +++ b/pkgs/applications/radio/rtl-sdr/default.nix @@ -29,7 +29,7 @@ stdenv.mkDerivation rec { buildInputs = [ libusb1 ]; - cmakeFlags = lib.optional stdenv.isLinux [ + cmakeFlags = lib.optionals stdenv.isLinux [ "-DINSTALL_UDEV_RULES=ON" "-DWITH_RPC=ON" ]; diff --git a/pkgs/applications/science/biology/megahit/default.nix b/pkgs/applications/science/biology/megahit/default.nix index 45cb7560502d..7f054a51d5e0 100644 --- a/pkgs/applications/science/biology/megahit/default.nix +++ b/pkgs/applications/science/biology/megahit/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ]; buildInputs = [ zlib ]; - cmakeFlags = lib.optional stdenv.hostPlatform.isStatic [ + cmakeFlags = lib.optionals stdenv.hostPlatform.isStatic [ "-DSTATIC_BUILD=ON" ]; meta = with lib; { diff --git a/pkgs/applications/science/biology/neuron/default.nix b/pkgs/applications/science/biology/neuron/default.nix index 36f1b4c699a8..a35d586b9ac3 100644 --- a/pkgs/applications/science/biology/neuron/default.nix +++ b/pkgs/applications/science/biology/neuron/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation rec { sha256 = "0f26v3qvzblcdjg7isq0m9j2q8q7x3vhmkfllv8lsr3gyj44lljf"; }; - patches = (lib.optional (stdenv.isDarwin) [ ./neuron-carbon-disable.patch ]); + patches = (lib.optionals (stdenv.isDarwin) [ ./neuron-carbon-disable.patch ]); # With LLVM 3.8 and above, clang (really libc++) gets upset if you attempt to redefine these... postPatch = lib.optionalString stdenv.cc.isClang '' diff --git a/pkgs/applications/science/biology/samtools/default.nix b/pkgs/applications/science/biology/samtools/default.nix index 29ba667b0552..41129a667e91 100644 --- a/pkgs/applications/science/biology/samtools/default.nix +++ b/pkgs/applications/science/biology/samtools/default.nix @@ -32,7 +32,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--with-htslib=${htslib}" ] ++ lib.optional (ncurses == null) "--without-curses" - ++ lib.optional stdenv.hostPlatform.isStatic ["--without-curses" ] + ++ lib.optionals stdenv.hostPlatform.isStatic ["--without-curses" ] ; preCheck = '' diff --git a/pkgs/applications/science/logic/fast-downward/default.nix b/pkgs/applications/science/logic/fast-downward/default.nix index 1d7c51e64e9d..ba0f3ee2e255 100644 --- a/pkgs/applications/science/logic/fast-downward/default.nix +++ b/pkgs/applications/science/logic/fast-downward/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake python3.pkgs.wrapPython ]; buildInputs = [ python3 osi ]; - cmakeFlags = lib.optional osi.withCplex [ "-DDOWNWARD_CPLEX_ROOT=${cplex}/cplex" ]; + cmakeFlags = lib.optionals osi.withCplex [ "-DDOWNWARD_CPLEX_ROOT=${cplex}/cplex" ]; configurePhase = '' python build.py release diff --git a/pkgs/applications/science/math/ratpoints/default.nix b/pkgs/applications/science/math/ratpoints/default.nix index dd8258a3456d..44c68ebcdcea 100644 --- a/pkgs/applications/science/math/ratpoints/default.nix +++ b/pkgs/applications/science/math/ratpoints/default.nix @@ -20,7 +20,7 @@ stdenv.mkDerivation rec { buildInputs = [ gmp ]; makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; - buildFlags = lib.optional stdenv.isDarwin ["CCFLAGS2=-lgmp -lc -lm" "CCFLAGS=-UUSE_SSE"]; + buildFlags = lib.optionals stdenv.isDarwin ["CCFLAGS2=-lgmp -lc -lm" "CCFLAGS=-UUSE_SSE"]; installFlags = [ "INSTALL_DIR=$(out)" ]; preInstall = ''mkdir -p "$out"/{bin,share,lib,include}''; diff --git a/pkgs/applications/version-management/datalad/default.nix b/pkgs/applications/version-management/datalad/default.nix index 65561aded31f..cd2c26ea8d42 100644 --- a/pkgs/applications/version-management/datalad/default.nix +++ b/pkgs/applications/version-management/datalad/default.nix @@ -59,8 +59,8 @@ python3.pkgs.buildPythonApplication rec { # python>=3.8 distro - ] ++ lib.optional stdenv.hostPlatform.isWindows [ colorama ] - ++ lib.optional (python3.pythonOlder "3.10") [ importlib-metadata ]; + ] ++ lib.optionals stdenv.hostPlatform.isWindows [ colorama ] + ++ lib.optionals (python3.pythonOlder "3.10") [ importlib-metadata ]; postInstall = '' installShellCompletion --cmd datalad \ diff --git a/pkgs/applications/version-management/dvc/default.nix b/pkgs/applications/version-management/dvc/default.nix index 6f1c4fe18577..40b550cb9e38 100644 --- a/pkgs/applications/version-management/dvc/default.nix +++ b/pkgs/applications/version-management/dvc/default.nix @@ -72,17 +72,17 @@ python3.pkgs.buildPythonApplication rec { typing-extensions voluptuous zc_lockfile - ] ++ lib.optional enableGoogle [ + ] ++ lib.optionals enableGoogle [ gcsfs google-cloud-storage - ] ++ lib.optional enableAWS [ + ] ++ lib.optionals enableAWS [ aiobotocore boto3 s3fs - ] ++ lib.optional enableAzure [ + ] ++ lib.optionals enableAzure [ azure-identity knack - ] ++ lib.optional enableSSH [ + ] ++ lib.optionals enableSSH [ bcrypt ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata diff --git a/pkgs/applications/version-management/subversion/default.nix b/pkgs/applications/version-management/subversion/default.nix index 5731ef59deb7..69a2bce49060 100644 --- a/pkgs/applications/version-management/subversion/default.nix +++ b/pkgs/applications/version-management/subversion/default.nix @@ -40,7 +40,7 @@ let ++ lib.optionals pythonBindings [ python3 py3c ] ++ lib.optional perlBindings perl ++ lib.optional saslSupport sasl - ++ lib.optional stdenv.hostPlatform.isDarwin [ CoreServices Security ]; + ++ lib.optionals stdenv.hostPlatform.isDarwin [ CoreServices Security ]; patches = [ ./apr-1.patch ] ++ extraPatches; diff --git a/pkgs/applications/video/kodi/unwrapped.nix b/pkgs/applications/video/kodi/unwrapped.nix index a272f90bd333..6eadd06af0fb 100644 --- a/pkgs/applications/video/kodi/unwrapped.nix +++ b/pkgs/applications/video/kodi/unwrapped.nix @@ -138,7 +138,7 @@ in stdenv.mkDerivation { lirc mesa # for libEGL ] - ++ lib.optional x11Support [ + ++ lib.optionals x11Support [ libX11 xorgproto libXt libXmu libXext.dev libXdmcp libXinerama libXrandr.dev libXtst libXfixes ] @@ -158,7 +158,7 @@ in stdenv.mkDerivation { # Not sure why ".dev" is needed here, but CMake doesn't find libxkbcommon otherwise libxkbcommon.dev ] - ++ lib.optional gbmSupport [ + ++ lib.optionals gbmSupport [ libxkbcommon.dev mesa.dev libinput.dev @@ -200,7 +200,7 @@ in stdenv.mkDerivation { # whitelisted directories). This adds the entire nix store to the Kodi # webserver whitelist to avoid this problem. "-DKODI_WEBSERVER_EXTRA_WHITELIST=${builtins.storeDir}" - ] ++ lib.optional waylandSupport [ + ] ++ lib.optionals waylandSupport [ "-DWAYLANDPP_SCANNER=${buildPackages.waylandpp}/bin/wayland-scanner++" ]; diff --git a/pkgs/build-support/skaware/build-skaware-package.nix b/pkgs/build-support/skaware/build-skaware-package.nix index 1988d95212c3..3ae9b7ce8aac 100644 --- a/pkgs/build-support/skaware/build-skaware-package.nix +++ b/pkgs/build-support/skaware/build-skaware-package.nix @@ -87,7 +87,7 @@ stdenv.mkDerivation { inherit postConfigure; - makeFlags = lib.optional stdenv.cc.isClang [ "AR=${stdenv.cc.targetPrefix}ar" "RANLIB=${stdenv.cc.targetPrefix}ranlib" ]; + makeFlags = lib.optionals stdenv.cc.isClang [ "AR=${stdenv.cc.targetPrefix}ar" "RANLIB=${stdenv.cc.targetPrefix}ranlib" ]; # TODO(Profpatsch): ensure that there is always a $doc output! postInstall = '' diff --git a/pkgs/data/fonts/iosevka/default.nix b/pkgs/data/fonts/iosevka/default.nix index 53e5b4a3db76..d9efb0eedcd7 100644 --- a/pkgs/data/fonts/iosevka/default.nix +++ b/pkgs/data/fonts/iosevka/default.nix @@ -86,7 +86,7 @@ stdenv.mkDerivation rec { inherit extraParameters; passAsFile = [ "extraParameters" - ] ++ lib.optional (! (builtins.isString privateBuildPlan && lib.hasPrefix builtins.storeDir privateBuildPlan)) [ + ] ++ lib.optionals (! (builtins.isString privateBuildPlan && lib.hasPrefix builtins.storeDir privateBuildPlan)) [ "buildPlan" ]; diff --git a/pkgs/desktops/gnome-2/platform/GConf/default.nix b/pkgs/desktops/gnome-2/platform/GConf/default.nix index ec8deb537d08..8419c1a7d730 100644 --- a/pkgs/desktops/gnome-2/platform/GConf/default.nix +++ b/pkgs/desktops/gnome-2/platform/GConf/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { configureFlags = # fixes the "libgconfbackend-oldxml.so is not portable" error on darwin - lib.optional stdenv.isDarwin [ "--enable-static" ]; + lib.optionals stdenv.isDarwin [ "--enable-static" ]; postPatch = '' 2to3 --write --nobackup gsettings/gsettings-schema-convert diff --git a/pkgs/development/compilers/dmd/default.nix b/pkgs/development/compilers/dmd/default.nix index 1c15e8b970b7..b29190b9b834 100644 --- a/pkgs/development/compilers/dmd/default.nix +++ b/pkgs/development/compilers/dmd/default.nix @@ -129,7 +129,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ makeWrapper unzip which git ]; buildInputs = [ gdb curl tzdata ] - ++ lib.optional stdenv.isDarwin [ Foundation gdb ]; + ++ lib.optionals stdenv.isDarwin [ Foundation gdb ]; osname = if stdenv.isDarwin then diff --git a/pkgs/development/compilers/edk2/default.nix b/pkgs/development/compilers/edk2/default.nix index 90e570f7da40..d51601404868 100644 --- a/pkgs/development/compilers/edk2/default.nix +++ b/pkgs/development/compilers/edk2/default.nix @@ -61,7 +61,7 @@ edk2 = buildStdenv.mkDerivation { ${"GCC5_${targetArch}_PREFIX"}=stdenv.cc.targetPrefix; makeFlags = [ "-C BaseTools" ] - ++ lib.optional (stdenv.cc.isClang) [ "BUILD_CC=clang BUILD_CXX=clang++ BUILD_AS=clang" ]; + ++ lib.optionals (stdenv.cc.isClang) [ "BUILD_CC=clang BUILD_CXX=clang++ BUILD_AS=clang" ]; NIX_CFLAGS_COMPILE = "-Wno-return-type" + lib.optionalString (stdenv.cc.isGNU) " -Wno-error=stringop-truncation"; diff --git a/pkgs/development/compilers/gforth/boot-forth.nix b/pkgs/development/compilers/gforth/boot-forth.nix index fc7b5ffa982d..74a267687b8f 100644 --- a/pkgs/development/compilers/gforth/boot-forth.nix +++ b/pkgs/development/compilers/gforth/boot-forth.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation { buildInputs = [ m4 ]; - configureFlags = lib.optional stdenv.isDarwin [ "--build=x86_64-apple-darwin" ]; + configureFlags = lib.optionals stdenv.isDarwin [ "--build=x86_64-apple-darwin" ]; meta = { description = "The Forth implementation of the GNU project (outdated version used to bootstrap)"; diff --git a/pkgs/development/compilers/ghdl/default.nix b/pkgs/development/compilers/ghdl/default.nix index 383fec786b91..0e11c703d7b6 100644 --- a/pkgs/development/compilers/ghdl/default.nix +++ b/pkgs/development/compilers/ghdl/default.nix @@ -38,7 +38,7 @@ stdenv.mkDerivation rec { ]; buildInputs = [ zlib - ] ++ lib.optional (backend == "llvm") [ + ] ++ lib.optionals (backend == "llvm") [ llvm ]; propagatedBuildInputs = [ diff --git a/pkgs/development/compilers/idris2/default.nix b/pkgs/development/compilers/idris2/default.nix index 9c7a9e53a2e6..bb7d7a7a131c 100644 --- a/pkgs/development/compilers/idris2/default.nix +++ b/pkgs/development/compilers/idris2/default.nix @@ -34,7 +34,7 @@ in stdenv.mkDerivation rec { strictDeps = true; nativeBuildInputs = [ makeWrapper clang platformChez ] - ++ lib.optional stdenv.isDarwin [ zsh ]; + ++ lib.optionals stdenv.isDarwin [ zsh ]; buildInputs = [ platformChez gmp ]; prePatch = '' diff --git a/pkgs/development/compilers/idris2/tests.nix b/pkgs/development/compilers/idris2/tests.nix index a8d48c26ca6f..54bb6d29eeef 100644 --- a/pkgs/development/compilers/idris2/tests.nix +++ b/pkgs/development/compilers/idris2/tests.nix @@ -11,7 +11,7 @@ let # is not the case with pure nix environments. Thus, we need to include zsh # when we build for darwin in tests. While this is impure, this is also what # we find in real darwin hosts. - nativeBuildInputs = lib.optional stdenv.isDarwin [ zsh ]; + nativeBuildInputs = lib.optionals stdenv.isDarwin [ zsh ]; buildCommand = '' set -eo pipefail diff --git a/pkgs/development/compilers/llvm/10/libcxx/default.nix b/pkgs/development/compilers/llvm/10/libcxx/default.nix index d438294bdd0b..6a4e645bb300 100644 --- a/pkgs/development/compilers/llvm/10/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/10/libcxx/default.nix @@ -45,7 +45,7 @@ stdenv.mkDerivation { "-DLIBCXX_CXX_ABI=libcxxabi" ] ++ lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) "-DLIBCXX_HAS_MUSL_LIBC=1" ++ lib.optional (stdenv.hostPlatform.useLLVM or false) "-DLIBCXX_USE_COMPILER_RT=ON" - ++ lib.optional stdenv.hostPlatform.isWasm [ + ++ lib.optionals stdenv.hostPlatform.isWasm [ "-DLIBCXX_ENABLE_THREADS=OFF" "-DLIBCXX_ENABLE_FILESYSTEM=OFF" "-DLIBCXX_ENABLE_EXCEPTIONS=OFF" diff --git a/pkgs/development/compilers/llvm/11/libcxx/default.nix b/pkgs/development/compilers/llvm/11/libcxx/default.nix index 9aa49c9a009e..2a83b36fc425 100644 --- a/pkgs/development/compilers/llvm/11/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/11/libcxx/default.nix @@ -48,7 +48,7 @@ stdenv.mkDerivation { "-DLIBCXX_CXX_ABI=libcxxabi" ] ++ lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) "-DLIBCXX_HAS_MUSL_LIBC=1" ++ lib.optional (stdenv.hostPlatform.useLLVM or false) "-DLIBCXX_USE_COMPILER_RT=ON" - ++ lib.optional stdenv.hostPlatform.isWasm [ + ++ lib.optionals stdenv.hostPlatform.isWasm [ "-DLIBCXX_ENABLE_THREADS=OFF" "-DLIBCXX_ENABLE_FILESYSTEM=OFF" "-DLIBCXX_ENABLE_EXCEPTIONS=OFF" diff --git a/pkgs/development/compilers/llvm/12/libcxx/default.nix b/pkgs/development/compilers/llvm/12/libcxx/default.nix index 3ddcb7997505..1386d3680f91 100644 --- a/pkgs/development/compilers/llvm/12/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/12/libcxx/default.nix @@ -36,7 +36,7 @@ stdenv.mkDerivation { "-DLIBCXX_CXX_ABI=libcxxabi" ] ++ lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) "-DLIBCXX_HAS_MUSL_LIBC=1" ++ lib.optional (stdenv.hostPlatform.useLLVM or false) "-DLIBCXX_USE_COMPILER_RT=ON" - ++ lib.optional stdenv.hostPlatform.isWasm [ + ++ lib.optionals stdenv.hostPlatform.isWasm [ "-DLIBCXX_ENABLE_THREADS=OFF" "-DLIBCXX_ENABLE_FILESYSTEM=OFF" "-DLIBCXX_ENABLE_EXCEPTIONS=OFF" diff --git a/pkgs/development/compilers/llvm/8/libcxx/default.nix b/pkgs/development/compilers/llvm/8/libcxx/default.nix index 87cd734899fa..536801129218 100644 --- a/pkgs/development/compilers/llvm/8/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/8/libcxx/default.nix @@ -49,7 +49,7 @@ stdenv.mkDerivation { "-DLIBCXX_CXX_ABI=libcxxabi" ] ++ lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) "-DLIBCXX_HAS_MUSL_LIBC=1" ++ lib.optional (stdenv.hostPlatform.useLLVM or false) "-DLIBCXX_USE_COMPILER_RT=ON" - ++ lib.optional stdenv.hostPlatform.isWasm [ + ++ lib.optionals stdenv.hostPlatform.isWasm [ "-DLIBCXX_ENABLE_THREADS=OFF" "-DLIBCXX_ENABLE_FILESYSTEM=OFF" "-DLIBCXX_ENABLE_EXCEPTIONS=OFF" diff --git a/pkgs/development/compilers/llvm/9/libcxx/default.nix b/pkgs/development/compilers/llvm/9/libcxx/default.nix index 271971103107..31a00ba54859 100644 --- a/pkgs/development/compilers/llvm/9/libcxx/default.nix +++ b/pkgs/development/compilers/llvm/9/libcxx/default.nix @@ -45,7 +45,7 @@ stdenv.mkDerivation { "-DLIBCXX_CXX_ABI=libcxxabi" ] ++ lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) "-DLIBCXX_HAS_MUSL_LIBC=1" ++ lib.optional (stdenv.hostPlatform.useLLVM or false) "-DLIBCXX_USE_COMPILER_RT=ON" - ++ lib.optional stdenv.hostPlatform.isWasm [ + ++ lib.optionals stdenv.hostPlatform.isWasm [ "-DLIBCXX_ENABLE_THREADS=OFF" "-DLIBCXX_ENABLE_FILESYSTEM=OFF" "-DLIBCXX_ENABLE_EXCEPTIONS=OFF" diff --git a/pkgs/development/compilers/orc/default.nix b/pkgs/development/compilers/orc/default.nix index fa4bf686a2ac..5ea72781e41f 100644 --- a/pkgs/development/compilers/orc/default.nix +++ b/pkgs/development/compilers/orc/default.nix @@ -26,7 +26,7 @@ in stdenv.mkDerivation rec { outputBin = "dev"; # compilation tools mesonFlags = - optional (!buildDevDoc) [ "-Dgtk_doc=disabled" ] + optionals (!buildDevDoc) [ "-Dgtk_doc=disabled" ] ; nativeBuildInputs = [ meson ninja ] diff --git a/pkgs/development/compilers/p4c/default.nix b/pkgs/development/compilers/p4c/default.nix index 9233489b06ae..cf02a656b770 100644 --- a/pkgs/development/compilers/p4c/default.nix +++ b/pkgs/development/compilers/p4c/default.nix @@ -66,8 +66,8 @@ stdenv.mkDerivation rec { flex cmake ] - ++ lib.optional enableDocumentation [ doxygen graphviz ] - ++ lib.optional enableBPF [ libllvm libbpf ]; + ++ lib.optionals enableDocumentation [ doxygen graphviz ] + ++ lib.optionals enableBPF [ libllvm libbpf ]; buildInputs = [ protobuf diff --git a/pkgs/development/compilers/sbcl/2.x.nix b/pkgs/development/compilers/sbcl/2.x.nix index cfc9d34a4da8..ec12ccf17b72 100644 --- a/pkgs/development/compilers/sbcl/2.x.nix +++ b/pkgs/development/compilers/sbcl/2.x.nix @@ -153,7 +153,7 @@ stdenv.mkDerivation rec { optional (!threadSupport) "sb-thread" ++ optionals disableImmobileSpace [ "immobile-space" "immobile-code" "compact-instance-header" ]; - NIX_CFLAGS_COMPILE = lib.optional (lib.versionOlder version "2.1.10") [ + NIX_CFLAGS_COMPILE = lib.optionals (lib.versionOlder version "2.1.10") [ # Workaround build failure on -fno-common toolchains like upstream # clang-13. Without the change build fails as: # duplicate symbol '_static_code_space_free_pointer' in: alloc.o traceroot.o diff --git a/pkgs/development/interpreters/kerf/default.nix b/pkgs/development/interpreters/kerf/default.nix index 5b605c6564b3..96db9bbaeb13 100644 --- a/pkgs/development/interpreters/kerf/default.nix +++ b/pkgs/development/interpreters/kerf/default.nix @@ -18,9 +18,9 @@ stdenv.mkDerivation rec { sourceRoot = "source/src"; buildInputs = [ libedit zlib ncurses ] - ++ lib.optional stdenv.isDarwin ([ + ++ lib.optionals stdenv.isDarwin ([ Accelerate - ] ++ lib.optional stdenv.isx86_64 /* && isDarwin */ [ + ] ++ lib.optionals stdenv.isx86_64 /* && isDarwin */ [ CoreGraphics CoreVideo ]); @@ -36,7 +36,7 @@ stdenv.mkDerivation rec { "implicit-function-declaration" "gnu-variable-sized-type-not-at-end" "unused-result" - ] ++ lib.optional stdenv.isDarwin [ "-fcommon" ]; + ] ++ lib.optionals stdenv.isDarwin [ "-fcommon" ]; patchPhase = '' substituteInPlace ./Makefile \ diff --git a/pkgs/development/interpreters/php/generic.nix b/pkgs/development/interpreters/php/generic.nix index 5984113574c2..d1b7c6829557 100644 --- a/pkgs/development/interpreters/php/generic.nix +++ b/pkgs/development/interpreters/php/generic.nix @@ -206,7 +206,7 @@ let [ pcre2 ] # Enable sapis - ++ lib.optional pearSupport [ libxml2.dev ] + ++ lib.optionals pearSupport [ libxml2.dev ] # Misc deps ++ lib.optional apxs2Support apacheHttpd @@ -230,7 +230,7 @@ let ++ lib.optional (!cgiSupport) "--disable-cgi" ++ lib.optional (!cliSupport) "--disable-cli" ++ lib.optional fpmSupport "--enable-fpm" - ++ lib.optional pearSupport [ "--with-pear" "--enable-xml" "--with-libxml" ] + ++ lib.optionals pearSupport [ "--with-pear" "--enable-xml" "--with-libxml" ] ++ lib.optional pharSupport "--enable-phar" ++ lib.optional (!phpdbgSupport) "--disable-phpdbg" diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix index 25446f5fca89..7da2a0047f33 100644 --- a/pkgs/development/interpreters/python/cpython/2.7/default.nix +++ b/pkgs/development/interpreters/python/cpython/2.7/default.nix @@ -166,7 +166,7 @@ let # only works for GCC and Apple Clang. This makes distutils to call C++ # compiler when needed. ./python-2.7-distutils-C++.patch - ] ++ optional (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ ./cross-compile.patch ]; diff --git a/pkgs/development/interpreters/racket/default.nix b/pkgs/development/interpreters/racket/default.nix index 67609132c80d..479557e0890f 100644 --- a/pkgs/development/interpreters/racket/default.nix +++ b/pkgs/development/interpreters/racket/default.nix @@ -128,8 +128,8 @@ stdenv.mkDerivation rec { shared = if stdenv.isDarwin then "dylib" else "shared"; configureFlags = [ "--enable-${shared}" "--enable-lt=${libtool}/bin/libtool" ] - ++ lib.optional disableDocs [ "--disable-docs" ] - ++ lib.optional stdenv.isDarwin [ "--enable-xonx" ]; + ++ lib.optionals disableDocs [ "--disable-docs" ] + ++ lib.optionals stdenv.isDarwin [ "--enable-xonx" ]; configureScript = "../configure"; diff --git a/pkgs/development/interpreters/racket/racket_7_9.nix b/pkgs/development/interpreters/racket/racket_7_9.nix index 07c0376b42aa..ac4b6b5ba180 100644 --- a/pkgs/development/interpreters/racket/racket_7_9.nix +++ b/pkgs/development/interpreters/racket/racket_7_9.nix @@ -83,8 +83,8 @@ stdenv.mkDerivation rec { shared = if stdenv.isDarwin then "dylib" else "shared"; configureFlags = [ "--enable-${shared}" "--enable-lt=${libtool}/bin/libtool" ] - ++ lib.optional disableDocs [ "--disable-docs" ] - ++ lib.optional stdenv.isDarwin [ "--enable-xonx" ]; + ++ lib.optionals disableDocs [ "--disable-docs" ] + ++ lib.optionals stdenv.isDarwin [ "--enable-xonx" ]; configureScript = "../configure"; diff --git a/pkgs/development/interpreters/spidermonkey/common.nix b/pkgs/development/interpreters/spidermonkey/common.nix index 1272e061b0d9..d12396396da4 100644 --- a/pkgs/development/interpreters/spidermonkey/common.nix +++ b/pkgs/development/interpreters/spidermonkey/common.nix @@ -42,7 +42,7 @@ stdenv.mkDerivation (finalAttrs: rec { inherit hash; }; - patches = lib.optional (lib.versionOlder version "91") [ + patches = lib.optionals (lib.versionOlder version "91") [ # Fix build failure on armv7l using Debian patch # Upstream bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1526653 (fetchpatch { diff --git a/pkgs/development/libraries/ada/gnatcoll/db.nix b/pkgs/development/libraries/ada/gnatcoll/db.nix index 0c597f199c34..6c87d63063fa 100644 --- a/pkgs/development/libraries/ada/gnatcoll/db.nix +++ b/pkgs/development/libraries/ada/gnatcoll/db.nix @@ -95,7 +95,7 @@ stdenv.mkDerivation rec { # confusingly, for gprbuild --target is autoconf --host "TARGET=${stdenv.hostPlatform.config}" "prefix=${placeholder "out"}" - ] ++ lib.optional (component == "sqlite") [ + ] ++ lib.optionals (component == "sqlite") [ # link against packaged, not vendored libsqlite3 "GNATCOLL_SQLITE=external" ]; diff --git a/pkgs/development/libraries/apr/default.nix b/pkgs/development/libraries/apr/default.nix index 536c8a5613a9..0d980db9b5a8 100644 --- a/pkgs/development/libraries/apr/default.nix +++ b/pkgs/development/libraries/apr/default.nix @@ -49,7 +49,7 @@ stdenv.mkDerivation rec { configureFlagsArray+=("--with-installbuilddir=$dev/share/build") ''; - configureFlags = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [ + configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ # For cross builds, provide answers to the configure time tests. # These answers are valid on x86_64-linux and aarch64-linux. "ac_cv_file__dev_zero=yes" diff --git a/pkgs/development/libraries/cxxopts/default.nix b/pkgs/development/libraries/cxxopts/default.nix index cf36a88a35be..a24127ab56d8 100644 --- a/pkgs/development/libraries/cxxopts/default.nix +++ b/pkgs/development/libraries/cxxopts/default.nix @@ -21,10 +21,10 @@ stdenv.mkDerivation rec { # CMake does not set CMAKE_LIBRARY_ARCHITECTURE variable in Nix, which breaks architecture-independent library path generation patches = [ ./fix-install-path.patch ]; - buildInputs = lib.optional enableUnicodeHelp [ icu.dev ]; + buildInputs = lib.optionals enableUnicodeHelp [ icu.dev ]; cmakeFlags = [ "-DCXXOPTS_BUILD_EXAMPLES=OFF" ] ++ lib.optional enableUnicodeHelp "-DCXXOPTS_USE_UNICODE_HELP=TRUE"; - nativeBuildInputs = [ cmake ] ++ lib.optional enableUnicodeHelp [ pkg-config ]; + nativeBuildInputs = [ cmake ] ++ lib.optionals enableUnicodeHelp [ pkg-config ]; doCheck = true; diff --git a/pkgs/development/libraries/cyrus-sasl/default.nix b/pkgs/development/libraries/cyrus-sasl/default.nix index 170b9a0fba4a..632c8427e4db 100644 --- a/pkgs/development/libraries/cyrus-sasl/default.nix +++ b/pkgs/development/libraries/cyrus-sasl/default.nix @@ -39,7 +39,7 @@ stdenv.mkDerivation rec { "--enable-shared" ] ++ lib.optional enableLdap "--with-ldap=${openldap.dev}"; - installFlags = lib.optional stdenv.isDarwin [ "framedir=$(out)/Library/Frameworks/SASL2.framework" ]; + installFlags = lib.optionals stdenv.isDarwin [ "framedir=$(out)/Library/Frameworks/SASL2.framework" ]; passthru.tests = { inherit (nixosTests) parsedmarc postfix; diff --git a/pkgs/development/libraries/drogon/default.nix b/pkgs/development/libraries/drogon/default.nix index 9cc3503acd6e..de4aaf32d980 100644 --- a/pkgs/development/libraries/drogon/default.nix +++ b/pkgs/development/libraries/drogon/default.nix @@ -37,7 +37,7 @@ stdenv.mkDerivation rec { ++ lib.optional postgresSupport postgresql ++ lib.optional redisSupport hiredis # drogon uses mariadb for mysql (see https://github.com/drogonframework/drogon/wiki/ENG-02-Installation#Library-Dependencies) - ++ lib.optional mysqlSupport [ libmysqlclient mariadb ]; + ++ lib.optionals mysqlSupport [ libmysqlclient mariadb ]; patches = [ # this part of the test would normally fail because it attempts to configure a CMake project that uses find_package on itself diff --git a/pkgs/development/libraries/galario/default.nix b/pkgs/development/libraries/galario/default.nix index ac7e4f4255e8..7f757fd48197 100644 --- a/pkgs/development/libraries/galario/default.nix +++ b/pkgs/development/libraries/galario/default.nix @@ -34,13 +34,13 @@ stdenv.mkDerivation rec { ++ lib.optional stdenv.isDarwin llvmPackages.openmp ; - propagatedBuildInputs = lib.optional enablePython [ + propagatedBuildInputs = lib.optionals enablePython [ pythonPackages.numpy pythonPackages.cython pythonPackages.pytest ]; - checkInputs = lib.optional enablePython [ pythonPackages.scipy pythonPackages.pytest-cov ]; + checkInputs = lib.optionals enablePython [ pythonPackages.scipy pythonPackages.pytest-cov ]; preConfigure = '' mkdir -p build/external/src diff --git a/pkgs/development/libraries/gnutls/default.nix b/pkgs/development/libraries/gnutls/default.nix index d04fda98c7fe..f1ec87ba008d 100644 --- a/pkgs/development/libraries/gnutls/default.nix +++ b/pkgs/development/libraries/gnutls/default.nix @@ -65,7 +65,7 @@ stdenv.mkDerivation rec { "--with-unbound-root-key-file=${dns-root-data}/root.key" (lib.withFeature withP11-kit "p11-kit") (lib.enableFeature cxxBindings "cxx") - ] ++ lib.optional guileBindings [ + ] ++ lib.optionals guileBindings [ "--enable-guile" "--with-guile-site-dir=\${out}/share/guile/site" "--with-guile-site-ccache-dir=\${out}/share/guile/site" diff --git a/pkgs/development/libraries/gstreamer/base/default.nix b/pkgs/development/libraries/gstreamer/base/default.nix index a53ffb4f1b3a..dac712e82387 100644 --- a/pkgs/development/libraries/gstreamer/base/default.nix +++ b/pkgs/development/libraries/gstreamer/base/default.nix @@ -79,7 +79,7 @@ stdenv.mkDerivation rec { libjpeg tremor libGL - ] ++ lib.optional (!stdenv.isDarwin) [ + ] ++ lib.optionals (!stdenv.isDarwin) [ libvisual ] ++ lib.optionals stdenv.isDarwin [ pango diff --git a/pkgs/development/libraries/json-glib/default.nix b/pkgs/development/libraries/json-glib/default.nix index e095945dabaa..9885384e00e1 100644 --- a/pkgs/development/libraries/json-glib/default.nix +++ b/pkgs/development/libraries/json-glib/default.nix @@ -45,7 +45,7 @@ stdenv.mkDerivation rec { libxslt gobject-introspection gi-docgen - ] ++ lib.optional stdenv.hostPlatform.isDarwin [ + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ fixDarwinDylibNames ]; diff --git a/pkgs/development/libraries/kerberos/krb5.nix b/pkgs/development/libraries/kerberos/krb5.nix index a7197f9ff984..fc8fb7398701 100644 --- a/pkgs/development/libraries/kerberos/krb5.nix +++ b/pkgs/development/libraries/kerberos/krb5.nix @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { configureFlags = [ "--localstatedir=/var/lib" ] # krb5's ./configure does not allow passing --enable-shared and --enable-static at the same time. # See https://bbs.archlinux.org/viewtopic.php?pid=1576737#p1576737 - ++ lib.optional staticOnly [ "--enable-static" "--disable-shared" ] + ++ lib.optionals staticOnly [ "--enable-static" "--disable-shared" ] ++ lib.optional stdenv.isFreeBSD ''WARN_CFLAGS=""'' ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "krb5_cv_attr_constructor_destructor=yes,yes" diff --git a/pkgs/development/libraries/libav/default.nix b/pkgs/development/libraries/libav/default.nix index a3de9225d1ce..283c2034be7e 100644 --- a/pkgs/development/libraries/libav/default.nix +++ b/pkgs/development/libraries/libav/default.nix @@ -17,7 +17,7 @@ assert faacSupport -> enableUnfree; -let inherit (lib) optional hasPrefix enableFeature; in +let inherit (lib) optional optionals hasPrefix enableFeature; in /* ToDo: - more deps, inspiration: https://packages.ubuntu.com/raring/libav-tools @@ -77,7 +77,7 @@ let (enableFeature vaapiSupport "vaapi") (enableFeature vdpauSupport "vdpau") (enableFeature freetypeSupport "libfreetype") - ] ++ optional (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "--cross-prefix=${stdenv.cc.targetPrefix}" "--enable-cross-compile" ]; diff --git a/pkgs/development/libraries/libdaemon/default.nix b/pkgs/development/libraries/libdaemon/default.nix index 51df45809789..581cc723dc41 100644 --- a/pkgs/development/libraries/libdaemon/default.nix +++ b/pkgs/development/libraries/libdaemon/default.nix @@ -12,7 +12,7 @@ stdenv.mkDerivation rec { patches = [ ./fix-includes.patch ]; configureFlags = [ "--disable-lynx" ] - ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) + ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ # Can't run this test while cross-compiling "ac_cv_func_setpgrp_void=yes" ]; diff --git a/pkgs/development/libraries/libdeflate/default.nix b/pkgs/development/libraries/libdeflate/default.nix index 449a3d309cd1..39b80238b719 100644 --- a/pkgs/development/libraries/libdeflate/default.nix +++ b/pkgs/development/libraries/libdeflate/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { substituteInPlace Makefile --replace /usr/local $out ''; - makeFlags = lib.optional stdenv.hostPlatform.isStatic [ "DISABLE_SHARED=1"]; + makeFlags = lib.optionals stdenv.hostPlatform.isStatic [ "DISABLE_SHARED=1"]; nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; diff --git a/pkgs/development/libraries/libff/default.nix b/pkgs/development/libraries/libff/default.nix index 35b7a33cc38f..36e8bb78c839 100644 --- a/pkgs/development/libraries/libff/default.nix +++ b/pkgs/development/libraries/libff/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { }; cmakeFlags = [ "-DWITH_PROCPS=Off" ] - ++ lib.optional stdenv.isAarch64 [ "-DCURVE=ALT_BN128" "-DUSE_ASM=OFF" ]; + ++ lib.optionals stdenv.isAarch64 [ "-DCURVE=ALT_BN128" "-DUSE_ASM=OFF" ]; # CMake is hardcoded to always build static library which causes linker # failure for Haskell applications depending on haskellPackages.hevm on macOS. diff --git a/pkgs/development/libraries/libmcrypt/default.nix b/pkgs/development/libraries/libmcrypt/default.nix index 50bbf8383e61..953a6d03e5e6 100644 --- a/pkgs/development/libraries/libmcrypt/default.nix +++ b/pkgs/development/libraries/libmcrypt/default.nix @@ -13,7 +13,7 @@ stdenv.mkDerivation rec { buildInputs = optional stdenv.isDarwin darwin.cctools; - configureFlags = optional disablePosixThreads + configureFlags = optionals disablePosixThreads [ "--disable-posix-threads" ]; meta = { diff --git a/pkgs/development/libraries/libpam-wrapper/default.nix b/pkgs/development/libraries/libpam-wrapper/default.nix index 10d5c98b6687..0701ae0fc55f 100644 --- a/pkgs/development/libraries/libpam-wrapper/default.nix +++ b/pkgs/development/libraries/libpam-wrapper/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { sha256 = "00mqhsashx7njrvxz085d0b88nizhdy7m3x17ip5yhvwsl63km6p"; }; - nativeBuildInputs = [ cmake ] ++ lib.optional enablePython [ python ]; + nativeBuildInputs = [ cmake ] ++ lib.optionals enablePython [ python ]; # We must use linux-pam, using openpam will result in broken fprintd. buildInputs = [ linux-pam ]; diff --git a/pkgs/development/libraries/libvdpau/default.nix b/pkgs/development/libraries/libvdpau/default.nix index e3be4db26cd8..906a3c59234a 100644 --- a/pkgs/development/libraries/libvdpau/default.nix +++ b/pkgs/development/libraries/libvdpau/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { propagatedBuildInputs = [ xorg.libX11 ]; - mesonFlags = lib.optional stdenv.isLinux + mesonFlags = lib.optionals stdenv.isLinux [ "-Dmoduledir=${mesa.drivers.driverLink}/lib/vdpau" ]; NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-lX11"; diff --git a/pkgs/development/libraries/libvncserver/default.nix b/pkgs/development/libraries/libvncserver/default.nix index b9da7135f92e..c111a81b0ccb 100644 --- a/pkgs/development/libraries/libvncserver/default.nix +++ b/pkgs/development/libraries/libvncserver/default.nix @@ -36,7 +36,7 @@ stdenv.mkDerivation rec { libpng ] ++ lib.optionals stdenv.isLinux [ systemd - ] ++ lib.optional stdenv.isDarwin [ + ] ++ lib.optionals stdenv.isDarwin [ Carbon ]; diff --git a/pkgs/development/libraries/libxslt/default.nix b/pkgs/development/libraries/libxslt/default.nix index a3bb7128c0f1..5e520c315f7d 100644 --- a/pkgs/development/libraries/libxslt/default.nix +++ b/pkgs/development/libraries/libxslt/default.nix @@ -36,7 +36,7 @@ stdenv.mkDerivation rec { buildInputs = [ libxml2.dev libxcrypt - ] ++ lib.optional stdenv.isDarwin [ + ] ++ lib.optionals stdenv.isDarwin [ gettext ] ++ lib.optionals pythonSupport [ libxml2.py diff --git a/pkgs/development/libraries/mimalloc/default.nix b/pkgs/development/libraries/mimalloc/default.nix index cc67e2070949..6dcf1978edcf 100644 --- a/pkgs/development/libraries/mimalloc/default.nix +++ b/pkgs/development/libraries/mimalloc/default.nix @@ -24,7 +24,7 @@ stdenv.mkDerivation rec { ''; nativeBuildInputs = [ cmake ninja ]; - cmakeFlags = [ "-DMI_INSTALL_TOPLEVEL=ON" ] ++ lib.optional secureBuild [ "-DMI_SECURE=ON" ]; + cmakeFlags = [ "-DMI_INSTALL_TOPLEVEL=ON" ] ++ lib.optionals secureBuild [ "-DMI_SECURE=ON" ]; postInstall = let rel = lib.versions.majorMinor version; diff --git a/pkgs/development/libraries/nng/default.nix b/pkgs/development/libraries/nng/default.nix index 9acc64fea642..7f0bd15aa542 100644 --- a/pkgs/development/libraries/nng/default.nix +++ b/pkgs/development/libraries/nng/default.nix @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake ninja ] ++ lib.optionals mbedtlsSupport [ mbedtls ]; - buildInputs = lib.optional mbedtlsSupport [ mbedtls ]; + buildInputs = lib.optionals mbedtlsSupport [ mbedtls ]; cmakeFlags = [ "-G Ninja" "-DNNG_ENABLE_TLS=ON" ] ++ lib.optionals mbedtlsSupport [ "-DMBEDTLS_ROOT_DIR=${mbedtls}" ]; diff --git a/pkgs/development/libraries/openbsm/default.nix b/pkgs/development/libraries/openbsm/default.nix index 4719b7fb7470..627e9b830714 100644 --- a/pkgs/development/libraries/openbsm/default.nix +++ b/pkgs/development/libraries/openbsm/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { sha256 = "0b98359hd8mm585sh145ss828pg2y8vgz38lqrb7nypapiyqdnd1"; }; - patches = lib.optional stdenv.isDarwin [ ./bsm-add-audit_token_to_pid.patch ]; + patches = lib.optionals stdenv.isDarwin [ ./bsm-add-audit_token_to_pid.patch ]; preConfigure = lib.optionalString (lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11") '' MACOSX_DEPLOYMENT_TARGET=10.16 diff --git a/pkgs/development/libraries/opencv/3.x.nix b/pkgs/development/libraries/opencv/3.x.nix index 550a7f39373a..56b022d03b9b 100644 --- a/pkgs/development/libraries/opencv/3.x.nix +++ b/pkgs/development/libraries/opencv/3.x.nix @@ -248,7 +248,7 @@ stdenv.mkDerivation { "-DBUILD_opencv_videoio=OFF" ] ++ lib.optionals enablePython [ "-DOPENCV_SKIP_PYTHON_LOADER=ON" - ] ++ lib.optional enableEigen [ + ] ++ lib.optionals enableEigen [ # Autodetection broken by https://github.com/opencv/opencv/pull/13337 "-DEIGEN_INCLUDE_PATH=${eigen}/include/eigen3" ]; diff --git a/pkgs/development/libraries/openmpi/default.nix b/pkgs/development/libraries/openmpi/default.nix index 723f1848c6a0..f2392bb00726 100644 --- a/pkgs/development/libraries/openmpi/default.nix +++ b/pkgs/development/libraries/openmpi/default.nix @@ -50,7 +50,7 @@ in stdenv.mkDerivation rec { ++ lib.optionals cudaSupport [ cudatoolkit ] ++ [ libevent hwloc ] ++ lib.optional (stdenv.isLinux || stdenv.isFreeBSD) rdma-core - ++ lib.optional fabricSupport [ libpsm2 libfabric ]; + ++ lib.optionals fabricSupport [ libpsm2 libfabric ]; nativeBuildInputs = [ perl ] ++ lib.optionals fortranSupport [ gfortran ]; diff --git a/pkgs/development/libraries/openvino/default.nix b/pkgs/development/libraries/openvino/default.nix index dabf56d9056b..e3ebb97cbdff 100644 --- a/pkgs/development/libraries/openvino/default.nix +++ b/pkgs/development/libraries/openvino/default.nix @@ -68,7 +68,7 @@ stdenv.mkDerivation rec { "-DNGRAPH_UNIT_TEST_ENABLE:BOOL=OFF" "-DENABLE_SAMPLES:BOOL=OFF" "-DENABLE_CPPLINT:BOOL=OFF" - ] ++ lib.optional enablePython [ + ] ++ lib.optionals enablePython [ "-DENABLE_PYTHON:BOOL=ON" ]; @@ -106,7 +106,7 @@ stdenv.mkDerivation rec { python tbb shellcheck - ] ++ lib.optional enablePython (with python.pkgs; [ + ] ++ lib.optionals enablePython (with python.pkgs; [ cython pybind11 ]); diff --git a/pkgs/development/libraries/pangomm/2.48.nix b/pkgs/development/libraries/pangomm/2.48.nix index cdc644ec9cd9..12aec5bd68ea 100644 --- a/pkgs/development/libraries/pangomm/2.48.nix +++ b/pkgs/development/libraries/pangomm/2.48.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation rec { meson ninja python3 - ] ++ lib.optional stdenv.isDarwin [ + ] ++ lib.optionals stdenv.isDarwin [ ApplicationServices ]; diff --git a/pkgs/development/libraries/poppler/default.nix b/pkgs/development/libraries/poppler/default.nix index cba1af704607..8ff218b79316 100644 --- a/pkgs/development/libraries/poppler/default.nix +++ b/pkgs/development/libraries/poppler/default.nix @@ -77,7 +77,7 @@ stdenv.mkDerivation (finalAttrs: rec { pcre libiconv libintl - ] ++ lib.optional withData [ + ] ++ lib.optionals withData [ poppler_data ]; diff --git a/pkgs/development/libraries/precice/default.nix b/pkgs/development/libraries/precice/default.nix index bc6a9359e614..01ab32577cb2 100644 --- a/pkgs/development/libraries/precice/default.nix +++ b/pkgs/development/libraries/precice/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { "-DPYTHON_INCLUDE_DIR=${python3}/include/${python3.libPrefix}" ]; - NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin [ "-D_GNU_SOURCE" ]; + NIX_CFLAGS_COMPILE = lib.optionals stdenv.isDarwin [ "-D_GNU_SOURCE" ]; nativeBuildInputs = [ cmake gcc ]; buildInputs = [ boost eigen libxml2 mpi python3 python3.pkgs.numpy ]; diff --git a/pkgs/development/libraries/qt-5/modules/qtlocation.nix b/pkgs/development/libraries/qt-5/modules/qtlocation.nix index 687571f18d29..b5fdc918dc69 100644 --- a/pkgs/development/libraries/qt-5/modules/qtlocation.nix +++ b/pkgs/development/libraries/qt-5/modules/qtlocation.nix @@ -4,7 +4,7 @@ qtModule { pname = "qtlocation"; qtInputs = [ qtbase qtmultimedia ]; outputs = [ "bin" "out" "dev" ]; - qmakeFlags = lib.optional stdenv.isDarwin [ + qmakeFlags = lib.optionals stdenv.isDarwin [ # boost uses std::auto_ptr which has been disabled in clang with libcxx # This flag re-enables this feature # https://libcxx.llvm.org/docs/UsingLibcxx.html#c-17-specific-configuration-macros diff --git a/pkgs/development/libraries/redis-plus-plus/default.nix b/pkgs/development/libraries/redis-plus-plus/default.nix index 7d3d7d486714..61e593d28c93 100644 --- a/pkgs/development/libraries/redis-plus-plus/default.nix +++ b/pkgs/development/libraries/redis-plus-plus/default.nix @@ -22,9 +22,9 @@ stdenv.mkDerivation rec { cmakeFlags = [ "-DREDIS_PLUS_PLUS_BUILD_TEST=OFF" - ] ++ lib.optional (!enableShared) [ + ] ++ lib.optionals (!enableShared) [ "-DREDIS_PLUS_PLUS_BUILD_SHARED=OFF" - ] ++ lib.optional (!enableStatic) [ + ] ++ lib.optionals (!enableStatic) [ "-DREDIS_PLUS_PLUS_BUILD_STATIC=OFF" ]; diff --git a/pkgs/development/libraries/science/math/faiss/default.nix b/pkgs/development/libraries/science/math/faiss/default.nix index f2d5e29f6a4a..9c83a1220e46 100644 --- a/pkgs/development/libraries/science/math/faiss/default.nix +++ b/pkgs/development/libraries/science/math/faiss/default.nix @@ -56,7 +56,7 @@ stdenv.mkDerivation { nativeBuildInputs = [ cmake ] ++ lib.optionals cudaSupport [ cudatoolkit addOpenGLRunpath - ] ++ lib.optional pythonSupport [ + ] ++ lib.optionals pythonSupport [ pythonPackages.python ]; diff --git a/pkgs/development/libraries/science/networking/ns-3/default.nix b/pkgs/development/libraries/science/networking/ns-3/default.nix index b9f7946f7161..9f80470eff2c 100644 --- a/pkgs/development/libraries/science/networking/ns-3/default.nix +++ b/pkgs/development/libraries/science/networking/ns-3/default.nix @@ -53,8 +53,8 @@ stdenv.mkDerivation rec { # ncurses is a hidden dependency of waf when checking python buildInputs = lib.optionals pythonSupport [ castxml ncurses ] - ++ lib.optional enableDoxygen [ doxygen graphviz imagemagick ] - ++ lib.optional withManual [ dia tetex ghostscript texlive.combined.scheme-medium ]; + ++ lib.optionals enableDoxygen [ doxygen graphviz imagemagick ] + ++ lib.optionals withManual [ dia tetex ghostscript texlive.combined.scheme-medium ]; propagatedBuildInputs = [ pythonEnv ]; diff --git a/pkgs/development/libraries/speechd/default.nix b/pkgs/development/libraries/speechd/default.nix index d27eabecf465..021246d73028 100644 --- a/pkgs/development/libraries/speechd/default.nix +++ b/pkgs/development/libraries/speechd/default.nix @@ -69,9 +69,9 @@ in stdenv.mkDerivation rec { espeak sonic pcaudiolib - ] ++ lib.optional withFlite [ + ] ++ lib.optionals withFlite [ flite - ] ++ lib.optional withPico [ + ] ++ lib.optionals withPico [ svox ]; @@ -83,17 +83,17 @@ in stdenv.mkDerivation rec { # Audio method falls back from left to right. "--with-default-audio-method=\"libao,pulse,alsa,oss\"" "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" - ] ++ lib.optional withPulse [ + ] ++ lib.optionals withPulse [ "--with-pulse" - ] ++ lib.optional withAlsa [ + ] ++ lib.optionals withAlsa [ "--with-alsa" - ] ++ lib.optional withLibao [ + ] ++ lib.optionals withLibao [ "--with-libao" - ] ++ lib.optional withOss [ + ] ++ lib.optionals withOss [ "--with-oss" - ] ++ lib.optional withEspeak [ + ] ++ lib.optionals withEspeak [ "--with-espeak-ng" - ] ++ lib.optional withPico [ + ] ++ lib.optionals withPico [ "--with-pico" ]; diff --git a/pkgs/development/libraries/vtk/generic.nix b/pkgs/development/libraries/vtk/generic.nix index b88ddee6b249..555e7d0a45de 100644 --- a/pkgs/development/libraries/vtk/generic.nix +++ b/pkgs/development/libraries/vtk/generic.nix @@ -48,7 +48,7 @@ in stdenv.mkDerivation rec { ImageIO OpenGL GLUT - ] ++ optional enablePython [ + ] ++ optionals enablePython [ pythonInterpreter ]; propagatedBuildInputs = optionals stdenv.isDarwin [ libobjc ]; diff --git a/pkgs/development/mobile/androidenv/cmake.nix b/pkgs/development/mobile/androidenv/cmake.nix index 3abad6b41f62..7df24ad4cc22 100644 --- a/pkgs/development/mobile/androidenv/cmake.nix +++ b/pkgs/development/mobile/androidenv/cmake.nix @@ -3,7 +3,7 @@ deployAndroidPackage { inherit package os; nativeBuildInputs = lib.optionals stdenv.isLinux [ autoPatchelfHook ]; - buildInputs = lib.optional (os == "linux") [ pkgs.stdenv.cc.libc pkgs.stdenv.cc.cc pkgs.ncurses5 ]; + buildInputs = lib.optionals (os == "linux") [ pkgs.stdenv.cc.libc pkgs.stdenv.cc.cc pkgs.ncurses5 ]; patchInstructions = lib.optionalString (os == "linux") '' autoPatchelf $packageBaseDir/bin ''; diff --git a/pkgs/development/mobile/androidenv/ndk-bundle/default.nix b/pkgs/development/mobile/androidenv/ndk-bundle/default.nix index 0f3e7e4faa23..ad729e24fb8a 100644 --- a/pkgs/development/mobile/androidenv/ndk-bundle/default.nix +++ b/pkgs/development/mobile/androidenv/ndk-bundle/default.nix @@ -12,7 +12,7 @@ deployAndroidPackage { nativeBuildInputs = [ makeWrapper ] ++ lib.optionals stdenv.isLinux [ autoPatchelfHook ]; autoPatchelfIgnoreMissingDeps = true; - buildInputs = lib.optional (os == "linux") [ pkgs.zlib ]; + buildInputs = lib.optionals (os == "linux") [ pkgs.zlib ]; patchInstructions = lib.optionalString (os == "linux") ('' patchShebangs . diff --git a/pkgs/development/mobile/androidenv/tools/25.nix b/pkgs/development/mobile/androidenv/tools/25.nix index 28ea249df25c..82642e04280b 100644 --- a/pkgs/development/mobile/androidenv/tools/25.nix +++ b/pkgs/development/mobile/androidenv/tools/25.nix @@ -3,7 +3,7 @@ deployAndroidPackage { name = "androidsdk"; nativeBuildInputs = [ autoPatchelfHook makeWrapper ]; - buildInputs = lib.optional (os == "linux") [ pkgs.glibc pkgs.xorg.libX11 pkgs.xorg.libXext pkgs.xorg.libXdamage pkgs.xorg.libxcb pkgs.xorg.libXfixes pkgs.xorg.libXrender pkgs.fontconfig.lib pkgs.freetype pkgs.libGL pkgs.zlib pkgs.ncurses5 pkgs.libpulseaudio pkgs_i686.glibc pkgs_i686.xorg.libX11 pkgs_i686.xorg.libXrender pkgs_i686.fontconfig pkgs_i686.freetype pkgs_i686.zlib ]; + buildInputs = lib.optionals (os == "linux") [ pkgs.glibc pkgs.xorg.libX11 pkgs.xorg.libXext pkgs.xorg.libXdamage pkgs.xorg.libxcb pkgs.xorg.libXfixes pkgs.xorg.libXrender pkgs.fontconfig.lib pkgs.freetype pkgs.libGL pkgs.zlib pkgs.ncurses5 pkgs.libpulseaudio pkgs_i686.glibc pkgs_i686.xorg.libX11 pkgs_i686.xorg.libXrender pkgs_i686.fontconfig pkgs_i686.freetype pkgs_i686.zlib ]; inherit package os; patchInstructions = '' diff --git a/pkgs/development/python-modules/aiodns/default.nix b/pkgs/development/python-modules/aiodns/default.nix index 9c626618ff0a..a5cf035aa060 100644 --- a/pkgs/development/python-modules/aiodns/default.nix +++ b/pkgs/development/python-modules/aiodns/default.nix @@ -20,7 +20,7 @@ buildPythonPackage rec { propagatedBuildInputs = [ pycares - ] ++ lib.optional (pythonOlder "3.7") [ + ] ++ lib.optionals (pythonOlder "3.7") [ typing ]; diff --git a/pkgs/development/python-modules/ansible-runner/default.nix b/pkgs/development/python-modules/ansible-runner/default.nix index c261e5b163b7..14dfb65cfea8 100644 --- a/pkgs/development/python-modules/ansible-runner/default.nix +++ b/pkgs/development/python-modules/ansible-runner/default.nix @@ -65,7 +65,7 @@ buildPythonPackage rec { "test_large_stdout_blob" # Failed: DID NOT RAISE "test_validate_pattern" - ] ++ lib.optional stdenv.isDarwin [ + ] ++ lib.optionals stdenv.isDarwin [ # test_process_isolation_settings is currently broken on Darwin Catalina # https://github.com/ansible/ansible-runner/issues/413 "process_isolation_settings" diff --git a/pkgs/development/python-modules/aspy-refactor-imports/default.nix b/pkgs/development/python-modules/aspy-refactor-imports/default.nix index cfe935e16e80..a19002449dfa 100644 --- a/pkgs/development/python-modules/aspy-refactor-imports/default.nix +++ b/pkgs/development/python-modules/aspy-refactor-imports/default.nix @@ -27,7 +27,7 @@ buildPythonPackage rec { ]; # fails on darwin due to case-insensitive file system - disabledTests = lib.optional stdenv.isDarwin ["test_application_directory_case"]; + disabledTests = lib.optionals stdenv.isDarwin ["test_application_directory_case"]; meta = with lib; { description = "Utilities for refactoring imports in python-like syntax."; diff --git a/pkgs/development/python-modules/asyncio_mqtt/default.nix b/pkgs/development/python-modules/asyncio_mqtt/default.nix index c0ae1cea95f7..a87bca439643 100644 --- a/pkgs/development/python-modules/asyncio_mqtt/default.nix +++ b/pkgs/development/python-modules/asyncio_mqtt/default.nix @@ -19,7 +19,7 @@ buildPythonPackage rec { propagatedBuildInputs = [ paho-mqtt - ] ++ lib.optional (pythonOlder "3.7") [ + ] ++ lib.optionals (pythonOlder "3.7") [ async_generator ]; diff --git a/pkgs/development/python-modules/azure-core/default.nix b/pkgs/development/python-modules/azure-core/default.nix index 5237130f59f8..75cf39587615 100644 --- a/pkgs/development/python-modules/azure-core/default.nix +++ b/pkgs/development/python-modules/azure-core/default.nix @@ -63,7 +63,7 @@ buildPythonPackage rec { # disable 8 tests failing on some darwin machines with errors: # azure.core.polling.base_polling.BadStatus: Invalid return status 403 for 'GET' operation # azure.core.exceptions.HttpResponseError: Operation returned an invalid status 'Forbidden' - ] ++ lib.optional stdenv.isDarwin [ + ] ++ lib.optionals stdenv.isDarwin [ "location_polling_fail" ]; disabledTestPaths = [ diff --git a/pkgs/development/python-modules/betterproto/default.nix b/pkgs/development/python-modules/betterproto/default.nix index 2f6ba2e29a23..b49204ee8c44 100644 --- a/pkgs/development/python-modules/betterproto/default.nix +++ b/pkgs/development/python-modules/betterproto/default.nix @@ -35,7 +35,7 @@ buildPythonPackage rec { propagatedBuildInputs = [ grpclib python-dateutil - ] ++ lib.optional (pythonOlder "3.7") [ + ] ++ lib.optionals (pythonOlder "3.7") [ dataclasses ]; diff --git a/pkgs/development/python-modules/catboost/default.nix b/pkgs/development/python-modules/catboost/default.nix index 02e107f27e19..9a395bc6c98e 100644 --- a/pkgs/development/python-modules/catboost/default.nix +++ b/pkgs/development/python-modules/catboost/default.nix @@ -19,7 +19,7 @@ buildPythonPackage rec { nativeBuildInputs = [ clang_12 python2 ]; propagatedBuildInputs = [ graphviz matplotlib numpy pandas scipy plotly six ] - ++ lib.optional withCuda [ cudatoolkit ]; + ++ lib.optionals withCuda [ cudatoolkit ]; patches = [ ./nix-support.patch diff --git a/pkgs/development/python-modules/ciso8601/default.nix b/pkgs/development/python-modules/ciso8601/default.nix index e210e974414d..79afe8500072 100644 --- a/pkgs/development/python-modules/ciso8601/default.nix +++ b/pkgs/development/python-modules/ciso8601/default.nix @@ -19,7 +19,7 @@ buildPythonPackage rec { checkInputs = [ pytz - ] ++ lib.optional (isPy27) [ + ] ++ lib.optionals (isPy27) [ unittest2 ]; diff --git a/pkgs/development/python-modules/deprecation/default.nix b/pkgs/development/python-modules/deprecation/default.nix index 441971fa6e70..0e15f2d74c61 100644 --- a/pkgs/development/python-modules/deprecation/default.nix +++ b/pkgs/development/python-modules/deprecation/default.nix @@ -30,7 +30,7 @@ buildPythonPackage rec { # avoiding mass rebuilds for python3.9, but no longer # needed with patch - checkInputs = [ unittestCheckHook ] ++ lib.optional (pythonOlder "3.10") [ + checkInputs = [ unittestCheckHook ] ++ lib.optionals (pythonOlder "3.10") [ unittest2 ]; diff --git a/pkgs/development/python-modules/dnspython/default.nix b/pkgs/development/python-modules/dnspython/default.nix index 1dbbba48b104..4b7148596492 100644 --- a/pkgs/development/python-modules/dnspython/default.nix +++ b/pkgs/development/python-modules/dnspython/default.nix @@ -21,7 +21,7 @@ buildPythonPackage rec { checkInputs = [ pytestCheckHook - ] ++ lib.optional stdenv.isDarwin [ + ] ++ lib.optionals stdenv.isDarwin [ cacert ]; diff --git a/pkgs/development/python-modules/enlighten/default.nix b/pkgs/development/python-modules/enlighten/default.nix index b6d31ddaf947..e970aaee3375 100644 --- a/pkgs/development/python-modules/enlighten/default.nix +++ b/pkgs/development/python-modules/enlighten/default.nix @@ -36,7 +36,7 @@ buildPythonPackage rec { disabledTests = [ # AssertionError: <_io.TextIOWrapper name='' mode='w' encoding='utf-8'> is not... "test_init" - ] ++ lib.optional stdenv.isDarwin [ + ] ++ lib.optionals stdenv.isDarwin [ # https://github.com/Rockhopper-Technologies/enlighten/issues/44 "test_autorefresh" ]; diff --git a/pkgs/development/python-modules/fixtures/default.nix b/pkgs/development/python-modules/fixtures/default.nix index 3e9f9943327d..2bc6612ba70d 100644 --- a/pkgs/development/python-modules/fixtures/default.nix +++ b/pkgs/development/python-modules/fixtures/default.nix @@ -19,7 +19,7 @@ buildPythonPackage rec { sha256 = "fcf0d60234f1544da717a9738325812de1f42c2fa085e2d9252d8fff5712b2ef"; }; - patches = lib.optional (pythonAtLeast "3.9") [ + patches = lib.optionals (pythonAtLeast "3.9") [ # drop tests that try to monkeypatch a classmethod, which fails on python3.9 # https://github.com/testing-cabal/fixtures/issues/44 (fetchpatch { diff --git a/pkgs/development/python-modules/funcsigs/default.nix b/pkgs/development/python-modules/funcsigs/default.nix index 115d358cb786..a59b6f33b5f6 100644 --- a/pkgs/development/python-modules/funcsigs/default.nix +++ b/pkgs/development/python-modules/funcsigs/default.nix @@ -12,7 +12,7 @@ buildPythonPackage rec { }; # https://github.com/testing-cabal/funcsigs/issues/10 - patches = lib.optional (isPyPy && isPy3k) [ ./fix-pypy3-tests.patch ]; + patches = lib.optionals (isPyPy && isPy3k) [ ./fix-pypy3-tests.patch ]; # requires, unittest2 and package hasn't been maintained since 2013 doCheck = false; diff --git a/pkgs/development/python-modules/glymur/default.nix b/pkgs/development/python-modules/glymur/default.nix index 40748f86954e..9c652994a8c3 100644 --- a/pkgs/development/python-modules/glymur/default.nix +++ b/pkgs/development/python-modules/glymur/default.nix @@ -26,7 +26,7 @@ buildPythonPackage rec { propagatedBuildInputs = [ numpy - ] ++ lib.optional isPy27 [ contextlib2 mock importlib-resources ]; + ] ++ lib.optionals isPy27 [ contextlib2 mock importlib-resources ]; checkInputs = [ scikitimage diff --git a/pkgs/development/python-modules/hupper/default.nix b/pkgs/development/python-modules/hupper/default.nix index 972606974602..a9e8bd112163 100644 --- a/pkgs/development/python-modules/hupper/default.nix +++ b/pkgs/development/python-modules/hupper/default.nix @@ -19,7 +19,7 @@ buildPythonPackage rec { # segfaults in the testsuite that end up failing the tests in a background thread (in myapp) checkInputs = [ pytestCheckHook - ] ++ lib.optional (!stdenv.isDarwin) [ + ] ++ lib.optionals (!stdenv.isDarwin) [ watchdog ]; diff --git a/pkgs/development/python-modules/importlib-resources/default.nix b/pkgs/development/python-modules/importlib-resources/default.nix index 7e5d7e1448ac..124733568723 100644 --- a/pkgs/development/python-modules/importlib-resources/default.nix +++ b/pkgs/development/python-modules/importlib-resources/default.nix @@ -27,7 +27,7 @@ buildPythonPackage rec { propagatedBuildInputs = [ importlib-metadata - ] ++ lib.optional (pythonOlder "3.5") [ + ] ++ lib.optionals (pythonOlder "3.5") [ typing ]; diff --git a/pkgs/development/python-modules/jaraco_text/default.nix b/pkgs/development/python-modules/jaraco_text/default.nix index 341c744a4293..4891b2ea38c5 100644 --- a/pkgs/development/python-modules/jaraco_text/default.nix +++ b/pkgs/development/python-modules/jaraco_text/default.nix @@ -37,13 +37,13 @@ buildPythonPackage rec { jaraco-context jaraco_functools inflect - ] ++ lib.optional (pythonOlder "3.9") [ + ] ++ lib.optionals (pythonOlder "3.9") [ importlib-resources ]; checkInputs = [ pytestCheckHook - ] ++ lib.optional (pythonOlder "3.10") [ + ] ++ lib.optionals (pythonOlder "3.10") [ pathlib2 ]; diff --git a/pkgs/development/python-modules/jaxlib/default.nix b/pkgs/development/python-modules/jaxlib/default.nix index 12ba67b71244..c745737d3523 100644 --- a/pkgs/development/python-modules/jaxlib/default.nix +++ b/pkgs/development/python-modules/jaxlib/default.nix @@ -219,11 +219,11 @@ let # relevant dependencies can be downloaded. bazelFlags = [ "-c opt" - ] ++ lib.optional (stdenv.targetPlatform.isx86_64 && stdenv.targetPlatform.isUnix) [ + ] ++ lib.optionals (stdenv.targetPlatform.isx86_64 && stdenv.targetPlatform.isUnix) [ "--config=avx_posix" - ] ++ lib.optional cudaSupport [ + ] ++ lib.optionals cudaSupport [ "--config=cuda" - ] ++ lib.optional mklSupport [ + ] ++ lib.optionals mklSupport [ "--config=mkl_open_source_only" ] ++ lib.optionals stdenv.cc.isClang [ # bazel depends on the compiler frontend automatically selecting these flags based on file diff --git a/pkgs/development/python-modules/lightgbm/default.nix b/pkgs/development/python-modules/lightgbm/default.nix index 015417151b7a..ad54268c8cf5 100644 --- a/pkgs/development/python-modules/lightgbm/default.nix +++ b/pkgs/development/python-modules/lightgbm/default.nix @@ -23,7 +23,7 @@ buildPythonPackage rec { dontUseCmakeConfigure = true; - buildInputs = lib.optional stdenv.cc.isClang [ llvmPackages.openmp ]; + buildInputs = lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ]; propagatedBuildInputs = [ numpy scipy diff --git a/pkgs/development/python-modules/markdown-it-py/default.nix b/pkgs/development/python-modules/markdown-it-py/default.nix index f4c83d5df348..d408c0071003 100644 --- a/pkgs/development/python-modules/markdown-it-py/default.nix +++ b/pkgs/development/python-modules/markdown-it-py/default.nix @@ -35,7 +35,7 @@ buildPythonPackage rec { attrs linkify-it-py mdurl - ] ++ lib.optional (pythonOlder "3.8") [ + ] ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; diff --git a/pkgs/development/python-modules/matplotlib/default.nix b/pkgs/development/python-modules/matplotlib/default.nix index ad32c3db7eb6..6a507d01ef3b 100644 --- a/pkgs/development/python-modules/matplotlib/default.nix +++ b/pkgs/development/python-modules/matplotlib/default.nix @@ -39,9 +39,9 @@ buildPythonPackage rec { buildInputs = [ which sphinx - ] ++ lib.optional enableGhostscript [ + ] ++ lib.optionals enableGhostscript [ ghostscript - ] ++ lib.optional stdenv.isDarwin [ + ] ++ lib.optionals stdenv.isDarwin [ Cocoa ]; diff --git a/pkgs/development/python-modules/nipy/default.nix b/pkgs/development/python-modules/nipy/default.nix index 5bdf6fdcd443..d5e399701dc8 100644 --- a/pkgs/development/python-modules/nipy/default.nix +++ b/pkgs/development/python-modules/nipy/default.nix @@ -21,7 +21,7 @@ buildPythonPackage rec { sha256 = "a8a2c97ce854fece4aced5a6394b9fdca5846150ad6d2a36b86590924af3c848"; }; - buildInputs = lib.optional doCheck [ nose ]; + buildInputs = lib.optionals doCheck [ nose ]; propagatedBuildInputs = [ matplotlib nibabel numpy scipy sympy ]; checkPhase = '' # wants to be run in a different directory diff --git a/pkgs/development/python-modules/notebook/default.nix b/pkgs/development/python-modules/notebook/default.nix index 4efaaf3f9ec9..fdb599466ff2 100644 --- a/pkgs/development/python-modules/notebook/default.nix +++ b/pkgs/development/python-modules/notebook/default.nix @@ -68,7 +68,7 @@ buildPythonPackage rec { "sock_server" "test_list_formats" # tries to find python MIME type "KernelCullingTest" # has a race condition failing on slower hardware - ] ++ lib.optional stdenv.isDarwin [ + ] ++ lib.optionals stdenv.isDarwin [ "test_delete" "test_checkpoints_follow_file" ]; diff --git a/pkgs/development/python-modules/numba/default.nix b/pkgs/development/python-modules/numba/default.nix index 2ca0e08ba5b1..965130658c44 100644 --- a/pkgs/development/python-modules/numba/default.nix +++ b/pkgs/development/python-modules/numba/default.nix @@ -40,7 +40,7 @@ in buildPythonPackage rec { NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${lib.getDev libcxx}/include/c++/v1"; - nativeBuildInputs = lib.optional cudaSupport [ + nativeBuildInputs = lib.optionals cudaSupport [ addOpenGLRunpath ]; diff --git a/pkgs/development/python-modules/paho-mqtt/default.nix b/pkgs/development/python-modules/paho-mqtt/default.nix index fb249acf6333..e25f54748685 100644 --- a/pkgs/development/python-modules/paho-mqtt/default.nix +++ b/pkgs/development/python-modules/paho-mqtt/default.nix @@ -22,7 +22,7 @@ buildPythonPackage rec { checkInputs = [ pytestCheckHook six - ] ++ lib.optional (!isPy3k) [ + ] ++ lib.optionals (!isPy3k) [ mock ]; diff --git a/pkgs/development/python-modules/peewee/default.nix b/pkgs/development/python-modules/peewee/default.nix index 86fcd3948a6c..bb1370fe0737 100644 --- a/pkgs/development/python-modules/peewee/default.nix +++ b/pkgs/development/python-modules/peewee/default.nix @@ -34,9 +34,9 @@ buildPythonPackage rec { propagatedBuildInputs = [ apsw - ] ++ lib.optional withPostgres [ + ] ++ lib.optionals withPostgres [ psycopg2 - ] ++ lib.optional withMysql [ + ] ++ lib.optionals withMysql [ mysql-connector ]; diff --git a/pkgs/development/python-modules/pygit2/default.nix b/pkgs/development/python-modules/pygit2/default.nix index 565cd6d67ec9..413b79c562b1 100644 --- a/pkgs/development/python-modules/pygit2/default.nix +++ b/pkgs/development/python-modules/pygit2/default.nix @@ -35,11 +35,11 @@ buildPythonPackage rec { propagatedBuildInputs = [ cached-property pycparser - ] ++ lib.optional (!isPyPy) [ + ] ++ lib.optionals (!isPyPy) [ cffi ]; - propagatedNativeBuildInputs = lib.optional (!isPyPy) [ + propagatedNativeBuildInputs = lib.optionals (!isPyPy) [ cffi ]; diff --git a/pkgs/development/python-modules/pyls-mypy/default.nix b/pkgs/development/python-modules/pyls-mypy/default.nix index acce4469eed4..ad387106e885 100644 --- a/pkgs/development/python-modules/pyls-mypy/default.nix +++ b/pkgs/development/python-modules/pyls-mypy/default.nix @@ -38,7 +38,7 @@ buildPythonPackage rec { propagatedBuildInputs = [ mypy python-language-server configparser - ] ++ lib.optional (isPy27) [ + ] ++ lib.optionals (isPy27) [ future ]; diff --git a/pkgs/development/python-modules/python-miio/default.nix b/pkgs/development/python-modules/python-miio/default.nix index d1497c43bcb7..32d5d542c30a 100644 --- a/pkgs/development/python-modules/python-miio/default.nix +++ b/pkgs/development/python-modules/python-miio/default.nix @@ -54,7 +54,7 @@ buildPythonPackage rec { pyyaml tqdm zeroconf - ] ++ lib.optional (pythonOlder "3.8") [ + ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata ]; diff --git a/pkgs/development/python-modules/qutip/default.nix b/pkgs/development/python-modules/qutip/default.nix index e99deef489f3..519cb9957bcc 100644 --- a/pkgs/development/python-modules/qutip/default.nix +++ b/pkgs/development/python-modules/qutip/default.nix @@ -46,7 +46,7 @@ buildPythonPackage rec { ] ++ passthru.optional-dependencies.graphics; # Disabling OpenMP support on Darwin. - setupPyGlobalFlags = lib.optional (!stdenv.isDarwin) [ + setupPyGlobalFlags = lib.optionals (!stdenv.isDarwin) [ "--with-openmp" ]; diff --git a/pkgs/development/python-modules/rdflib/default.nix b/pkgs/development/python-modules/rdflib/default.nix index 1aa995d85d77..27356390cfda 100644 --- a/pkgs/development/python-modules/rdflib/default.nix +++ b/pkgs/development/python-modules/rdflib/default.nix @@ -68,7 +68,7 @@ buildPythonPackage rec { # Requires network access "test_service" "testGuessFormatForParse" - ] ++ lib.optional stdenv.isDarwin [ + ] ++ lib.optionals stdenv.isDarwin [ # Require loopback network access "TestGraphHTTP" ]; diff --git a/pkgs/development/python-modules/rich/default.nix b/pkgs/development/python-modules/rich/default.nix index 36e7ca24fbdb..c2cd935c651f 100644 --- a/pkgs/development/python-modules/rich/default.nix +++ b/pkgs/development/python-modules/rich/default.nix @@ -35,9 +35,9 @@ buildPythonPackage rec { propagatedBuildInputs = [ CommonMark pygments - ] ++ lib.optional (pythonOlder "3.7") [ + ] ++ lib.optionals (pythonOlder "3.7") [ dataclasses - ] ++ lib.optional (pythonOlder "3.9") [ + ] ++ lib.optionals (pythonOlder "3.9") [ typing-extensions ]; diff --git a/pkgs/development/python-modules/simple-di/default.nix b/pkgs/development/python-modules/simple-di/default.nix index c79b58f8a629..150eb52f8d4e 100644 --- a/pkgs/development/python-modules/simple-di/default.nix +++ b/pkgs/development/python-modules/simple-di/default.nix @@ -23,7 +23,7 @@ buildPythonPackage rec { propagatedBuildInputs = [ setuptools typing-extensions - ] ++ lib.optional (pythonOlder "3.7") [ + ] ++ lib.optionals (pythonOlder "3.7") [ dataclasses ]; diff --git a/pkgs/development/python-modules/spacy/default.nix b/pkgs/development/python-modules/spacy/default.nix index cc1c01adf288..f197b1080fb3 100644 --- a/pkgs/development/python-modules/spacy/default.nix +++ b/pkgs/development/python-modules/spacy/default.nix @@ -63,7 +63,7 @@ buildPythonPackage rec { tqdm typer wasabi - ] ++ lib.optional (pythonOlder "3.8") [ + ] ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ]; diff --git a/pkgs/development/python-modules/sphinx/default.nix b/pkgs/development/python-modules/sphinx/default.nix index 0983fb7e7a73..5a27f04bd0ee 100644 --- a/pkgs/development/python-modules/sphinx/default.nix +++ b/pkgs/development/python-modules/sphinx/default.nix @@ -107,7 +107,7 @@ buildPythonPackage rec { # requires imagemagick (increases build closure size), doesn't # test anything substantial "test_ext_imgconverter" - ] ++ lib.optional stdenv.isDarwin [ + ] ++ lib.optionals stdenv.isDarwin [ # Due to lack of network sandboxing can't guarantee port 7777 isn't bound "test_inspect_main_url" "test_auth_header_uses_first_match" diff --git a/pkgs/development/python-modules/starlette/default.nix b/pkgs/development/python-modules/starlette/default.nix index d1e8f789fc38..78a428a2a724 100644 --- a/pkgs/development/python-modules/starlette/default.nix +++ b/pkgs/development/python-modules/starlette/default.nix @@ -50,7 +50,7 @@ buildPythonPackage rec { typing-extensions ] ++ lib.optionals (pythonOlder "3.7") [ contextlib2 - ] ++ lib.optional stdenv.isDarwin [ + ] ++ lib.optionals stdenv.isDarwin [ ApplicationServices ]; diff --git a/pkgs/development/python-modules/tensorflow/bin.nix b/pkgs/development/python-modules/tensorflow/bin.nix index b266f837f849..ca3c818d34af 100644 --- a/pkgs/development/python-modules/tensorflow/bin.nix +++ b/pkgs/development/python-modules/tensorflow/bin.nix @@ -82,7 +82,7 @@ in buildPythonPackage { ++ lib.optionals (pythonOlder "3.4") [ backports_weakref ]; # remove patchelfUnstable once patchelf 0.14 with https://github.com/NixOS/patchelf/pull/256 becomes the default - nativeBuildInputs = [ wheel ] ++ lib.optional cudaSupport [ addOpenGLRunpath patchelfUnstable ]; + nativeBuildInputs = [ wheel ] ++ lib.optionals cudaSupport [ addOpenGLRunpath patchelfUnstable ]; preConfigure = '' unset SOURCE_DATE_EPOCH diff --git a/pkgs/development/python-modules/tensorflow/default.nix b/pkgs/development/python-modules/tensorflow/default.nix index 31fff4832052..c8308b2f80ac 100644 --- a/pkgs/development/python-modules/tensorflow/default.nix +++ b/pkgs/development/python-modules/tensorflow/default.nix @@ -483,7 +483,7 @@ in buildPythonPackage { ]; # remove patchelfUnstable once patchelf 0.14 with https://github.com/NixOS/patchelf/pull/256 becomes the default - nativeBuildInputs = lib.optional cudaSupport [ addOpenGLRunpath patchelfUnstable ]; + nativeBuildInputs = lib.optionals cudaSupport [ addOpenGLRunpath patchelfUnstable ]; postFixup = lib.optionalString cudaSupport '' find $out -type f \( -name '*.so' -or -name '*.so.*' \) | while read lib; do diff --git a/pkgs/development/python-modules/thinc/default.nix b/pkgs/development/python-modules/thinc/default.nix index 51ee2803f3cf..6da1ae894450 100644 --- a/pkgs/development/python-modules/thinc/default.nix +++ b/pkgs/development/python-modules/thinc/default.nix @@ -66,9 +66,9 @@ buildPythonPackage rec { tqdm pydantic wasabi - ] ++ lib.optional (pythonOlder "3.8") [ + ] ++ lib.optionals (pythonOlder "3.8") [ typing-extensions - ] ++ lib.optional (pythonOlder "3.7") [ + ] ++ lib.optionals (pythonOlder "3.7") [ contextvars dataclasses ]; diff --git a/pkgs/development/python-modules/tzdata/default.nix b/pkgs/development/python-modules/tzdata/default.nix index c701d3683cdb..d1fed0b21fa9 100644 --- a/pkgs/development/python-modules/tzdata/default.nix +++ b/pkgs/development/python-modules/tzdata/default.nix @@ -25,7 +25,7 @@ buildPythonPackage rec { checkInputs = [ pytestCheckHook pytest-subtests - ] ++ lib.optional (pythonOlder "3.7") [ + ] ++ lib.optionals (pythonOlder "3.7") [ importlib-resources ]; diff --git a/pkgs/development/python-modules/wandb/default.nix b/pkgs/development/python-modules/wandb/default.nix index b1ad380f04b9..090b7a247651 100644 --- a/pkgs/development/python-modules/wandb/default.nix +++ b/pkgs/development/python-modules/wandb/default.nix @@ -157,7 +157,7 @@ buildPythonPackage rec { # Disable test that fails on darwin due to issue with python3Packages.psutil: # https://github.com/giampaolo/psutil/issues/1219 - disabledTests = lib.optional stdenv.isDarwin [ + disabledTests = lib.optionals stdenv.isDarwin [ "test_tpu_system_stats" ]; diff --git a/pkgs/development/python-modules/web3/default.nix b/pkgs/development/python-modules/web3/default.nix index b07bc9cee9d7..8515ccda3625 100644 --- a/pkgs/development/python-modules/web3/default.nix +++ b/pkgs/development/python-modules/web3/default.nix @@ -56,7 +56,7 @@ buildPythonPackage rec { protobuf requests websockets - ] ++ lib.optional (pythonOlder "3.8") [ + ] ++ lib.optionals (pythonOlder "3.8") [ typing-extensions ] ++ eth-hash.optional-dependencies.pycryptodome; diff --git a/pkgs/development/python-modules/yamllint/default.nix b/pkgs/development/python-modules/yamllint/default.nix index 58d47d1fff9c..ca092cef8c72 100644 --- a/pkgs/development/python-modules/yamllint/default.nix +++ b/pkgs/development/python-modules/yamllint/default.nix @@ -30,7 +30,7 @@ buildPythonPackage rec { disabledTests = [ # test failure reported upstream: https://github.com/adrienverge/yamllint/issues/373 "test_find_files_recursively" - ] ++ lib.optional stdenv.isDarwin [ + ] ++ lib.optionals stdenv.isDarwin [ # locale tests are broken on BSDs; see https://github.com/adrienverge/yamllint/issues/307 "test_locale_accents" "test_locale_case" diff --git a/pkgs/development/tools/analysis/radare2/default.nix b/pkgs/development/tools/analysis/radare2/default.nix index 63594300e835..905e78fd7655 100644 --- a/pkgs/development/tools/analysis/radare2/default.nix +++ b/pkgs/development/tools/analysis/radare2/default.nix @@ -97,10 +97,10 @@ stdenv.mkDerivation rec { zlib openssl libuv - ] ++ lib.optional useX11 [ gtkdialog vte gtk2 ] - ++ lib.optional rubyBindings [ ruby ] - ++ lib.optional pythonBindings [ python3 ] - ++ lib.optional luaBindings [ lua ]; + ] ++ lib.optionals useX11 [ gtkdialog vte gtk2 ] + ++ lib.optionals rubyBindings [ ruby ] + ++ lib.optionals pythonBindings [ python3 ] + ++ lib.optionals luaBindings [ lua ]; propagatedBuildInputs = [ # radare2 exposes r_lib which depends on these libraries diff --git a/pkgs/development/tools/misc/pahole/default.nix b/pkgs/development/tools/misc/pahole/default.nix index 1e923c380d6d..7a60da1e53a3 100644 --- a/pkgs/development/tools/misc/pahole/default.nix +++ b/pkgs/development/tools/misc/pahole/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake pkg-config ]; buildInputs = [ elfutils zlib libbpf ] - ++ lib.optional stdenv.hostPlatform.isMusl [ + ++ lib.optionals stdenv.hostPlatform.isMusl [ argp-standalone musl-obstack ]; diff --git a/pkgs/development/tools/misc/pkg-config/default.nix b/pkgs/development/tools/misc/pkg-config/default.nix index 70370e421261..f2721ab952c6 100644 --- a/pkgs/development/tools/misc/pkg-config/default.nix +++ b/pkgs/development/tools/misc/pkg-config/default.nix @@ -28,9 +28,9 @@ stdenv.mkDerivation rec { buildInputs = optional (stdenv.isCygwin || stdenv.isDarwin || stdenv.isSunOS) libiconv; configureFlags = [ "--with-internal-glib" ] - ++ optional (stdenv.isSunOS) [ "--with-libiconv=gnu" "--with-system-library-path" "--with-system-include-path" "CFLAGS=-DENABLE_NLS" ] + ++ optionals (stdenv.isSunOS) [ "--with-libiconv=gnu" "--with-system-library-path" "--with-system-include-path" "CFLAGS=-DENABLE_NLS" ] # Can't run these tests while cross-compiling - ++ optional (stdenv.hostPlatform != stdenv.buildPlatform) + ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "glib_cv_stack_grows=no" "glib_cv_uscore=no" "ac_cv_func_posix_getpwuid_r=yes" diff --git a/pkgs/development/tools/parsing/ragel/default.nix b/pkgs/development/tools/parsing/ragel/default.nix index 81d7d9f0b35e..0e8777e9f3f9 100644 --- a/pkgs/development/tools/parsing/ragel/default.nix +++ b/pkgs/development/tools/parsing/ragel/default.nix @@ -13,7 +13,7 @@ let inherit sha256; }; - buildInputs = lib.optional build-manual [ fig2dev ghostscript tex ]; + buildInputs = lib.optionals build-manual [ fig2dev ghostscript tex ]; preConfigure = lib.optionalString build-manual '' sed -i "s/build_manual=no/build_manual=yes/g" DIST diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/overrides/default.nix b/pkgs/development/tools/poetry2nix/poetry2nix/overrides/default.nix index a3204dd01477..d1a009f32c3f 100644 --- a/pkgs/development/tools/poetry2nix/poetry2nix/overrides/default.nix +++ b/pkgs/development/tools/poetry2nix/poetry2nix/overrides/default.nix @@ -385,7 +385,7 @@ lib.composeManyExtensions [ ( old: { nativeBuildInputs = (old.nativeBuildInputs or [ ]) - ++ lib.optional (lib.versionAtLeast old.version "3.4") [ self.setuptools-rust ] + ++ lib.optionals (lib.versionAtLeast old.version "3.4") [ self.setuptools-rust ] ++ lib.optional (!self.isPyPy) pyBuildPackages.cffi ++ lib.optional (lib.versionAtLeast old.version "3.5" && !isWheel) (with pkgs.rustPlatform; [ cargoSetupHook rust.cargo rust.rustc ]); @@ -1061,9 +1061,9 @@ lib.composeManyExtensions [ buildInputs = old.buildInputs or [ ] ++ [ pkgs.which - ] ++ lib.optional enableGhostscript [ + ] ++ lib.optionals enableGhostscript [ pkgs.ghostscript - ] ++ lib.optional stdenv.isDarwin [ + ] ++ lib.optionals stdenv.isDarwin [ Cocoa ]; @@ -1080,7 +1080,7 @@ lib.composeManyExtensions [ nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkg-config - ] ++ lib.optional (lib.versionAtLeast super.matplotlib.version "3.5.0") [ + ] ++ lib.optionals (lib.versionAtLeast super.matplotlib.version "3.5.0") [ self.setuptools-scm self.setuptools-scm-git-archive ]; @@ -2029,7 +2029,7 @@ lib.composeManyExtensions [ if old.format != "wheel" then { nativeBuildInputs = (old.nativeBuildInputs or [ ]) ++ [ pkgs.gfortran ] ++ - lib.optional (lib.versionAtLeast super.scipy.version "1.7.0") [ self.pythran ]; + lib.optionals (lib.versionAtLeast super.scipy.version "1.7.0") [ self.pythran ]; propagatedBuildInputs = (old.propagatedBuildInputs or [ ]) ++ [ self.pybind11 ]; setupPyBuildFlags = [ "--fcompiler='gnu95'" ]; enableParallelBuilding = true; diff --git a/pkgs/development/tools/summon/default.nix b/pkgs/development/tools/summon/default.nix index 5c811aaf2391..2ed17061c219 100644 --- a/pkgs/development/tools/summon/default.nix +++ b/pkgs/development/tools/summon/default.nix @@ -19,7 +19,7 @@ buildGoModule rec { # Patches provider resolver to support resolving unqualified names # from $PATH, e.g. `summon -p gopass` instead of `summon -p $(which gopass)` - patches = optional patchResolver [ ./resolve-paths.patch ]; + patches = optionals patchResolver [ ./resolve-paths.patch ]; postInstall = '' mv $out/bin/cmd $out/bin/summon diff --git a/pkgs/games/anki/default.nix b/pkgs/games/anki/default.nix index 3796741f96ca..71575c35fd37 100644 --- a/pkgs/games/anki/default.nix +++ b/pkgs/games/anki/default.nix @@ -101,7 +101,7 @@ buildPythonApplication rec { setuptools ] ++ lib.optional plotsSupport matplotlib - ++ lib.optional stdenv.isDarwin [ CoreAudio ] + ++ lib.optionals stdenv.isDarwin [ CoreAudio ] ; checkInputs = [ pytest glibcLocales nose ]; diff --git a/pkgs/games/blightmud/default.nix b/pkgs/games/blightmud/default.nix index 32c9ddb65347..d737c4c282d2 100644 --- a/pkgs/games/blightmud/default.nix +++ b/pkgs/games/blightmud/default.nix @@ -18,7 +18,7 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ pkg-config ]; - buildInputs = [ alsa-lib openssl ] ++ lib.optional withTTS [ speechd ]; + buildInputs = [ alsa-lib openssl ] ++ lib.optionals withTTS [ speechd ]; # Building the speech-dispatcher-sys crate for TTS support requires setting # LIBCLANG_PATH. diff --git a/pkgs/games/freeciv/default.nix b/pkgs/games/freeciv/default.nix index abe8aff15806..4c18190e4fcc 100644 --- a/pkgs/games/freeciv/default.nix +++ b/pkgs/games/freeciv/default.nix @@ -27,8 +27,8 @@ stdenv.mkDerivation rec { ''; nativeBuildInputs = [ autoreconfHook pkg-config ] - ++ lib.optional qtClient [ qt5.wrapQtAppsHook ] - ++ lib.optional gtkClient [ wrapGAppsHook ]; + ++ lib.optionals qtClient [ qt5.wrapQtAppsHook ] + ++ lib.optionals gtkClient [ wrapGAppsHook ]; buildInputs = [ lua5_3 zlib bzip2 curl xz gettext libiconv icu ] ++ [ SDL2 SDL2_mixer SDL2_image SDL2_ttf SDL2_gfx freetype fluidsynth ] diff --git a/pkgs/games/xonotic/default.nix b/pkgs/games/xonotic/default.nix index d29e43850fbd..cad021ff5705 100644 --- a/pkgs/games/xonotic/default.nix +++ b/pkgs/games/xonotic/default.nix @@ -66,8 +66,8 @@ let nativeBuildInputs = [ unzip ]; buildInputs = [ libjpeg zlib libvorbis curl gmp ] - ++ lib.optional withGLX [ libX11.dev libGLU.dev libGL.dev libXpm.dev libXext.dev libXxf86vm.dev alsa-lib.dev ] - ++ lib.optional withSDL [ SDL2.dev ]; + ++ lib.optionals withGLX [ libX11.dev libGLU.dev libGL.dev libXpm.dev libXext.dev libXxf86vm.dev alsa-lib.dev ] + ++ lib.optionals withSDL [ SDL2.dev ]; sourceRoot = "Xonotic/source/darkplaces"; diff --git a/pkgs/os-specific/darwin/apple-source-releases/ICU/default.nix b/pkgs/os-specific/darwin/apple-source-releases/ICU/default.nix index cdebfe6d2f72..ed5e998714af 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/ICU/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/ICU/default.nix @@ -13,7 +13,7 @@ in appleDerivation { nativeBuildInputs = [ python3 ]; - depsBuildBuild = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [ buildPackages.stdenv.cc ]; + depsBuildBuild = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ buildPackages.stdenv.cc ]; postPatch = '' substituteInPlace makefile \ diff --git a/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix b/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix index 8b0d2054d58a..266c2ef4dfef 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/xnu/default.nix @@ -12,7 +12,7 @@ appleDerivation' (if headersOnly then stdenvNoCC else stdenv) ( nativeBuildInputs = [ bootstrap_cmds bison flex gnum4 unifdef perl python3 ]; - patches = lib.optional stdenv.isx86_64 [ ./python3.patch ]; + patches = lib.optionals stdenv.isx86_64 [ ./python3.patch ]; postPatch = '' substituteInPlace Makefile \ diff --git a/pkgs/os-specific/darwin/libtapi/default.nix b/pkgs/os-specific/darwin/libtapi/default.nix index eba61a15ccb9..d109e0edcbd8 100644 --- a/pkgs/os-specific/darwin/libtapi/default.nix +++ b/pkgs/os-specific/darwin/libtapi/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation { # Also means we don't have to manually fix the result with install_name_tool. patches = [ ./disable-rpath.patch - ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ # TODO: make unconditional and rebuild the world # TODO: send upstream ./native-clang-tblgen.patch @@ -30,7 +30,7 @@ stdenv.mkDerivation { buildInputs = [ ncurses ]; cmakeFlags = [ "-DLLVM_INCLUDE_TESTS=OFF" ] - ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) [ + ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "-DCMAKE_CROSSCOMPILING=True" # This package could probably have a llvm_6 llvm-tblgen and clang-tblgen # provided to reduce some building. This package seems intended to diff --git a/pkgs/os-specific/linux/exfat/default.nix b/pkgs/os-specific/linux/exfat/default.nix index d459d2408442..ee6f448112d8 100644 --- a/pkgs/os-specific/linux/exfat/default.nix +++ b/pkgs/os-specific/linux/exfat/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation rec { makeFlags = [ "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" "ARCH=${stdenv.hostPlatform.linuxArch}" - ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "CROSS_COMPILE=${stdenv.cc.targetPrefix}" ]; diff --git a/pkgs/os-specific/linux/kernel-headers/default.nix b/pkgs/os-specific/linux/kernel-headers/default.nix index 7e148b9145c6..ebf20a015c04 100644 --- a/pkgs/os-specific/linux/kernel-headers/default.nix +++ b/pkgs/os-specific/linux/kernel-headers/default.nix @@ -27,7 +27,7 @@ let flex bison python rsync ]; - extraIncludeDirs = lib.optional (with stdenvNoCC.hostPlatform; isPower && is32bit && isBigEndian) ["ppc"]; + extraIncludeDirs = lib.optionals (with stdenvNoCC.hostPlatform; isPower && is32bit && isBigEndian) ["ppc"]; inherit patches; diff --git a/pkgs/os-specific/linux/nvidia-x11/generic.nix b/pkgs/os-specific/linux/nvidia-x11/generic.nix index 351d71ab8e2d..ea9dbcabd0e9 100644 --- a/pkgs/os-specific/linux/nvidia-x11/generic.nix +++ b/pkgs/os-specific/linux/nvidia-x11/generic.nix @@ -101,7 +101,7 @@ let nativeBuildInputs = [ perl nukeReferences ] ++ optionals (!libsOnly) kernel.moduleBuildDependencies; - disallowedReferences = optional (!libsOnly) [ kernel.dev ]; + disallowedReferences = optionals (!libsOnly) [ kernel.dev ]; passthru = { open = mapNullable (hash: callPackage ./open.nix { diff --git a/pkgs/os-specific/linux/rtl8812au/default.nix b/pkgs/os-specific/linux/rtl8812au/default.nix index 03a5c0f4aeb4..6a1c4fc80dae 100644 --- a/pkgs/os-specific/linux/rtl8812au/default.nix +++ b/pkgs/os-specific/linux/rtl8812au/default.nix @@ -28,7 +28,7 @@ stdenv.mkDerivation rec { "KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" ("CONFIG_PLATFORM_I386_PC=" + (if stdenv.hostPlatform.isx86 then "y" else "n")) ("CONFIG_PLATFORM_ARM_RPI=" + (if stdenv.hostPlatform.isAarch then "y" else "n")) - ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [ + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "CROSS_COMPILE=${stdenv.cc.targetPrefix}" ]; diff --git a/pkgs/servers/dante/default.nix b/pkgs/servers/dante/default.nix index 742ee2a0e684..f5b2e5a785fc 100644 --- a/pkgs/servers/dante/default.nix +++ b/pkgs/servers/dante/default.nix @@ -19,7 +19,7 @@ stdenv.mkDerivation rec { dontAddDisableDepTrack = stdenv.isDarwin; - patches = lib.optional stdenv.hostPlatform.isMips64 [ + patches = lib.optionals stdenv.hostPlatform.isMips64 [ (fetchpatch { name = "0002-osdep-m4-Remove-getaddrinfo-too-low-checks.patch"; url = "https://raw.githubusercontent.com/buildroot/buildroot/master/package/dante/0002-osdep-m4-Remove-getaddrinfo-too-low-checks.patch"; diff --git a/pkgs/servers/foundationdb/cmake.nix b/pkgs/servers/foundationdb/cmake.nix index 98fd6ca79813..9d65198c8cef 100644 --- a/pkgs/servers/foundationdb/cmake.nix +++ b/pkgs/servers/foundationdb/cmake.nix @@ -33,7 +33,7 @@ let buildInputs = [ libressl boost ]; nativeBuildInputs = [ cmake ninja python3 openjdk mono ] - ++ lib.optional useClang [ llvmPackages.lld ]; + ++ lib.optionals useClang [ llvmPackages.lld ]; separateDebugInfo = true; dontFixCmake = true; diff --git a/pkgs/servers/foundationdb/vsmake.nix b/pkgs/servers/foundationdb/vsmake.nix index 284dc9fb3bd5..21ee2e4f8485 100644 --- a/pkgs/servers/foundationdb/vsmake.nix +++ b/pkgs/servers/foundationdb/vsmake.nix @@ -84,11 +84,11 @@ let makeFlags = [ "all" "fdb_java" "fdb_python" ] # Don't compile FDBLibTLS if we don't need it in 6.0 or later; # it gets statically linked in - ++ lib.optional (lib.versionOlder version "6.0") [ "fdb_c" ] + ++ lib.optionals (lib.versionOlder version "6.0") [ "fdb_c" ] # Needed environment overrides ++ [ "KVRELEASE=1" "NOSTRIP=1" - ] ++ lib.optional officialRelease [ "RELEASE=true" ]; + ] ++ lib.optionals officialRelease [ "RELEASE=true" ]; # on 6.0 and later, we can specify all this information manually configurePhase = lib.optionalString (lib.versionAtLeast version "6.0") '' diff --git a/pkgs/servers/geospatial/mapserver/default.nix b/pkgs/servers/geospatial/mapserver/default.nix index d7012af0ffee..ac8af5b7de0c 100644 --- a/pkgs/servers/geospatial/mapserver/default.nix +++ b/pkgs/servers/geospatial/mapserver/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ cmake pkg-config - ] ++ lib.optional withPython [ swig python3.pkgs.setuptools ]; + ] ++ lib.optionals withPython [ swig python3.pkgs.setuptools ]; buildInputs = [ cairo diff --git a/pkgs/servers/nosql/redis/default.nix b/pkgs/servers/nosql/redis/default.nix index ab5a5672af69..d10d8b8c073d 100644 --- a/pkgs/servers/nosql/redis/default.nix +++ b/pkgs/servers/nosql/redis/default.nix @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { # It's weird that the build isn't failing because of failure to compile dependencies, it's from failure to link them! makeFlags = [ "PREFIX=${placeholder "out"}" ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ "AR=${stdenv.cc.targetPrefix}ar" "RANLIB=${stdenv.cc.targetPrefix}ranlib" "MALLOC=libc" ] - ++ lib.optional withSystemd [ "USE_SYSTEMD=yes" ] + ++ lib.optionals withSystemd [ "USE_SYSTEMD=yes" ] ++ lib.optionals tlsSupport [ "BUILD_TLS=yes" ]; enableParallelBuilding = true; diff --git a/pkgs/servers/samba/4.x.nix b/pkgs/servers/samba/4.x.nix index e86527440cf4..c5607b4d037e 100644 --- a/pkgs/servers/samba/4.x.nix +++ b/pkgs/servers/samba/4.x.nix @@ -141,7 +141,7 @@ stdenv.mkDerivation rec { ++ optional (!enablePam) "--without-pam" ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "--bundled-libraries=!asn1_compile,!compile_et" - ] ++ optional stdenv.isAarch32 [ + ] ++ optionals stdenv.isAarch32 [ # https://bugs.gentoo.org/683148 "--jobs 1" ]; diff --git a/pkgs/servers/sql/mariadb/default.nix b/pkgs/servers/sql/mariadb/default.nix index 7190f1209e08..f75fada0d8a0 100644 --- a/pkgs/servers/sql/mariadb/default.nix +++ b/pkgs/servers/sql/mariadb/default.nix @@ -44,7 +44,7 @@ commonOptions = packageSettings: rec { # attributes common to both builds ++ lib.optionals stdenv.hostPlatform.isLinux ([ libkrb5 systemd ] ++ (if (lib.versionOlder version "10.6") then [ libaio ] else [ liburing ])) ++ lib.optionals stdenv.hostPlatform.isDarwin [ CoreServices cctools perl libedit ] - ++ lib.optional (!stdenv.hostPlatform.isDarwin) [ jemalloc ] + ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ jemalloc ] ++ (if (lib.versionOlder version "10.5") then [ pcre ] else [ pcre2 ]) ++ (if (lib.versionOlder version "10.6") then [ openssl_1_1 (curl.override { openssl = openssl_1_1; }) ] @@ -203,15 +203,15 @@ in stdenv.mkDerivation (common // { "-DWITHOUT_EXAMPLE=1" "-DWITHOUT_FEDERATED=1" "-DWITHOUT_TOKUDB=1" - ] ++ lib.optional (stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isAarch32) [ + ] ++ lib.optionals (stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isAarch32) [ "-DWITH_NUMA=ON" - ] ++ lib.optional (!withStorageMroonga) [ + ] ++ lib.optionals (!withStorageMroonga) [ "-DWITHOUT_MROONGA=1" - ] ++ lib.optional (!withStorageRocks) [ + ] ++ lib.optionals (!withStorageRocks) [ "-DWITHOUT_ROCKSDB=1" - ] ++ lib.optional (!stdenv.hostPlatform.isDarwin && withStorageRocks) [ + ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin && withStorageRocks) [ "-DWITH_ROCKSDB_JEMALLOC=ON" - ] ++ lib.optional (!stdenv.hostPlatform.isDarwin) [ + ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ "-DWITH_JEMALLOC=yes" ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "-DPLUGIN_AUTH_PAM=NO" diff --git a/pkgs/shells/bash/5.1.nix b/pkgs/shells/bash/5.1.nix index 390dab12c947..0f50c72f5da0 100644 --- a/pkgs/shells/bash/5.1.nix +++ b/pkgs/shells/bash/5.1.nix @@ -86,7 +86,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - makeFlags = optional stdenv.hostPlatform.isCygwin [ + makeFlags = optionals stdenv.hostPlatform.isCygwin [ "LOCAL_LDFLAGS=-Wl,--export-all,--out-implib,libbash.dll.a" "SHOBJ_LIBS=-lbash" ]; diff --git a/pkgs/shells/ion/default.nix b/pkgs/shells/ion/default.nix index f20c80810a0b..ce15dbf2d255 100644 --- a/pkgs/shells/ion/default.nix +++ b/pkgs/shells/ion/default.nix @@ -20,7 +20,7 @@ rustPlatform.buildRustPackage rec { maintainers = with maintainers; [ dywedir ]; }; - buildInputs = lib.optional stdenv.hostPlatform.isDarwin [ + buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ Security libiconv ]; diff --git a/pkgs/tools/cd-dvd/dvdisaster/default.nix b/pkgs/tools/cd-dvd/dvdisaster/default.nix index 72f8cc0be2e9..55e0e51e5f44 100644 --- a/pkgs/tools/cd-dvd/dvdisaster/default.nix +++ b/pkgs/tools/cd-dvd/dvdisaster/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ gettext pkg-config which ]; buildInputs = [ glib gtk2 ]; - patches = lib.optional enableSoftening [ + patches = lib.optionals enableSoftening [ ./encryption.patch ./dvdrom.patch ]; diff --git a/pkgs/tools/compression/bsdiff/default.nix b/pkgs/tools/compression/bsdiff/default.nix index b8a86eae89bd..6db5d9924677 100644 --- a/pkgs/tools/compression/bsdiff/default.nix +++ b/pkgs/tools/compression/bsdiff/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { }) ./CVE-2020-14315.patch ./include-systypes.patch - ] ++ lib.optional stdenv.hostPlatform.isLinux [ + ] ++ lib.optionals stdenv.hostPlatform.isLinux [ (fetchpatch { url = "https://sources.debian.org/data/main/b/bsdiff/4.3-22/debian/patches/30-bug-632585-mmap-src-file-instead-of-malloc-read-it.patch"; sha256 = "sha256-esbhz2/efUiuQDuF7LGfSeEn3/f1WbqCxQpTs2A0ulI="; diff --git a/pkgs/tools/graphics/mangohud/default.nix b/pkgs/tools/graphics/mangohud/default.nix index 7202f9f8b562..9639a7881f0f 100644 --- a/pkgs/tools/graphics/mangohud/default.nix +++ b/pkgs/tools/graphics/mangohud/default.nix @@ -108,7 +108,7 @@ in stdenv.mkDerivation rec { libdbus = dbus.lib; inherit hwdata libX11; }) - ] ++ lib.optional (stdenv.hostPlatform.system == "x86_64-linux") [ + ] ++ lib.optionals (stdenv.hostPlatform.system == "x86_64-linux") [ # Support 32bit OpenGL applications by appending the mangohud32 # lib path to LD_LIBRARY_PATH. # diff --git a/pkgs/tools/misc/hiksink/default.nix b/pkgs/tools/misc/hiksink/default.nix index 9cc91035afe0..05d7e1c9f44e 100644 --- a/pkgs/tools/misc/hiksink/default.nix +++ b/pkgs/tools/misc/hiksink/default.nix @@ -26,7 +26,7 @@ rustPlatform.buildRustPackage rec { buildInputs = [ openssl - ] ++ lib.optional stdenv.isDarwin [ + ] ++ lib.optionals stdenv.isDarwin [ Security ]; diff --git a/pkgs/tools/misc/jsonwatch/default.nix b/pkgs/tools/misc/jsonwatch/default.nix index 3fe4f5008fd6..6f11e7d97e5d 100644 --- a/pkgs/tools/misc/jsonwatch/default.nix +++ b/pkgs/tools/misc/jsonwatch/default.nix @@ -18,7 +18,7 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "sha256-Gjb7v3kz11iOml3Ykxhy43KNxzaprgMbb5DpPNChLTc="; - buildInputs = lib.optional stdenv.isDarwin [ + buildInputs = lib.optionals stdenv.isDarwin [ Security ]; diff --git a/pkgs/tools/misc/less/default.nix b/pkgs/tools/misc/less/default.nix index df8d9eef22ac..a7212ccf7648 100644 --- a/pkgs/tools/misc/less/default.nix +++ b/pkgs/tools/misc/less/default.nix @@ -10,7 +10,7 @@ stdenv.mkDerivation rec { }; configureFlags = [ "--sysconfdir=/etc" ] # Look for ‘sysless’ in /etc. - ++ lib.optional lessSecure [ "--with-secure" ]; + ++ lib.optionals lessSecure [ "--with-secure" ]; buildInputs = [ ncurses ]; diff --git a/pkgs/tools/misc/man-db/default.nix b/pkgs/tools/misc/man-db/default.nix index 3e34a81cd4f8..4c23143b103e 100644 --- a/pkgs/tools/misc/man-db/default.nix +++ b/pkgs/tools/misc/man-db/default.nix @@ -53,7 +53,7 @@ stdenv.mkDerivation rec { "--with-systemdtmpfilesdir=${placeholder "out"}/lib/tmpfiles.d" "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system" "--with-pager=less" - ] ++ lib.optional stdenv.hostPlatform.isDarwin [ + ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "ac_cv_func__set_invalid_parameter_handler=no" "ac_cv_func_posix_fadvise=no" "ac_cv_func_mempcpy=no" diff --git a/pkgs/tools/misc/otfcc/default.nix b/pkgs/tools/misc/otfcc/default.nix index b233e94f4f60..b6c971dd3c2e 100644 --- a/pkgs/tools/misc/otfcc/default.nix +++ b/pkgs/tools/misc/otfcc/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { ./move-makefiles.patch ]; - buildFlags = lib.optional stdenv.isAarch64 [ "config=release_arm" ]; + buildFlags = lib.optionals stdenv.isAarch64 [ "config=release_arm" ]; installPhase = '' mkdir -p $out/bin diff --git a/pkgs/tools/misc/pre-commit/default.nix b/pkgs/tools/misc/pre-commit/default.nix index 4c455d6fb2d7..1d475ead4605 100644 --- a/pkgs/tools/misc/pre-commit/default.nix +++ b/pkgs/tools/misc/pre-commit/default.nix @@ -37,9 +37,9 @@ buildPythonPackage rec { pyyaml toml virtualenv - ] ++ lib.optional (pythonOlder "3.8") [ + ] ++ lib.optionals (pythonOlder "3.8") [ importlib-metadata - ] ++ lib.optional (pythonOlder "3.7") [ + ] ++ lib.optionals (pythonOlder "3.7") [ importlib-resources ]; diff --git a/pkgs/tools/misc/rust-motd/default.nix b/pkgs/tools/misc/rust-motd/default.nix index a2c7710984ea..b881d94438cd 100644 --- a/pkgs/tools/misc/rust-motd/default.nix +++ b/pkgs/tools/misc/rust-motd/default.nix @@ -26,7 +26,7 @@ rustPlatform.buildRustPackage rec { buildInputs = [ openssl - ] ++ lib.optional stdenv.isDarwin [ + ] ++ lib.optionals stdenv.isDarwin [ Security ]; diff --git a/pkgs/tools/misc/sheldon/default.nix b/pkgs/tools/misc/sheldon/default.nix index db6aa9d8f170..8f2c458fe1d6 100644 --- a/pkgs/tools/misc/sheldon/default.nix +++ b/pkgs/tools/misc/sheldon/default.nix @@ -20,7 +20,7 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "sha256-uRcaHuDLQm6OYqt01kLbW/mfZnL4HaDabaweaw1EOfs="; - buildInputs = [ openssl ] ++ lib.optional stdenv.isDarwin [ Security curl ]; + buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security curl ]; nativeBuildInputs = [ installShellFiles pkg-config ]; # Needs network connection diff --git a/pkgs/tools/misc/ttwatch/default.nix b/pkgs/tools/misc/ttwatch/default.nix index ecfc40bdf6f3..273d34ffdb8e 100644 --- a/pkgs/tools/misc/ttwatch/default.nix +++ b/pkgs/tools/misc/ttwatch/default.nix @@ -17,7 +17,7 @@ stdenv.mkDerivation { nativeBuildInputs = [ cmake perl pkg-config ]; buildInputs = [ openssl curl libusb1 protobufc ]; - cmakeFlags = lib.optional enableUnsafe [ "-Dunsafe=on" ]; + cmakeFlags = lib.optionals enableUnsafe [ "-Dunsafe=on" ]; preFixup = '' chmod +x $out/bin/ttbin2mysports diff --git a/pkgs/tools/networking/bore-cli/default.nix b/pkgs/tools/networking/bore-cli/default.nix index 5ca16499fe82..ae39bfb6204f 100644 --- a/pkgs/tools/networking/bore-cli/default.nix +++ b/pkgs/tools/networking/bore-cli/default.nix @@ -18,7 +18,7 @@ rustPlatform.buildRustPackage rec { cargoSha256 = "sha256-ZnEVTFiPo3AFyo1BoV88X2nCqYzRK6PkcbawiR+QnV0="; - buildInputs = lib.optional stdenv.isDarwin [ + buildInputs = lib.optionals stdenv.isDarwin [ Security ]; diff --git a/pkgs/tools/networking/eternal-terminal/default.nix b/pkgs/tools/networking/eternal-terminal/default.nix index 05e3152bec19..96315e305ad5 100644 --- a/pkgs/tools/networking/eternal-terminal/default.nix +++ b/pkgs/tools/networking/eternal-terminal/default.nix @@ -43,7 +43,7 @@ stdenv.mkDerivation rec { "-DDISABLE_CRASH_LOG=TRUE" ]; - CXXFLAGS = lib.optional stdenv.cc.isClang [ + CXXFLAGS = lib.optionals stdenv.cc.isClang [ "-std=c++17" ]; diff --git a/pkgs/tools/networking/ipv6calc/default.nix b/pkgs/tools/networking/ipv6calc/default.nix index 6df96e268eff..8489ffd6f707 100644 --- a/pkgs/tools/networking/ipv6calc/default.nix +++ b/pkgs/tools/networking/ipv6calc/default.nix @@ -43,11 +43,11 @@ stdenv.mkDerivation rec { "--disable-bundled-md5" "--disable-dynamic-load" "--enable-shared" - ] ++ lib.optional (libmaxminddb != null) [ + ] ++ lib.optionals (libmaxminddb != null) [ "--enable-mmdb" - ] ++ lib.optional (geolite-legacy != null) [ + ] ++ lib.optionals (geolite-legacy != null) [ "--with-geoip-db=${geolite-legacy}/share/GeoIP" - ] ++ lib.optional (ip2location-c != null) [ + ] ++ lib.optionals (ip2location-c != null) [ "--enable-ip2location" ]; diff --git a/pkgs/tools/networking/rathole/default.nix b/pkgs/tools/networking/rathole/default.nix index ceaf89ef92e9..cb392114e062 100644 --- a/pkgs/tools/networking/rathole/default.nix +++ b/pkgs/tools/networking/rathole/default.nix @@ -21,7 +21,7 @@ rustPlatform.buildRustPackage rec { nativeBuildInputs = [ pkg-config ]; - buildInputs = [ openssl ] ++ lib.optional stdenv.isDarwin [ CoreServices ]; + buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ CoreServices ]; __darwinAllowLocalNetworking = true; diff --git a/pkgs/tools/networking/termscp/default.nix b/pkgs/tools/networking/termscp/default.nix index 7fbf30614e7a..70e164319940 100644 --- a/pkgs/tools/networking/termscp/default.nix +++ b/pkgs/tools/networking/termscp/default.nix @@ -33,7 +33,7 @@ rustPlatform.buildRustPackage rec { dbus libssh openssl - ] ++ lib.optional stdenv.isDarwin [ + ] ++ lib.optionals stdenv.isDarwin [ AppKit Cocoa Foundation diff --git a/pkgs/tools/networking/toxvpn/default.nix b/pkgs/tools/networking/toxvpn/default.nix index 57a5510bd430..633ecf654924 100644 --- a/pkgs/tools/networking/toxvpn/default.nix +++ b/pkgs/tools/networking/toxvpn/default.nix @@ -26,7 +26,7 @@ stdenv.mkDerivation { nativeBuildInputs = [ cmake ]; - cmakeFlags = lib.optional stdenv.isLinux [ "-DSYSTEMD=1" ]; + cmakeFlags = lib.optionals stdenv.isLinux [ "-DSYSTEMD=1" ]; postInstall = "$out/bin/toxvpn -h"; diff --git a/pkgs/tools/networking/unbound/default.nix b/pkgs/tools/networking/unbound/default.nix index 25fcc1bcc397..5e44eb0dabf5 100644 --- a/pkgs/tools/networking/unbound/default.nix +++ b/pkgs/tools/networking/unbound/default.nix @@ -75,7 +75,7 @@ stdenv.mkDerivation rec { "--with-rootkey-file=${dns-root-data}/root.key" "--enable-pie" "--enable-relro-now" - ] ++ lib.optional stdenv.hostPlatform.isStatic [ + ] ++ lib.optionals stdenv.hostPlatform.isStatic [ "--disable-flto" ] ++ lib.optionals withSystemd [ "--enable-systemd" diff --git a/pkgs/tools/networking/vde2/default.nix b/pkgs/tools/networking/vde2/default.nix index c14aa8bb3c13..83cee2e466af 100644 --- a/pkgs/tools/networking/vde2/default.nix +++ b/pkgs/tools/networking/vde2/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { sha256 = "sha256-Yf6QB7j5lYld2XtqhYspK4037lTtimoFc7nCavCP+mU="; }; - patches = lib.optional stdenv.hostPlatform.isMusl [ + patches = lib.optionals stdenv.hostPlatform.isMusl [ (fetchpatch { url = "https://git.alpinelinux.org/aports/plain/main/vde2/musl-build-fix.patch?id=ddee2f86a48e087867d4a2c12849b2e3baccc238"; sha256 = "0b5382v541bkxhqylilcy34bh83ag96g71f39m070jzvi84kx8af"; diff --git a/pkgs/tools/package-management/nix/common.nix b/pkgs/tools/package-management/nix/common.nix index f69ee083af1f..95fbd0782b79 100644 --- a/pkgs/tools/package-management/nix/common.nix +++ b/pkgs/tools/package-management/nix/common.nix @@ -113,7 +113,7 @@ self = stdenv.mkDerivation { propagatedBuildInputs = [ boehmgc - ] ++ lib.optional (atLeast27) [ + ] ++ lib.optionals (atLeast27) [ nlohmann_json ]; diff --git a/pkgs/tools/security/asc-key-to-qr-code-gif/default.nix b/pkgs/tools/security/asc-key-to-qr-code-gif/default.nix index 13327a84fff0..28913c685778 100644 --- a/pkgs/tools/security/asc-key-to-qr-code-gif/default.nix +++ b/pkgs/tools/security/asc-key-to-qr-code-gif/default.nix @@ -23,7 +23,7 @@ stdenv.mkDerivation { substitutions = [ ''--replace "convert" "${imagemagick}/bin/convert"'' ''--replace "qrencode" "${qrencode.bin}/bin/qrencode"'' - ] ++ lib.optional testQR [ + ] ++ lib.optionals testQR [ ''--replace "hash zbarimg" "true"'' # hash does not work on NixOS ''--replace "$(zbarimg --raw" "$(${zbar.out}/bin/zbarimg --raw"'' ]; diff --git a/pkgs/tools/security/chipsec/default.nix b/pkgs/tools/security/chipsec/default.nix index 5b4957139d75..64a4946136f0 100644 --- a/pkgs/tools/security/chipsec/default.nix +++ b/pkgs/tools/security/chipsec/default.nix @@ -48,7 +48,7 @@ python3.pkgs.buildPythonApplication rec { setupPyBuildFlags = [ "--build-lib=$CHIPSEC_BUILD_LIB" - ] ++ lib.optional (!withDriver) [ + ] ++ lib.optionals (!withDriver) [ "--skip-driver" ]; diff --git a/pkgs/tools/security/rhash/default.nix b/pkgs/tools/security/rhash/default.nix index e071f460b1aa..b539772213bb 100644 --- a/pkgs/tools/security/rhash/default.nix +++ b/pkgs/tools/security/rhash/default.nix @@ -46,7 +46,7 @@ stdenv.mkDerivation rec { installTargets = [ "install" "install-lib-headers" - ] ++ lib.optional (!enableStatic) [ + ] ++ lib.optionals (!enableStatic) [ "install-lib-so-link" ]; diff --git a/pkgs/tools/security/sudo/default.nix b/pkgs/tools/security/sudo/default.nix index 429027df872d..d667734ef991 100644 --- a/pkgs/tools/security/sudo/default.nix +++ b/pkgs/tools/security/sudo/default.nix @@ -35,10 +35,10 @@ stdenv.mkDerivation rec { "--with-iologdir=/var/log/sudo-io" "--with-sendmail=${sendmailPath}" "--enable-tmpfiles.d=no" - ] ++ lib.optional withInsults [ + ] ++ lib.optionals withInsults [ "--with-insults" "--with-all-insults" - ] ++ lib.optional withSssd [ + ] ++ lib.optionals withSssd [ "--with-sssd" "--with-sssd-lib=${sssd}/lib" ]; diff --git a/pkgs/tools/system/fio/default.nix b/pkgs/tools/system/fio/default.nix index 0fc90be2dcbf..c2c46e9a5d14 100644 --- a/pkgs/tools/system/fio/default.nix +++ b/pkgs/tools/system/fio/default.nix @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { pythonPath = [ python3.pkgs.six ]; - makeWrapperArgs = lib.optional withGnuplot [ + makeWrapperArgs = lib.optionals withGnuplot [ "--prefix PATH : ${lib.makeBinPath [ gnuplot ]}" ]; diff --git a/pkgs/tools/system/netdata/default.nix b/pkgs/tools/system/netdata/default.nix index 96ca146358d2..d27ebc4e2a64 100644 --- a/pkgs/tools/system/netdata/default.nix +++ b/pkgs/tools/system/netdata/default.nix @@ -99,9 +99,9 @@ in stdenv.mkDerivation rec { "--sysconfdir=/etc" "--disable-ebpf" "--with-jemalloc=${jemalloc}" - ] ++ optional (!withDBengine) [ + ] ++ optionals (!withDBengine) [ "--disable-dbengine" - ] ++ optional (!withCloud) [ + ] ++ optionals (!withCloud) [ "--disable-cloud" ]; diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix index 7d44b42e389f..a2b547d5fbb7 100644 --- a/pkgs/top-level/perl-packages.nix +++ b/pkgs/top-level/perl-packages.nix @@ -849,7 +849,7 @@ let }; buildInputs = [ PodParser ]; propagatedBuildInputs = [ AppPackager FileLoadLines IOString ImageInfo PDFAPI2 StringInterpolateNamed TextLayout ] - ++ lib.optional (!stdenv.isDarwin) [ Wx ]; + ++ lib.optionals (!stdenv.isDarwin) [ Wx ]; nativeBuildInputs = lib.optional stdenv.isDarwin shortenPerlShebang; postInstall = lib.optionalString stdenv.isDarwin '' shortenPerlShebang $out/bin/chordpro