diff --git a/pkgs/applications/audio/gpodder/default.nix b/pkgs/applications/audio/gpodder/default.nix index 61e33cae90268..4ddbf4b6ef61c 100644 --- a/pkgs/applications/audio/gpodder/default.nix +++ b/pkgs/applications/audio/gpodder/default.nix @@ -27,7 +27,7 @@ python311Packages.buildPythonApplication rec { ./disable-autoupdate.patch ]; - postPatch = with lib; '' + postPatch = '' sed -i -re 's,^( *gpodder_dir *= *).*,\1"'"$out"'",' bin/gpodder ''; diff --git a/pkgs/applications/display-managers/ly/deps.nix b/pkgs/applications/display-managers/ly/deps.nix index 0269a8e8190a9..c1f733aebc994 100644 --- a/pkgs/applications/display-managers/ly/deps.nix +++ b/pkgs/applications/display-managers/ly/deps.nix @@ -10,8 +10,6 @@ name ? "zig-packages", }: -with lib; - let unpackZigArtifact = { name, artifact }: @@ -39,9 +37,9 @@ let hash, }: let - parts = splitString "#" url; - base = elemAt parts 0; - rev = elemAt parts 1; + parts = lib.splitString "#" url; + base = lib.elemAt parts 0; + rev = lib.elemAt parts 1; in fetchgit { inherit name rev hash; @@ -56,9 +54,9 @@ let hash, }: let - parts = splitString "://" url; - proto = elemAt parts 0; - path = elemAt parts 1; + parts = lib.splitString "://" url; + proto = lib.elemAt parts 0; + path = lib.elemAt parts 1; fetcher = { "git+http" = fetchGitZig { inherit name hash; diff --git a/pkgs/applications/editors/eclipse/default.nix b/pkgs/applications/editors/eclipse/default.nix index c7b8b3dc0f5c6..9c1963554c3fa 100644 --- a/pkgs/applications/editors/eclipse/default.nix +++ b/pkgs/applications/editors/eclipse/default.nix @@ -210,9 +210,7 @@ in rec { # Gather up the desired plugins. pluginEnv = buildEnv { name = "eclipse-plugins"; - paths = - with lib; - filter (x: x ? isEclipsePlugin) (closePropagation plugins); + paths = lib.filter (x: x ? isEclipsePlugin) (lib.closePropagation plugins); }; # Prepare the JVM arguments to add to the ini file. We here also diff --git a/pkgs/applications/editors/jupyter/kernel.nix b/pkgs/applications/editors/jupyter/kernel.nix index 3640de28e8acc..b036c7274d51d 100644 --- a/pkgs/applications/editors/jupyter/kernel.nix +++ b/pkgs/applications/editors/jupyter/kernel.nix @@ -26,7 +26,7 @@ in # Definitions is an attribute set. - create = { definitions ? default }: with lib; stdenv.mkDerivation { + create = { definitions ? default }: stdenv.mkDerivation { name = "jupyter-kernels"; @@ -37,14 +37,14 @@ in installPhase = '' mkdir kernels - ${concatStringsSep "\n" (mapAttrsToList (kernelName: unfilteredKernel: + ${lib.concatStringsSep "\n" (lib.mapAttrsToList (kernelName: unfilteredKernel: let allowedKernelKeys = ["argv" "displayName" "language" "interruptMode" "env" "metadata" "logo32" "logo64" "extraPaths"]; - kernel = filterAttrs (n: v: (any (x: x == n) allowedKernelKeys)) unfilteredKernel; + kernel = lib.filterAttrs (n: v: (lib.any (x: x == n) allowedKernelKeys)) unfilteredKernel; config = builtins.toJSON ( kernel // {display_name = if (kernel.displayName != "") then kernel.displayName else kernelName;} - // (optionalAttrs (kernel ? interruptMode) { interrupt_mode = kernel.interruptMode; }) + // (lib.optionalAttrs (kernel ? interruptMode) { interrupt_mode = kernel.interruptMode; }) ); extraPaths = kernel.extraPaths or {} // lib.optionalAttrs (kernel.logo32 != null) { "logo-32x32.png" = kernel.logo32; } @@ -64,7 +64,7 @@ in meta = { description = "Wrapper to create jupyter notebook kernel definitions"; homepage = "https://jupyter.org/"; - maintainers = with maintainers; [ aborsu ]; + maintainers = with lib.maintainers; [ aborsu ]; }; }; } diff --git a/pkgs/applications/editors/kakoune/plugins/aliases.nix b/pkgs/applications/editors/kakoune/plugins/aliases.nix index 1d516f9b436f5..392ee835d3392 100644 --- a/pkgs/applications/editors/kakoune/plugins/aliases.nix +++ b/pkgs/applications/editors/kakoune/plugins/aliases.nix @@ -2,21 +2,19 @@ lib: overridden: -with overridden; - let # Removing recurseForDerivation prevents derivations of aliased attribute # set to appear while listing all the packages available. - removeRecurseForDerivations = alias: with lib; + removeRecurseForDerivations = alias: if alias.recurseForDerivations or false then - removeAttrs alias ["recurseForDerivations"] + lib.removeAttrs alias ["recurseForDerivations"] else alias; # Disabling distribution prevents top-level aliases for non-recursed package # sets from building on Hydra. - removeDistribute = alias: with lib; - if isDerivation alias then - dontDistribute alias + removeDistribute = alias: + if lib.isDerivation alias then + lib.dontDistribute alias else alias; # Make sure that we are not shadowing something from @@ -37,11 +35,11 @@ let in mapAliases ({ - kak-auto-pairs = auto-pairs-kak; # backwards compat, added 2021-01-04 - kak-buffers = kakoune-buffers; # backwards compat, added 2021-01-04 - kak-byline = byline-kak; # backwards compat, added 2023-10-22 - kak-fzf = fzf-kak; # backwards compat, added 2021-01-04 - kak-powerline = powerline-kak; # backwards compat, added 2021-01-04 - kak-prelude = prelude-kak; # backwards compat, added 2021-01-04 - kak-vertical-selection = kakoune-vertical-selection; # backwards compat, added 2021-01-04 + kak-auto-pairs = overridden.auto-pairs-kak; # backwards compat, added 2021-01-04 + kak-buffers = overridden.kakoune-buffers; # backwards compat, added 2021-01-04 + kak-byline = overridden.byline-kak; # backwards compat, added 2023-10-22 + kak-fzf = overridden.fzf-kak; # backwards compat, added 2021-01-04 + kak-powerline = overridden.powerline-kak; # backwards compat, added 2021-01-04 + kak-prelude = overridden.prelude-kak; # backwards compat, added 2021-01-04 + kak-vertical-selection = overridden.kakoune-vertical-selection; # backwards compat, added 2021-01-04 } // deprecations) diff --git a/pkgs/applications/editors/rstudio/default.nix b/pkgs/applications/editors/rstudio/default.nix index 0521d3dce56a6..4d606904e2f68 100644 --- a/pkgs/applications/editors/rstudio/default.nix +++ b/pkgs/applications/editors/rstudio/default.nix @@ -158,13 +158,13 @@ in --replace-fail '@quarto@' ${quarto} ''; - hunspellDictionaries = with lib; filter isDerivation (unique (attrValues hunspellDicts)); + hunspellDictionaries = lib.filter lib.isDerivation (lib.unique (lib.attrValues hunspellDicts)); # These dicts contain identically-named dict files, so we only keep the # -large versions in case of clashes - largeDicts = with lib; filter (d: hasInfix "-large-wordlist" d.name) hunspellDictionaries; - otherDicts = with lib; filter - (d: !(hasAttr "dictFileName" d && - elem d.dictFileName (map (d: d.dictFileName) largeDicts))) + largeDicts = lib.filter (d: lib.hasInfix "-large-wordlist" d.name) hunspellDictionaries; + otherDicts = lib.filter + (d: !(lib.hasAttr "dictFileName" d && + lib.elem d.dictFileName (map (d: d.dictFileName) largeDicts))) hunspellDictionaries; dictionaries = largeDicts ++ otherDicts; diff --git a/pkgs/applications/editors/vim/plugins/aliases.nix b/pkgs/applications/editors/vim/plugins/aliases.nix index ff504416489e2..e447c41a4666f 100644 --- a/pkgs/applications/editors/vim/plugins/aliases.nix +++ b/pkgs/applications/editors/vim/plugins/aliases.nix @@ -6,16 +6,16 @@ final: prev: let # Removing recurseForDerivation prevents derivations of aliased attribute # set to appear while listing all the packages available. - removeRecurseForDerivations = alias: with lib; + removeRecurseForDerivations = alias: if alias.recurseForDerivations or false then - removeAttrs alias ["recurseForDerivations"] + lib.removeAttrs alias ["recurseForDerivations"] else alias; # Disabling distribution prevents top-level aliases for non-recursed package # sets from building on Hydra. - removeDistribute = alias: with lib; - if isDerivation alias then - dontDistribute alias + removeDistribute = alias: + if lib.isDerivation alias then + lib.dontDistribute alias else alias; # Make sure that we are not shadowing something from diff --git a/pkgs/applications/graphics/sane/backends/brscan4/default.nix b/pkgs/applications/graphics/sane/backends/brscan4/default.nix index c15b3033a2651..ece80ef18a5be 100644 --- a/pkgs/applications/graphics/sane/backends/brscan4/default.nix +++ b/pkgs/applications/graphics/sane/backends/brscan4/default.nix @@ -1,8 +1,8 @@ { stdenv, lib, fetchurl, callPackage, patchelf, makeWrapper, libusb-compat-0_1 }: let - myPatchElf = file: with lib; '' + myPatchElf = file: '' patchelf --set-interpreter \ - ${stdenv.cc.libc}/lib/ld-linux${optionalString stdenv.is64bit "-x86-64"}.so.2 \ + ${stdenv.cc.libc}/lib/ld-linux${lib.optionalString stdenv.is64bit "-x86-64"}.so.2 \ ${file} ''; @@ -43,13 +43,13 @@ stdenv.mkDerivation rec { done ''; - installPhase = with lib; '' + installPhase = '' runHook preInstall PATH_TO_BRSCAN4="opt/brother/scanner/brscan4" mkdir -p $out/$PATH_TO_BRSCAN4 cp -rp $PATH_TO_BRSCAN4/* $out/$PATH_TO_BRSCAN4 mkdir -p $out/lib/sane - cp -rp usr/lib${optionalString stdenv.is64bit "64"}/sane/* $out/lib/sane + cp -rp usr/lib${lib.optionalString stdenv.is64bit "64"}/sane/* $out/lib/sane # Symbolic links were absolute. Fix them so that they point to $out. pushd "$out/lib/sane" > /dev/null diff --git a/pkgs/applications/graphics/sane/backends/brscan5/default.nix b/pkgs/applications/graphics/sane/backends/brscan5/default.nix index 9749ae5b658fd..b816eb71d27c1 100644 --- a/pkgs/applications/graphics/sane/backends/brscan5/default.nix +++ b/pkgs/applications/graphics/sane/backends/brscan5/default.nix @@ -1,8 +1,8 @@ { stdenv, lib, fetchurl, patchelf, makeWrapper, libusb1, avahi-compat, glib, libredirect, nixosTests }: let - myPatchElf = file: with lib; '' + myPatchElf = file: '' patchelf --set-interpreter \ - ${stdenv.cc.libc}/lib/ld-linux${optionalString stdenv.is64bit "-x86-64"}.so.2 \ + ${stdenv.cc.libc}/lib/ld-linux${lib.optionalString stdenv.is64bit "-x86-64"}.so.2 \ ${file} ''; system = stdenv.hostPlatform.system; @@ -57,7 +57,7 @@ stdenv.mkDerivation rec { printf '/etc/opt/brother/scanner/models\x00' | dd of=opt/brother/scanner/brscan5/libsane-brother5.so.1.0.7 bs=1 seek=${toString patchOffsetBytes} conv=notrunc ''; - installPhase = with lib; '' + installPhase = '' runHook preInstall PATH_TO_BRSCAN5="opt/brother/scanner/brscan5" mkdir -p $out/$PATH_TO_BRSCAN5 diff --git a/pkgs/applications/misc/ape/apeclex.nix b/pkgs/applications/misc/ape/apeclex.nix index 81096d9877f76..7f0523270f283 100644 --- a/pkgs/applications/misc/ape/apeclex.nix +++ b/pkgs/applications/misc/ape/apeclex.nix @@ -4,5 +4,5 @@ callPackage ./. { pname = "ape-clex"; lexiconPath = "${attemptoClex}/clex_lexicon.pl"; description = "Parser for Attempto Controlled English (ACE) with a large lexicon (~100,000 entries)"; - license = with lib; [ licenses.lgpl3 licenses.gpl3 ]; + license = with lib.licenses; [ lgpl3 gpl3 ]; } diff --git a/pkgs/applications/misc/ape/default.nix b/pkgs/applications/misc/ape/default.nix index e50d766a88b2b..30911d6380fe9 100644 --- a/pkgs/applications/misc/ape/default.nix +++ b/pkgs/applications/misc/ape/default.nix @@ -3,7 +3,7 @@ lexiconPath ? "prolog/lexicon/clex_lexicon.pl", pname ? "ape", description ? "Parser for Attempto Controlled English (ACE)", - license ? with lib; licenses.lgpl3 + license ? lib.licenses.lgpl3 }: stdenv.mkDerivation rec { diff --git a/pkgs/applications/misc/bemenu/default.nix b/pkgs/applications/misc/bemenu/default.nix index 1ddf73deb98fd..7c4cd0f935424 100644 --- a/pkgs/applications/misc/bemenu/default.nix +++ b/pkgs/applications/misc/bemenu/default.nix @@ -20,15 +20,15 @@ stdenv.mkDerivation (finalAttrs: { nativeBuildInputs = [ pkg-config scdoc ] ++ lib.optionals waylandSupport [ wayland-scanner ]; - buildInputs = with lib; [ + buildInputs = [ cairo fribidi harfbuzz libxkbcommon pango - ] ++ optional ncursesSupport ncurses - ++ optionals waylandSupport [ wayland wayland-protocols ] - ++ optionals x11Support [ + ] ++ lib.optional ncursesSupport ncurses + ++ lib.optionals waylandSupport [ wayland wayland-protocols ] + ++ lib.optionals x11Support [ xorg.libX11 xorg.libXinerama xorg.libXft xorg.libXdmcp xorg.libpthreadstubs xorg.libxcb ]; diff --git a/pkgs/applications/misc/clight/clightd.nix b/pkgs/applications/misc/clight/clightd.nix index b6958d86bbd03..4d7ba199472f8 100644 --- a/pkgs/applications/misc/clight/clightd.nix +++ b/pkgs/applications/misc/clight/clightd.nix @@ -29,16 +29,16 @@ stdenv.mkDerivation rec { sed -i "s@pkg_get_variable(POLKIT_ACTION_DIR.*@set(POLKIT_ACTION_DIR $POLKIT_ACTION_DIR)@" CMakeLists.txt ''; - cmakeFlags = with lib; + cmakeFlags = [ "-DSYSTEMD_SERVICE_DIR=${placeholder "out"}/lib/systemd/system" "-DDBUS_CONFIG_DIR=${placeholder "out"}/etc/dbus-1/system.d" # systemd.pc has prefix=${systemd.out} "-DMODULE_LOAD_DIR=${placeholder "out"}/lib/modules-load.d" - ] ++ optional enableDdc "-DENABLE_DDC=1" - ++ optional enableDpms "-DENABLE_DPMS=1" - ++ optional enableGamma "-DENABLE_GAMMA=1" - ++ optional enableScreen "-DENABLE_SCREEN=1" - ++ optional enableYoctolight "-DENABLE_YOCTOLIGHT=1"; + ] ++ lib.optional enableDdc "-DENABLE_DDC=1" + ++ lib.optional enableDpms "-DENABLE_DPMS=1" + ++ lib.optional enableGamma "-DENABLE_GAMMA=1" + ++ lib.optional enableScreen "-DENABLE_SCREEN=1" + ++ lib.optional enableYoctolight "-DENABLE_YOCTOLIGHT=1"; nativeBuildInputs = [ dbus @@ -46,7 +46,7 @@ stdenv.mkDerivation rec { pkg-config ]; - buildInputs = with lib; [ + buildInputs = [ glib udev polkit @@ -58,10 +58,10 @@ stdenv.mkDerivation rec { libXdmcp util-linux libpthreadstubs - ] ++ optionals enableDdc [ ddcutil ] - ++ optionals enableDpms [ libXext ] - ++ optionals enableGamma [ libXrandr ] - ++ optionals (enableDpms || enableGamma || enableScreen) [ libdrm wayland ]; + ] ++ lib.optionals enableDdc [ ddcutil ] + ++ lib.optionals enableDpms [ libXext ] + ++ lib.optionals enableGamma [ libXrandr ] + ++ lib.optionals (enableDpms || enableGamma || enableScreen) [ libdrm wayland ]; postInstall = '' mkdir -p $out/bin diff --git a/pkgs/applications/misc/clight/default.nix b/pkgs/applications/misc/clight/default.nix index 882c29f4b36e4..3f3ea2416d893 100644 --- a/pkgs/applications/misc/clight/default.nix +++ b/pkgs/applications/misc/clight/default.nix @@ -22,7 +22,7 @@ stdenv.mkDerivation rec { bash-completion ]; - buildInputs = with lib; [ + buildInputs = [ gsl popt upower @@ -31,8 +31,8 @@ stdenv.mkDerivation rec { geoclue2 libconfig libmodule - ] ++ optional withGeoclue geoclue2 - ++ optional withUpower upower; + ] ++ lib.optional withGeoclue geoclue2 + ++ lib.optional withUpower upower; cmakeFlags = [ "-DSESSION_BUS_DIR=${placeholder "out"}/share/dbus-1/services" diff --git a/pkgs/applications/misc/digitalbitbox/default.nix b/pkgs/applications/misc/digitalbitbox/default.nix index 418c4996eb3b3..93802ee8682c4 100644 --- a/pkgs/applications/misc/digitalbitbox/default.nix +++ b/pkgs/applications/misc/digitalbitbox/default.nix @@ -58,7 +58,7 @@ in mkDerivation rec { sha256 = "ig3+TdYv277D9GVnkRSX6nc6D6qruUOw/IQdQCK6FoA="; }; - nativeBuildInputs = with lib; [ + nativeBuildInputs = [ autoreconfHook curl git diff --git a/pkgs/applications/misc/goldendict/default.nix b/pkgs/applications/misc/goldendict/default.nix index 328f1f7343208..6b1865509b727 100644 --- a/pkgs/applications/misc/goldendict/default.nix +++ b/pkgs/applications/misc/goldendict/default.nix @@ -44,15 +44,15 @@ stdenv.mkDerivation rec { ++ lib.optionals withFFmpeg [ libao ffmpeg ] ++ lib.optional withZim zstd; - qmakeFlags = with lib; [ + qmakeFlags = [ "goldendict.pro" - (optional withCC "CONFIG+=chinese_conversion_support") - (optional (!withCC) "CONFIG+=no_chinese_conversion_support") - (optional (!withEpwing) "CONFIG+=no_epwing_support") - (optional (!withExtraTiff) "CONFIG+=no_extra_tiff_handler") - (optional (!withFFmpeg) "CONFIG+=no_ffmpeg_player") - (optional (!withMultimedia)"CONFIG+=no_qtmultimedia_player") - (optional withZim "CONFIG+=zim_support") + (lib.optional withCC "CONFIG+=chinese_conversion_support") + (lib.optional (!withCC) "CONFIG+=no_chinese_conversion_support") + (lib.optional (!withEpwing) "CONFIG+=no_epwing_support") + (lib.optional (!withExtraTiff) "CONFIG+=no_extra_tiff_handler") + (lib.optional (!withFFmpeg) "CONFIG+=no_ffmpeg_player") + (lib.optional (!withMultimedia)"CONFIG+=no_qtmultimedia_player") + (lib.optional withZim "CONFIG+=zim_support") ]; postInstall = lib.optionalString stdenv.isDarwin '' diff --git a/pkgs/applications/misc/sweethome3d/editors.nix b/pkgs/applications/misc/sweethome3d/editors.nix index a426494b61f64..9d37423f568db 100644 --- a/pkgs/applications/misc/sweethome3d/editors.nix +++ b/pkgs/applications/misc/sweethome3d/editors.nix @@ -14,10 +14,7 @@ let - sweetExec = with lib; - m: "sweethome3d-" - + removeSuffix "libraryeditor" (toLower m) - + "-editor"; + sweetExec = m: "sweethome3d-" + lib.removeSuffix "libraryeditor" (lib.toLower m) + "-editor"; mkEditorProject = { pname, module, version, src, license, description, desktopName }: diff --git a/pkgs/applications/misc/workrave/default.nix b/pkgs/applications/misc/workrave/default.nix index 1235b22b8aba1..a0521d443937b 100644 --- a/pkgs/applications/misc/workrave/default.nix +++ b/pkgs/applications/misc/workrave/default.nix @@ -40,8 +40,7 @@ stdenv.mkDerivation rec { src = fetchFromGitHub { repo = "workrave"; owner = "rcaelers"; - rev = with lib; - "v" + concatStringsSep "_" (splitVersion version); + rev = "v" + lib.concatStringsSep "_" (lib.splitVersion version); sha256 = "sha256-U39zr8XGIDbyY480bla2yTaRQLP3wMrL8RLWjlTa5uY="; }; diff --git a/pkgs/applications/networking/brig/default.nix b/pkgs/applications/networking/brig/default.nix index e7204a68d14cb..b20543c0c58a4 100644 --- a/pkgs/applications/networking/brig/default.nix +++ b/pkgs/applications/networking/brig/default.nix @@ -21,16 +21,16 @@ buildGoModule rec { subPackages = [ "." ]; - ldflags = [ "-s" "-w" ] ++ (with lib; - mapAttrsToList (n: v: "-X github.com/sahib/brig/version.${n}=${v}") - (with versions; { - Major = major version; - Minor = minor version; - Patch = patch version; + ldflags = [ "-s" "-w" ] ++ + lib.mapAttrsToList (n: v: "-X github.com/sahib/brig/version.${n}=${v}") + { + Major = lib.versions.major version; + Minor = lib.versions.minor version; + Patch = lib.versions.patch version; ReleaseType = ""; BuildTime = "1970-01-01T00:00:00+0000"; GitRev = src.rev; - })); + }; postInstall = '' installShellCompletion --cmd brig \ diff --git a/pkgs/applications/networking/browsers/chromium/default.nix b/pkgs/applications/networking/browsers/chromium/default.nix index 09b575811b83c..bebb279f1a669 100644 --- a/pkgs/applications/networking/browsers/chromium/default.nix +++ b/pkgs/applications/networking/browsers/chromium/default.nix @@ -117,12 +117,12 @@ in stdenv.mkDerivation { browserBinary = "${chromiumWV}/libexec/chromium/chromium"; libPath = lib.makeLibraryPath [ libva pipewire wayland gtk3 gtk4 libkrb5 ]; - in with lib; '' + in '' mkdir -p "$out/bin" makeWrapper "${browserBinary}" "$out/bin/chromium" \ --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}" \ - --add-flags ${escapeShellArg commandLineArgs} + --add-flags ${lib.escapeShellArg commandLineArgs} ed -v -s "$out/bin/chromium" << EOF 2i diff --git a/pkgs/applications/networking/browsers/links2/default.nix b/pkgs/applications/networking/browsers/links2/default.nix index cbf4f538c4286..9fe4fe7e37f2f 100644 --- a/pkgs/applications/networking/browsers/links2/default.nix +++ b/pkgs/applications/networking/browsers/links2/default.nix @@ -16,11 +16,11 @@ stdenv.mkDerivation (finalAttrs: { hash = "sha256-IqqWwLOOGm+PftnXpBZ6R/w3JGCXdZ72BZ7Pj56teZg="; }; - buildInputs = with lib; + buildInputs = [ libev librsvg libpng libjpeg libtiff libavif openssl xz bzip2 zlib ] - ++ optionals stdenv.isLinux [ gpm ] - ++ optionals enableX11 [ libX11 libXau libXt ] - ++ optionals enableDirectFB [ directfb ]; + ++ lib.optionals stdenv.isLinux [ gpm ] + ++ lib.optionals enableX11 [ libX11 libXau libXt ] + ++ lib.optionals enableDirectFB [ directfb ]; nativeBuildInputs = [ pkg-config bzip2 ]; diff --git a/pkgs/applications/networking/irc/weechat/default.nix b/pkgs/applications/networking/irc/weechat/default.nix index f398b4a6b0354..2d963bce32891 100644 --- a/pkgs/applications/networking/irc/weechat/default.nix +++ b/pkgs/applications/networking/irc/weechat/default.nix @@ -51,30 +51,28 @@ let outputs = [ "out" "man" ] ++ map (p: p.name) enabledPlugins; - cmakeFlags = with lib; [ + cmakeFlags = [ "-DENABLE_MAN=ON" "-DENABLE_DOC=ON" "-DENABLE_DOC_INCOMPLETE=ON" "-DENABLE_TESTS=${if enableTests then "ON" else "OFF"}" ] - ++ optionals stdenv.isDarwin ["-DICONV_LIBRARY=${libiconv}/lib/libiconv.dylib"] + ++ lib.optionals stdenv.isDarwin ["-DICONV_LIBRARY=${libiconv}/lib/libiconv.dylib"] ++ map (p: "-D${p.cmakeFlag}=" + (if p.enabled then "ON" else "OFF")) plugins ; nativeBuildInputs = [ cmake pkg-config asciidoctor ] ++ lib.optional enableTests cpputest; - buildInputs = with lib; [ - ncurses openssl aspell cjson gnutls gettext zlib curl - libgcrypt ] - ++ optionals stdenv.isDarwin [ libobjc libresolv ] - ++ concatMap (p: p.buildInputs) enabledPlugins + buildInputs = [ ncurses openssl aspell cjson gnutls gettext zlib curl libgcrypt ] + ++ lib.optionals stdenv.isDarwin [ libobjc libresolv ] + ++ lib.concatMap (p: p.buildInputs) enabledPlugins ++ extraBuildInputs; env.NIX_CFLAGS_COMPILE = "-I${python}/include/${python.libPrefix}" # Fix '_res_9_init: undefined symbol' error + (lib.optionalString stdenv.isDarwin "-DBIND_8_COMPAT=1 -lresolv"); - postInstall = with lib; '' - for p in ${concatMapStringsSep " " (p: p.name) enabledPlugins}; do + postInstall = '' + for p in ${lib.concatMapStringsSep " " (p: p.name) enabledPlugins}; do from=$out/lib/weechat/plugins/$p.so to=''${!p}/lib/weechat/plugins/$p.so mkdir -p $(dirname $to) diff --git a/pkgs/applications/networking/ngadmin/default.nix b/pkgs/applications/networking/ngadmin/default.nix index f63fbfcf95033..fb36a0367c594 100644 --- a/pkgs/applications/networking/ngadmin/default.nix +++ b/pkgs/applications/networking/ngadmin/default.nix @@ -19,10 +19,10 @@ stdenv.mkDerivation { [ autoreconfHook ] ++ lib.optional withReadline readline; enableParallelBuilding = true; - configureFlags = with lib; - optional (!withReadline) "--without-readline" - ++ optional enableEmu "--enable-emu" - ++ optional enableSpy "--enable-spy"; + configureFlags = + lib.optional (!withReadline) "--without-readline" + ++ lib.optional enableEmu "--enable-emu" + ++ lib.optional enableSpy "--enable-spy"; meta = with lib; { description = "Netgear switch (NSDP) administration tool"; diff --git a/pkgs/applications/networking/p2p/tremc/default.nix b/pkgs/applications/networking/p2p/tremc/default.nix index 6a75a02d854b3..8f3b2c6e35ef4 100644 --- a/pkgs/applications/networking/p2p/tremc/default.nix +++ b/pkgs/applications/networking/p2p/tremc/default.nix @@ -5,9 +5,9 @@ , useGeoIP ? false # Require /var/lib/geoip-databases/GeoIP.dat }: let - wrapperPath = with lib; makeBinPath ( - optional x11Support xclip ++ - optional stdenv.isDarwin pbcopy + wrapperPath = lib.makeBinPath ( + lib.optional x11Support xclip ++ + lib.optional stdenv.isDarwin pbcopy ); in python3Packages.buildPythonApplication rec { diff --git a/pkgs/applications/networking/synology-drive-client/default.nix b/pkgs/applications/networking/synology-drive-client/default.nix index d4ab94315bf96..2fafbad3499e2 100644 --- a/pkgs/applications/networking/synology-drive-client/default.nix +++ b/pkgs/applications/networking/synology-drive-client/default.nix @@ -3,7 +3,7 @@ let pname = "synology-drive-client"; baseUrl = "https://global.synologydownload.com/download/Utility/SynologyDriveClient"; version = "3.5.0-16084"; - buildNumber = with lib; last (splitString "-" version); + buildNumber = lib.last (lib.splitString "-" version); meta = with lib; { description = "Desktop application to synchronize files and folders between the computer and the Synology Drive server"; homepage = "https://www.synology.com/en-global/dsm/feature/drive"; diff --git a/pkgs/applications/science/chemistry/gwyddion/default.nix b/pkgs/applications/science/chemistry/gwyddion/default.nix index b7f06898504f1..9e64ee7afe4db 100644 --- a/pkgs/applications/science/chemistry/gwyddion/default.nix +++ b/pkgs/applications/science/chemistry/gwyddion/default.nix @@ -24,19 +24,18 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config file ]; - buildInputs = with lib; - [ gtk2 fftw ] ++ - optionals openglSupport [ gnome2.gtkglext libGL ] ++ - optional openexrSupport openexr ++ - optional libXmuSupport xorg.libXmu ++ - optional fitsSupport cfitsio ++ - optional libpngSupport libpng ++ - optional libxsltSupport libxslt ++ - optional libxml2Support libxml2 ++ - optional libwebpSupport libwebp ++ - optional zlibSupport zlib ++ - optional libuniqueSupport libunique ++ - optional libzipSupport libzip; + buildInputs = [ gtk2 fftw ] ++ + lib.optionals openglSupport [ gnome2.gtkglext libGL ] ++ + lib.optional openexrSupport openexr ++ + lib.optional libXmuSupport xorg.libXmu ++ + lib.optional fitsSupport cfitsio ++ + lib.optional libpngSupport libpng ++ + lib.optional libxsltSupport libxslt ++ + lib.optional libxml2Support libxml2 ++ + lib.optional libwebpSupport libwebp ++ + lib.optional zlibSupport zlib ++ + lib.optional libuniqueSupport libunique ++ + lib.optional libzipSupport libzip; # This patch corrects problems with python support, but should apply cleanly # regardless of whether python support is enabled, and have no effects if diff --git a/pkgs/applications/science/electronics/picoscope/default.nix b/pkgs/applications/science/electronics/picoscope/default.nix index 3aa5cb22aa52c..27e527a01d876 100644 --- a/pkgs/applications/science/electronics/picoscope/default.nix +++ b/pkgs/applications/science/electronics/picoscope/default.nix @@ -15,13 +15,12 @@ ] }: let - shared_meta = lib: - with lib; { - homepage = "https://www.picotech.com/downloads/linux"; - maintainers = with maintainers; [ expipiplus1 wirew0rm ] ++ teams.lumiguide.members; - platforms = [ "x86_64-linux" ]; - license = licenses.unfree; - }; + shared_meta = lib: { + homepage = "https://www.picotech.com/downloads/linux"; + maintainers = with lib.maintainers; [ expipiplus1 wirew0rm ] ++ lib.teams.lumiguide.members; + platforms = [ "x86_64-linux" ]; + license = lib.licenses.unfree; + }; libpicoipp = callPackage ({ stdenv, lib, fetchurl, autoPatchelfHook, dpkg }: stdenv.mkDerivation rec { @@ -39,11 +38,10 @@ let install -Dt $out/usr/share/doc/libpicoipp usr/share/doc/libpicoipp/copyright runHook postInstall ''; - meta = with lib; - shared_meta lib // { - sourceProvenance = with sourceTypes; [ binaryNativeCode ]; - description = "library for picotech oscilloscope software"; - }; + meta = shared_meta lib // { + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; + description = "library for picotech oscilloscope software"; + }; }) { }; # If we don't have a platform available, put a dummy version here, so at diff --git a/pkgs/applications/science/logic/coq/default.nix b/pkgs/applications/science/logic/coq/default.nix index d07ebd90ec7d1..25531c6a33af0 100644 --- a/pkgs/applications/science/logic/coq/default.nix +++ b/pkgs/applications/science/logic/coq/default.nix @@ -15,10 +15,9 @@ , csdp ? null , version, coq-version ? null }@args: -let lib' = lib; in -let lib = import ../../../../build-support/coq/extra-lib.nix {lib = lib';}; in -with builtins; with lib; let + lib = import ../../../../build-support/coq/extra-lib.nix { inherit (args) lib; }; + release = { "8.5pl1".sha256 = "1976ki5xjg2r907xj9p7gs0kpdinywbwcqlgxqw75dgp0hkgi00n"; "8.5pl2".sha256 = "109rrcrx7mz0fj7725kjjghfg5ydwb24hjsa5hspa27b4caah7rh"; @@ -67,29 +66,29 @@ let { inherit release releaseRev; location = { owner = "coq"; repo = "coq";}; } args.version; version = fetched.version; - coq-version = args.coq-version or (if version != "dev" then versions.majorMinor version else "dev"); - coqAtLeast = v: coq-version == "dev" || versionAtLeast coq-version v; + coq-version = args.coq-version or (if version != "dev" then lib.versions.majorMinor version else "dev"); + coqAtLeast = v: coq-version == "dev" || lib.versionAtLeast coq-version v; buildIde = args.buildIde or (!coqAtLeast "8.14"); - ideFlags = optionalString (buildIde && !coqAtLeast "8.10") + ideFlags = lib.optionalString (buildIde && !coqAtLeast "8.10") "-lablgtkdir ${ocamlPackages.lablgtk}/lib/ocaml/*/site-lib/lablgtk2 -coqide opt"; csdpPatch = lib.optionalString (csdp != null) '' substituteInPlace plugins/micromega/sos.ml --replace "; csdp" "; ${csdp}/bin/csdp" substituteInPlace plugins/micromega/coq_micromega.ml --replace "System.is_in_system_path \"csdp\"" "true" ''; ocamlPackages = if customOCamlPackages != null then customOCamlPackages - else with versions; switch coq-version [ - { case = range "8.16" "8.18"; out = ocamlPackages_4_14; } - { case = range "8.14" "8.15"; out = ocamlPackages_4_12; } - { case = range "8.11" "8.13"; out = ocamlPackages_4_10; } - { case = range "8.7" "8.10"; out = ocamlPackages_4_09; } - { case = range "8.5" "8.6"; out = ocamlPackages_4_05; } + else lib.switch coq-version [ + { case = lib.versions.range "8.16" "8.18"; out = ocamlPackages_4_14; } + { case = lib.versions.range "8.14" "8.15"; out = ocamlPackages_4_12; } + { case = lib.versions.range "8.11" "8.13"; out = ocamlPackages_4_10; } + { case = lib.versions.range "8.7" "8.10"; out = ocamlPackages_4_09; } + { case = lib.versions.range "8.5" "8.6"; out = ocamlPackages_4_05; } ] ocamlPackages_4_14; - ocamlNativeBuildInputs = with ocamlPackages; [ ocaml findlib ] - ++ optional (coqAtLeast "8.14") dune_3; + ocamlNativeBuildInputs = [ ocamlPackages.ocaml ocamlPackages.findlib ] + ++ lib.optional (coqAtLeast "8.14") ocamlPackages.dune_3; ocamlPropagatedBuildInputs = [ ] - ++ optional (!coqAtLeast "8.10") ocamlPackages.camlp5 - ++ optional (!coqAtLeast "8.13") ocamlPackages.num - ++ optional (coqAtLeast "8.13") ocamlPackages.zarith; + ++ lib.optional (!coqAtLeast "8.10") ocamlPackages.camlp5 + ++ lib.optional (!coqAtLeast "8.13") ocamlPackages.num + ++ lib.optional (coqAtLeast "8.13") ocamlPackages.zarith; self = stdenv.mkDerivation { pname = "coq"; inherit (fetched) version src; @@ -111,7 +110,7 @@ self = stdenv.mkDerivation { (coq-prog-args)) (mapc (lambda (arg) (when (file-directory-p (concat arg "/lib/coq/${coq-version}/user-contrib")) - (setenv "COQPATH" (concat (getenv "COQPATH") ":" arg "/lib/coq/${coq-version}/user-contrib")))) '(${concatStringsSep " " (map (pkg: "\"${pkg}\"") pkgs)})) + (setenv "COQPATH" (concat (getenv "COQPATH") ":" arg "/lib/coq/${coq-version}/user-contrib")))) '(${lib.concatStringsSep " " (map (pkg: "\"${pkg}\"") pkgs)})) ; TODO Abstract this pattern from here and nixBufferBuilders.withPackages! (defvar nixpkgs--coq-buffer-count 0) (when (eq nixpkgs--coq-buffer-count 0) @@ -148,11 +147,11 @@ self = stdenv.mkDerivation { nativeBuildInputs = [ pkg-config ] ++ ocamlNativeBuildInputs - ++ optional buildIde copyDesktopItems - ++ optional (buildIde && coqAtLeast "8.10") wrapGAppsHook3 - ++ optional (!coqAtLeast "8.6") gnumake42; + ++ lib.optional buildIde copyDesktopItems + ++ lib.optional (buildIde && coqAtLeast "8.10") wrapGAppsHook3 + ++ lib.optional (!coqAtLeast "8.6") gnumake42; buildInputs = [ ncurses ] - ++ optionals buildIde + ++ lib.optionals buildIde (if coqAtLeast "8.10" then [ ocamlPackages.lablgtk3-sourceview3 glib adwaita-icon-theme ] else [ ocamlPackages.lablgtk ]) @@ -188,12 +187,12 @@ self = stdenv.mkDerivation { prefixKey = "-prefix "; - buildFlags = [ "revision" "coq" ] ++ optional buildIde "coqide" ++ optional (!coqAtLeast "8.14") "bin/votour"; + buildFlags = [ "revision" "coq" ] ++ lib.optional buildIde "coqide" ++ lib.optional (!coqAtLeast "8.14") "bin/votour"; enableParallelBuilding = true; createFindlibDestdir = true; - desktopItems = optional buildIde (makeDesktopItem { + desktopItems = lib.optional buildIde (makeDesktopItem { name = "coqide"; exec = "coqide"; icon = "coq"; @@ -202,18 +201,18 @@ self = stdenv.mkDerivation { categories = [ "Development" "Science" "Math" "IDE" "GTK" ]; }); - postInstall = let suffix = optionalString (coqAtLeast "8.14") "-core"; in optionalString (!coqAtLeast "8.17") '' + postInstall = let suffix = lib.optionalString (coqAtLeast "8.14") "-core"; in lib.optionalString (!coqAtLeast "8.17") '' cp bin/votour $out/bin/ '' + '' ln -s $out/lib/coq${suffix} $OCAMLFIND_DESTDIR/coq${suffix} - '' + optionalString (coqAtLeast "8.14") '' + '' + lib.optionalString (coqAtLeast "8.14") '' ln -s $out/lib/coqide-server $OCAMLFIND_DESTDIR/coqide-server - '' + optionalString buildIde '' + '' + lib.optionalString buildIde '' mkdir -p "$out/share/pixmaps" ln -s "$out/share/coq/coq.png" "$out/share/pixmaps/" ''; - meta = { + meta = with lib; { description = "Coq proof assistant"; longDescription = '' Coq is a formal proof management system. It provides a formal language diff --git a/pkgs/applications/science/math/wolfram-engine/l10ns.nix b/pkgs/applications/science/math/wolfram-engine/l10ns.nix index 2682b6d71a1b4..cfd296087d742 100644 --- a/pkgs/applications/science/math/wolfram-engine/l10ns.nix +++ b/pkgs/applications/science/math/wolfram-engine/l10ns.nix @@ -4,7 +4,7 @@ , majorVersion ? null }: -let allVersions = with lib; flip map +let allVersions = lib.flip map # N.B. Versions in this list should be ordered from newest to oldest. [ { diff --git a/pkgs/applications/version-management/git-sync/default.nix b/pkgs/applications/version-management/git-sync/default.nix index 3ff96da704e07..07fa41a726379 100644 --- a/pkgs/applications/version-management/git-sync/default.nix +++ b/pkgs/applications/version-management/git-sync/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { cp -a contrib/git-* $out/bin/ ''; - wrapperPath = with lib; makeBinPath ([ + wrapperPath = lib.makeBinPath ([ coreutils git gnugrep diff --git a/pkgs/applications/video/mplayer/default.nix b/pkgs/applications/video/mplayer/default.nix index 47e5604eea5df..6b546b5111ebb 100644 --- a/pkgs/applications/video/mplayer/default.nix +++ b/pkgs/applications/video/mplayer/default.nix @@ -86,38 +86,37 @@ stdenv.mkDerivation rec { depsBuildBuild = [ buildPackages.stdenv.cc ]; nativeBuildInputs = [ pkg-config yasm ]; - buildInputs = with lib; - [ freetype ffmpeg_6 ] - ++ optional aalibSupport aalib - ++ optional fontconfigSupport fontconfig - ++ optional fribidiSupport fribidi - ++ optionals x11Support [ libX11 libXext libGLU libGL ] - ++ optional alsaSupport alsa-lib - ++ optional xvSupport libXv - ++ optional theoraSupport libtheora - ++ optional cacaSupport libcaca - ++ optional xineramaSupport libXinerama - ++ optional dvdnavSupport libdvdnav - ++ optional dvdreadSupport libdvdread - ++ optional bluraySupport libbluray - ++ optional cddaSupport cdparanoia - ++ optional jackaudioSupport libjack2 - ++ optionals amrSupport [ amrnb amrwb ] - ++ optional x264Support x264 - ++ optional pulseSupport libpulseaudio - ++ optional screenSaverSupport libXScrnSaver - ++ optional lameSupport lame - ++ optional vdpauSupport libvdpau - ++ optional speexSupport speex - ++ optional libpngSupport libpng - ++ optional libjpegSupport libjpeg - ++ optional bs2bSupport libbs2b - ++ optional v4lSupport libv4l - ++ (with darwin.apple_sdk.frameworks; optionals stdenv.isDarwin [ Cocoa OpenGL ]) + buildInputs = [ freetype ffmpeg_6 ] + ++ lib.optional aalibSupport aalib + ++ lib.optional fontconfigSupport fontconfig + ++ lib.optional fribidiSupport fribidi + ++ lib.optionals x11Support [ libX11 libXext libGLU libGL ] + ++ lib.optional alsaSupport alsa-lib + ++ lib.optional xvSupport libXv + ++ lib.optional theoraSupport libtheora + ++ lib.optional cacaSupport libcaca + ++ lib.optional xineramaSupport libXinerama + ++ lib.optional dvdnavSupport libdvdnav + ++ lib.optional dvdreadSupport libdvdread + ++ lib.optional bluraySupport libbluray + ++ lib.optional cddaSupport cdparanoia + ++ lib.optional jackaudioSupport libjack2 + ++ lib.optionals amrSupport [ amrnb amrwb ] + ++ lib.optional x264Support x264 + ++ lib.optional pulseSupport libpulseaudio + ++ lib.optional screenSaverSupport libXScrnSaver + ++ lib.optional lameSupport lame + ++ lib.optional vdpauSupport libvdpau + ++ lib.optional speexSupport speex + ++ lib.optional libpngSupport libpng + ++ lib.optional libjpegSupport libjpeg + ++ lib.optional bs2bSupport libbs2b + ++ lib.optional v4lSupport libv4l + ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Cocoa darwin.apple_sdk.frameworks.OpenGL ] ; configurePlatforms = [ ]; - configureFlags = with lib; [ + configureFlags = [ "--enable-freetype" (if fontconfigSupport then "--enable-fontconfig" else "--disable-fontconfig") (if x11Support then "--enable-x11 --enable-gl" else "--disable-x11 --disable-gl") @@ -143,18 +142,14 @@ stdenv.mkDerivation rec { "--disable-ossaudio" "--disable-ffmpeg_a" "--yasm=${buildPackages.yasm}/bin/yasm" - # Note, the `target` vs `host` confusion is intensional. + # Note, the `target` vs `host` confusion is intentional. "--target=${stdenv.hostPlatform.config}" - ] ++ optional - (useUnfreeCodecs && codecs != null && !crossBuild) - "--codecsdir=${codecs}" - ++ optional - (stdenv.hostPlatform.isx86 && !crossBuild) - "--enable-runtime-cpudetection" - ++ optional fribidiSupport "--enable-fribidi" - ++ optional (stdenv.isLinux && !stdenv.isAarch64) "--enable-vidix" - ++ optional stdenv.isLinux "--enable-fbdev" - ++ optionals (crossBuild) [ + ] ++ lib.optional (useUnfreeCodecs && codecs != null && !crossBuild) "--codecsdir=${codecs}" + ++ lib.optional (stdenv.hostPlatform.isx86 && !crossBuild) "--enable-runtime-cpudetection" + ++ lib.optional fribidiSupport "--enable-fribidi" + ++ lib.optional (stdenv.isLinux && !stdenv.isAarch64) "--enable-vidix" + ++ lib.optional stdenv.isLinux "--enable-fbdev" + ++ lib.optionals (crossBuild) [ "--enable-cross-compile" "--disable-vidix-pcidb" "--with-vidix-drivers=no" @@ -179,11 +174,11 @@ stdenv.mkDerivation rec { # Fixes compilation with newer versions of clang that make these warnings errors by default. NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-int-conversion -Wno-incompatible-function-pointer-types"; - NIX_LDFLAGS = with lib; toString ( - optional fontconfigSupport "-lfontconfig" - ++ optional fribidiSupport "-lfribidi" - ++ optionals x11Support [ "-lX11" "-lXext" ] - ++ optional x264Support "-lx264" + NIX_LDFLAGS = toString ( + lib.optional fontconfigSupport "-lfontconfig" + ++ lib.optional fribidiSupport "-lfribidi" + ++ lib.optionals x11Support [ "-lX11" "-lXext" ] + ++ lib.optional x264Support "-lx264" ++ [ "-lfreetype" ] ); diff --git a/pkgs/applications/video/mpv/scripts/default.nix b/pkgs/applications/video/mpv/scripts/default.nix index 873010ca3f5ac..de0ee95044caa 100644 --- a/pkgs/applications/video/mpv/scripts/default.nix +++ b/pkgs/applications/video/mpv/scripts/default.nix @@ -41,40 +41,38 @@ let } # can't check whether `fullScriptPath` is a directory, in pure-evaluation mode - ( - with lib; - optionalAttrs - ( - !any (s: hasSuffix s drv.passthru.scriptName) [ - ".js" - ".lua" - ".so" - ] - ) - { - single-main-in-script-dir = - runCommand "mpvScripts.${name}.passthru.tests.single-main-in-script-dir" - { - meta.maintainers = with lib.maintainers; [ nicoo ]; - preferLocalBuild = true; + (lib.optionalAttrs + ( + !lib.any (s: lib.hasSuffix s drv.passthru.scriptName) [ + ".js" + ".lua" + ".so" + ] + ) + { + single-main-in-script-dir = + runCommand "mpvScripts.${name}.passthru.tests.single-main-in-script-dir" + { + meta.maintainers = with lib.maintainers; [ nicoo ]; + preferLocalBuild = true; + } + '' + die() { + echo "$@" >&2 + exit 1 } - '' - die() { - echo "$@" >&2 - exit 1 - } - cd "${drv}/${scriptPath}" # so the glob expands to filenames only - mains=( main.* ) - if [ "''${#mains[*]}" -eq 1 ]; then - touch $out - elif [ "''${#mains[*]}" -eq 0 ]; then - die "'${scriptPath}' contains no 'main.*' file" - else - die "'${scriptPath}' contains multiple 'main.*' files:" "''${mains[*]}" - fi - ''; - } + cd "${drv}/${scriptPath}" # so the glob expands to filenames only + mains=( main.* ) + if [ "''${#mains[*]}" -eq 1 ]; then + touch $out + elif [ "''${#mains[*]}" -eq 0 ]; then + die "'${scriptPath}' contains no 'main.*' file" + else + die "'${scriptPath}' contains multiple 'main.*' files:" "''${mains[*]}" + fi + ''; + } ) ]; }; diff --git a/pkgs/applications/video/obs-studio/wrapper.nix b/pkgs/applications/video/obs-studio/wrapper.nix index 62bc80d26df3b..0c972fc58d371 100644 --- a/pkgs/applications/video/obs-studio/wrapper.nix +++ b/pkgs/applications/video/obs-studio/wrapper.nix @@ -8,11 +8,11 @@ symlinkJoin { nativeBuildInputs = [ makeWrapper ]; paths = [ obs-studio ] ++ plugins; - postBuild = with lib; + postBuild = let # Some plugins needs extra environment, see obs-gstreamer for an example. pluginArguments = - lists.concatMap (plugin: plugin.obsWrapperArguments or []) plugins; + lib.lists.concatMap (plugin: plugin.obsWrapperArguments or []) plugins; pluginsJoined = symlinkJoin { name = "obs-studio-plugins"; @@ -24,9 +24,9 @@ symlinkJoin { "$out/bin/obs" ''--set OBS_PLUGINS_PATH "${pluginsJoined}/lib/obs-plugins"'' ''--set OBS_PLUGINS_DATA_PATH "${pluginsJoined}/share/obs/obs-plugins"'' - ] ++ lists.unique pluginArguments; + ] ++ lib.lists.unique pluginArguments; in '' - ${concatStringsSep " " wrapCommandLine} + ${lib.concatStringsSep " " wrapCommandLine} # Remove unused obs-plugins dir to not cause confusion rm -r $out/share/obs/obs-plugins diff --git a/pkgs/applications/virtualization/singularity/generic.nix b/pkgs/applications/virtualization/singularity/generic.nix index 1cac1d4f16c65..24e1b3b67b26f 100644 --- a/pkgs/applications/virtualization/singularity/generic.nix +++ b/pkgs/applications/virtualization/singularity/generic.nix @@ -326,26 +326,23 @@ in ''} ''; - meta = - with lib; - { - description = "Application containers for linux" + extraDescription; - longDescription = '' - Singularity (the upstream) renamed themselves to Apptainer - to distinguish themselves from a fork made by Sylabs Inc.. See + meta = { + description = "Application containers for linux" + extraDescription; + longDescription = '' + Singularity (the upstream) renamed themselves to Apptainer + to distinguish themselves from a fork made by Sylabs Inc.. See - https://sylabs.io/2021/05/singularity-community-edition - https://apptainer.org/news/community-announcement-20211130 - ''; - license = licenses.bsd3; - platforms = platforms.linux; - maintainers = with maintainers; [ - jbedo - ShamrockLee - ]; - mainProgram = projectName; - } - // extraMeta; + https://sylabs.io/2021/05/singularity-community-edition + https://apptainer.org/news/community-announcement-20211130 + ''; + license = lib.licenses.bsd3; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ + jbedo + ShamrockLee + ]; + mainProgram = projectName; + } // extraMeta; }).overrideAttrs ( finalAttrs: prevAttrs: { diff --git a/pkgs/build-support/fetchsvn/default.nix b/pkgs/build-support/fetchsvn/default.nix index 41752eb55a7a8..203a145b64341 100644 --- a/pkgs/build-support/fetchsvn/default.nix +++ b/pkgs/build-support/fetchsvn/default.nix @@ -10,15 +10,15 @@ assert sshSupport -> openssh != null; let - repoName = with lib; + repoName = let - fst = head; - snd = l: head (tail l); - trd = l: head (tail (tail l)); + fst = lib.head; + snd = l: lib.head (lib.tail l); + trd = l: lib.head (lib.tail (lib.tail l)); path_ = - (p: if head p == "" then tail p else p) # ~ drop final slash if any - (reverseList (splitString "/" url)); - path = [ (removeSuffix "/" (head path_)) ] ++ (tail path_); + (p: if lib.head p == "" then lib.tail p else p) # ~ drop final slash if any + (lib.reverseList (lib.splitString "/" url)); + path = [ (lib.removeSuffix "/" (lib.head path_)) ] ++ (lib.tail path_); in # ../repo/trunk -> repo if fst path == "trunk" then snd path diff --git a/pkgs/build-support/writers/aliases.nix b/pkgs/build-support/writers/aliases.nix index fb108a6fd857a..8441abf36ce5e 100644 --- a/pkgs/build-support/writers/aliases.nix +++ b/pkgs/build-support/writers/aliases.nix @@ -3,16 +3,16 @@ lib: prev: let # Removing recurseForDerivation prevents derivations of aliased attribute # set to appear while listing all the packages available. - removeRecurseForDerivations = alias: with lib; + removeRecurseForDerivations = alias: if alias.recurseForDerivations or false then - removeAttrs alias ["recurseForDerivations"] + lib.removeAttrs alias ["recurseForDerivations"] else alias; # Disabling distribution prevents top-level aliases for non-recursed package # sets from building on Hydra. - removeDistribute = alias: with lib; - if isDerivation alias then - dontDistribute alias + removeDistribute = alias: + if lib.isDerivation alias then + lib.dontDistribute alias else alias; # Make sure that we are not shadowing something from diff --git a/pkgs/by-name/bt/btrfs-auto-snapshot/package.nix b/pkgs/by-name/bt/btrfs-auto-snapshot/package.nix index 7392a0c5809d1..7cd30f563bc44 100644 --- a/pkgs/by-name/bt/btrfs-auto-snapshot/package.nix +++ b/pkgs/by-name/bt/btrfs-auto-snapshot/package.nix @@ -32,19 +32,17 @@ stdenv.mkDerivation rec { install -Dm755 btrfs-auto-snapshot $out/bin/btrfs-auto-snapshot ''; - wrapperPath = - with lib; - makeBinPath ( - [ - coreutils - getopt - gnugrep - gnused - gawk - btrfs-progs - ] - ++ optional syslogSupport util-linux - ); + wrapperPath = lib.makeBinPath ( + [ + coreutils + getopt + gnugrep + gnused + gawk + btrfs-progs + ] + ++ lib.optional syslogSupport util-linux + ); postFixup = '' wrapProgram $out/bin/btrfs-auto-snapshot \ diff --git a/pkgs/by-name/la/labelife-label-printer/package.nix b/pkgs/by-name/la/labelife-label-printer/package.nix index fb73aa24d572a..712d478e6a619 100644 --- a/pkgs/by-name/la/labelife-label-printer/package.nix +++ b/pkgs/by-name/la/labelife-label-printer/package.nix @@ -54,7 +54,7 @@ stdenv.mkDerivation (finalAttrs: { - Aimo ''; maintainers = with lib.maintainers; [ daniel-fahey ]; - platforms = with lib; [ "i686-linux" "x86_64-linux" ]; + platforms = [ "i686-linux" "x86_64-linux" ]; sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; }; }) diff --git a/pkgs/by-name/li/libplacebo_5/package.nix b/pkgs/by-name/li/libplacebo_5/package.nix index 8dc6dbe1cea6e..5bc799ddf8607 100644 --- a/pkgs/by-name/li/libplacebo_5/package.nix +++ b/pkgs/by-name/li/libplacebo_5/package.nix @@ -46,13 +46,13 @@ stdenv.mkDerivation rec { libdovi ]; - mesonFlags = with lib; [ - (mesonOption "vulkan-registry" "${vulkan-headers}/share/vulkan/registry/vk.xml") - (mesonBool "demos" false) # Don't build and install the demo programs - (mesonEnable "d3d11" false) # Disable the Direct3D 11 based renderer - (mesonEnable "glslang" false) # rely on shaderc for GLSL compilation instead - ] ++ optionals stdenv.isDarwin [ - (mesonEnable "unwind" false) # libplacebo doesn’t build with `darwin.libunwind` + mesonFlags = [ + (lib.mesonOption "vulkan-registry" "${vulkan-headers}/share/vulkan/registry/vk.xml") + (lib.mesonBool "demos" false) # Don't build and install the demo programs + (lib.mesonEnable "d3d11" false) # Disable the Direct3D 11 based renderer + (lib.mesonEnable "glslang" false) # rely on shaderc for GLSL compilation instead + ] ++ lib.optionals stdenv.isDarwin [ + (lib.mesonEnable "unwind" false) # libplacebo doesn’t build with `darwin.libunwind` ]; postPatch = '' diff --git a/pkgs/by-name/mo/modrinth-app-unwrapped/package.nix b/pkgs/by-name/mo/modrinth-app-unwrapped/package.nix index 7814ec363dce2..c9c5cbdc73f5c 100644 --- a/pkgs/by-name/mo/modrinth-app-unwrapped/package.nix +++ b/pkgs/by-name/mo/modrinth-app-unwrapped/package.nix @@ -187,7 +187,7 @@ rustPlatform.buildRustPackage { unfreeRedistributable ]; maintainers = with lib.maintainers; [ getchoo ]; - platforms = with lib; platforms.linux ++ platforms.darwin; + platforms = lib.platforms.linux ++ lib.platforms.darwin; # this builds on architectures like aarch64, but the launcher itself does not support them yet broken = !stdenv.isx86_64; }; diff --git a/pkgs/by-name/mo/mousecape/package.nix b/pkgs/by-name/mo/mousecape/package.nix index 3f29a01358276..7d45953a4e402 100644 --- a/pkgs/by-name/mo/mousecape/package.nix +++ b/pkgs/by-name/mo/mousecape/package.nix @@ -24,10 +24,10 @@ stdenvNoCC.mkDerivation (finalAttrs: { meta = { description = "Cursor manager for macOS built using private, nonintrusive CoreGraphics APIs"; homepage = "https://github.com/alexzielenski/Mousecape"; - license = with lib; licenses.free; - maintainers = with lib; with maintainers; [ donteatoreo ]; - platforms = with lib; platforms.darwin; - sourceProvenance = with lib; with sourceTypes; [ binaryNativeCode ]; + license = lib.licenses.free; + maintainers = with lib.maintainers; [ donteatoreo ]; + platforms = lib.platforms.darwin; + sourceProvenance = [ lib.sourceTypes.binaryNativeCode ]; }; }) diff --git a/pkgs/by-name/sm/smartgithg/package.nix b/pkgs/by-name/sm/smartgithg/package.nix index d3bb1ed1b67d7..d636c9d9b1ede 100644 --- a/pkgs/by-name/sm/smartgithg/package.nix +++ b/pkgs/by-name/sm/smartgithg/package.nix @@ -26,10 +26,10 @@ stdenv.mkDerivation rec { buildInputs = [ jre adwaita-icon-theme gtk3 ]; - preFixup = with lib; '' + preFixup = '' gappsWrapperArgs+=( \ - --prefix PATH : ${makeBinPath [ jre which ]} \ - --prefix LD_LIBRARY_PATH : ${makeLibraryPath [ + --prefix PATH : ${lib.makeBinPath [ jre which ]} \ + --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ gtk3 glib libXtst @@ -65,7 +65,7 @@ stdenv.mkDerivation rec { runHook postInstall ''; - desktopItem = with lib; makeDesktopItem rec { + desktopItem = makeDesktopItem rec { name = "smartgit"; exec = "smartgit"; comment = meta.description; diff --git a/pkgs/development/compilers/ats2/default.nix b/pkgs/development/compilers/ats2/default.nix index f9ba2e1ac4170..2dad47c08abcc 100644 --- a/pkgs/development/compilers/ats2/default.nix +++ b/pkgs/development/compilers/ats2/default.nix @@ -49,14 +49,12 @@ stdenv.mkDerivation rec { "CCOMP=${stdenv.cc.targetPrefix}cc" ]; - setupHook = with lib; + setupHook = let - hookFiles = - [ ./setup-hook.sh ] - ++ optional withContrib ./setup-contrib-hook.sh; + hookFiles = [ ./setup-hook.sh ] ++ lib.optional withContrib ./setup-contrib-hook.sh; in builtins.toFile "setupHook.sh" - (concatMapStringsSep "\n" builtins.readFile hookFiles); + (lib.concatMapStringsSep "\n" builtins.readFile hookFiles); postInstall = postInstallContrib + postInstallEmacs; diff --git a/pkgs/development/compilers/dotnet/build-dotnet.nix b/pkgs/development/compilers/dotnet/build-dotnet.nix index 246cc9ade7172..0c9de3f05cab4 100644 --- a/pkgs/development/compilers/dotnet/build-dotnet.nix +++ b/pkgs/development/compilers/dotnet/build-dotnet.nix @@ -161,9 +161,7 @@ mkCommon type rec { updateScript = let - majorVersion = - with lib; - concatStringsSep "." (take 2 (splitVersion version)); + majorVersion = lib.concatStringsSep "." (lib.take 2 (lib.splitVersion version)); in writeShellScript "update-dotnet-${majorVersion}" '' pushd pkgs/development/compilers/dotnet diff --git a/pkgs/development/compilers/elm/packages/ghc8_10/default.nix b/pkgs/development/compilers/elm/packages/ghc8_10/default.nix index f68e582b3d0b9..ef6e5142b2f1e 100644 --- a/pkgs/development/compilers/elm/packages/ghc8_10/default.nix +++ b/pkgs/development/compilers/elm/packages/ghc8_10/default.nix @@ -1,8 +1,9 @@ { pkgs, lib }: self: pkgs.haskell.packages.ghc810.override { - overrides = self: super: with pkgs.haskell.lib.compose; with lib; + overrides = self: super: let + inherit (pkgs.haskell.lib.compose) justStaticExecutables overrideCabal doJailbreak; elmPkgs = rec { elmi-to-json = justStaticExecutables (overrideCabal (drv: { @@ -22,8 +23,8 @@ self: pkgs.haskell.packages.ghc810.override { description = "Tool that reads .elmi files (Elm interface file) generated by the elm compiler"; homepage = "https://github.com/stoeffel/elmi-to-json"; - license = licenses.bsd3; - maintainers = [ maintainers.turbomack ]; + license = lib.licenses.bsd3; + maintainers = [ lib.maintainers.turbomack ]; }) (self.callPackage ./elmi-to-json { })); @@ -55,8 +56,8 @@ self: pkgs.haskell.packages.ghc810.override { description = "Instrument Elm code as a preprocessing step for elm-coverage"; homepage = "https://github.com/zwilias/elm-instrument"; - license = licenses.bsd3; - maintainers = [ maintainers.turbomack ]; + license = lib.licenses.bsd3; + maintainers = [ lib.maintainers.turbomack ]; }) (self.callPackage ./elm-instrument { })); }; diff --git a/pkgs/development/compilers/elm/packages/ghc9_2/default.nix b/pkgs/development/compilers/elm/packages/ghc9_2/default.nix index 5ef5eff3bef17..6c3e23460c220 100644 --- a/pkgs/development/compilers/elm/packages/ghc9_2/default.nix +++ b/pkgs/development/compilers/elm/packages/ghc9_2/default.nix @@ -1,8 +1,9 @@ { pkgs, lib }: self: pkgs.haskell.packages.ghc92.override { - overrides = self: super: with pkgs.haskell.lib.compose; with lib; + overrides = self: super: let + inherit (pkgs.haskell.lib.compose) justStaticExecutables overrideCabal doJailbreak; elmPkgs = rec { /* The elm-format expression is updated via a script in the https://github.com/avh4/elm-format repo: @@ -23,8 +24,8 @@ self: pkgs.haskell.packages.ghc92.override { description = "Formats Elm source code according to a standard set of rules based on the official Elm Style Guide"; homepage = "https://github.com/avh4/elm-format"; - license = licenses.bsd3; - maintainers = with maintainers; [ avh4 turbomack ]; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ avh4 turbomack ]; }) (self.callPackage ./elm-format/elm-format.nix { })); }; diff --git a/pkgs/development/compilers/elm/packages/ghc9_6/default.nix b/pkgs/development/compilers/elm/packages/ghc9_6/default.nix index 0c30c9bea7285..9fdc0e72f1272 100644 --- a/pkgs/development/compilers/elm/packages/ghc9_6/default.nix +++ b/pkgs/development/compilers/elm/packages/ghc9_6/default.nix @@ -1,8 +1,9 @@ { pkgs, lib, makeWrapper, nodejs, fetchElmDeps }: self: pkgs.haskell.packages.ghc96.override { - overrides = self: super: with pkgs.haskell.lib.compose; with lib; + overrides = self: super: let + inherit (pkgs.haskell.lib.compose) overrideCabal; elmPkgs = rec { elm = overrideCabal (drv: { @@ -21,8 +22,8 @@ self: pkgs.haskell.packages.ghc96.override { description = "Delightful language for reliable webapps"; homepage = "https://elm-lang.org/"; - license = licenses.bsd3; - maintainers = with maintainers; [ domenkozar turbomack ]; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ domenkozar turbomack ]; }) (self.callPackage ./elm { }); diff --git a/pkgs/development/compilers/llvm/common/llvm/default.nix b/pkgs/development/compilers/llvm/common/llvm/default.nix index fdcd40201c0bb..a995c83405e98 100644 --- a/pkgs/development/compilers/llvm/common/llvm/default.nix +++ b/pkgs/development/compilers/llvm/common/llvm/default.nix @@ -46,8 +46,7 @@ let inherit (lib) optional optionals optionalString; # Used when creating a version-suffixed symlink of libLLVM.dylib - shortVersion = with lib; - concatStringsSep "." (take 1 (splitString "." release_version)); + shortVersion = lib.concatStringsSep "." (lib.take 1 (lib.splitString "." release_version)); # Ordinarily we would just the `doCheck` and `checkDeps` functionality # `mkDerivation` gives us to manage our test dependencies (instead of breaking @@ -71,7 +70,7 @@ let # platform here; the splicing that would ordinarily take care of this for # us does not seem to work once we use `withPackages`. let - checkDeps = ps: with ps; [ psutil ]; + checkDeps = ps: [ ps.psutil ]; in pkgsBuildBuild.targetPackages.python3.withPackages checkDeps else python3; @@ -323,7 +322,7 @@ stdenv.mkDerivation (rec { cmakeBuildType = if debugVersion then "Debug" else "Release"; - cmakeFlags = with stdenv; let + cmakeFlags = let # These flags influence llvm-config's BuildVariables.inc in addition to the # general build. We need to make sure these are also passed via # CROSS_TOOLCHAIN_FLAGS_NATIVE when cross-compiling or llvm-config-native @@ -367,7 +366,7 @@ stdenv.mkDerivation (rec { "-DSPHINX_WARNINGS_AS_ERRORS=OFF" ] ++ optionals (enableGoldPlugin) [ "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include" - ] ++ optionals isDarwin [ + ] ++ optionals stdenv.isDarwin [ "-DLLVM_ENABLE_LIBCXX=ON" "-DCAN_TARGET_i386=false" ] ++ optionals ((stdenv.hostPlatform != stdenv.buildPlatform) && !(stdenv.buildPlatform.canExecute stdenv.hostPlatform)) [ diff --git a/pkgs/development/compilers/mezzo/default.nix b/pkgs/development/compilers/mezzo/default.nix index 498743ee743e0..a47228b1d0b12 100644 --- a/pkgs/development/compilers/mezzo/default.nix +++ b/pkgs/development/compilers/mezzo/default.nix @@ -7,7 +7,7 @@ then throw "mezzo is not available for OCaml ${ocaml.version}" else let - check-ocaml-version = with lib; versionAtLeast (getVersion ocaml); + check-ocaml-version = lib.versionAtLeast (lib.getVersion ocaml); in assert check-ocaml-version "4"; diff --git a/pkgs/development/compilers/sbcl/default.nix b/pkgs/development/compilers/sbcl/default.nix index f523939616654..86c0ddd52fab8 100644 --- a/pkgs/development/compilers/sbcl/default.nix +++ b/pkgs/development/compilers/sbcl/default.nix @@ -159,17 +159,17 @@ stdenv.mkDerivation (self: { export HOME=$PWD/test-home ''; - enableFeatures = with lib; - assert assertMsg (self.markRegionGC -> self.threadSupport) "SBCL mark region GC requires thread support"; - optional self.threadSupport "sb-thread" ++ - optional self.linkableRuntime "sb-linkable-runtime" ++ - optional self.coreCompression "sb-core-compression" ++ - optional stdenv.isAarch32 "arm" ++ - optional self.markRegionGC "mark-region-gc"; - - disableFeatures = with lib; - optional (!self.threadSupport) "sb-thread" ++ - optionals self.disableImmobileSpace [ "immobile-space" "immobile-code" "compact-instance-header" ]; + enableFeatures = + assert lib.assertMsg (self.markRegionGC -> self.threadSupport) "SBCL mark region GC requires thread support"; + lib.optional self.threadSupport "sb-thread" ++ + lib.optional self.linkableRuntime "sb-linkable-runtime" ++ + lib.optional self.coreCompression "sb-core-compression" ++ + lib.optional stdenv.isAarch32 "arm" ++ + lib.optional self.markRegionGC "mark-region-gc"; + + disableFeatures = + lib.optional (!self.threadSupport) "sb-thread" ++ + lib.optionals self.disableImmobileSpace [ "immobile-space" "immobile-code" "compact-instance-header" ]; buildArgs = [ "--prefix=$out" diff --git a/pkgs/development/coq-modules/QuickChick/default.nix b/pkgs/development/coq-modules/QuickChick/default.nix index 629e752ca6287..451353a341423 100644 --- a/pkgs/development/coq-modules/QuickChick/default.nix +++ b/pkgs/development/coq-modules/QuickChick/default.nix @@ -5,18 +5,18 @@ let recent = lib.versions.isGe "8.7" coq.coq-version || coq.coq-version == "dev" pname = "QuickChick"; owner = "QuickChick"; inherit version; - defaultVersion = with lib; with versions; lib.switch [ coq.coq-version ssreflect.version ] [ - { cases = [ (range "8.15" "8.19") pred.true ]; out = "2.0.2"; } - { cases = [ (range "8.13" "8.17") pred.true ]; out = "1.6.5"; } - { cases = [ "8.13" pred.true ]; out = "1.5.0"; } - { cases = [ "8.12" pred.true ]; out = "1.4.0"; } - { cases = [ "8.11" pred.true ]; out = "1.3.2"; } - { cases = [ "8.10" pred.true ]; out = "1.2.1"; } - { cases = [ "8.9" pred.true ]; out = "1.1.0"; } - { cases = [ "8.8" pred.true ]; out = "20190311"; } - { cases = [ "8.7" isLe "1.8" ]; out = "1.0.0"; } - { cases = [ "8.6" pred.true ]; out = "20171102"; } - { cases = [ "8.5" pred.true ]; out = "20170512"; } + defaultVersion = lib.switch [ coq.coq-version ssreflect.version ] [ + { cases = [ (lib.versions.range "8.15" "8.19") lib.pred.true ]; out = "2.0.2"; } + { cases = [ (lib.versions.range "8.13" "8.17") lib.pred.true ]; out = "1.6.5"; } + { cases = [ "8.13" lib.pred.true ]; out = "1.5.0"; } + { cases = [ "8.12" lib.pred.true ]; out = "1.4.0"; } + { cases = [ "8.11" lib.pred.true ]; out = "1.3.2"; } + { cases = [ "8.10" lib.pred.true ]; out = "1.2.1"; } + { cases = [ "8.9" lib.pred.true ]; out = "1.1.0"; } + { cases = [ "8.8" lib.pred.true ]; out = "20190311"; } + { cases = [ "8.7" lib.versions.isLe "1.8" ]; out = "1.0.0"; } + { cases = [ "8.6" lib.pred.true ]; out = "20171102"; } + { cases = [ "8.5" lib.pred.true ]; out = "20170512"; } ] null; release."2.0.2".sha256 = "sha256-xxKkwDRjB8nUiXNhein1Ppn0DP5FZ13J90xUPAnQBbs="; release."2.0.1".sha256 = "sha256-gJc+9Or6tbqE00920Il4pnEvokRoiADX6CxP/Q0QZaY="; diff --git a/pkgs/development/coq-modules/mathcomp-abel/default.nix b/pkgs/development/coq-modules/mathcomp-abel/default.nix index bae9266d4de10..c9d6a709d6a38 100644 --- a/pkgs/development/coq-modules/mathcomp-abel/default.nix +++ b/pkgs/development/coq-modules/mathcomp-abel/default.nix @@ -7,10 +7,10 @@ mkCoqDerivation { owner = "math-comp"; inherit version; - defaultVersion = with lib; with versions; lib.switch [ coq.version mathcomp.version ] [ - { cases = [ (range "8.10" "8.16") (range "1.12.0" "1.15.0") ]; out = "1.2.1"; } - { cases = [ (range "8.10" "8.15") (range "1.12.0" "1.14.0") ]; out = "1.2.0"; } - { cases = [ (range "8.10" "8.14") (range "1.11.0" "1.12.0") ]; out = "1.1.2"; } + defaultVersion = lib.switch [ coq.version mathcomp.version ] [ + { cases = [ (lib.versions.range "8.10" "8.16") (lib.versions.range "1.12.0" "1.15.0") ]; out = "1.2.1"; } + { cases = [ (lib.versions.range "8.10" "8.15") (lib.versions.range "1.12.0" "1.14.0") ]; out = "1.2.0"; } + { cases = [ (lib.versions.range "8.10" "8.14") (lib.versions.range "1.11.0" "1.12.0") ]; out = "1.1.2"; } ] null; release."1.2.1".sha256 = "sha256-M1q6WIPBsayHde2hwlTxylH169hcTs3OuFsEkM0e3yc="; diff --git a/pkgs/development/coq-modules/serapi/default.nix b/pkgs/development/coq-modules/serapi/default.nix index ac61e4eed0184..d8077640d6e10 100644 --- a/pkgs/development/coq-modules/serapi/default.nix +++ b/pkgs/development/coq-modules/serapi/default.nix @@ -15,23 +15,22 @@ let }; in -(with lib; mkCoqDerivation { +(mkCoqDerivation { pname = "serapi"; repo = "coq-serapi"; inherit version release; - defaultVersion = with versions; - lib.switch coq.version [ - { case = isEq "8.19"; out = "8.19.0+0.19.3"; } - { case = isEq "8.18"; out = "8.18.0+0.18.3"; } - { case = isEq "8.17"; out = "8.17.0+0.17.3"; } - { case = isEq "8.16"; out = "8.16.0+0.16.3"; } - { case = isEq "8.15"; out = "8.15.0+0.15.0"; } - { case = isEq "8.14"; out = "8.14.0+0.14.0"; } - { case = isEq "8.13"; out = "8.13.0+0.13.0"; } - { case = isEq "8.12"; out = "8.12.0+0.12.1"; } - { case = isEq "8.11"; out = "8.11.0+0.11.1"; } - { case = isEq "8.10"; out = "8.10.0+0.7.2"; } + defaultVersion = lib.switch coq.version [ + { case = lib.versions.isEq "8.19"; out = "8.19.0+0.19.3"; } + { case = lib.versions.isEq "8.18"; out = "8.18.0+0.18.3"; } + { case = lib.versions.isEq "8.17"; out = "8.17.0+0.17.3"; } + { case = lib.versions.isEq "8.16"; out = "8.16.0+0.16.3"; } + { case = lib.versions.isEq "8.15"; out = "8.15.0+0.15.0"; } + { case = lib.versions.isEq "8.14"; out = "8.14.0+0.14.0"; } + { case = lib.versions.isEq "8.13"; out = "8.13.0+0.13.0"; } + { case = lib.versions.isEq "8.12"; out = "8.12.0+0.12.1"; } + { case = lib.versions.isEq "8.11"; out = "8.11.0+0.11.1"; } + { case = lib.versions.isEq "8.10"; out = "8.10.0+0.7.2"; } ] null; useDune = true; diff --git a/pkgs/development/haskell-modules/lib/compose.nix b/pkgs/development/haskell-modules/lib/compose.nix index 8d09dcf5bea18..09de1d228d942 100644 --- a/pkgs/development/haskell-modules/lib/compose.nix +++ b/pkgs/development/haskell-modules/lib/compose.nix @@ -345,14 +345,14 @@ rec { , ignorePackages ? [] } : drv : overrideCabal (_drv: { - postBuild = with lib; - let args = concatStringsSep " " ( - optional ignoreEmptyImports "--ignore-empty-imports" ++ - optional ignoreMainModule "--ignore-main-module" ++ + postBuild = + let args = lib.concatStringsSep " " ( + lib.optional ignoreEmptyImports "--ignore-empty-imports" ++ + lib.optional ignoreMainModule "--ignore-main-module" ++ map (pkg: "--ignore-package ${pkg}") ignorePackages ); in "${pkgs.haskellPackages.packunused}/bin/packunused" + - optionalString (args != "") " ${args}"; + lib.optionalString (args != "") " ${args}"; }) (appendConfigureFlag "--ghc-option=-ddump-minimal-imports" drv); buildStackProject = pkgs.callPackage ../generic-stack-builder.nix { }; diff --git a/pkgs/development/interpreters/gnu-apl/default.nix b/pkgs/development/interpreters/gnu-apl/default.nix index d854643bb2fe8..85e86de1d6b29 100644 --- a/pkgs/development/interpreters/gnu-apl/default.nix +++ b/pkgs/development/interpreters/gnu-apl/default.nix @@ -11,7 +11,7 @@ stdenv.mkDerivation rec { buildInputs = [ readline gettext ncurses ]; - env.NIX_CFLAGS_COMPILE = with lib; toString ((optionals stdenv.cc.isGNU [ + env.NIX_CFLAGS_COMPILE = toString ((lib.optionals stdenv.cc.isGNU [ # Needed with GCC 8 "-Wno-error=int-in-bool-context" "-Wno-error=class-memaccess" @@ -25,7 +25,7 @@ stdenv.mkDerivation rec { "-Wno-error=nonnull" "-Wno-error=stringop-overflow" "-Wno-error=use-after-free" - ]) ++ optional stdenv.cc.isClang "-Wno-error=null-dereference"); + ]) ++ lib.optional stdenv.cc.isClang "-Wno-error=null-dereference"); patchPhase = lib.optionalString stdenv.isDarwin '' substituteInPlace src/LApack.cc --replace "malloc.h" "malloc/malloc.h" diff --git a/pkgs/development/interpreters/luajit/2.0.nix b/pkgs/development/interpreters/luajit/2.0.nix index 9ad3099143c8d..c70b6809d1df9 100644 --- a/pkgs/development/interpreters/luajit/2.0.nix +++ b/pkgs/development/interpreters/luajit/2.0.nix @@ -14,8 +14,8 @@ callPackage ./default.nix { extraMeta = { # this isn't precise but it at least stops the useless Hydra build - platforms = with lib; filter (p: !hasPrefix "aarch64-" p) - (platforms.linux ++ platforms.darwin); + platforms = lib.filter (p: !lib.hasPrefix "aarch64-" p) + (lib.platforms.linux ++ lib.platforms.darwin); }; inherit self passthruFun; } diff --git a/pkgs/development/interpreters/luajit/default.nix b/pkgs/development/interpreters/luajit/default.nix index 25f3332b2602a..f5e25b6261bc2 100644 --- a/pkgs/development/interpreters/luajit/default.nix +++ b/pkgs/development/interpreters/luajit/default.nix @@ -40,18 +40,18 @@ let luaPackages = self.pkgs; - XCFLAGS = with lib; - optional (!enableFFI) "-DLUAJIT_DISABLE_FFI" - ++ optional (!enableJIT) "-DLUAJIT_DISABLE_JIT" - ++ optional enable52Compat "-DLUAJIT_ENABLE_LUA52COMPAT" - ++ optional (!enableGC64) "-DLUAJIT_DISABLE_GC64" - ++ optional useSystemMalloc "-DLUAJIT_USE_SYSMALLOC" - ++ optional enableValgrindSupport "-DLUAJIT_USE_VALGRIND" - ++ optional enableGDBJITSupport "-DLUAJIT_USE_GDBJIT" - ++ optional enableAPICheck "-DLUAJIT_USE_APICHECK" - ++ optional enableVMAssertions "-DLUAJIT_USE_ASSERT" - ++ optional enableRegisterAllocationRandomization "-DLUAJIT_RANDOM_RA" - ++ optional deterministicStringIds "-DLUAJIT_SECURITY_STRID=0" + XCFLAGS = + lib.optional (!enableFFI) "-DLUAJIT_DISABLE_FFI" + ++ lib.optional (!enableJIT) "-DLUAJIT_DISABLE_JIT" + ++ lib.optional enable52Compat "-DLUAJIT_ENABLE_LUA52COMPAT" + ++ lib.optional (!enableGC64) "-DLUAJIT_DISABLE_GC64" + ++ lib.optional useSystemMalloc "-DLUAJIT_USE_SYSMALLOC" + ++ lib.optional enableValgrindSupport "-DLUAJIT_USE_VALGRIND" + ++ lib.optional enableGDBJITSupport "-DLUAJIT_USE_GDBJIT" + ++ lib.optional enableAPICheck "-DLUAJIT_USE_APICHECK" + ++ lib.optional enableVMAssertions "-DLUAJIT_USE_ASSERT" + ++ lib.optional enableRegisterAllocationRandomization "-DLUAJIT_RANDOM_RA" + ++ lib.optional deterministicStringIds "-DLUAJIT_SECURITY_STRID=0" ; # LuaJIT requires build for 32bit architectures to be build on x86 not x86_64 diff --git a/pkgs/development/libraries/getdns/default.nix b/pkgs/development/libraries/getdns/default.nix index 7fb6411584608..69d7f17dafe7d 100644 --- a/pkgs/development/libraries/getdns/default.nix +++ b/pkgs/development/libraries/getdns/default.nix @@ -3,10 +3,10 @@ { lib, stdenv, fetchurl, cmake, darwin, doxygen, libidn2, libyaml, openssl , systemd, unbound, yq }: let - metaCommon = with lib; { - maintainers = with maintainers; [ leenaars ehmry ]; - license = licenses.bsd3; - platforms = platforms.all; + metaCommon = { + maintainers = with lib.maintainers; [ leenaars ehmry ]; + license = lib.licenses.bsd3; + platforms = lib.platforms.all; }; in rec { @@ -16,7 +16,7 @@ in rec { outputs = [ "out" "dev" "lib" "man" ]; src = fetchurl { - url = with lib; "https://getdnsapi.net/releases/${pname}-${concatStringsSep "-" (splitVersion version)}/${pname}-${version}.tar.gz"; + url = "https://getdnsapi.net/releases/${pname}-${lib.concatStringsSep "-" (lib.splitVersion version)}/${pname}-${version}.tar.gz"; # upstream publishes hashes in hex format sha256 = "f1404ca250f02e37a118aa00cf0ec2cbe11896e060c6d369c6761baea7d55a2c"; }; @@ -34,22 +34,21 @@ in rec { postInstall = "rm -r $out/share/doc"; - meta = with lib; - metaCommon // { - description = "Modern asynchronous DNS API"; - longDescription = '' - getdns is an implementation of a modern asynchronous DNS API; the - specification was originally edited by Paul Hoffman. It is intended to make all - types of DNS information easily available to application developers and non-DNS - experts. DNSSEC offers a unique global infrastructure for establishing and - enhancing cryptographic trust relations. With the development of this API the - developers intend to offer application developers a modern and flexible - interface that enables end-to-end trust in the DNS architecture, and which will - inspire application developers to implement innovative security solutions in - their applications. - ''; - homepage = "https://getdnsapi.net"; - }; + meta = metaCommon // { + description = "Modern asynchronous DNS API"; + longDescription = '' + getdns is an implementation of a modern asynchronous DNS API; the + specification was originally edited by Paul Hoffman. It is intended to make all + types of DNS information easily available to application developers and non-DNS + experts. DNSSEC offers a unique global infrastructure for establishing and + enhancing cryptographic trust relations. With the development of this API the + developers intend to offer application developers a modern and flexible + interface that enables end-to-end trust in the DNS architecture, and which will + inspire application developers to implement innovative security solutions in + their applications. + ''; + homepage = "https://getdnsapi.net"; + }; }; stubby = stdenv.mkDerivation rec { @@ -72,22 +71,20 @@ in rec { > $stubbyExampleJson ''; - passthru.settingsExample = with builtins; - fromJSON (readFile stubby.stubbyExampleJson); - - meta = with lib; - metaCommon // { - description = "Local DNS Privacy stub resolver (using DNS-over-TLS)"; - mainProgram = "stubby"; - longDescription = '' - Stubby is an application that acts as a local DNS Privacy stub - resolver (using RFC 7858, aka DNS-over-TLS). Stubby encrypts DNS - queries sent from a client machine (desktop or laptop) to a DNS - Privacy resolver increasing end user privacy. Stubby is developed by - the getdns team. - ''; - homepage = "https://dnsprivacy.org/dns_privacy_daemon_-_stubby/"; - }; + passthru.settingsExample = builtins.fromJSON (builtins.readFile stubby.stubbyExampleJson); + + meta = metaCommon // { + description = "Local DNS Privacy stub resolver (using DNS-over-TLS)"; + mainProgram = "stubby"; + longDescription = '' + Stubby is an application that acts as a local DNS Privacy stub + resolver (using RFC 7858, aka DNS-over-TLS). Stubby encrypts DNS + queries sent from a client machine (desktop or laptop) to a DNS + Privacy resolver increasing end user privacy. Stubby is developed by + the getdns team. + ''; + homepage = "https://dnsprivacy.org/dns_privacy_daemon_-_stubby/"; + }; }; } diff --git a/pkgs/development/libraries/libint/default.nix b/pkgs/development/libraries/libint/default.nix index a6ad9498afa3c..73e400810f619 100644 --- a/pkgs/development/libraries/libint/default.nix +++ b/pkgs/development/libraries/libint/default.nix @@ -111,11 +111,11 @@ let pname = "libint"; version = "2.9.0"; - meta = with lib; { + meta = { description = "Library for the evaluation of molecular integrals of many-body operators over Gaussian functions"; homepage = "https://github.com/evaleev/libint"; - license = with licenses; [ lgpl3Only gpl3Only ]; - maintainers = with maintainers; [ markuskowa sheepforce ]; + license = with lib.licenses; [ lgpl3Only gpl3Only ]; + maintainers = with lib.maintainers; [ markuskowa sheepforce ]; platforms = [ "x86_64-linux" ]; }; @@ -155,31 +155,31 @@ let buildInputs = [ boost eigen ]; - configureFlags = with lib; [ + configureFlags = [ "--with-max-am=${builtins.toString maxAm}" - "--with-eri-max-am=${concatStringsSep "," (builtins.map builtins.toString eriAm)}" - "--with-eri3-max-am=${concatStringsSep "," (builtins.map builtins.toString eri3Am)}" - "--with-eri2-max-am=${concatStringsSep "," (builtins.map builtins.toString eri2Am)}" - "--with-eri-opt-am=${concatStringsSep "," (builtins.map builtins.toString eriOptAm)}" - "--with-eri3-opt-am=${concatStringsSep "," (builtins.map builtins.toString eri3OptAm)}" - "--with-eri2-opt-am=${concatStringsSep "," (builtins.map builtins.toString eri2OptAm)}" + "--with-eri-max-am=${lib.concatStringsSep "," (builtins.map builtins.toString eriAm)}" + "--with-eri3-max-am=${lib.concatStringsSep "," (builtins.map builtins.toString eri3Am)}" + "--with-eri2-max-am=${lib.concatStringsSep "," (builtins.map builtins.toString eri2Am)}" + "--with-eri-opt-am=${lib.concatStringsSep "," (builtins.map builtins.toString eriOptAm)}" + "--with-eri3-opt-am=${lib.concatStringsSep "," (builtins.map builtins.toString eri3OptAm)}" + "--with-eri2-opt-am=${lib.concatStringsSep "," (builtins.map builtins.toString eri2OptAm)}" "--with-cartgauss-ordering=${cartGaussOrd}" "--with-shgauss-ordering=${shGaussOrd}" "--with-shell-set=${shellSet}" ] - ++ optional enableFMA "--enable-fma" - ++ optional (eriDeriv > 0) "--enable-eri=${builtins.toString eriDeriv}" - ++ optional (eri2Deriv > 0) "--enable-eri2=${builtins.toString eri2Deriv}" - ++ optional (eri3Deriv > 0) "--enable-eri3=${builtins.toString eri3Deriv}" - ++ lists.optionals enableOneBody [ + ++ lib.optional enableFMA "--enable-fma" + ++ lib.optional (eriDeriv > 0) "--enable-eri=${builtins.toString eriDeriv}" + ++ lib.optional (eri2Deriv > 0) "--enable-eri2=${builtins.toString eri2Deriv}" + ++ lib.optional (eri3Deriv > 0) "--enable-eri3=${builtins.toString eri3Deriv}" + ++ lib.optionals enableOneBody [ "--enable-1body=${builtins.toString oneBodyDerivOrd}" "--enable-1body-property-derivs" ] - ++ optional (multipoleOrd > 0) "--with-multipole-max-order=${builtins.toString multipoleOrd}" - ++ optional enableGeneric "--enable-generic" - ++ optional enableContracted "--enable-contracted-ints" - ++ optional eri3PureSh "--enable-eri3-pure-sh" - ++ optional eri2PureSh "--enable-eri2-pure-sh" + ++ lib.optional (multipoleOrd > 0) "--with-multipole-max-order=${builtins.toString multipoleOrd}" + ++ lib.optional enableGeneric "--enable-generic" + ++ lib.optional enableContracted "--enable-contracted-ints" + ++ lib.optional eri3PureSh "--enable-eri3-pure-sh" + ++ lib.optional eri2PureSh "--enable-eri2-pure-sh" ; preConfigure = '' diff --git a/pkgs/development/libraries/libplacebo/default.nix b/pkgs/development/libraries/libplacebo/default.nix index b9bcd3cd08e2b..0ffa7b2828f35 100644 --- a/pkgs/development/libraries/libplacebo/default.nix +++ b/pkgs/development/libraries/libplacebo/default.nix @@ -53,14 +53,14 @@ stdenv.mkDerivation rec { fast-float ]; - mesonFlags = with lib; [ - (mesonBool "demos" false) # Don't build and install the demo programs - (mesonEnable "d3d11" false) # Disable the Direct3D 11 based renderer - (mesonEnable "glslang" false) # rely on shaderc for GLSL compilation instead - (mesonEnable "vk-proc-addr" vulkanSupport) - (mesonOption "vulkan-registry" "${vulkan-headers}/share/vulkan/registry/vk.xml") - ] ++ optionals stdenv.isDarwin [ - (mesonEnable "unwind" false) # libplacebo doesn’t build with `darwin.libunwind` + mesonFlags = [ + (lib.mesonBool "demos" false) # Don't build and install the demo programs + (lib.mesonEnable "d3d11" false) # Disable the Direct3D 11 based renderer + (lib.mesonEnable "glslang" false) # rely on shaderc for GLSL compilation instead + (lib.mesonEnable "vk-proc-addr" vulkanSupport) + (lib.mesonOption "vulkan-registry" "${vulkan-headers}/share/vulkan/registry/vk.xml") + ] ++ lib.optionals stdenv.isDarwin [ + (lib.mesonEnable "unwind" false) # libplacebo doesn’t build with `darwin.libunwind` ]; postPatch = '' diff --git a/pkgs/development/libraries/libucl/default.nix b/pkgs/development/libraries/libucl/default.nix index 6275a85e6ee2e..0adb3a66465ef 100644 --- a/pkgs/development/libraries/libucl/default.nix +++ b/pkgs/development/libraries/libucl/default.nix @@ -36,17 +36,15 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config autoreconfHook ]; - buildInputs = with lib; - concatLists ( - mapAttrsToList (feat: enabled: - optionals enabled (featureDeps."${feat}" or []) + buildInputs = lib.concatLists ( + lib.mapAttrsToList (feat: enabled: + lib.optionals enabled (featureDeps."${feat}" or []) ) features ); enableParallelBuilding = true; - configureFlags = with lib; - mapAttrsToList (feat: enabled: strings.enableFeature enabled feat) features; + configureFlags = lib.mapAttrsToList (feat: enabled: lib.strings.enableFeature enabled feat) features; meta = with lib; { description = "Universal configuration library parser"; diff --git a/pkgs/development/libraries/mvapich/default.nix b/pkgs/development/libraries/mvapich/default.nix index 2182c40833765..1299d06d46877 100644 --- a/pkgs/development/libraries/mvapich/default.nix +++ b/pkgs/development/libraries/mvapich/default.nix @@ -25,17 +25,17 @@ stdenv.mkDerivation rec { nativeBuildInputs = [ pkg-config bison makeWrapper gfortran ]; propagatedBuildInputs = [ numactl rdma-core zlib opensm ]; - buildInputs = with lib; [ + buildInputs = [ numactl libxml2 perl openssh hwloc - ] ++ optionals (network == "infiniband") [ rdma-core opensm ] - ++ optionals (network == "omnipath") [ libpsm2 libfabric ] - ++ optional useSlurm slurm; + ] ++ lib.optionals (network == "infiniband") [ rdma-core opensm ] + ++ lib.optionals (network == "omnipath") [ libpsm2 libfabric ] + ++ lib.optional useSlurm slurm; - configureFlags = with lib; [ + configureFlags = [ "--with-pm=hydra" "--enable-fortran=all" "--enable-cxx" @@ -43,10 +43,10 @@ stdenv.mkDerivation rec { "--enable-hybrid" "--enable-shared" "FFLAGS=-fallow-argument-mismatch" # fix build with gfortran 10 - ] ++ optional useSlurm "--with-pm=slurm" - ++ optional (network == "ethernet") "--with-device=ch3:sock" - ++ optionals (network == "infiniband") [ "--with-device=ch3:mrail" "--with-rdma=gen2" "--disable-ibv-dlopen" ] - ++ optionals (network == "omnipath") ["--with-device=ch3:psm" "--with-psm2=${libpsm2}"]; + ] ++ lib.optional useSlurm "--with-pm=slurm" + ++ lib.optional (network == "ethernet") "--with-device=ch3:sock" + ++ lib.optionals (network == "infiniband") [ "--with-device=ch3:mrail" "--with-rdma=gen2" "--disable-ibv-dlopen" ] + ++ lib.optionals (network == "omnipath") ["--with-device=ch3:psm" "--with-psm2=${libpsm2}"]; doCheck = true; diff --git a/pkgs/development/libraries/opencv/3.x.nix b/pkgs/development/libraries/opencv/3.x.nix index adb6532bd6825..01479f31116e8 100644 --- a/pkgs/development/libraries/opencv/3.x.nix +++ b/pkgs/development/libraries/opencv/3.x.nix @@ -134,9 +134,9 @@ let }; # See opencv/cmake/OpenCVDownload.cmake - installExtraFiles = extra : with lib; '' + installExtraFiles = extra : '' mkdir -p "${extra.dst}" - '' + concatStrings (mapAttrsToList (name : md5 : '' + '' + lib.concatStrings (lib.mapAttrsToList (name : md5 : '' ln -s "${extra.src}/${name}" "${extra.dst}/${md5}-${name}" '') extra.files); @@ -197,7 +197,7 @@ stdenv.mkDerivation { ++ lib.optional enableFfmpeg ffmpeg ++ lib.optionals (enableFfmpeg && stdenv.isDarwin) [ VideoDecodeAcceleration bzip2 ] - ++ lib.optionals enableGStreamer (with gst_all_1; [ gstreamer gst-plugins-base ]) + ++ lib.optionals enableGStreamer [ gst_all_1.gstreamer gst_all_1.gst-plugins-base ] ++ lib.optional enableOvis ogre ++ lib.optional enableGPhoto2 libgphoto2 ++ lib.optional enableDC1394 libdc1394 @@ -292,13 +292,13 @@ stdenv.mkDerivation { }; }; - meta = with lib; { + meta = { description = "Open Computer Vision Library with more than 500 algorithms"; homepage = "https://opencv.org/"; # OpenCV 3 won't build with CUDA 12+ broken = enableCuda && cudaPackages.cudaAtLeast "12"; - license = with licenses; if enableUnfree then unfree else bsd3; - maintainers = with maintainers; [mdaiter basvandijk]; - platforms = with platforms; linux ++ darwin; + license = if enableUnfree then lib.licenses.unfree else lib.licenses.bsd3; + maintainers = with lib.maintainers; [mdaiter basvandijk]; + platforms = with lib.platforms; linux ++ darwin; }; } diff --git a/pkgs/development/libraries/opencv/4.x.nix b/pkgs/development/libraries/opencv/4.x.nix index e2509ca5199a1..eb10bd6c46736 100644 --- a/pkgs/development/libraries/opencv/4.x.nix +++ b/pkgs/development/libraries/opencv/4.x.nix @@ -228,9 +228,9 @@ let }; # See opencv/cmake/OpenCVDownload.cmake - installExtraFiles = extra: with lib; '' + installExtraFiles = extra: '' mkdir -p "${extra.dst}" - '' + concatStrings (flip mapAttrsToList extra.files (name: md5: '' + '' + lib.concatStrings (lib.flip lib.mapAttrsToList extra.files (name: md5: '' ln -s "${extra.src}/${name}" "${extra.dst}/${md5}-${name}" '')); installExtraFile = extra: '' @@ -332,15 +332,15 @@ effectiveStdenv.mkDerivation { ] ++ lib.optionals (enableFfmpeg && effectiveStdenv.isDarwin) [ bzip2 VideoDecodeAcceleration - ] ++ lib.optionals (enableGStreamer && effectiveStdenv.isLinux) (with gst_all_1; [ + ] ++ lib.optionals (enableGStreamer && effectiveStdenv.isLinux) [ elfutils - gst-plugins-base - gst-plugins-good - gstreamer + gst_all_1.gst-plugins-base + gst_all_1.gst-plugins-good + gst_all_1.gstreamer libunwind orc zstd - ]) ++ lib.optionals enableOvis [ + ] ++ lib.optionals enableOvis [ ogre ] ++ lib.optionals enableGPhoto2 [ libgphoto2 @@ -371,21 +371,21 @@ effectiveStdenv.mkDerivation { ] ++ lib.optionals enableDocs [ doxygen graphviz-nox - ] ++ lib.optionals enableCuda (with cudaPackages; [ - cuda_cudart - cuda_cccl # - libnpp # npp.h - nvidia-optical-flow-sdk + ] ++ lib.optionals enableCuda [ + cudaPackages.cuda_cudart + cudaPackages.cuda_cccl # + cudaPackages.libnpp # npp.h + cudaPackages.nvidia-optical-flow-sdk ] ++ lib.optionals enableCublas [ # May start using the default $out instead once # https://github.com/NixOS/nixpkgs/issues/271792 # has been addressed - libcublas # cublas_v2.h + cudaPackages.libcublas # cublas_v2.h ] ++ lib.optionals enableCudnn [ - cudnn # cudnn.h + cudaPackages.cudnn # cudnn.h ] ++ lib.optionals enableCufft [ - libcufft # cufft.h - ]); + cudaPackages.libcufft # cufft.h + ]; propagatedBuildInputs = lib.optionals enablePython [ pythonPackages.numpy ]; @@ -549,11 +549,11 @@ effectiveStdenv.mkDerivation { }; } // lib.optionalAttrs enablePython { pythonPath = [ ]; }; - meta = with lib; { + meta = { description = "Open Computer Vision Library with more than 500 algorithms"; homepage = "https://opencv.org/"; - license = with licenses; if enableUnfree then unfree else bsd3; - maintainers = with maintainers; [ basvandijk ]; - platforms = with platforms; linux ++ darwin; + license = if enableUnfree then lib.licenses.unfree else lib.licenses.bsd3; + maintainers = with lib.maintainers; [ basvandijk ]; + platforms = with lib.platforms; linux ++ darwin; }; } diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix index 94934c489e527..5ddb26798af51 100644 --- a/pkgs/development/libraries/openssl/default.nix +++ b/pkgs/development/libraries/openssl/default.nix @@ -227,19 +227,19 @@ let passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; - meta = with lib; { + meta = { homepage = "https://www.openssl.org/"; changelog = "https://github.com/openssl/openssl/blob/openssl-${version}/CHANGES.md"; description = "Cryptographic library that implements the SSL and TLS protocols"; - license = licenses.openssl; + license = lib.licenses.openssl; mainProgram = "openssl"; - maintainers = with maintainers; [ thillux ] ++ lib.teams.stridtech.members; + maintainers = with lib.maintainers; [ thillux ] ++ lib.teams.stridtech.members; pkgConfigModules = [ "libcrypto" "libssl" "openssl" ]; - platforms = platforms.all; + platforms = lib.platforms.all; } // extraMeta; }); @@ -295,8 +295,8 @@ in { withDocs = true; - extraMeta = with lib; { - license = licenses.asl20; + extraMeta = { + license = lib.licenses.asl20; }; }; @@ -320,8 +320,8 @@ in { withDocs = true; - extraMeta = with lib; { - license = licenses.asl20; + extraMeta = { + license = lib.licenses.asl20; }; }; @@ -345,8 +345,8 @@ in { withDocs = true; - extraMeta = with lib; { - license = licenses.asl20; + extraMeta = { + license = lib.licenses.asl20; }; }; } diff --git a/pkgs/development/libraries/science/math/tensorrt/extension.nix b/pkgs/development/libraries/science/math/tensorrt/extension.nix index ffd9b672684cb..7db869a2c1698 100644 --- a/pkgs/development/libraries/science/math/tensorrt/extension.nix +++ b/pkgs/development/libraries/science/math/tensorrt/extension.nix @@ -12,11 +12,11 @@ final: prev: let majorMinorPatch = str: lib.concatStringsSep "." (lib.take 3 (lib.splitVersion str)); - tensorRTPackages = with lib; let + tensorRTPackages = let # Check whether a file is supported for our cuda version - isSupported = fileData: elem cudaVersion fileData.supportedCudaVersions; + isSupported = fileData: lib.elem cudaVersion fileData.supportedCudaVersions; # Return the first file that is supported. In practice there should only ever be one anyway. - supportedFile = files: findFirst isSupported null files; + supportedFile = files: lib.findFirst isSupported null files; # Compute versioned attribute name to be used in this package set computeName = version: "tensorrt_${toUnderscore version}"; @@ -34,11 +34,11 @@ final: prev: let supportedCudaVersions = [ ]; }; } - (mapAttrs' (version: attrs: nameValuePair (computeName version) attrs) - (filterAttrs (version: file: file != null) (mapAttrs (version: files: supportedFile files) tensorRTVersions))); + (lib.mapAttrs' (version: attrs: lib.nameValuePair (computeName version) attrs) + (lib.filterAttrs (version: file: file != null) (lib.mapAttrs (version: files: supportedFile files) tensorRTVersions))); # Add all supported builds as attributes - allBuilds = mapAttrs (name: file: buildTensorRTPackage (removeAttrs file ["fileVersionCuda"])) supportedVersions; + allBuilds = lib.mapAttrs (name: file: buildTensorRTPackage (lib.removeAttrs file ["fileVersionCuda"])) supportedVersions; # Set the default attributes, e.g. tensorrt = tensorrt_8_4; defaultName = computeName tensorRTDefaultVersion; diff --git a/pkgs/development/libraries/zeroc-ice/default.nix b/pkgs/development/libraries/zeroc-ice/default.nix index b41ec7f511745..9c8db3159396f 100644 --- a/pkgs/development/libraries/zeroc-ice/default.nix +++ b/pkgs/development/libraries/zeroc-ice/default.nix @@ -50,19 +50,19 @@ in stdenv.mkDerivation rec { doCheck = true; nativeCheckInputs = with python3.pkgs; [ passlib ]; - checkPhase = with lib; let + checkPhase = let # these tests require network access so we need to skip them. - brokenTests = map escapeRegex [ + brokenTests = map lib.escapeRegex [ "Ice/udp" "Glacier2" "IceGrid/simple" "IceStorm" "IceDiscovery/simple" # FIXME: certificate expired, remove for next release? "IceSSL/configuration" ]; # matches CONFIGS flag in makeFlagsArray - configFlag = optionalString cpp11 "--config=cpp11-shared"; + configFlag = lib.optionalString cpp11 "--config=cpp11-shared"; in '' runHook preCheck - ${python3.interpreter} ./cpp/allTests.py ${configFlag} --rfilter='${concatStringsSep "|" brokenTests}' + ${python3.interpreter} ./cpp/allTests.py ${configFlag} --rfilter='${lib.concatStringsSep "|" brokenTests}' runHook postCheck ''; diff --git a/pkgs/development/lua-modules/lib.nix b/pkgs/development/lua-modules/lib.nix index a527b2e1189fb..df5dbc5d30243 100644 --- a/pkgs/development/lua-modules/lib.nix +++ b/pkgs/development/lua-modules/lib.nix @@ -1,9 +1,9 @@ { pkgs, lib, lua }: let inherit (lib.generators) toLua; - requiredLuaModules = drvs: with lib; let - modules = filter hasLuaModule drvs; - in unique ([lua] ++ modules ++ concatLists (catAttrs "requiredLuaModules" modules)); + requiredLuaModules = drvs: let + modules = lib.filter hasLuaModule drvs; + in lib.unique ([lua] ++ modules ++ lib.concatLists (lib.catAttrs "requiredLuaModules" modules)); # Check whether a derivation provides a lua module. hasLuaModule = drv: drv ? luaModule; diff --git a/pkgs/development/lua-modules/overrides.nix b/pkgs/development/lua-modules/overrides.nix index fa83ee0e57ff9..819144c0ec59d 100644 --- a/pkgs/development/lua-modules/overrides.nix +++ b/pkgs/development/lua-modules/overrides.nix @@ -108,11 +108,11 @@ in cqueues = prev.cqueues.overrideAttrs (oa: rec { # Parse out a version number without the Lua version inserted - version = with lib; let + version = let version' = prev.cqueues.version; - rel = splitVersion version'; - date = head rel; - rev = last (splitString "-" (last rel)); + rel = lib.splitVersion version'; + date = lib.head rel; + rev = lib.last (lib.splitString "-" (lib.last rel)); in "${date}-${rev}"; @@ -203,7 +203,7 @@ in ''; meta.broken = luaOlder "5.1" || luaAtLeast "5.3"; - propagatedBuildInputs = with lib; oa.propagatedBuildInputs ++ optional (!isLuaJIT) final.luaffi; + propagatedBuildInputs = oa.propagatedBuildInputs ++ lib.optional (!isLuaJIT) final.luaffi; }); lgi = prev.lgi.overrideAttrs (oa: { diff --git a/pkgs/development/node-packages/aliases.nix b/pkgs/development/node-packages/aliases.nix index 4439a86849012..2f3cbaddec614 100644 --- a/pkgs/development/node-packages/aliases.nix +++ b/pkgs/development/node-packages/aliases.nix @@ -9,16 +9,16 @@ pkgs: lib: self: super: let # Removing recurseForDerivation prevents derivations of aliased attribute # set to appear while listing all the packages available. - removeRecurseForDerivations = alias: with lib; + removeRecurseForDerivations = alias: if alias.recurseForDerivations or false - then removeAttrs alias ["recurseForDerivations"] + then lib.removeAttrs alias ["recurseForDerivations"] else alias; # Disabling distribution prevents top-level aliases for non-recursed package # sets from building on Hydra. - removeDistribute = alias: with lib; - if isDerivation alias then - dontDistribute alias + removeDistribute = alias: + if lib.isDerivation alias then + lib.dontDistribute alias else alias; # Make sure that we are not shadowing something from node-packages.nix. diff --git a/pkgs/development/php-packages/gnupg/default.nix b/pkgs/development/php-packages/gnupg/default.nix index 6b5e7e326ec57..0efe234668407 100644 --- a/pkgs/development/php-packages/gnupg/default.nix +++ b/pkgs/development/php-packages/gnupg/default.nix @@ -32,25 +32,25 @@ buildPecl { --replace 'SEARCH_PATH="/usr/local /usr /opt"' 'SEARCH_PATH="${gpgme.dev}"' ''; - postConfigure = with lib; '' + postConfigure = '' substituteInPlace Makefile \ --replace 'run-tests.php' 'run-tests.php -q --offline' substituteInPlace tests/gnupg_res_init_file_name.phpt \ --replace '/usr/bin/gpg' '${gnupg}/bin/gpg' \ - --replace 'string(12)' 'string(${toString (stringLength "${gnupg}/bin/gpg")})' + --replace 'string(12)' 'string(${toString (lib.stringLength "${gnupg}/bin/gpg")})' substituteInPlace tests/gnupg_oo_init_file_name.phpt \ --replace '/usr/bin/gpg' '${gnupg}/bin/gpg' \ - --replace 'string(12)' 'string(${toString (stringLength "${gnupg}/bin/gpg")})' + --replace 'string(12)' 'string(${toString (lib.stringLength "${gnupg}/bin/gpg")})' ''; doCheck = true; - meta = with lib; { + meta = { changelog = "https://github.com/php-gnupg/php-gnupg/releases/tag/gnupg-${version}"; broken = lib.versionOlder php.version "8.1"; # Broken on PHP older than 8.1. description = "PHP wrapper for GpgME library that provides access to GnuPG"; - license = licenses.bsd3; + license = lib.licenses.bsd3; homepage = "https://pecl.php.net/package/gnupg"; - maintainers = with maintainers; [ taikx4 ] ++ teams.php.members; + maintainers = with lib.maintainers; [ taikx4 ] ++ lib.teams.php.members; }; } diff --git a/pkgs/development/python-modules/python-lsp-black/default.nix b/pkgs/development/python-modules/python-lsp-black/default.nix index 6c3dcfbb6994f..2a963148439a3 100644 --- a/pkgs/development/python-modules/python-lsp-black/default.nix +++ b/pkgs/development/python-modules/python-lsp-black/default.nix @@ -36,11 +36,11 @@ buildPythonPackage rec { includes a series of patches fixing tests not yet released as 2.0.1+ version they are meant to keep up to date with black releases */ - lib.optional (with lib; versionAtLeast black.version "24.2.0") (fetchpatch { + lib.optional (lib.versionAtLeast black.version "24.2.0") (fetchpatch { url = "https://github.com/python-lsp/python-lsp-black/commit/d43b41431379f9c9bb05fab158c4d97e6d515f8f.patch"; hash = "sha256-38bYU27+xtA8Kq3appXTkNnkG5/XgrUJ2nQ5+yuSU2U="; }) - ++ lib.optional (with lib; versionAtLeast black.version "24.3.0") (fetchpatch { + ++ lib.optional (lib.versionAtLeast black.version "24.3.0") (fetchpatch { url = "https://github.com/python-lsp/python-lsp-black/commit/9298585a9d14d25920c33b188d79e820dc98d4a9.patch"; hash = "sha256-4u0VIS7eidVEiKRW2wc8lJVkJwhzJD/M+uuqmTtiZ7E="; }); diff --git a/pkgs/development/python-modules/spacy/models.nix b/pkgs/development/python-modules/spacy/models.nix index bb795682a1873..a8e99669b4489 100644 --- a/pkgs/development/python-modules/spacy/models.nix +++ b/pkgs/development/python-modules/spacy/models.nix @@ -88,14 +88,14 @@ let popd || exit ''; - meta = with lib; { + meta = { description = "Models for the spaCy NLP library"; homepage = "https://github.com/explosion/spacy-models"; - license = licenses.${license}; + license = lib.licenses.${license}; }; }; makeModelSet = - models: with lib; listToAttrs (map (m: nameValuePair m.pname (buildModelPackage m)) models); + models: lib.listToAttrs (map (m: lib.nameValuePair m.pname (buildModelPackage m)) models); in makeModelSet (lib.importJSON ./models.json) diff --git a/pkgs/development/python-modules/tensorflow/default.nix b/pkgs/development/python-modules/tensorflow/default.nix index b1a2dd0f90979..31639d48f9349 100644 --- a/pkgs/development/python-modules/tensorflow/default.nix +++ b/pkgs/development/python-modules/tensorflow/default.nix @@ -589,15 +589,14 @@ let }; meta = - with lib; { badPlatforms = lib.optionals cudaSupport lib.platforms.darwin; changelog = "https://github.com/tensorflow/tensorflow/releases/tag/v${version}"; description = "Computation using data flow graphs for scalable machine learning"; homepage = "http://tensorflow.org"; - license = licenses.asl20; - maintainers = with maintainers; [ abbradar ]; - platforms = with platforms; linux ++ darwin; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ abbradar ]; + platforms = with lib.platforms; linux ++ darwin; broken = stdenv.isDarwin || !(xlaSupport -> cudaSupport) diff --git a/pkgs/development/python-modules/tinyobjloader-py/default.nix b/pkgs/development/python-modules/tinyobjloader-py/default.nix index 1d0b621c482dd..ea3d31342c259 100644 --- a/pkgs/development/python-modules/tinyobjloader-py/default.nix +++ b/pkgs/development/python-modules/tinyobjloader-py/default.nix @@ -21,10 +21,7 @@ buildPythonPackage rec { doCheck = false; pythonImportsCheck = [ "tinyobjloader" ]; - meta = - with lib; - tinyobjloader.meta - // { - description = "Python wrapper for the C++ wavefront .obj loader tinyobjloader"; - }; + meta = tinyobjloader.meta // { + description = "Python wrapper for the C++ wavefront .obj loader tinyobjloader"; + }; } diff --git a/pkgs/development/python-modules/vega-datasets/default.nix b/pkgs/development/python-modules/vega-datasets/default.nix index 09da2c1f0792f..b7de5f6c1b655 100644 --- a/pkgs/development/python-modules/vega-datasets/default.nix +++ b/pkgs/development/python-modules/vega-datasets/default.nix @@ -29,14 +29,13 @@ buildPythonPackage rec { pythonImportsCheck = [ "vega_datasets" ]; meta = - with lib; let - tag = removeSuffix ".0" "v${version}"; + tag = lib.removeSuffix ".0" "v${version}"; in { description = "Python package for offline access to vega datasets"; homepage = "https://github.com/altair-viz/vega_datasets"; changelog = "https://github.com/altair-viz/vega_datasets/blob/${tag}/CHANGES.md"; - license = licenses.mit; + license = lib.licenses.mit; }; } diff --git a/pkgs/development/tools/azure-static-sites-client/default.nix b/pkgs/development/tools/azure-static-sites-client/default.nix index 452976b7282a6..126eaf1ec68ec 100644 --- a/pkgs/development/tools/azure-static-sites-client/default.nix +++ b/pkgs/development/tools/azure-static-sites-client/default.nix @@ -14,7 +14,7 @@ }: let versions = lib.importJSON ./versions.json; - flavor = with lib; head (filter (x: x.version == versionFlavor) versions); + flavor = lib.head (lib.filter (x: x.version == versionFlavor) versions); fetchBinary = runtimeId: fetchurl { url = flavor.files.${runtimeId}.url; sha256 = flavor.files.${runtimeId}.sha; @@ -53,7 +53,7 @@ stdenv.mkDerivation { install -m755 "$src" -D "$out/bin/StaticSitesClient" for icu_lib in 'icui18n' 'icuuc' 'icudata'; do - patchelf --add-needed "lib''${icu_lib}.so.${with lib; head (splitVersion (getVersion icu70.name))}" "$out/bin/StaticSitesClient" + patchelf --add-needed "lib''${icu_lib}.so.${lib.head (lib.splitVersion (lib.getVersion icu70.name))}" "$out/bin/StaticSitesClient" done patchelf --add-needed 'libgssapi_krb5.so' \ @@ -79,19 +79,19 @@ stdenv.mkDerivation { passthru = { # Create tests for all flavors - tests = with lib; genAttrs (map (x: x.version) versions) (versionFlavor: + tests = lib.genAttrs (map (x: x.version) versions) (versionFlavor: azure-static-sites-client.override { inherit versionFlavor; } ); updateScript = ./update.sh; }; - meta = with lib; { + meta = { description = "Azure static sites client"; homepage = "https://github.com/Azure/static-web-apps-cli"; sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; - license = licenses.unfree; + license = lib.licenses.unfree; mainProgram = "StaticSitesClient"; - maintainers = with maintainers; [ veehaitch ]; + maintainers = with lib.maintainers; [ veehaitch ]; platforms = [ "x86_64-linux" ]; }; } diff --git a/pkgs/development/tools/misc/gdb/default.nix b/pkgs/development/tools/misc/gdb/default.nix index 7f97eebce157a..da8167b3b16ec 100644 --- a/pkgs/development/tools/misc/gdb/default.nix +++ b/pkgs/development/tools/misc/gdb/default.nix @@ -88,7 +88,7 @@ stdenv.mkDerivation rec { ''; configureScript = "../configure"; - configureFlags = with lib; [ + configureFlags = [ # Set the program prefix to the current targetPrefix. # This ensures that the prefix always conforms to # nixpkgs' expectations instead of relying on the build @@ -139,7 +139,7 @@ stdenv.mkDerivation rec { ''; }; - meta = with lib; { + meta = { mainProgram = "gdb"; description = "GNU Project debugger"; @@ -155,7 +155,7 @@ stdenv.mkDerivation rec { license = lib.licenses.gpl3Plus; # GDB upstream does not support ARM darwin - platforms = with platforms; linux ++ cygwin ++ freebsd ++ ["x86_64-darwin"]; - maintainers = with maintainers; [ pierron globin lsix ]; + platforms = with lib.platforms; linux ++ cygwin ++ freebsd ++ ["x86_64-darwin"]; + maintainers = with lib.maintainers; [ pierron globin lsix ]; }; } diff --git a/pkgs/development/tools/misc/lsof/default.nix b/pkgs/development/tools/misc/lsof/default.nix index b43030594d3d1..de1decee524fb 100644 --- a/pkgs/development/tools/misc/lsof/default.nix +++ b/pkgs/development/tools/misc/lsof/default.nix @@ -1,7 +1,7 @@ { lib, stdenv, fetchFromGitHub, buildPackages, perl, which, ncurses, nukeReferences }: let - dialect = with lib; last (splitString "-" stdenv.hostPlatform.system); + dialect = lib.last (lib.splitString "-" stdenv.hostPlatform.system); in stdenv.mkDerivation rec { @@ -53,7 +53,7 @@ stdenv.mkDerivation rec { cp lsof $out/bin ''; - meta = with lib; { + meta = { homepage = "https://github.com/lsof-org/lsof"; description = "Tool to list open files"; mainProgram = "lsof"; @@ -62,8 +62,8 @@ stdenv.mkDerivation rec { socket (IPv6/IPv4/UNIX local), or partition (by opening a file from it). ''; - license = licenses.purdueBsd; - maintainers = with maintainers; [ dezgeg ]; - platforms = platforms.unix; + license = lib.licenses.purdueBsd; + maintainers = with lib.maintainers; [ dezgeg ]; + platforms = lib.platforms.unix; }; } diff --git a/pkgs/games/ezquake/default.nix b/pkgs/games/ezquake/default.nix index 4cc6bd2258b57..579783af2ef8e 100644 --- a/pkgs/games/ezquake/default.nix +++ b/pkgs/games/ezquake/default.nix @@ -20,9 +20,9 @@ stdenv.mkDerivation rec { expat curl jansson libpng libjpeg libGLU libGL libsndfile libXxf86vm pcre SDL2 vim speex ]; - installPhase = with lib; let - sys = last (splitString "-" stdenv.hostPlatform.system); - arch = head (splitString "-" stdenv.hostPlatform.system); + installPhase = let + sys = lib.last (lib.splitString "-" stdenv.hostPlatform.system); + arch = lib.head (lib.splitString "-" stdenv.hostPlatform.system); in '' mkdir -p $out/bin find . @@ -31,12 +31,12 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - meta = with lib; { + meta = { homepage = "https://ezquake.com/"; description = "Modern QuakeWorld client focused on competitive online play"; mainProgram = "ezquake"; - license = licenses.gpl2Plus; - platforms = platforms.linux; - maintainers = with maintainers; [ edwtjo ]; + license = lib.licenses.gpl2Plus; + platforms = lib.platforms.linux; + maintainers = with lib.maintainers; [ edwtjo ]; }; } diff --git a/pkgs/games/mindustry/default.nix b/pkgs/games/mindustry/default.nix index 7e739b2a8c0f6..789b2bca65a52 100644 --- a/pkgs/games/mindustry/default.nix +++ b/pkgs/games/mindustry/default.nix @@ -162,9 +162,9 @@ stdenv.mkDerivation { gradleFlags = [ "-Pbuildversion=${buildVersion}" "-Dorg.gradle.java.home=${jdk}" ]; - buildPhase = with lib; optionalString enableServer '' + buildPhase = lib.optionalString enableServer '' gradle server:dist - '' + optionalString enableClient '' + '' + lib.optionalString enableClient '' pushd ../Arc gradle jnigenBuild gradle jnigenJarNativesDesktop @@ -181,7 +181,7 @@ stdenv.mkDerivation { gradle desktop:dist ''; - installPhase = with lib; let + installPhase = let installClient = '' install -Dm644 desktop/build/libs/Mindustry.jar $out/share/mindustry.jar mkdir -p $out/bin @@ -189,7 +189,7 @@ stdenv.mkDerivation { --add-flags "-jar $out/share/mindustry.jar" \ ${lib.optionalString stdenv.isLinux "--suffix PATH : ${lib.makeBinPath [zenity]}"} \ --suffix LD_LIBRARY_PATH : ${lib.makeLibraryPath [libpulseaudio alsa-lib libjack2]} \ - --set ALSA_PLUGIN_DIR ${alsa-plugins}/lib/alsa-lib/'' + optionalString enableWayland '' \ + --set ALSA_PLUGIN_DIR ${alsa-plugins}/lib/alsa-lib/'' + lib.optionalString enableWayland '' \ --set SDL_VIDEODRIVER wayland \ --set SDL_VIDEO_WAYLAND_WMCLASS Mindustry '' + '' @@ -214,8 +214,8 @@ stdenv.mkDerivation { ''; in '' runHook preInstall - '' + optionalString enableClient installClient - + optionalString enableServer installServer + '' + lib.optionalString enableClient installClient + + lib.optionalString enableServer installServer + '' runHook postInstall ''; @@ -228,17 +228,17 @@ stdenv.mkDerivation { passthru.tests.nixosTest = nixosTests.mindustry; - meta = with lib; { + meta = { homepage = "https://mindustrygame.github.io/"; downloadPage = "https://github.com/Anuken/Mindustry/releases"; description = "Sandbox tower defense game"; - sourceProvenance = with sourceTypes; [ + sourceProvenance = with lib.sourceTypes; [ fromSource binaryBytecode # deps ]; - license = licenses.gpl3Plus; - maintainers = with maintainers; [ chkno fgaz thekostins ]; - platforms = platforms.all; + license = lib.licenses.gpl3Plus; + maintainers = with lib.maintainers; [ chkno fgaz thekostins ]; + platforms = lib.platforms.all; # TODO alsa-lib is linux-only, figure out what dependencies are required on Darwin broken = enableClient && stdenv.isDarwin; }; diff --git a/pkgs/games/simutrans/default.nix b/pkgs/games/simutrans/default.nix index 0a4ec4f326eb2..6a48c5a2caeb4 100644 --- a/pkgs/games/simutrans/default.nix +++ b/pkgs/games/simutrans/default.nix @@ -6,9 +6,9 @@ let # Choose your "paksets" of objects, images, text, music, etc. paksets = config.simutrans.paksets or "pak64 pak64.japan pak128 pak128.britain pak128.german"; - result = with lib; withPaks ( - if paksets == "*" then attrValues pakSpec # taking all - else map (name: pakSpec.${name}) (splitString " " paksets) + result = withPaks ( + if paksets == "*" then lib.attrValues pakSpec # taking all + else map (name: pakSpec.${name}) (lib.splitString " " paksets) ); ver1 = "121"; @@ -152,7 +152,7 @@ let mv build/default/sim $out/bin/simutrans ''; - meta = with lib; { + meta = { description = "Simulation game in which the player strives to run a successful transport system"; mainProgram = "simutrans"; longDescription = '' @@ -163,9 +163,9 @@ let ''; homepage = "http://www.simutrans.com/"; - license = with licenses; [ artistic1 gpl1Plus ]; + license = with lib.licenses; [ artistic1 gpl1Plus ]; maintainers = [ ]; - platforms = with platforms; linux; # TODO: ++ darwin; + platforms = lib.platforms.linux; # TODO: ++ darwin; }; }; diff --git a/pkgs/games/ultrastardx/default.nix b/pkgs/games/ultrastardx/default.nix index 7708652d22b31..ed206fd582d3b 100644 --- a/pkgs/games/ultrastardx/default.nix +++ b/pkgs/games/ultrastardx/default.nix @@ -67,8 +67,8 @@ in stdenv.mkDerivation rec { -i src/lib/ffmpeg-4.0/swscale.pas ''; - preBuild = with lib; - let items = concatMapStringsSep " " (x: "-rpath ${getLib x}/lib") sharedLibs; + preBuild = + let items = lib.concatMapStringsSep " " (x: "-rpath ${lib.getLib x}/lib") sharedLibs; in '' export NIX_LDFLAGS="$NIX_LDFLAGS ${items}" ''; diff --git a/pkgs/misc/cups/drivers/brgenml1lpr/default.nix b/pkgs/misc/cups/drivers/brgenml1lpr/default.nix index 1e838db932634..d683e80b28937 100644 --- a/pkgs/misc/cups/drivers/brgenml1lpr/default.nix +++ b/pkgs/misc/cups/drivers/brgenml1lpr/default.nix @@ -28,9 +28,9 @@ */ let - myPatchElf = file: with lib; '' + myPatchElf = file: '' patchelf --set-interpreter \ - ${stdenv.cc.libc}/lib/ld-linux${optionalString stdenv.is64bit "-x86-64"}.so.2 \ + ${stdenv.cc.libc}/lib/ld-linux${lib.optionalString stdenv.is64bit "-x86-64"}.so.2 \ ${file} ''; in diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix b/pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix index aae852c487983..4c2fe571999f1 100644 --- a/pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix +++ b/pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix @@ -73,17 +73,14 @@ lib.makeOverridable ( strictDeps = true; - meta = - with lib; - { - maintainers = with maintainers; [ - rhelmot - artemist - ]; - platforms = platforms.unix; - license = licenses.bsd2; - } - // attrs.meta or { }; + meta = { + maintainers = with lib.maintainers; [ + rhelmot + artemist + ]; + platforms = lib.platforms.unix; + license = lib.licenses.bsd2; + } // attrs.meta or { }; } // lib.optionalAttrs stdenv'.hasCC { # TODO should CC wrapper set this? diff --git a/pkgs/os-specific/linux/cryptsetup/default.nix b/pkgs/os-specific/linux/cryptsetup/default.nix index 39f03c475fdaa..044daf8484677 100644 --- a/pkgs/os-specific/linux/cryptsetup/default.nix +++ b/pkgs/os-specific/linux/cryptsetup/default.nix @@ -53,7 +53,7 @@ stdenv.mkDerivation rec { # support, because the path still gets included in the binary even # though it isn't used. "--with-luks2-external-tokens-path=/" - ] ++ (with lib; mapAttrsToList (flip enableFeature)) programs; + ] ++ (lib.mapAttrsToList (lib.flip lib.enableFeature)) programs; nativeBuildInputs = [ pkg-config ] ++ lib.optionals rebuildMan [ asciidoctor ]; buildInputs = [ lvm2 json_c openssl libuuid popt ] ++ lib.optional (!withInternalArgon2) libargon2; diff --git a/pkgs/os-specific/linux/device-tree/default.nix b/pkgs/os-specific/linux/device-tree/default.nix index a15a9e32137cd..87c9b84e12404 100644 --- a/pkgs/os-specific/linux/device-tree/default.nix +++ b/pkgs/os-specific/linux/device-tree/default.nix @@ -1,6 +1,6 @@ { lib, stdenv, stdenvNoCC, dtc }: -with lib; { +{ # Compile single Device Tree overlay source # file (.dts) into its compiled variant (.dtb) compileDTS = ({ @@ -28,7 +28,7 @@ with lib; { name = "device-tree-overlays"; nativeBuildInputs = [ dtc ]; buildCommand = let - overlays = toList overlays'; + overlays = lib.toList overlays'; in '' mkdir -p $out cd "${base}" @@ -40,7 +40,7 @@ with lib; { # skip files without `compatible` string test -z "$dtbCompat" && continue - ${flip (concatMapStringsSep "\n") overlays (o: '' + ${lib.flip (lib.concatMapStringsSep "\n") overlays (o: '' overlayCompat="$(fdtget -t s "${o.dtboFile}" / compatible)" # skip incompatible and non-matching overlays diff --git a/pkgs/os-specific/linux/nvidia-x11/fabricmanager.nix b/pkgs/os-specific/linux/nvidia-x11/fabricmanager.nix index e70857ea356ed..818d847f21961 100644 --- a/pkgs/os-specific/linux/nvidia-x11/fabricmanager.nix +++ b/pkgs/os-specific/linux/nvidia-x11/fabricmanager.nix @@ -3,7 +3,7 @@ nvidia_x11: sha256: { stdenv, lib, fetchurl, patchelf }: let - sys = with lib; concatStringsSep "-" (reverseList (splitString "-" stdenv.system)); + sys = lib.concatStringsSep "-" (lib.reverseList (lib.splitString "-" stdenv.system)); bsys = builtins.replaceStrings ["_"] ["-"] sys; fmver = nvidia_x11.version; in @@ -35,12 +35,12 @@ stdenv.mkDerivation rec { done ''; - meta = with lib; { + meta = { homepage = "https://www.nvidia.com/object/unix.html"; description = "Fabricmanager daemon for NVLink intialization and control"; - license = licenses.unfreeRedistributable; + license = lib.licenses.unfreeRedistributable; platforms = nvidia_x11.meta.platforms; mainProgram = "nv-fabricmanager"; - maintainers = with maintainers; [ edwtjo ]; + maintainers = with lib.maintainers; [ edwtjo ]; }; } diff --git a/pkgs/pkgs-lib/formats.nix b/pkgs/pkgs-lib/formats.nix index 8fc808b2646f4..c99144d935190 100644 --- a/pkgs/pkgs-lib/formats.nix +++ b/pkgs/pkgs-lib/formats.nix @@ -45,9 +45,13 @@ rec { php = (import ./formats/php/default.nix { inherit lib pkgs; }).format; + inherit (lib) mkOptionType; + inherit (lib.types) nullOr oneOf coercedTo listOf nonEmptyListOf attrsOf either; + inherit (lib.types) bool int float str path; + json = {}: { - type = with lib.types; let + type = let valueType = nullOr (oneOf [ bool int @@ -83,7 +87,7 @@ rec { json2yaml "$valuePath" "$out" '') {}; - type = with lib.types; let + type = let valueType = nullOr (oneOf [ bool int @@ -102,10 +106,10 @@ rec { # the ini formats share a lot of code inherit ( let - singleIniAtom = with lib.types; nullOr (oneOf [ bool int float str ]) // { + singleIniAtom = nullOr (oneOf [ bool int float str ]) // { description = "INI atom (null, bool, int, float or string)"; }; - iniAtom = with lib.types; { listsAsDuplicateKeys, listToValue }: + iniAtom = { listsAsDuplicateKeys, listToValue }: if listsAsDuplicateKeys then coercedTo singleIniAtom lib.singleton (listOf singleIniAtom) // { description = singleIniAtom.description + " or a list of them for duplicate keys"; @@ -116,7 +120,7 @@ rec { } else singleIniAtom; - iniSection = with lib.types; { listsAsDuplicateKeys, listToValue }@args: + iniSection = { listsAsDuplicateKeys, listToValue }@args: attrsOf (iniAtom args) // { description = "section of an INI file (attrs of " + (iniAtom args).description + ")"; }; @@ -183,7 +187,7 @@ rec { listsAsDuplicateKeys = listsAsDuplicateKeys; listToValue = null; }; - in with lib.types; attrsOf (attrsOf (either atom (attrsOf atom))); + in attrsOf (attrsOf (either atom (attrsOf atom))); generate = name: value: pkgs.writeText name (lib.generators.toGitINI value); }; @@ -215,7 +219,7 @@ rec { assert listsAsDuplicateKeys -> listToValue == null; { - type = with lib.types; let + type = let singleAtom = nullOr (oneOf [ bool @@ -254,7 +258,7 @@ rec { }; toml = {}: json {} // { - type = with lib.types; let + type = let valueType = oneOf [ bool int @@ -312,18 +316,18 @@ rec { [Tuple]: */ elixirConf = { elixir ? pkgs.elixir }: - with lib; let - toElixir = value: with builtins; + let + toElixir = value: if value == null then "nil" else if value == true then "true" else if value == false then "false" else - if isInt value || isFloat value then toString value else - if isString value then string value else - if isAttrs value then attrs value else - if isList value then list value else + if lib.isInt value || lib.isFloat value then toString value else + if lib.isString value then string value else + if lib.isAttrs value then attrs value else + if lib.isList value then list value else abort "formats.elixirConf: should never happen (value = ${value})"; - escapeElixir = escape [ "\\" "#" "\"" ]; + escapeElixir = lib.escape [ "\\" "#" "\"" ]; string = value: "\"${escapeElixir value}\""; attrs = set: @@ -331,11 +335,11 @@ rec { else let toKeyword = name: value: "${name}: ${toElixir value}"; - keywordList = concatStringsSep ", " (mapAttrsToList toKeyword set); + keywordList = lib.concatStringsSep ", " (lib.mapAttrsToList toKeyword set); in "[" + keywordList + "]"; - listContent = values: concatStringsSep ", " (map toElixir values); + listContent = values: lib.concatStringsSep ", " (map toElixir values); list = values: "[" + (listContent values) + "]"; @@ -349,7 +353,7 @@ rec { elixirMap = set: let toEntry = name: value: "${toElixir name} => ${toElixir value}"; - entries = concatStringsSep ", " (mapAttrsToList toEntry set); + entries = lib.concatStringsSep ", " (lib.mapAttrsToList toEntry set); in "%{${entries}}"; @@ -359,17 +363,17 @@ rec { let keyConfig = rootKey: key: value: "config ${rootKey}, ${key}, ${toElixir value}"; - keyConfigs = rootKey: values: mapAttrsToList (keyConfig rootKey) values; - rootConfigs = flatten (mapAttrsToList keyConfigs values); + keyConfigs = rootKey: values: lib.mapAttrsToList (keyConfig rootKey) values; + rootConfigs = lib.flatten (lib.mapAttrsToList keyConfigs values); in '' import Config - ${concatStringsSep "\n" rootConfigs} + ${lib.concatStringsSep "\n" rootConfigs} ''; in { - type = with lib.types; let + type = let valueType = nullOr (oneOf [ bool @@ -429,7 +433,7 @@ rec { It also reexports standard types, wrapping them so that they can also be raw Elixir. */ - types = with lib.types; let + types = let isElixirType = type: x: (x._elixirType or "") == type; rawElixir = mkOptionType { @@ -480,7 +484,7 @@ rec { # Outputs a succession of Python variable assignments # Useful for many Django-based services pythonVars = {}: { - type = with lib.types; let + type = let valueType = nullOr(oneOf [ bool float diff --git a/pkgs/servers/apache-kafka/default.nix b/pkgs/servers/apache-kafka/default.nix index 815905f76edb6..b69a9d62d81cf 100644 --- a/pkgs/servers/apache-kafka/default.nix +++ b/pkgs/servers/apache-kafka/default.nix @@ -18,17 +18,17 @@ let }; }; - build = versionInfo: with versionInfo; stdenv.mkDerivation rec { - version = "${scalaVersion}-${kafkaVersion}"; + build = versionInfo: stdenv.mkDerivation rec { + version = "${versionInfo.scalaVersion}-${versionInfo.kafkaVersion}"; pname = "apache-kafka"; src = fetchurl { - url = "mirror://apache/kafka/${kafkaVersion}/kafka_${version}.tgz"; - inherit sha256; + url = "mirror://apache/kafka/${versionInfo.kafkaVersion}/kafka_${version}.tgz"; + inherit (versionInfo) sha256; }; nativeBuildInputs = [ makeWrapper ]; - buildInputs = [ jre bash gnugrep gnused coreutils ps ]; + buildInputs = [ versionInfo.jre bash gnugrep gnused coreutils ps ]; installPhase = '' mkdir -p $out @@ -47,7 +47,7 @@ let for p in $out/bin\/*.sh; do wrapProgram $p \ - --set JAVA_HOME "${jre}" \ + --set JAVA_HOME "${versionInfo.jre}" \ --set KAFKA_LOG_DIR "/tmp/apache-kafka-logs" \ --prefix PATH : "${bash}/bin:${coreutils}/bin:${gnugrep}/bin:${gnused}/bin" done @@ -55,19 +55,19 @@ let ''; passthru = { - inherit jre; # Used by the NixOS module to select the supported jre + inherit (versionInfo) jre; # Used by the NixOS module to select the supported JRE tests.nixos = versionInfo.nixosTest; }; - meta = with lib; { + meta = { homepage = "https://kafka.apache.org"; description = "High-throughput distributed messaging system"; - license = licenses.asl20; - sourceProvenance = with sourceTypes; [ binaryBytecode ]; - maintainers = [ maintainers.ragge ]; - platforms = platforms.unix; + license = lib.licenses.asl20; + sourceProvenance = [ lib.sourceTypes.binaryBytecode ]; + maintainers = [ lib.maintainers.ragge ]; + platforms = lib.platforms.unix; }; }; -in with lib; mapAttrs' - (majorVersion: versionInfo: nameValuePair "apacheKafka_${majorVersion}" (build versionInfo)) +in lib.mapAttrs' + (majorVersion: versionInfo: lib.nameValuePair "apacheKafka_${majorVersion}" (build versionInfo)) versionMap diff --git a/pkgs/servers/computing/slurm/default.nix b/pkgs/servers/computing/slurm/default.nix index 0f7e144b0c154..2419ac8c6c718 100644 --- a/pkgs/servers/computing/slurm/default.nix +++ b/pkgs/servers/computing/slurm/default.nix @@ -64,8 +64,8 @@ stdenv.mkDerivation rec { ] ++ lib.optionals enableX11 [ xorg.xauth ] ++ lib.optionals enableGtk2 [ gtk2 ]; - configureFlags = with lib; - [ "--with-freeipmi=${freeipmi}" + configureFlags = [ + "--with-freeipmi=${freeipmi}" "--with-http-parser=${http-parser}" "--with-hwloc=${lib.getDev hwloc}" "--with-json=${lib.getDev json_c}" @@ -78,8 +78,8 @@ stdenv.mkDerivation rec { "--with-pmix=${lib.getDev pmix}" "--with-bpf=${libbpf}" "--without-rpath" # Required for configure to pick up the right dlopen path - ] ++ (optional enableGtk2 "--disable-gtktest") - ++ (optional (!enableX11) "--disable-x11"); + ] ++ (lib.optional enableGtk2 "--disable-gtktest") + ++ (lib.optional (!enableX11) "--disable-x11"); preConfigure = '' diff --git a/pkgs/servers/mail/public-inbox/default.nix b/pkgs/servers/mail/public-inbox/default.nix index 9918d075a733f..05dc98b466d42 100644 --- a/pkgs/servers/mail/public-inbox/default.nix +++ b/pkgs/servers/mail/public-inbox/default.nix @@ -78,8 +78,7 @@ let "v2mirror" ]; - testConditions = with lib; - concatMapStringsSep " " (n: "! -name ${escapeShellArg n}.t") skippedTests; + testConditions = lib.concatMapStringsSep " " (n: "! -name ${lib.escapeShellArg n}.t") skippedTests; in diff --git a/pkgs/servers/monitoring/plugins/labs_consol_de.nix b/pkgs/servers/monitoring/plugins/labs_consol_de.nix index b30fd4b275772..255fd01f71f2c 100644 --- a/pkgs/servers/monitoring/plugins/labs_consol_de.nix +++ b/pkgs/servers/monitoring/plugins/labs_consol_de.nix @@ -22,14 +22,14 @@ let nativeBuildInputs = [ autoreconfHook makeWrapper ]; - prePatch = with lib; '' + prePatch = '' rm -rf GLPlugin ln -s ${glplugin} GLPlugin substituteInPlace plugins-scripts/Makefile.am \ - --replace /bin/cat ${getBin coreutils}/bin/cat \ - --replace /bin/echo ${getBin coreutils}/bin/echo \ - --replace /bin/grep ${getBin gnugrep}/bin/grep \ - --replace /bin/sed ${getBin gnused}/bin/sed + --replace /bin/cat ${lib.getBin coreutils}/bin/cat \ + --replace /bin/echo ${lib.getBin coreutils}/bin/echo \ + --replace /bin/grep ${lib.getBin gnugrep}/bin/grep \ + --replace /bin/sed ${lib.getBin gnused}/bin/sed ''; postInstall = '' @@ -42,10 +42,10 @@ let done ''; - meta = with lib; { + meta = { homepage = "https://labs.consol.de/"; - license = licenses.gpl2Only; - maintainers = with maintainers; [ peterhoeg ]; + license = lib.licenses.gpl2Only; + maintainers = with lib.maintainers; [ peterhoeg ]; inherit description; }; }; diff --git a/pkgs/servers/search/sphinxsearch/default.nix b/pkgs/servers/search/sphinxsearch/default.nix index 33725697d7999..0b34c1f44a8f0 100644 --- a/pkgs/servers/search/sphinxsearch/default.nix +++ b/pkgs/servers/search/sphinxsearch/default.nix @@ -31,7 +31,7 @@ stdenv.mkDerivation rec { expat ]; - CXXFLAGS = with lib; concatStringsSep " " (optionals stdenv.isDarwin [ + CXXFLAGS = lib.concatStringsSep " " (lib.optionals stdenv.isDarwin [ # see upstream bug: http://sphinxsearch.com/bugs/view.php?id=2578 # workaround for "error: invalid suffix on literal "-Wno-reserved-user-defined-literal" diff --git a/pkgs/servers/trickster/trickster.nix b/pkgs/servers/trickster/trickster.nix index d11144a8359a0..2f0a3b60f217c 100644 --- a/pkgs/servers/trickster/trickster.nix +++ b/pkgs/servers/trickster/trickster.nix @@ -21,9 +21,9 @@ buildGoModule rec { subPackages = [ "cmd/trickster" ]; - ldflags = with lib; + ldflags = [ "-extldflags '-static'" "-s" "-w" ] ++ - (mapAttrsToList (n: v: "-X main.application${n}=${v}") { + (lib.mapAttrsToList (n: v: "-X main.application${n}=${v}") { BuildTime = "1970-01-01T00:00:00+0000"; GitCommitID = rev; GoVersion = "go${go.version}}"; diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index e9dd62f4168f4..b3eb0e74dc68e 100644 --- a/pkgs/servers/x11/xorg/overrides.nix +++ b/pkgs/servers/x11/xorg/overrides.nix @@ -365,13 +365,13 @@ self: super: libXres = super.libXres.overrideAttrs (attrs: { outputs = [ "out" "dev" "devdoc" ]; - buildInputs = with xorg; attrs.buildInputs ++ [ utilmacros ]; + buildInputs = attrs.buildInputs ++ [ xorg.utilmacros ]; configureFlags = attrs.configureFlags or [] ++ malloc0ReturnsNullCrossFlag; }); libXScrnSaver = super.libXScrnSaver.overrideAttrs (attrs: { - buildInputs = with xorg; attrs.buildInputs ++ [ utilmacros ]; + buildInputs = attrs.buildInputs ++ [ xorg.utilmacros ]; configureFlags = attrs.configureFlags or [] ++ malloc0ReturnsNullCrossFlag; }); @@ -401,7 +401,7 @@ self: super: }); libXpresent = super.libXpresent.overrideAttrs (attrs: { - buildInputs = with xorg; attrs.buildInputs ++ [ libXext libXfixes libXrandr ]; + buildInputs = attrs.buildInputs ++ [ xorg.libXext xorg.libXfixes xorg.libXrandr ]; propagatedBuildInputs = attrs.propagatedBuildInputs or [] ++ [ xorg.libXfixes ]; }); @@ -417,7 +417,7 @@ self: super: nativeBuildInputs = attrs.nativeBuildInputs ++ [ meson ninja ]; buildInputs = attrs.buildInputs ++ [ zlib ] - ++ lib.optionals stdenv.hostPlatform.isNetBSD (with netbsd; [ libarch libpci ]); + ++ lib.optionals stdenv.hostPlatform.isNetBSD [ netbsd.libarch netbsd.libpci ]; mesonFlags = [ (lib.mesonOption "pci-ids" "${hwdata}/share/hwdata") @@ -668,15 +668,13 @@ self: super: xkeyboardconfig_custom = { layouts ? { } }: let patchIn = name: layout: - with layout; - with lib; '' # install layout files - ${optionalString (compatFile != null) "cp '${compatFile}' 'compat/${name}'"} - ${optionalString (geometryFile != null) "cp '${geometryFile}' 'geometry/${name}'"} - ${optionalString (keycodesFile != null) "cp '${keycodesFile}' 'keycodes/${name}'"} - ${optionalString (symbolsFile != null) "cp '${symbolsFile}' 'symbols/${name}'"} - ${optionalString (typesFile != null) "cp '${typesFile}' 'types/${name}'"} + ${lib.optionalString (layout.compatFile != null) "cp '${layout.compatFile}' 'compat/${name}'"} + ${lib.optionalString (layout.geometryFile != null) "cp '${layout.geometryFile}' 'geometry/${name}'"} + ${lib.optionalString (layout.keycodesFile != null) "cp '${layout.keycodesFile}' 'keycodes/${name}'"} + ${lib.optionalString (layout.symbolsFile != null) "cp '${layout.symbolsFile}' 'symbols/${name}'"} + ${lib.optionalString (layout.typesFile != null) "cp '${layout.typesFile}' 'types/${name}'"} # add model description ${ed}/bin/ed -v rules/base.xml <${name} ${layout.description} - ${concatMapStrings (lang: "${lang}\n") layout.languages} + ${lib.concatMapStrings (lang: "${lang}\n") layout.languages} @@ -717,7 +715,7 @@ self: super: in xorg.xkeyboardconfig.overrideAttrs (old: { buildInputs = old.buildInputs ++ [ automake ]; - postPatch = with lib; concatStrings (mapAttrsToList patchIn layouts); + postPatch = lib.concatStrings (lib.mapAttrsToList patchIn layouts); }); xlsfonts = super.xlsfonts.overrideAttrs (attrs: { @@ -743,7 +741,7 @@ self: super: meta = attrs.meta // { platforms = lib.platforms.unix ++ lib.platforms.windows; }; }); - xorgserver = with xorg; super.xorgserver.overrideAttrs (attrs_passed: + xorgserver = super.xorgserver.overrideAttrs (attrs_passed: let attrs = attrs_passed // { buildInputs = attrs_passed.buildInputs ++ @@ -759,14 +757,14 @@ self: super: in attrs // (let version = lib.getVersion attrs; - commonBuildInputs = attrs.buildInputs ++ [ xtrans libxcvt ]; + commonBuildInputs = attrs.buildInputs ++ [ xorg.xtrans xorg.libxcvt ]; commonPropagatedBuildInputs = [ - dbus libGL libGLU libXext libXfont libXfont2 libepoxy libunwind - libxshmfence pixman xorgproto zlib + dbus libGL libGLU xorg.libXext xorg.libXfont xorg.libXfont2 libepoxy libunwind + xorg.libxshmfence xorg.pixman xorg.xorgproto zlib ]; # XQuartz requires two compilations: the first to get X / XQuartz, # and the second to get Xvfb, Xnest, etc. - darwinOtherX = xorgserver.overrideAttrs (oldAttrs: { + darwinOtherX = xorg.xorgserver.overrideAttrs (oldAttrs: { configureFlags = oldAttrs.configureFlags ++ [ "--disable-xquartz" "--enable-xorg" @@ -796,7 +794,7 @@ self: super: ./dont-create-logdir-during-build.patch ]; buildInputs = commonBuildInputs ++ [ libdrm mesa ]; - propagatedBuildInputs = attrs.propagatedBuildInputs or [] ++ [ libpciaccess ] ++ commonPropagatedBuildInputs ++ lib.optionals stdenv.isLinux [ + propagatedBuildInputs = attrs.propagatedBuildInputs or [] ++ [ xorg.libpciaccess ] ++ commonPropagatedBuildInputs ++ lib.optionals stdenv.isLinux [ udev ]; depsBuildBuild = [ buildPackages.stdenv.cc ]; @@ -844,7 +842,7 @@ self: super: mesa ]; propagatedBuildInputs = commonPropagatedBuildInputs ++ [ - libAppleWM xorgproto + xorg.libAppleWM xorg.xorgproto ]; patches = [ @@ -932,12 +930,12 @@ self: super: "--without-dtrace" ]; - buildInputs = old.buildInputs ++ (with xorg; [ - pixman - libXfont2 - xtrans - libxcvt - ]) ++ lib.optional stdenv.isDarwin [ Xplugin ]; + buildInputs = old.buildInputs ++ [ + xorg.pixman + xorg.libXfont2 + xorg.xtrans + xorg.libxcvt + ] ++ lib.optional stdenv.isDarwin [ Xplugin ]; }); lndir = super.lndir.overrideAttrs (attrs: { @@ -1182,8 +1180,7 @@ self: super: super.${name}.overrideAttrs (attrs: { meta = attrs.meta // { inherit license; }; }); - mapNamesToAttrs = f: names: with lib; - listToAttrs (zipListsWith nameValuePair names (map f names)); + mapNamesToAttrs = f: names: lib.listToAttrs (lib.zipListsWith lib.nameValuePair names (map f names)); in mapNamesToAttrs (setLicense lib.licenses.unfreeRedistributable) redist // diff --git a/pkgs/shells/fish/default.nix b/pkgs/shells/fish/default.nix index 921e0fc6d7fe6..73065cb380fdf 100644 --- a/pkgs/shells/fish/default.nix +++ b/pkgs/shells/fish/default.nix @@ -249,7 +249,7 @@ let make test ''; - postInstall = with lib; '' + postInstall = '' sed -r "s|command grep|command ${gnugrep}/bin/grep|" \ -i "$out/share/fish/functions/grep.fish" sed -e "s|\|cut|\|${coreutils}/bin/cut|" \ @@ -262,7 +262,7 @@ let "$out/share/fish/functions/prompt_pwd.fish" sed -i "s|nroff|${groff}/bin/nroff|" \ "$out/share/fish/functions/__fish_print_help.fish" - sed -e "s|clear;|${getBin ncurses}/bin/clear;|" \ + sed -e "s|clear;|${lib.getBin ncurses}/bin/clear;|" \ -i "$out/share/fish/functions/fish_default_key_bindings.fish" sed -i "s|/usr/local/sbin /sbin /usr/sbin||" \ $out/share/fish/completions/{sudo.fish,doas.fish} @@ -270,7 +270,7 @@ let -i $out/share/fish/functions/{__fish_print_packages.fish,__fish_print_addresses.fish,__fish_describe_command.fish,__fish_complete_man.fish,__fish_complete_convert_options.fish} \ $out/share/fish/completions/{cwebp,adb,ezjail-admin,grunt,helm,heroku,lsusb,make,p4,psql,rmmod,vim-addons}.fish - '' + optionalString usePython '' + '' + lib.optionalString usePython '' cat > $out/share/fish/functions/__fish_anypython.fish < diff --git a/pkgs/tools/system/rofi-systemd/default.nix b/pkgs/tools/system/rofi-systemd/default.nix index b8be1adea984f..9241a066e7139 100644 --- a/pkgs/tools/system/rofi-systemd/default.nix +++ b/pkgs/tools/system/rofi-systemd/default.nix @@ -21,7 +21,7 @@ stdenv.mkDerivation rec { cp -a rofi-systemd $out/bin/rofi-systemd ''; - wrapperPath = with lib; makeBinPath [ + wrapperPath = lib.makeBinPath [ coreutils gawk jq diff --git a/pkgs/tools/system/rsyslog/default.nix b/pkgs/tools/system/rsyslog/default.nix index 8479e6840a53b..a14b1d38e4284 100644 --- a/pkgs/tools/system/rsyslog/default.nix +++ b/pkgs/tools/system/rsyslog/default.nix @@ -104,91 +104,91 @@ stdenv.mkDerivation rec { ++ lib.optional withMysql libmysqlclient ++ lib.optional withSystemd systemd; - configureFlags = with lib; [ + configureFlags = [ "--sysconfdir=/etc" "--localstatedir=/var" "--with-systemdsystemunitdir=\${out}/etc/systemd/system" - (enableFeature true "largefile") - (enableFeature true "regexp") - (enableFeature withKrb5 "gssapi-krb5") - (enableFeature true "klog") - (enableFeature true "kmsg") - (enableFeature withSystemd "imjournal") - (enableFeature true "inet") - (enableFeature withJemalloc "jemalloc") - (enableFeature true "unlimited-select") - (enableFeature withCurl "clickhouse") - (enableFeature false "debug") - (enableFeature false "debug-symbols") - (enableFeature true "debugless") - (enableFeature false "valgrind") - (enableFeature false "diagtools") - (enableFeature withCurl "fmhttp") - (enableFeature true "usertools") - (enableFeature withMysql "mysql") - (enableFeature withPostgres "pgsql") - (enableFeature withDbi "libdbi") - (enableFeature withNetSnmp "snmp") - (enableFeature withUuid "uuid") - (enableFeature withCurl "elasticsearch") - (enableFeature withGnutls "gnutls") - (enableFeature withGcrypt "libgcrypt") - (enableFeature true "rsyslogrt") - (enableFeature true "rsyslogd") - (enableFeature true "mail") - (enableFeature withLognorm "mmnormalize") - (enableFeature withMaxminddb "mmdblookup") - (enableFeature true "mmjsonparse") - (enableFeature true "mmaudit") - (enableFeature true "mmanon") - (enableFeature true "mmutf8fix") - (enableFeature true "mmcount") - (enableFeature true "mmsequence") - (enableFeature true "mmfields") - (enableFeature true "mmpstrucdata") - (enableFeature withOpenssl "mmrfc5424addhmac") - (enableFeature withRelp "relp") - (enableFeature withKsi "ksi-ls12") - (enableFeature withLogging "liblogging-stdlog") - (enableFeature withLogging "rfc3195") - (enableFeature true "imfile") - (enableFeature false "imsolaris") - (enableFeature true "imptcp") - (enableFeature true "impstats") - (enableFeature true "omprog") - (enableFeature withNet "omudpspoof") - (enableFeature true "omstdout") - (enableFeature withSystemd "omjournal") - (enableFeature true "pmlastmsg") - (enableFeature true "pmcisconames") - (enableFeature true "pmciscoios") - (enableFeature true "pmaixforwardedfrom") - (enableFeature true "pmsnare") - (enableFeature true "omruleset") - (enableFeature true "omuxsock") - (enableFeature true "mmsnmptrapd") - (enableFeature withHadoop "omhdfs") - (enableFeature withRdkafka "omkafka") - (enableFeature withMongo "ommongodb") - (enableFeature withCzmq "imczmq") - (enableFeature withCzmq "omczmq") - (enableFeature withRabbitmq "omrabbitmq") - (enableFeature withHiredis "omhiredis") - (enableFeature withCurl "omhttp") - (enableFeature true "generate-man-pages") + (lib.enableFeature true "largefile") + (lib.enableFeature true "regexp") + (lib.enableFeature withKrb5 "gssapi-krb5") + (lib.enableFeature true "klog") + (lib.enableFeature true "kmsg") + (lib.enableFeature withSystemd "imjournal") + (lib.enableFeature true "inet") + (lib.enableFeature withJemalloc "jemalloc") + (lib.enableFeature true "unlimited-select") + (lib.enableFeature withCurl "clickhouse") + (lib.enableFeature false "debug") + (lib.enableFeature false "debug-symbols") + (lib.enableFeature true "debugless") + (lib.enableFeature false "valgrind") + (lib.enableFeature false "diagtools") + (lib.enableFeature withCurl "fmhttp") + (lib.enableFeature true "usertools") + (lib.enableFeature withMysql "mysql") + (lib.enableFeature withPostgres "pgsql") + (lib.enableFeature withDbi "libdbi") + (lib.enableFeature withNetSnmp "snmp") + (lib.enableFeature withUuid "uuid") + (lib.enableFeature withCurl "elasticsearch") + (lib.enableFeature withGnutls "gnutls") + (lib.enableFeature withGcrypt "libgcrypt") + (lib.enableFeature true "rsyslogrt") + (lib.enableFeature true "rsyslogd") + (lib.enableFeature true "mail") + (lib.enableFeature withLognorm "mmnormalize") + (lib.enableFeature withMaxminddb "mmdblookup") + (lib.enableFeature true "mmjsonparse") + (lib.enableFeature true "mmaudit") + (lib.enableFeature true "mmanon") + (lib.enableFeature true "mmutf8fix") + (lib.enableFeature true "mmcount") + (lib.enableFeature true "mmsequence") + (lib.enableFeature true "mmfields") + (lib.enableFeature true "mmpstrucdata") + (lib.enableFeature withOpenssl "mmrfc5424addhmac") + (lib.enableFeature withRelp "relp") + (lib.enableFeature withKsi "ksi-ls12") + (lib.enableFeature withLogging "liblogging-stdlog") + (lib.enableFeature withLogging "rfc3195") + (lib.enableFeature true "imfile") + (lib.enableFeature false "imsolaris") + (lib.enableFeature true "imptcp") + (lib.enableFeature true "impstats") + (lib.enableFeature true "omprog") + (lib.enableFeature withNet "omudpspoof") + (lib.enableFeature true "omstdout") + (lib.enableFeature withSystemd "omjournal") + (lib.enableFeature true "pmlastmsg") + (lib.enableFeature true "pmcisconames") + (lib.enableFeature true "pmciscoios") + (lib.enableFeature true "pmaixforwardedfrom") + (lib.enableFeature true "pmsnare") + (lib.enableFeature true "omruleset") + (lib.enableFeature true "omuxsock") + (lib.enableFeature true "mmsnmptrapd") + (lib.enableFeature withHadoop "omhdfs") + (lib.enableFeature withRdkafka "omkafka") + (lib.enableFeature withMongo "ommongodb") + (lib.enableFeature withCzmq "imczmq") + (lib.enableFeature withCzmq "omczmq") + (lib.enableFeature withRabbitmq "omrabbitmq") + (lib.enableFeature withHiredis "omhiredis") + (lib.enableFeature withCurl "omhttp") + (lib.enableFeature true "generate-man-pages") ]; passthru.tests = { nixos-rsyslogd = nixosTests.rsyslogd; }; - meta = with lib; { + meta = { homepage = "https://www.rsyslog.com/"; description = "Enhanced syslog implementation"; mainProgram = "rsyslogd"; changelog = "https://raw.githubusercontent.com/rsyslog/rsyslog/v${version}/ChangeLog"; - license = licenses.gpl3Only; - platforms = platforms.linux; + license = lib.licenses.gpl3Only; + platforms = lib.platforms.linux; maintainers = [ ]; }; } diff --git a/pkgs/tools/typesetting/asciidoc/default.nix b/pkgs/tools/typesetting/asciidoc/default.nix index 1a7fde588c756..24e1c6bc1a304 100644 --- a/pkgs/tools/typesetting/asciidoc/default.nix +++ b/pkgs/tools/typesetting/asciidoc/default.nix @@ -138,20 +138,20 @@ in python3.pkgs.buildPythonApplication rec { ]; # install filters early, so their shebangs are patched too - postPatch = with lib; '' + postPatch = '' mkdir -p "$out/etc/asciidoc/filters" mkdir -p "$out/etc/asciidoc/backends" - '' + optionalString _enableDitaaFilter '' + '' + lib.optionalString _enableDitaaFilter '' echo "Extracting ditaa filter" unzip -d "$out/etc/asciidoc/filters/ditaa" "${ditaaFilterSrc}" sed -i -e "s|java -jar|${jre}/bin/java -jar|" \ "$out/etc/asciidoc/filters/ditaa/ditaa2img.py" - '' + optionalString _enableMscgenFilter '' + '' + lib.optionalString _enableMscgenFilter '' echo "Extracting mscgen filter" unzip -d "$out/etc/asciidoc/filters/mscgen" "${mscgenFilterSrc}" sed -i -e "s|filter-wrapper.py mscgen|filter-wrapper.py ${mscgen}/bin/mscgen|" \ "$out/etc/asciidoc/filters/mscgen/mscgen-filter.conf" - '' + optionalString _enableDiagFilter '' + '' + lib.optionalString _enableDiagFilter '' echo "Extracting diag filter" unzip -d "$out/etc/asciidoc/filters/diag" "${diagFilterSrc}" sed -i \ @@ -161,12 +161,12 @@ in python3.pkgs.buildPythonApplication rec { -e "s|filter='nwdiag|filter=\'${nwdiag}/bin/nwdiag|" \ -e "s|filter='packetdiag|filter=\'${nwdiag}/bin/packetdiag|" \ "$out/etc/asciidoc/filters/diag/diag-filter.conf" - '' + optionalString _enableQrcodeFilter '' + '' + lib.optionalString _enableQrcodeFilter '' echo "Extracting qrcode filter" unzip -d "$out/etc/asciidoc/filters/qrcode" "${qrcodeFilterSrc}" sed -i -e "s|systemcmd('qrencode|systemcmd('${qrencode}/bin/qrencode|" \ "$out/etc/asciidoc/filters/qrcode/qrcode2img.py" - '' + optionalString _enableMatplotlibFilter '' + '' + lib.optionalString _enableMatplotlibFilter '' echo "Extracting mpl (matplotlib) filter" mkdir -p "$out/etc/asciidoc/filters/mpl" tar xvf "${matplotlibFilterSrc}" -C "$out/etc/asciidoc/filters/mpl" --strip-components=1 @@ -177,7 +177,7 @@ in python3.pkgs.buildPythonApplication rec { numpy_path="$(toPythonPath ${numpy})" sed -i "/^import.*sys/asys.path.append(\"$matplotlib_path\"); sys.path.append(\"$numpy_path\");" \ "$out/etc/asciidoc/filters/mpl/mplw.py" - '' + optionalString _enableAafigureFilter '' + '' + lib.optionalString _enableAafigureFilter '' echo "Extracting aafigure filter" unzip -d "$out/etc/asciidoc/filters/aafigure" "${aafigureFilterSrc}" # Add aafigure to sys.path (and it needs recursive-pth-loader) @@ -185,10 +185,10 @@ in python3.pkgs.buildPythonApplication rec { aafigure_path="$(toPythonPath ${aafigure})" sed -i "/^import.*sys/asys.path.append(\"$pth_loader_path\"); sys.path.append(\"$aafigure_path\"); import sitecustomize" \ "$out/etc/asciidoc/filters/aafigure/aafig2img.py" - '' + optionalString _enableDeckjsBackend '' + '' + lib.optionalString _enableDeckjsBackend '' echo "Extracting deckjs backend" unzip -d "$out/etc/asciidoc/backends/deckjs" "${deckjsBackendSrc}" - '' + optionalString _enableOdfBackend '' + '' + lib.optionalString _enableOdfBackend '' echo "Extracting odf backend (odt + odp)" unzip -d "$out/etc/asciidoc/backends/odt" "${odtBackendSrc}" unzip -d "$out/etc/asciidoc/backends/odp" "${odpBackendSrc}" @@ -228,7 +228,7 @@ in python3.pkgs.buildPythonApplication rec { -e "s|^ASCIIDOC =.*|ASCIIDOC = '$out/bin/asciidoc'|" \ -e "s|^XSLTPROC =.*|XSLTPROC = '${libxslt.bin}/bin/xsltproc'|" \ -e "s|^DBLATEX =.*|DBLATEX = '${dblatexFull}/bin/dblatex'|" \ - ${optionalString enableJava ''-e "s|^FOP =.*|FOP = '${fop}/bin/fop'|"''} \ + ${lib.optionalString enableJava ''-e "s|^FOP =.*|FOP = '${fop}/bin/fop'|"''} \ -e "s|^W3M =.*|W3M = '${w3m}/bin/w3m'|" \ -e "s|^LYNX =.*|LYNX = '${lynx}/bin/lynx'|" \ -e "s|^XMLLINT =.*|XMLLINT = '${libxml2.bin}/bin/xmllint'|" \ @@ -274,7 +274,7 @@ in python3.pkgs.buildPythonApplication rec { runHook postCheck ''; - meta = with lib; { + meta = { description = "Text-based document generation system"; longDescription = '' AsciiDoc is a text document format for writing notes, documentation, @@ -286,13 +286,12 @@ in python3.pkgs.buildPythonApplication rec { the backend output markups (which can be almost any type of SGML/XML markup) can be customized and extended by the user. ''; - sourceProvenance = with sourceTypes; [ - fromSource - ] ++ lib.optional _enableDitaaFilter binaryBytecode; + sourceProvenance = [ lib.sourceTypes.fromSource ] + ++ lib.optional _enableDitaaFilter lib.sourceTypes.binaryBytecode; homepage = "https://asciidoc-py.github.io/"; changelog = "https://github.com/asciidoc-py/asciidoc-py/blob/${version}/CHANGELOG.adoc"; - license = licenses.gpl2Plus; - platforms = platforms.unix; - maintainers = with maintainers; [ bjornfor dotlambda ]; + license = lib.licenses.gpl2Plus; + platforms = lib.platforms.unix; + maintainers = with lib.maintainers; [ bjornfor dotlambda ]; }; } diff --git a/pkgs/tools/typesetting/tex/texlive/default.nix b/pkgs/tools/typesetting/tex/texlive/default.nix index e84f89cdd6af3..acb4a20314ed6 100644 --- a/pkgs/tools/typesetting/tex/texlive/default.nix +++ b/pkgs/tools/typesetting/tex/texlive/default.nix @@ -57,11 +57,11 @@ let # need to be used instead. Ideally, for the release branches of NixOS we # should be switching to the tlnet-final versions # (https://tug.org/historic/). - mirrors = with version; lib.optionals final [ + mirrors = lib.optionals version.final [ # tlnet-final snapshot; used when texlive.tlpdb is frozen # the TeX Live yearly freeze typically happens in mid-March - "http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/${toString texliveYear}/tlnet-final" - "ftp://tug.org/texlive/historic/${toString texliveYear}/tlnet-final" + "http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/${toString version.texliveYear}/tlnet-final" + "ftp://tug.org/texlive/historic/${toString version.texliveYear}/tlnet-final" ] ++ [ # CTAN mirrors "https://mirror.ctan.org/systems/texlive/tlnet" @@ -71,7 +71,7 @@ let # please note that this server is not meant for large scale deployment # https://tug.org/pipermail/tex-live/2019-November/044456.html # https://texlive.info/ MUST appear last (see tlpdbxz) - "https://texlive.info/tlnet-archive/${year}/${month}/${day}/tlnet" + "https://texlive.info/tlnet-archive/${version.year}/${version.month}/${version.day}/tlnet" ]; tlpdbxz = fetchurl { @@ -148,9 +148,9 @@ let # now a legacy wrapper around buildTeXEnv combine = import ./combine-wrapper.nix { inherit buildTeXEnv lib toTLPkgList toTLPkgSets; }; - assertions = with lib; - assertMsg (tlpdbVersion.year == version.texliveYear) "TeX Live year in texlive does not match tlpdb.nix, refusing to evaluate" && - assertMsg (tlpdbVersion.frozen == version.final) "TeX Live final status in texlive does not match tlpdb.nix, refusing to evaluate"; + assertions = + lib.assertMsg (tlpdbVersion.year == version.texliveYear) "TeX Live year in texlive does not match tlpdb.nix, refusing to evaluate" && + lib.assertMsg (tlpdbVersion.frozen == version.final) "TeX Live final status in texlive does not match tlpdb.nix, refusing to evaluate"; # Pre-defined evironment packages for TeX Live schemes, # to make nix-env usage more comfortable and build selected on Hydra. @@ -191,7 +191,7 @@ let (pname: (buildTeXEnv { __extraName = "combined" + lib.removePrefix "scheme" pname; - __extraVersion = with version; if final then "-final" else ".${year}${month}${day}"; + __extraVersion = if version.final then "-final" else ".${version.year}${version.month}${version.day}"; requiredTeXPackages = ps: [ ps.${pname} ]; # to maintain full backward compatibility, enable texlive.combine behavior __combine = true; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index a6403e6792eb4..694dd8bd6f88e 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -22,16 +22,16 @@ with self; let # Removing recurseForDerivation prevents derivations of aliased attribute set # to appear while listing all the packages available. - removeRecurseForDerivations = alias: with lib; + removeRecurseForDerivations = alias: if alias.recurseForDerivations or false - then removeAttrs alias [ "recurseForDerivations" ] + then lib.removeAttrs alias [ "recurseForDerivations" ] else alias; # Disabling distribution prevents top-level aliases for non-recursed package # sets from building on Hydra. - removeDistribute = alias: with lib; - if isDerivation alias then - dontDistribute alias + removeDistribute = alias: + if lib.isDerivation alias then + lib.dontDistribute alias else alias; transmission3Warning = { prefix ? "", suffix ? "" }: let diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 25a9db99e50e2..20cebb8c7b7ea 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13189,14 +13189,14 @@ with pkgs; thelounge = callPackage ../applications/networking/irc/thelounge { }; - theLoungePlugins = with lib; let - pkgs = filterAttrs (name: _: hasPrefix "thelounge-" name) nodePackages; - getPackagesWithPrefix = prefix: mapAttrs' (name: pkg: nameValuePair (removePrefix ("thelounge-" + prefix + "-") name) pkg) - (filterAttrs (name: _: hasPrefix ("thelounge-" + prefix + "-") name) pkgs); + theLoungePlugins = let + pkgs = lib.filterAttrs (name: _: lib.hasPrefix "thelounge-" name) nodePackages; + getPackagesWithPrefix = prefix: lib.mapAttrs' (name: pkg: lib.nameValuePair (lib.removePrefix ("thelounge-" + prefix + "-") name) pkg) + (lib.filterAttrs (name: _: lib.hasPrefix ("thelounge-" + prefix + "-") name) pkgs); in - recurseIntoAttrs { - plugins = recurseIntoAttrs (getPackagesWithPrefix "plugin"); - themes = recurseIntoAttrs (getPackagesWithPrefix "theme"); + lib.recurseIntoAttrs { + plugins = lib.recurseIntoAttrs (getPackagesWithPrefix "plugin"); + themes = lib.recurseIntoAttrs (getPackagesWithPrefix "theme"); }; theme-sh = callPackage ../tools/misc/theme-sh { }; diff --git a/pkgs/top-level/python-aliases.nix b/pkgs/top-level/python-aliases.nix index 65c3957f95045..cea0900e2e34a 100644 --- a/pkgs/top-level/python-aliases.nix +++ b/pkgs/top-level/python-aliases.nix @@ -5,16 +5,16 @@ with self; let # Removing recurseForDerivation prevents derivations of aliased attribute # set to appear while listing all the packages available. - removeRecurseForDerivations = alias: with lib; + removeRecurseForDerivations = alias: if alias.recurseForDerivations or false then - removeAttrs alias ["recurseForDerivations"] + lib.removeAttrs alias ["recurseForDerivations"] else alias; # Disabling distribution prevents top-level aliases for non-recursed package # sets from building on Hydra. - removeDistribute = alias: with lib; - if isDerivation alias then - dontDistribute alias + removeDistribute = alias: + if lib.isDerivation alias then + lib.dontDistribute alias else alias; # Make sure that we are not shadowing something from