From 67c8ac6bc60833e20d780aade4305bc3af81cd60 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 09:50:26 -0700 Subject: [PATCH 001/123] gpodder: remove with statements --- pkgs/applications/audio/gpodder/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/audio/gpodder/default.nix b/pkgs/applications/audio/gpodder/default.nix index 61e33cae9026..4ddbf4b6ef61 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 ''; From 9c61e1077606f384e8af13b6e80a5e692f6d426d Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 09:55:09 -0700 Subject: [PATCH 002/123] ly: remove with statements --- pkgs/applications/display-managers/ly/deps.nix | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pkgs/applications/display-managers/ly/deps.nix b/pkgs/applications/display-managers/ly/deps.nix index 0269a8e8190a..c1f733aebc99 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; From 44f5fc12643103991b4348cd25eea4f231ecfa07 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:06:15 -0700 Subject: [PATCH 003/123] eclipse: remove with statements --- pkgs/applications/editors/eclipse/default.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/applications/editors/eclipse/default.nix b/pkgs/applications/editors/eclipse/default.nix index c7b8b3dc0f5c..9c1963554c3f 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 From f88f22d6b2e2dc703615ca7cb93ae5971361aeae Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:07:42 -0700 Subject: [PATCH 004/123] jupyter-kernels: remove with statements --- pkgs/applications/editors/jupyter/kernel.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/editors/jupyter/kernel.nix b/pkgs/applications/editors/jupyter/kernel.nix index 3640de28e8ac..b036c7274d51 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 ]; }; }; } From 729237c1631481746ff4d3578dc2c963e50c3da1 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:07:47 -0700 Subject: [PATCH 005/123] kakounePlugins: remove with statements As I'm the maintainer, I also removed `with overridden`. --- .../editors/kakoune/plugins/aliases.nix | 26 +++++++++---------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/pkgs/applications/editors/kakoune/plugins/aliases.nix b/pkgs/applications/editors/kakoune/plugins/aliases.nix index 1d516f9b436f..392ee835d339 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) From 167cc0bef41a4536a444c6de4078bdea6bed27bf Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:10:59 -0700 Subject: [PATCH 006/123] rstudio: remove with statements --- pkgs/applications/editors/rstudio/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/editors/rstudio/default.nix b/pkgs/applications/editors/rstudio/default.nix index 0521d3dce56a..4d606904e2f6 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; From 549dbd2a6b1e04dd59c70e4765fc6eecd516ab7f Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:12:13 -0700 Subject: [PATCH 007/123] vimPlugins: remove with statements in aliases --- pkgs/applications/editors/vim/plugins/aliases.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/editors/vim/plugins/aliases.nix b/pkgs/applications/editors/vim/plugins/aliases.nix index ff504416489e..e447c41a4666 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 From c61702920fa9ebf257b0320b3f0d42b4ddf6d5f0 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:13:59 -0700 Subject: [PATCH 008/123] brscan4: remove with statements --- .../graphics/sane/backends/brscan4/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/graphics/sane/backends/brscan4/default.nix b/pkgs/applications/graphics/sane/backends/brscan4/default.nix index c15b3033a265..ece80ef18a5b 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 From fe193f426266640805f4c73357c8f55b1a139b8e Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:18:08 -0700 Subject: [PATCH 009/123] brscan5: remove with statements --- .../applications/graphics/sane/backends/brscan5/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/graphics/sane/backends/brscan5/default.nix b/pkgs/applications/graphics/sane/backends/brscan5/default.nix index 9749ae5b658f..b816eb71d27c 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 From a50bd73adf12a56eaff79a7f0a18586a1661afe6 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:18:13 -0700 Subject: [PATCH 010/123] apeClex: remove with statements --- pkgs/applications/misc/ape/apeclex.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/misc/ape/apeclex.nix b/pkgs/applications/misc/ape/apeclex.nix index 81096d9877f7..7f0523270f28 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 ]; } From dc3c6727ed2b278a87dbb095a257215135dbfe06 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:20:05 -0700 Subject: [PATCH 011/123] ape: remove with statements --- pkgs/applications/misc/ape/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/misc/ape/default.nix b/pkgs/applications/misc/ape/default.nix index e50d766a88b2..30911d6380fe 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 { From 36a37349fb570e096a30012575f4e1b78fc5f19c Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:20:10 -0700 Subject: [PATCH 012/123] bemenu: remove with statements --- pkgs/applications/misc/bemenu/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/misc/bemenu/default.nix b/pkgs/applications/misc/bemenu/default.nix index 1ddf73deb98f..7c4cd0f93542 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 ]; From ae33a527a513f862161c28ed5f102d8b197e8506 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:20:13 -0700 Subject: [PATCH 013/123] clightd: remove with statements --- pkgs/applications/misc/clight/clightd.nix | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pkgs/applications/misc/clight/clightd.nix b/pkgs/applications/misc/clight/clightd.nix index b6958d86bbd0..4d7ba199472f 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 From 7dbea2568fb7385b0ffb6d11827d6244cc188656 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:20:15 -0700 Subject: [PATCH 014/123] clight: remove with statements --- pkgs/applications/misc/clight/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/misc/clight/default.nix b/pkgs/applications/misc/clight/default.nix index 882c29f4b36e..3f3ea2416d89 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" From b4eeedc00b523a5ba0f3d62be2c9895f46b7ff01 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:20:17 -0700 Subject: [PATCH 015/123] digitalbitbox: remove with statements --- pkgs/applications/misc/digitalbitbox/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/misc/digitalbitbox/default.nix b/pkgs/applications/misc/digitalbitbox/default.nix index 418c4996eb3b..93802ee8682c 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 From 6ecdcc651c4fdefd7f7778d4583859191ef87628 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:20:19 -0700 Subject: [PATCH 016/123] goldendict: remove with statements --- pkgs/applications/misc/goldendict/default.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/applications/misc/goldendict/default.nix b/pkgs/applications/misc/goldendict/default.nix index 328f1f734320..6b1865509b72 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 '' From 141978912008dabb4d7a53a67361d12766210890 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:20:37 -0700 Subject: [PATCH 017/123] sweethome3d: remove with statements --- pkgs/applications/misc/sweethome3d/editors.nix | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pkgs/applications/misc/sweethome3d/editors.nix b/pkgs/applications/misc/sweethome3d/editors.nix index a426494b61f6..9d37423f568d 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 }: From 929615b55cecd4475ee12851f53faf6b896aaca9 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:22:22 -0700 Subject: [PATCH 018/123] workrave: remove with statements --- pkgs/applications/misc/workrave/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/applications/misc/workrave/default.nix b/pkgs/applications/misc/workrave/default.nix index 1235b22b8aba..a0521d443937 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="; }; From b70b0ceb8ce816ece361a72f3c794a2b685420c6 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:22:26 -0700 Subject: [PATCH 019/123] brig: remove with statements --- pkgs/applications/networking/brig/default.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/networking/brig/default.nix b/pkgs/applications/networking/brig/default.nix index e7204a68d14c..b20543c0c58a 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 \ From 642bfd678c06947fae185607c544f4bdb6bc6da5 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:22:28 -0700 Subject: [PATCH 020/123] chromium: remove with statements --- pkgs/applications/networking/browsers/chromium/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/browsers/chromium/default.nix b/pkgs/applications/networking/browsers/chromium/default.nix index 09b575811b83..bebb279f1a66 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 From bc794b796b56ff2441e1fc873d905f3a0833ac94 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:23:21 -0700 Subject: [PATCH 021/123] links2: remove with statements --- pkgs/applications/networking/browsers/links2/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/networking/browsers/links2/default.nix b/pkgs/applications/networking/browsers/links2/default.nix index cbf4f538c428..9fe4fe7e37f2 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 ]; From 19b0d701817bf344e18774cf299b3acd41e2710a Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:23:24 -0700 Subject: [PATCH 022/123] weechat: remove with statements --- .../networking/irc/weechat/default.nix | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/pkgs/applications/networking/irc/weechat/default.nix b/pkgs/applications/networking/irc/weechat/default.nix index f398b4a6b035..2d963bce3289 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) From 926b6220cd423f600dcd3bc03dffd07d0fc49b79 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:23:27 -0700 Subject: [PATCH 023/123] ngadmin: remove with statements --- pkgs/applications/networking/ngadmin/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/networking/ngadmin/default.nix b/pkgs/applications/networking/ngadmin/default.nix index f63fbfcf9503..fb36a0367c59 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"; From 62cb4575a758e906d09f1c4121c719f907866dca Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:23:28 -0700 Subject: [PATCH 024/123] tremc: remove with statements --- pkgs/applications/networking/p2p/tremc/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/p2p/tremc/default.nix b/pkgs/applications/networking/p2p/tremc/default.nix index 6a75a02d854b..8f3b2c6e35ef 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 { From ecc748b3d1cc3ecacb1bd8eac601dc518c51c566 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:23:30 -0700 Subject: [PATCH 025/123] synology-drive-client: remove with statements --- pkgs/applications/networking/synology-drive-client/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/networking/synology-drive-client/default.nix b/pkgs/applications/networking/synology-drive-client/default.nix index d4ab94315bf9..2fafbad3499e 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"; From 0b74a12120d8ae332af1b8a5996553744eb8dd87 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:23:33 -0700 Subject: [PATCH 026/123] gwyddion: remove with statements --- .../science/chemistry/gwyddion/default.nix | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/pkgs/applications/science/chemistry/gwyddion/default.nix b/pkgs/applications/science/chemistry/gwyddion/default.nix index b7f06898504f..9e64ee7afe4d 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 From 6b764605dc738238db0be382c6cbb8527e361ce5 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:23:34 -0700 Subject: [PATCH 027/123] picoscope: remove with statements --- .../science/electronics/picoscope/default.nix | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/pkgs/applications/science/electronics/picoscope/default.nix b/pkgs/applications/science/electronics/picoscope/default.nix index 3aa5cb22aa52..27e527a01d87 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 From 66a0775dbe3cb29bc21f7647f358ce005d5caa3e Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:24:38 -0700 Subject: [PATCH 028/123] coq: remove with statements --- .../science/logic/coq/default.nix | 55 +++++++++---------- 1 file changed, 27 insertions(+), 28 deletions(-) diff --git a/pkgs/applications/science/logic/coq/default.nix b/pkgs/applications/science/logic/coq/default.nix index d07ebd90ec7d..25531c6a33af 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 From 24395a180ddf126150ce4ce5a5752845b0240308 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:28:59 -0700 Subject: [PATCH 029/123] wolfram-engine: remove with statements --- pkgs/applications/science/math/wolfram-engine/l10ns.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/science/math/wolfram-engine/l10ns.nix b/pkgs/applications/science/math/wolfram-engine/l10ns.nix index 2682b6d71a1b..cfd296087d74 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. [ { From 75923e2640cdb6ad9a857f862f6e4b8c928cee9b Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:29:03 -0700 Subject: [PATCH 030/123] git-sync: remove with statements --- pkgs/applications/version-management/git-sync/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/version-management/git-sync/default.nix b/pkgs/applications/version-management/git-sync/default.nix index 3ff96da704e0..07fa41a72637 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 From 48e8083013a577e18e0bc1f20194465c7df91410 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:29:06 -0700 Subject: [PATCH 031/123] mplayer: remove with statements --- pkgs/applications/video/mplayer/default.nix | 85 ++++++++++----------- 1 file changed, 40 insertions(+), 45 deletions(-) diff --git a/pkgs/applications/video/mplayer/default.nix b/pkgs/applications/video/mplayer/default.nix index 47e5604eea5d..6b546b5111eb 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" ] ); From 2d7ef18297f24678fe736fc3e59cefad5daf4ee2 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:30:44 -0700 Subject: [PATCH 032/123] mpv: remove with statements --- .../video/mpv/scripts/default.nix | 62 +++++++++---------- 1 file changed, 30 insertions(+), 32 deletions(-) diff --git a/pkgs/applications/video/mpv/scripts/default.nix b/pkgs/applications/video/mpv/scripts/default.nix index 873010ca3f5a..de0ee95044ca 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 + ''; + } ) ]; }; From e3c6d330177b0f49db6bdf691a778afcfaa64024 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:31:28 -0700 Subject: [PATCH 033/123] obs-studio: remove with statements --- pkgs/applications/video/obs-studio/wrapper.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/video/obs-studio/wrapper.nix b/pkgs/applications/video/obs-studio/wrapper.nix index 62bc80d26df3..0c972fc58d37 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 From e1854c33b254da8ad38001b12f536735102273a4 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 10:32:10 -0700 Subject: [PATCH 034/123] singularity: remove with statements This is a generic meta, so it doesn't fall into the "simple" pattern as I see it. --- .../virtualization/singularity/generic.nix | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/pkgs/applications/virtualization/singularity/generic.nix b/pkgs/applications/virtualization/singularity/generic.nix index 1cac1d4f16c6..24e1b3b67b26 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: { From c406a6ed332e43bccb8fcf3ad6aae8a2653d8dfe Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 11:57:43 -0700 Subject: [PATCH 035/123] fetchsvn: remove with statements --- pkgs/build-support/fetchsvn/default.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/build-support/fetchsvn/default.nix b/pkgs/build-support/fetchsvn/default.nix index 41752eb55a7a..203a145b6434 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 From 661aa513a13a93dc18cbf88daec4ca89bd12d6f2 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 11:58:09 -0700 Subject: [PATCH 036/123] writers: remove with statements from aliases --- pkgs/build-support/writers/aliases.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/build-support/writers/aliases.nix b/pkgs/build-support/writers/aliases.nix index fb108a6fd857..8441abf36ce5 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 From 9996e83d771c5ffb2bf4e02898c969ec3ff4f6f7 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 11:58:27 -0700 Subject: [PATCH 037/123] btrfs-auto-snapshot: remove with statements --- .../bt/btrfs-auto-snapshot/package.nix | 24 +++++++++---------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/pkgs/by-name/bt/btrfs-auto-snapshot/package.nix b/pkgs/by-name/bt/btrfs-auto-snapshot/package.nix index 7392a0c5809d..7cd30f563bc4 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 \ From e05d16a57aaf60682fd9c45dcad22c87a9b17956 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 11:58:33 -0700 Subject: [PATCH 038/123] labelife-label-printer: remove with statements --- pkgs/by-name/la/labelife-label-printer/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/la/labelife-label-printer/package.nix b/pkgs/by-name/la/labelife-label-printer/package.nix index fb73aa24d572..712d478e6a61 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 ]; }; }) From c58fcdeb91f773f5893396a589d9fadd105bbe2c Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 12:06:52 -0700 Subject: [PATCH 039/123] libplacebo: remove with statements --- pkgs/by-name/li/libplacebo_5/package.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/li/libplacebo_5/package.nix b/pkgs/by-name/li/libplacebo_5/package.nix index 8dc6dbe1cea6..5bc799ddf860 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 = '' From aa20ccad78ec5752e68e87304f71c37a14c02291 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 12:06:55 -0700 Subject: [PATCH 040/123] modrinth-app-unwrapped: remove with statements --- pkgs/by-name/mo/modrinth-app-unwrapped/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/mo/modrinth-app-unwrapped/package.nix b/pkgs/by-name/mo/modrinth-app-unwrapped/package.nix index 7814ec363dce..c9c5cbdc73f5 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; }; From faa935f4728f0070e58e827a02dbddf4b298b3d1 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 12:07:19 -0700 Subject: [PATCH 041/123] mousecape: remove with statements --- pkgs/by-name/mo/mousecape/package.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/mo/mousecape/package.nix b/pkgs/by-name/mo/mousecape/package.nix index 3f29a0135827..7d45953a4e40 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 ]; }; }) From e659af6d2e4ab529438701f2516654e8066516cc Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 12:07:40 -0700 Subject: [PATCH 042/123] smartgithg: remove with statements --- pkgs/by-name/sm/smartgithg/package.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/by-name/sm/smartgithg/package.nix b/pkgs/by-name/sm/smartgithg/package.nix index d3bb1ed1b67d..d636c9d9b1ed 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; From 63b05516687f10e84a7f605036bd25fdd1dd88d6 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 12:07:43 -0700 Subject: [PATCH 043/123] ats2: remove with statements --- pkgs/development/compilers/ats2/default.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkgs/development/compilers/ats2/default.nix b/pkgs/development/compilers/ats2/default.nix index f9ba2e1ac417..2dad47c08abc 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; From 418495c4f9d16c8bbba39d35667fef8f6c9345e6 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 13:46:23 -0700 Subject: [PATCH 044/123] dotnet: remove with statements --- pkgs/development/compilers/dotnet/build-dotnet.nix | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pkgs/development/compilers/dotnet/build-dotnet.nix b/pkgs/development/compilers/dotnet/build-dotnet.nix index 246cc9ade717..0c9de3f05cab 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 From bdc75c92355879a463c549a04716faa703cb00d5 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 13:47:11 -0700 Subject: [PATCH 045/123] elm.hs810Pkgs: remove with statements --- .../compilers/elm/packages/ghc8_10/default.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/development/compilers/elm/packages/ghc8_10/default.nix b/pkgs/development/compilers/elm/packages/ghc8_10/default.nix index f68e582b3d0b..ef6e5142b2f1 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 { })); }; From 344f63daef9bd2448cb1f3e120585e3296740db8 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 13:49:01 -0700 Subject: [PATCH 046/123] elm.hs92Pkgs: remove with statements --- pkgs/development/compilers/elm/packages/ghc9_2/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/elm/packages/ghc9_2/default.nix b/pkgs/development/compilers/elm/packages/ghc9_2/default.nix index 5ef5eff3bef1..6c3e23460c22 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 { })); }; From 37a0bd368a42b7f5806a8c5c27cbf5ae36da600c Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 13:49:34 -0700 Subject: [PATCH 047/123] elm.hs96Pkgs: remove with statements --- pkgs/development/compilers/elm/packages/ghc9_6/default.nix | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/development/compilers/elm/packages/ghc9_6/default.nix b/pkgs/development/compilers/elm/packages/ghc9_6/default.nix index 0c30c9bea728..9fdc0e72f127 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 { }); From 99aabc6f9e98baf357f51672b1d8ac18abedf726 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 13:49:57 -0700 Subject: [PATCH 048/123] llvm: remove with statements from common.nix --- pkgs/development/compilers/llvm/common/llvm/default.nix | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pkgs/development/compilers/llvm/common/llvm/default.nix b/pkgs/development/compilers/llvm/common/llvm/default.nix index fdcd40201c0b..a995c83405e9 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)) [ From e9bf9df5e402035309ba3ffced78a77b687fba77 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 13:50:08 -0700 Subject: [PATCH 049/123] mezzo: remove with statements --- pkgs/development/compilers/mezzo/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/compilers/mezzo/default.nix b/pkgs/development/compilers/mezzo/default.nix index 498743ee743e..a47228b1d0b1 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"; From 835804ea262ffa13497b0b8a597bface1dc4e7d8 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 13:50:18 -0700 Subject: [PATCH 050/123] sbcl: remove with statements --- pkgs/development/compilers/sbcl/default.nix | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pkgs/development/compilers/sbcl/default.nix b/pkgs/development/compilers/sbcl/default.nix index f52393961665..86c0ddd52fab 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"; + 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 = with lib; - optional (!self.threadSupport) "sb-thread" ++ - optionals self.disableImmobileSpace [ "immobile-space" "immobile-code" "compact-instance-header" ]; + disableFeatures = + lib.optional (!self.threadSupport) "sb-thread" ++ + lib.optionals self.disableImmobileSpace [ "immobile-space" "immobile-code" "compact-instance-header" ]; buildArgs = [ "--prefix=$out" From 58fe1a068fa363da32c51fcff904fab84ae44b95 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 13:50:22 -0700 Subject: [PATCH 051/123] coqPackages.QuickChick: remove with statements --- .../coq-modules/QuickChick/default.nix | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pkgs/development/coq-modules/QuickChick/default.nix b/pkgs/development/coq-modules/QuickChick/default.nix index 629e752ca628..451353a34142 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="; From 4b1852399b68dfe3d7c1208b0df5c117177ada54 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 13:51:05 -0700 Subject: [PATCH 052/123] coqPackages_8_10.mathcomp-abel: remove with statements --- pkgs/development/coq-modules/mathcomp-abel/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/coq-modules/mathcomp-abel/default.nix b/pkgs/development/coq-modules/mathcomp-abel/default.nix index bae9266d4de1..c9d6a709d6a3 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="; From 1dbcead1d720190c58cf9579bb795ccfe74752ed Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 13:52:40 -0700 Subject: [PATCH 053/123] coqPackages.serapi: remove with statements --- .../coq-modules/serapi/default.nix | 25 +++++++++---------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/pkgs/development/coq-modules/serapi/default.nix b/pkgs/development/coq-modules/serapi/default.nix index ac61e4eed018..d8077640d6e1 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; From 8e3651c954987c526435810e3bc992397c57a9d0 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 13:53:33 -0700 Subject: [PATCH 054/123] aeson: remove with statements --- pkgs/development/haskell-modules/lib/compose.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/haskell-modules/lib/compose.nix b/pkgs/development/haskell-modules/lib/compose.nix index 8d09dcf5bea1..09de1d228d94 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 { }; From 0abbed5dd5d9ff19165579639b6c31bd4a6b6c6d Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 13:56:37 -0700 Subject: [PATCH 055/123] haskellLib.checkUnusedPackages: remove with lib statement --- pkgs/development/interpreters/gnu-apl/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/gnu-apl/default.nix b/pkgs/development/interpreters/gnu-apl/default.nix index d854643bb2fe..85e86de1d6b2 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" From ce3cb3730a5c9027754a6a113202ec9fd7bef20d Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 13:57:40 -0700 Subject: [PATCH 056/123] luajit_2_0: remove with lib statement --- pkgs/development/interpreters/luajit/2.0.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/interpreters/luajit/2.0.nix b/pkgs/development/interpreters/luajit/2.0.nix index 9ad3099143c8..c70b6809d1df 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; } From f8967b46f60d2864f83f7cf226b7634acd939356 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 13:57:57 -0700 Subject: [PATCH 057/123] luajit: remove with lib statement --- .../interpreters/luajit/default.nix | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pkgs/development/interpreters/luajit/default.nix b/pkgs/development/interpreters/luajit/default.nix index 25f3332b2602..f5e25b6261bc 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 From b77e53f5523018d46a7ba80471c6852781967315 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 13:58:09 -0700 Subject: [PATCH 058/123] getdns: remove with statements --- pkgs/development/libraries/getdns/default.nix | 69 +++++++++---------- 1 file changed, 33 insertions(+), 36 deletions(-) diff --git a/pkgs/development/libraries/getdns/default.nix b/pkgs/development/libraries/getdns/default.nix index 7fb641158460..69d7f17dafe7 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); + passthru.settingsExample = builtins.fromJSON (builtins.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/"; - }; + 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/"; + }; }; } From 06198190ca3588528300d0721d370e67bd717d1d Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 13:58:18 -0700 Subject: [PATCH 059/123] libint: remove with statements --- pkgs/development/libraries/libint/default.nix | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/pkgs/development/libraries/libint/default.nix b/pkgs/development/libraries/libint/default.nix index a6ad9498afa3..73e400810f61 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 = '' From ead2eecbb23f24cf16c2b607afe5cf8dd5e17dd3 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 13:58:21 -0700 Subject: [PATCH 060/123] libplacebo: remove with statements --- .../development/libraries/libplacebo/default.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/development/libraries/libplacebo/default.nix b/pkgs/development/libraries/libplacebo/default.nix index b9bcd3cd08e2..0ffa7b2828f3 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 = '' From 97070902ca4ec5e40ffddab6e470e3584a604786 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 13:58:22 -0700 Subject: [PATCH 061/123] libucl: remove with statements --- pkgs/development/libraries/libucl/default.nix | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/libucl/default.nix b/pkgs/development/libraries/libucl/default.nix index 6275a85e6ee2..0adb3a66465e 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"; From 4d44b70c86a70a62eda3bf703ee96c79643e395d Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 13:58:24 -0700 Subject: [PATCH 062/123] mvapich: remove with statements --- pkgs/development/libraries/mvapich/default.nix | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pkgs/development/libraries/mvapich/default.nix b/pkgs/development/libraries/mvapich/default.nix index 2182c4083376..1299d06d4687 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; From 13deb3a2a1ad07779b7206ed4b25404556c9b774 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 13:58:26 -0700 Subject: [PATCH 063/123] opencv: remove with statements --- pkgs/development/libraries/opencv/3.x.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/development/libraries/opencv/3.x.nix b/pkgs/development/libraries/opencv/3.x.nix index adb6532bd682..01479f31116e 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; }; } From e949a91d02555ced9029cc6ae16df91e0145b723 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 13:58:28 -0700 Subject: [PATCH 064/123] opencv: remove with statements --- pkgs/development/libraries/opencv/4.x.nix | 40 +++++++++++------------ 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/pkgs/development/libraries/opencv/4.x.nix b/pkgs/development/libraries/opencv/4.x.nix index e2509ca5199a..eb10bd6c4673 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; }; } From 2429bed6928bdc19e08c75aed5e70e977a3c72e9 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 13:58:29 -0700 Subject: [PATCH 065/123] openssl: remove with statements --- .../development/libraries/openssl/default.nix | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix index 94934c489e52..5ddb26798af5 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; }; }; } From 99219bdfbc1847e728c3649b9c29fca824d92320 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 13:59:09 -0700 Subject: [PATCH 066/123] tensorrt: remove with statements --- .../libraries/science/math/tensorrt/extension.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/development/libraries/science/math/tensorrt/extension.nix b/pkgs/development/libraries/science/math/tensorrt/extension.nix index ffd9b672684c..7db869a2c169 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; From 11cddcd4ad0eef35cac9465496a15d576e276e52 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 13:59:12 -0700 Subject: [PATCH 067/123] zeroc-mcpp: remove with statements --- pkgs/development/libraries/zeroc-ice/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/libraries/zeroc-ice/default.nix b/pkgs/development/libraries/zeroc-ice/default.nix index b41ec7f51174..9c8db3159396 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 ''; From 8526be06d2717098c255d4723fca4d0b4c2abc64 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:00:10 -0700 Subject: [PATCH 068/123] luaPackages.requiredLuaModules: remove with lib statement --- pkgs/development/lua-modules/lib.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/lua-modules/lib.nix b/pkgs/development/lua-modules/lib.nix index a527b2e1189f..df5dbc5d3024 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; From eded5c3275d376db93a167795ad539aa5e07dedf Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:00:35 -0700 Subject: [PATCH 069/123] luaPackages: remove with sstatement in overrides --- pkgs/development/lua-modules/overrides.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/lua-modules/overrides.nix b/pkgs/development/lua-modules/overrides.nix index fa83ee0e57ff..819144c0ec59 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: { From 633c856885a635ee56fcbd162bcb3be64f59ba6c Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:01:08 -0700 Subject: [PATCH 070/123] nodePackage: remove with statements in aliases --- pkgs/development/node-packages/aliases.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/node-packages/aliases.nix b/pkgs/development/node-packages/aliases.nix index 4439a8684901..2f3cbaddec61 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. From 8d7117294ca9645b44ae10d6ad09b8766f85847a Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:01:17 -0700 Subject: [PATCH 071/123] gnupg: remove with statements --- pkgs/development/php-packages/gnupg/default.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/development/php-packages/gnupg/default.nix b/pkgs/development/php-packages/gnupg/default.nix index 6b5e7e326ec5..0efe23466840 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; }; } From b45066a87529fcde506422846d735b1c55a0a6b7 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:01:30 -0700 Subject: [PATCH 072/123] python-lsp-black: remove with statements --- pkgs/development/python-modules/python-lsp-black/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/python-lsp-black/default.nix b/pkgs/development/python-modules/python-lsp-black/default.nix index 6c3dcfbb6994..2a963148439a 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="; }); From 8b61506fec468d408d042693d0f1418d5486edf8 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:02:31 -0700 Subject: [PATCH 073/123] python311Packages.spacy: remove with statements --- pkgs/development/python-modules/spacy/models.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/spacy/models.nix b/pkgs/development/python-modules/spacy/models.nix index bb795682a187..a8e99669b448 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) From 4785eeeea3a1230875c4913d8379a4a9e6dcfe36 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:03:12 -0700 Subject: [PATCH 074/123] python311Packages.tensorflow: remove with statements --- pkgs/development/python-modules/tensorflow/default.nix | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/tensorflow/default.nix b/pkgs/development/python-modules/tensorflow/default.nix index b1a2dd0f9097..31639d48f934 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) From c434f3c029b6bfa1f97cc6e1c1e1cf428c2368d5 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:03:47 -0700 Subject: [PATCH 075/123] python3Packages.tinyobjloader-py: remove with statements --- .../python-modules/tinyobjloader-py/default.nix | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pkgs/development/python-modules/tinyobjloader-py/default.nix b/pkgs/development/python-modules/tinyobjloader-py/default.nix index 1d0b621c482d..ea3d31342c25 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"; + }; } From 49ddbfef6cffcf03fc0e5d3ce8b5600b65af0135 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:04:20 -0700 Subject: [PATCH 076/123] python3Packages.vega-datasets: remove with statements --- pkgs/development/python-modules/vega-datasets/default.nix | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pkgs/development/python-modules/vega-datasets/default.nix b/pkgs/development/python-modules/vega-datasets/default.nix index 09da2c1f0792..b7de5f6c1b65 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; }; } From 623a797295bc58026eed59c06e61affeb27516d1 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:04:32 -0700 Subject: [PATCH 077/123] azure-static-sites-client: remove with statements --- .../tools/azure-static-sites-client/default.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/development/tools/azure-static-sites-client/default.nix b/pkgs/development/tools/azure-static-sites-client/default.nix index 452976b7282a..126eaf1ec68e 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" ]; }; } From d3d5b2d2f56d1f02807904d4dcfd3cf6e1fa7d8b Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:05:05 -0700 Subject: [PATCH 078/123] gdb: remove with statements --- pkgs/development/tools/misc/gdb/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/tools/misc/gdb/default.nix b/pkgs/development/tools/misc/gdb/default.nix index 7f97eebce157..da8167b3b16e 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 ]; }; } From 479dd4d050ba787a2074189c5f354415be7c9f5d Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:05:29 -0700 Subject: [PATCH 079/123] lsof: remove with statements --- pkgs/development/tools/misc/lsof/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/development/tools/misc/lsof/default.nix b/pkgs/development/tools/misc/lsof/default.nix index b43030594d3d..de1decee524f 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; }; } From 979820ea65bfd00a8b43745633b292c703201507 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:05:32 -0700 Subject: [PATCH 080/123] ezquake: remove with statements --- pkgs/games/ezquake/default.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/games/ezquake/default.nix b/pkgs/games/ezquake/default.nix index 4cc6bd2258b5..579783af2ef8 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 ]; }; } From 96d895f6a9eafa843c343090e953d4945ff20d61 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:05:34 -0700 Subject: [PATCH 081/123] mindustry: remove with statements --- pkgs/games/mindustry/default.nix | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pkgs/games/mindustry/default.nix b/pkgs/games/mindustry/default.nix index 7e739b2a8c0f..789b2bca65a5 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; }; From 8910fea8d216e9aaab508da6996362263981a96b Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:05:35 -0700 Subject: [PATCH 082/123] simutrans: remove with statements --- pkgs/games/simutrans/default.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/games/simutrans/default.nix b/pkgs/games/simutrans/default.nix index 0a4ec4f326eb..6a48c5a2caeb 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; }; }; From 8ee773a28e8a953ee751c28f90b33d9d5d04a73f Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:05:37 -0700 Subject: [PATCH 083/123] ultrastardx: remove with statements --- pkgs/games/ultrastardx/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/games/ultrastardx/default.nix b/pkgs/games/ultrastardx/default.nix index 7708652d22b3..ed206fd582d3 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}" ''; From 9062806b52286d8e223e6110f75c43b80336fbd9 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:05:39 -0700 Subject: [PATCH 084/123] brgenml1lpr: remove with statements --- pkgs/misc/cups/drivers/brgenml1lpr/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/misc/cups/drivers/brgenml1lpr/default.nix b/pkgs/misc/cups/drivers/brgenml1lpr/default.nix index 1e838db93263..d683e80b2893 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 From 7b3a3f3f8bdde57169a2ceb26fea1dc2432b2167 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:05:40 -0700 Subject: [PATCH 085/123] freebsd.mkDerivation: remove with statements --- .../bsd/freebsd/pkgs/mkDerivation.nix | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix b/pkgs/os-specific/bsd/freebsd/pkgs/mkDerivation.nix index aae852c48798..4c2fe571999f 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? From 17a74527b5d3a2dfe75c43d58edb3d425dcee91c Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:07:17 -0700 Subject: [PATCH 086/123] cryptsetup: remove with statements --- pkgs/os-specific/linux/cryptsetup/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/os-specific/linux/cryptsetup/default.nix b/pkgs/os-specific/linux/cryptsetup/default.nix index 39f03c475fda..044daf848467 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; From 9a6897925d997bf27389a3b9611fea2514361cce Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:07:49 -0700 Subject: [PATCH 087/123] deviceTree: remove with statements --- pkgs/os-specific/linux/device-tree/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/os-specific/linux/device-tree/default.nix b/pkgs/os-specific/linux/device-tree/default.nix index a15a9e32137c..87c9b84e1240 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 From 460c91c5aecba5580f17c89e49677370b5dbfa55 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:08:03 -0700 Subject: [PATCH 088/123] nv-fabricmanager: remove with statements --- pkgs/os-specific/linux/nvidia-x11/fabricmanager.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/os-specific/linux/nvidia-x11/fabricmanager.nix b/pkgs/os-specific/linux/nvidia-x11/fabricmanager.nix index e70857ea356e..818d847f2196 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 ]; }; } From 1f6ce17b6d6e41e3a68cffe54442aff985fd49c9 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:09:02 -0700 Subject: [PATCH 089/123] formats: remove with statements --- pkgs/pkgs-lib/formats.nix | 52 +++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/pkgs/pkgs-lib/formats.nix b/pkgs/pkgs-lib/formats.nix index 8fc808b2646f..c99144d93519 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 From 6d77de48e2c1f4090ec0c6e03ef0d1410039dfda Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:09:11 -0700 Subject: [PATCH 090/123] apacheKafka: remove with statements --- pkgs/servers/apache-kafka/default.nix | 28 +++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/pkgs/servers/apache-kafka/default.nix b/pkgs/servers/apache-kafka/default.nix index 815905f76edb..b69a9d62d81c 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 From d6236f244afa3e6dba0f8d1e00b393dd4e2dcefb Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:09:31 -0700 Subject: [PATCH 091/123] slurm: remove with statements --- pkgs/servers/computing/slurm/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/servers/computing/slurm/default.nix b/pkgs/servers/computing/slurm/default.nix index 0f7e144b0c15..2419ac8c6c71 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 = '' From 82929eb694f194cc359ba37f899c2de95640d1e5 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:09:33 -0700 Subject: [PATCH 092/123] public-inbox: remove with statements --- pkgs/servers/mail/public-inbox/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/servers/mail/public-inbox/default.nix b/pkgs/servers/mail/public-inbox/default.nix index 9918d075a733..05dc98b466d4 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 From 07c453277e6484c7e97c41e2e0be65ead7155e8f Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:10:44 -0700 Subject: [PATCH 093/123] check-{mssql,nwc,ups}-health: remove with statements --- .../monitoring/plugins/labs_consol_de.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/servers/monitoring/plugins/labs_consol_de.nix b/pkgs/servers/monitoring/plugins/labs_consol_de.nix index b30fd4b27577..255fd01f71f2 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; }; }; From 31d91e9af647d719115d8a161b1bb3e95016f61d Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:10:54 -0700 Subject: [PATCH 094/123] sphinxsearch: remove with statements --- pkgs/servers/search/sphinxsearch/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/servers/search/sphinxsearch/default.nix b/pkgs/servers/search/sphinxsearch/default.nix index 33725697d799..0b34c1f44a8f 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" From 463a5e7c03ce739eca5217d3fa9f3a4309bbbb47 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:10:57 -0700 Subject: [PATCH 095/123] trickster: remove with statements --- pkgs/servers/trickster/trickster.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/trickster/trickster.nix b/pkgs/servers/trickster/trickster.nix index d11144a8359a..2f0a3b60f217 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}}"; From 2cc74f92a007b3b9b8b55bf78b4120062f2fb16f Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:11:28 -0700 Subject: [PATCH 096/123] xorg: remove with statements in overrides --- pkgs/servers/x11/xorg/overrides.nix | 53 ++++++++++++++--------------- 1 file changed, 25 insertions(+), 28 deletions(-) diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix index e9dd62f4168f..b3eb0e74dc68 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 // From 9ef28332db9b1127258f54329aca52bc4cd15a5a Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:11:30 -0700 Subject: [PATCH 097/123] fish: remove with statements --- pkgs/shells/fish/default.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/shells/fish/default.nix b/pkgs/shells/fish/default.nix index 921e0fc6d7fe..73065cb380fd 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 < Date: Fri, 16 Aug 2024 14:11:32 -0700 Subject: [PATCH 098/123] stdenv: remove with statements --- pkgs/stdenv/linux/default.nix | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/pkgs/stdenv/linux/default.nix b/pkgs/stdenv/linux/default.nix index a81ccfeb1188..c5e0498de66a 100644 --- a/pkgs/stdenv/linux/default.nix +++ b/pkgs/stdenv/linux/default.nix @@ -500,7 +500,7 @@ in assert isFromBootstrapFiles prevStage.coreutils; assert isFromBootstrapFiles prevStage.gnugrep; assert isBuiltByNixpkgsCompiler prevStage.patchelf; - assert lib.all isBuiltByNixpkgsCompiler (with prevStage; [ gmp isl_0_20 libmpc mpfr ]); + assert lib.all isBuiltByNixpkgsCompiler [ prevStage.gmp prevStage.isl_0_20 prevStage.libmpc prevStage.mpfr ]; stageFun prevStage { name = "bootstrap-stage3"; @@ -634,19 +634,24 @@ in disallowedRequisites = [ bootstrapTools.out ]; # Mainly avoid reference to bootstrap tools - allowedRequisites = with prevStage; with lib; + allowedRequisites = let + inherit (prevStage) gzip bzip2 xz zlib bash binutils coreutils diffutils findutils + gawk gmp gnumake gnused gnutar gnugrep gnupatch patchelf ed file glibc + attr acl libidn2 libunistring linuxHeaders gcc fortify-headers gcc-unwrapped + ; + in # Simple executable tools - concatMap (p: [ (getBin p) (getLib p) ]) [ + lib.concatMap (p: [ (lib.getBin p) (lib.getLib p) ]) [ gzip bzip2 xz bash binutils.bintools coreutils diffutils findutils gawk gmp gnumake gnused gnutar gnugrep gnupatch patchelf ed file ] # Library dependencies - ++ map getLib ( + ++ map lib.getLib ( [ attr acl zlib gnugrep.pcre2 libidn2 libunistring ] ++ lib.optional (gawk.libsigsegv != null) gawk.libsigsegv ) # More complicated cases - ++ (map (x: getOutput x (getLibc prevStage)) [ "out" "dev" "bin" ] ) + ++ (map (x: lib.getOutput x (getLibc prevStage)) [ "out" "dev" "bin" ] ) ++ [ linuxHeaders # propagated from .dev binutils gcc gcc.cc gcc.cc.lib gcc.expand-response-params # != (prevStage.)expand-response-params @@ -654,9 +659,9 @@ in ] ++ lib.optionals (localSystem.libc == "musl") [ fortify-headers ] ++ [ prevStage.updateAutotoolsGnuConfigScriptsHook prevStage.gnu-config ] - ++ (with gcc-unwrapped.passthru; [ - gmp libmpc mpfr isl - ]) + ++ [ + gcc-unwrapped.gmp gcc-unwrapped.libmpc gcc-unwrapped.mpfr gcc-unwrapped.isl + ] ; overrides = self: super: { From abcb8ef242d2812d14fd8d0b07e157ff34d87e39 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:15:23 -0700 Subject: [PATCH 099/123] tests.texlive: remove with statements --- pkgs/test/texlive/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/test/texlive/default.nix b/pkgs/test/texlive/default.nix index e363b5776e89..c142623233ac 100644 --- a/pkgs/test/texlive/default.nix +++ b/pkgs/test/texlive/default.nix @@ -190,7 +190,7 @@ rec { texdoc = runCommand "texlive-test-texdoc" { nativeBuildInputs = [ - (texlive.withPackages (ps: with ps; [ luatex ps.texdoc ps.texdoc.texdoc ])) + (texlive.withPackages (ps: [ ps.luatex ps.texdoc ps.texdoc.texdoc ])) ]; } '' texdoc --version @@ -668,14 +668,14 @@ rec { # verify that all fixed hashes are present # this is effectively an eval-time assertion, converted into a derivation for # ease of testing - fixedHashes = with lib; let + fixedHashes = let fods = lib.concatMap - (p: lib.optional (p ? tex && isDerivation p.tex) p.tex + (p: lib.optional (p ? tex && lib.isDerivation p.tex) p.tex ++ lib.optional (p ? texdoc) p.texdoc ++ lib.optional (p ? texsource) p.texsource ++ lib.optional (p ? tlpkg) p.tlpkg) - (attrValues texlive.pkgs); - errorText = concatMapStrings (p: optionalString (! p ? outputHash) "${p.pname}-${p.tlOutputName} does not have a fixed output hash\n") fods; + (lib.attrValues texlive.pkgs); + errorText = lib.concatMapStrings (p: lib.optionalString (! p ? outputHash) "${p.pname}-${p.tlOutputName} does not have a fixed output hash\n") fods; in runCommand "texlive-test-fixed-hashes" { inherit errorText; passAsFile = [ "errorText" ]; From 60f995275a179d2a3d71544b989c4bd42243b688 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:15:31 -0700 Subject: [PATCH 100/123] xnotify: remove with statements --- pkgs/tools/X11/xnotify/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/X11/xnotify/default.nix b/pkgs/tools/X11/xnotify/default.nix index 017835cbc4b6..8d2018e7a374 100644 --- a/pkgs/tools/X11/xnotify/default.nix +++ b/pkgs/tools/X11/xnotify/default.nix @@ -29,13 +29,13 @@ stdenv.mkDerivation rec { libXinerama ]; - postPatch = with lib; + postPatch = let configFile = - if isDerivation conf || builtins.isPath conf + if lib.isDerivation conf || builtins.isPath conf then conf else writeText "config.h" conf; in - optionalString (conf != null) "cp ${configFile} config.h"; + lib.optionalString (conf != null) "cp ${configFile} config.h"; makeFlags = [ "PREFIX=$(out)" ]; From fada673a227ccfd040396683636a4e9de3f2372a Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:15:34 -0700 Subject: [PATCH 101/123] xprompt: remove with statements --- pkgs/tools/X11/xprompt/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/X11/xprompt/default.nix b/pkgs/tools/X11/xprompt/default.nix index 818f5cda362d..e62afb988d75 100644 --- a/pkgs/tools/X11/xprompt/default.nix +++ b/pkgs/tools/X11/xprompt/default.nix @@ -28,13 +28,13 @@ stdenv.mkDerivation rec { libXinerama ]; - postPatch = with lib; + postPatch = let configFile = - if isDerivation conf || builtins.isPath conf + if lib.isDerivation conf || builtins.isPath conf then conf else writeText "config.h" conf; in - optionalString (conf != null) "cp ${configFile} config.h"; + lib.optionalString (conf != null) "cp ${configFile} config.h"; makeFlags = [ "CC:=$(CC)" "PREFIX=$(out)" ]; From 6245f7868f5d19e562ea6f25746b16fc68025f41 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:15:36 -0700 Subject: [PATCH 102/123] ceph: remove with statements --- pkgs/tools/filesystems/ceph/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/filesystems/ceph/default.nix b/pkgs/tools/filesystems/ceph/default.nix index 22363fbabbd4..3a9c513e566d 100644 --- a/pkgs/tools/filesystems/ceph/default.nix +++ b/pkgs/tools/filesystems/ceph/default.nix @@ -138,11 +138,11 @@ let none = [ ]; }; - getMeta = description: with lib; { + getMeta = description: { homepage = "https://ceph.io/en/"; inherit description; - license = with licenses; [ lgpl21 gpl2Only bsd3 mit publicDomain ]; - maintainers = with maintainers; [ adev ak johanot krav ]; + license = with lib.licenses; [ lgpl21 gpl2Only bsd3 mit publicDomain ]; + maintainers = with lib.maintainers; [ adev ak johanot krav ]; platforms = [ "x86_64-linux" "aarch64-linux" ]; }; From 31fa793eacbb08ca7136f8791cb9262da7a0cdf6 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:15:52 -0700 Subject: [PATCH 103/123] mergerfs-tools: remove with statements --- pkgs/tools/filesystems/mergerfs/tools.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/filesystems/mergerfs/tools.nix b/pkgs/tools/filesystems/mergerfs/tools.nix index f5235239103d..2708328bf4d6 100644 --- a/pkgs/tools/filesystems/mergerfs/tools.nix +++ b/pkgs/tools/filesystems/mergerfs/tools.nix @@ -20,10 +20,10 @@ stdenv.mkDerivation rec { "PREFIX=${placeholder "out"}" ]; - postInstall = with lib; '' - wrapProgram $out/bin/mergerfs.balance --prefix PATH : ${makeBinPath [ rsync ]} - wrapProgram $out/bin/mergerfs.dup --prefix PATH : ${makeBinPath [ rsync ]} - wrapProgram $out/bin/mergerfs.mktrash --prefix PATH : ${makeBinPath [ python3.pkgs.xattr ]} + postInstall = '' + wrapProgram $out/bin/mergerfs.balance --prefix PATH : ${lib.makeBinPath [ rsync ]} + wrapProgram $out/bin/mergerfs.dup --prefix PATH : ${lib.makeBinPath [ rsync ]} + wrapProgram $out/bin/mergerfs.mktrash --prefix PATH : ${lib.makeBinPath [ python3.pkgs.xattr ]} ''; meta = with lib; { From 092a9b8df196aa25caed532363d9fd977d5f42d3 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:15:54 -0700 Subject: [PATCH 104/123] mtdutils: remove with statements --- pkgs/tools/filesystems/mtdutils/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/filesystems/mtdutils/default.nix b/pkgs/tools/filesystems/mtdutils/default.nix index 641b50d43506..80ce88836e34 100644 --- a/pkgs/tools/filesystems/mtdutils/default.nix +++ b/pkgs/tools/filesystems/mtdutils/default.nix @@ -15,9 +15,9 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - configureFlags = with lib; [ - (enableFeature doCheck "unit-tests") - (enableFeature doCheck "tests") + configureFlags = [ + (lib.enableFeature doCheck "unit-tests") + (lib.enableFeature doCheck "tests") ]; makeFlags = [ From ebdb16362ddfe44feac7d5456bdaebe14ef7e4da Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:16:33 -0700 Subject: [PATCH 105/123] diagrams-builder: remove with statements --- pkgs/tools/graphics/diagrams-builder/default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkgs/tools/graphics/diagrams-builder/default.nix b/pkgs/tools/graphics/diagrams-builder/default.nix index b88e4e517364..d066657ff0eb 100644 --- a/pkgs/tools/graphics/diagrams-builder/default.nix +++ b/pkgs/tools/graphics/diagrams-builder/default.nix @@ -35,8 +35,7 @@ stdenv.mkDerivation { nativeBuildInputs = [ makeWrapper ]; - buildCommand = with lib; - concatStringsSep "\n" (map exeWrapper backends); + buildCommand = lib.concatStringsSep "\n" (map exeWrapper backends); # Will be faster to build the wrapper locally then to fetch it from a binary cache. preferLocalBuild = true; From 7173c946c744adb8763d41d3096c5c1b359da283 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:16:36 -0700 Subject: [PATCH 106/123] fim: remove with statements --- pkgs/tools/graphics/fim/default.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/tools/graphics/fim/default.nix b/pkgs/tools/graphics/fim/default.nix index 45b03319fa2a..c61d5f832d95 100644 --- a/pkgs/tools/graphics/fim/default.nix +++ b/pkgs/tools/graphics/fim/default.nix @@ -25,15 +25,15 @@ gcc9Stdenv.mkDerivation rec { nativeBuildInputs = [ autoconf automake pkg-config ]; - buildInputs = with lib; + buildInputs = [ perl flex bison readline libexif ] - ++ optional x11Support SDL - ++ optional svgSupport inkscape - ++ optional asciiArtSupport aalib - ++ optional gifSupport giflib - ++ optional tiffSupport libtiff - ++ optional jpegSupport libjpeg - ++ optional pngSupport libpng; + ++ lib.optional x11Support SDL + ++ lib.optional svgSupport inkscape + ++ lib.optional asciiArtSupport aalib + ++ lib.optional gifSupport giflib + ++ lib.optional tiffSupport libtiff + ++ lib.optional jpegSupport libjpeg + ++ lib.optional pngSupport libpng; env.NIX_CFLAGS_COMPILE = lib.optionalString x11Support "-lSDL"; From 6e44d53415f268f55c8402f5c8e1d72304143a90 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:16:38 -0700 Subject: [PATCH 107/123] coreboot-utils: remove with statements --- pkgs/tools/misc/coreboot-utils/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/misc/coreboot-utils/default.nix b/pkgs/tools/misc/coreboot-utils/default.nix index 0410a23221ea..69be5edc3f64 100644 --- a/pkgs/tools/misc/coreboot-utils/default.nix +++ b/pkgs/tools/misc/coreboot-utils/default.nix @@ -3,12 +3,12 @@ let version = "24.05"; - commonMeta = with lib; { + commonMeta = { description = "Various coreboot-related tools"; homepage = "https://www.coreboot.org"; - license = with licenses; [ gpl2Only gpl2Plus ]; - maintainers = with maintainers; [ felixsinger jmbaur ]; - platforms = platforms.linux; + license = with lib.licenses; [ gpl2Only gpl2Plus ]; + maintainers = with lib.maintainers; [ felixsinger jmbaur ]; + platforms = lib.platforms.linux; }; generic = { pname, path ? "util/${pname}", ... }@args: stdenv.mkDerivation ({ From 85878e1127d26125d52c18fe7f6ac07d5f55fb9b Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:17:33 -0700 Subject: [PATCH 108/123] ultrastar-creator: remove with statements --- pkgs/tools/misc/ultrastar-creator/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/misc/ultrastar-creator/default.nix b/pkgs/tools/misc/ultrastar-creator/default.nix index 547d0a86f957..bc39b7ed76c1 100644 --- a/pkgs/tools/misc/ultrastar-creator/default.nix +++ b/pkgs/tools/misc/ultrastar-creator/default.nix @@ -17,15 +17,15 @@ mkDerivation { sha256 = "1rzz04l7s7pxj74xam0cxlq569lfpgig35kpbsplq531d4007pc9"; }; - postPatch = with lib; '' + postPatch = '' # we don’t want prebuild binaries checked into version control! rm -rf lib include sed -e "s|DESTDIR =.*$|DESTDIR = $out/bin|" \ -e 's|-L".*unix"||' \ -e "/QMAKE_POST_LINK/d" \ - -e "s|../include/bass|${getLib libbass}/include|g" \ - -e "s|../include/bass_fx|${getLib libbass_fx}/include|g" \ - -e "s|../include/taglib|${getLib taglib}/include|g" \ + -e "s|../include/bass|${lib.getLib libbass}/include|g" \ + -e "s|../include/bass_fx|${lib.getLib libbass_fx}/include|g" \ + -e "s|../include/taglib|${lib.getLib taglib}/include|g" \ -i src/UltraStar-Creator.pro ''; From 5ac2cd5911836d88f5b270d30abff9b473ff0915 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:17:36 -0700 Subject: [PATCH 109/123] ultrastar-manager: remove with statements --- pkgs/tools/misc/ultrastar-manager/default.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/tools/misc/ultrastar-manager/default.nix b/pkgs/tools/misc/ultrastar-manager/default.nix index 4921c1de397e..d1d983bc10da 100644 --- a/pkgs/tools/misc/ultrastar-manager/default.nix +++ b/pkgs/tools/misc/ultrastar-manager/default.nix @@ -30,21 +30,21 @@ let dontInstall = true; - patchPhase = with lib; '' + patchPhase = '' # we don’t want prebuild binaries checked into version control! rm -rf lib include # fix up main project file sed -e 's|-L.*unix.*lbass.*$|-lbass|' \ -e "/QMAKE_POST_LINK/d" \ - -e "s|../include/bass|${getLib libbass}/include|g" \ - -e "s|../include/taglib|${getLib taglib}/include|g" \ - -e "s|../include/mediainfo|${getLib libmediainfo}/include|g" \ + -e "s|../include/bass|${lib.getLib libbass}/include|g" \ + -e "s|../include/taglib|${lib.getLib taglib}/include|g" \ + -e "s|../include/mediainfo|${lib.getLib libmediainfo}/include|g" \ -i src/UltraStar-Manager.pro # if more plugins start depending on ../../../include, # it should be abstracted out for all .pro files - sed -e "s|../../../include/taglib|${getLib taglib}/include/taglib|g" \ + sed -e "s|../../../include/taglib|${lib.getLib taglib}/include/taglib|g" \ -i src/plugins/audiotag/audiotag.pro mkdir $out From 6c28c49df23201c49d5e2a6fa487d37c3340741b Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:18:03 -0700 Subject: [PATCH 110/123] curl: remove with statements --- pkgs/tools/networking/curl/default.nix | 46 +++++++++++++------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/pkgs/tools/networking/curl/default.nix b/pkgs/tools/networking/curl/default.nix index 06130e8add34..1cf50ac79c43 100644 --- a/pkgs/tools/networking/curl/default.nix +++ b/pkgs/tools/networking/curl/default.nix @@ -78,25 +78,25 @@ stdenv.mkDerivation (finalAttrs: { # Zlib and OpenSSL must be propagated because `libcurl.la' contains # "-lz -lssl", which aren't necessary direct build inputs of # applications that use Curl. - propagatedBuildInputs = with lib; - optional brotliSupport brotli ++ - optional c-aresSupport c-aresMinimal ++ - optional gnutlsSupport gnutls ++ - optional gsaslSupport gsasl ++ - optional gssSupport libkrb5 ++ - optional http2Support nghttp2 ++ - optionals http3Support [ nghttp3 ngtcp2 ] ++ - optional idnSupport libidn2 ++ - optional ldapSupport openldap ++ - optional opensslSupport openssl ++ - optional pslSupport libpsl ++ - optional rtmpSupport rtmpdump ++ - optional scpSupport libssh2 ++ - optional wolfsslSupport wolfssl ++ - optional rustlsSupport rustls-ffi ++ - optional zlibSupport zlib ++ - optional zstdSupport zstd ++ - optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ + propagatedBuildInputs = + lib.optional brotliSupport brotli ++ + lib.optional c-aresSupport c-aresMinimal ++ + lib.optional gnutlsSupport gnutls ++ + lib.optional gsaslSupport gsasl ++ + lib.optional gssSupport libkrb5 ++ + lib.optional http2Support nghttp2 ++ + lib.optionals http3Support [ nghttp3 ngtcp2 ] ++ + lib.optional idnSupport libidn2 ++ + lib.optional ldapSupport openldap ++ + lib.optional opensslSupport openssl ++ + lib.optional pslSupport libpsl ++ + lib.optional rtmpSupport rtmpdump ++ + lib.optional scpSupport libssh2 ++ + lib.optional wolfsslSupport wolfssl ++ + lib.optional rustlsSupport rustls-ffi ++ + lib.optional zlibSupport zlib ++ + lib.optional zstdSupport zstd ++ + lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ CoreFoundation CoreServices SystemConfiguration @@ -208,13 +208,13 @@ stdenv.mkDerivation (finalAttrs: { }; }; - meta = with lib; { + meta = { changelog = "https://curl.se/ch/${finalAttrs.version}.html"; description = "Command line tool for transferring files with URL syntax"; homepage = "https://curl.se/"; - license = licenses.curl; - maintainers = with maintainers; [ lovek323 ]; - platforms = platforms.all; + license = lib.licenses.curl; + maintainers = with lib.maintainers; [ lovek323 ]; + platforms = lib.platforms.all; # Fails to link against static brotli or gss broken = stdenv.hostPlatform.isStatic && (brotliSupport || gssSupport || stdenv.hostPlatform.system == "x86_64-darwin"); pkgConfigModules = [ "libcurl" ]; From 4377a792d4ed629d24f9569df7c0af68dc517847 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:18:07 -0700 Subject: [PATCH 111/123] linux-router: remove with statements --- pkgs/tools/networking/linux-router/default.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/tools/networking/linux-router/default.nix b/pkgs/tools/networking/linux-router/default.nix index b5cc9ef6f5dd..728954cf403e 100644 --- a/pkgs/tools/networking/linux-router/default.nix +++ b/pkgs/tools/networking/linux-router/default.nix @@ -55,15 +55,15 @@ stdenv.mkDerivation rec { dontBuild = true; - installPhase = with lib; let - binPath = makeBinPath ([ procps iproute2 getopt bash dnsmasq + installPhase = let + binPath = lib.makeBinPath ([ procps iproute2 getopt bash dnsmasq iptables coreutils which flock gnugrep gnused gawk ] - ++ optional useNetworkManager networkmanager - ++ optional useWifiDependencies hostapd - ++ optional useWifiDependencies iw - ++ optional (useWifiDependencies && useWirelessTools) wirelesstools - ++ optional (useWifiDependencies && useHaveged) haveged - ++ optional (useWifiDependencies && useQrencode) qrencode); + ++ lib.optional useNetworkManager networkmanager + ++ lib.optional useWifiDependencies hostapd + ++ lib.optional useWifiDependencies iw + ++ lib.optional (useWifiDependencies && useWirelessTools) wirelesstools + ++ lib.optional (useWifiDependencies && useHaveged) haveged + ++ lib.optional (useWifiDependencies && useQrencode) qrencode); in '' mkdir -p $out/bin/ $out/.bin-wrapped From a5d230f94227e972c796555d24e416536223e8bc Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:18:33 -0700 Subject: [PATCH 112/123] ghidra: remove with statements --- pkgs/tools/security/ghidra/build-extension.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/security/ghidra/build-extension.nix b/pkgs/tools/security/ghidra/build-extension.nix index b34f67d34b56..652b7bcdf8bf 100644 --- a/pkgs/tools/security/ghidra/build-extension.nix +++ b/pkgs/tools/security/ghidra/build-extension.nix @@ -11,10 +11,10 @@ let metaCommon = oldMeta: oldMeta - // (with lib; { - maintainers = (oldMeta.maintainers or [ ]) ++ (with maintainers; [ vringar ]); + // { + maintainers = (oldMeta.maintainers or [ ]) ++ (with lib.maintainers; [ vringar ]); platforms = oldMeta.platforms or ghidra.meta.platforms; - }); + }; buildGhidraExtension = { From 3eb82a79e45db61ec05622fe3e2880bcc4005ca1 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:18:42 -0700 Subject: [PATCH 113/123] pass: remove with statements --- pkgs/tools/security/pass/default.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/tools/security/pass/default.nix b/pkgs/tools/security/pass/default.nix index 735d025e2ea6..748ec2ccf3bf 100644 --- a/pkgs/tools/security/pass/default.nix +++ b/pkgs/tools/security/pass/default.nix @@ -76,7 +76,7 @@ stdenv.mkDerivation rec { cp "contrib/dmenu/passmenu" "$out/bin/" ''; - wrapperPath = with lib; makeBinPath ([ + wrapperPath = lib.makeBinPath ([ coreutils findutils getopt @@ -89,11 +89,11 @@ stdenv.mkDerivation rec { openssh procps qrencode - ] ++ optional stdenv.isDarwin openssl - ++ optional x11Support xclip - ++ optional waylandSupport wl-clipboard - ++ optionals (waylandSupport && dmenuSupport) [ ydotool dmenu-wayland ] - ++ optionals (x11Support && dmenuSupport) [ xdotool dmenu ] + ] ++ lib.optional stdenv.isDarwin openssl + ++ lib.optional x11Support xclip + ++ lib.optional waylandSupport wl-clipboard + ++ lib.optionals (waylandSupport && dmenuSupport) [ ydotool dmenu-wayland ] + ++ lib.optionals (x11Support && dmenuSupport) [ xdotool dmenu ] ); postFixup = '' From 2e0ccc25d9c6fa9ce9b2a472e6fe7e706296fcd4 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:19:05 -0700 Subject: [PATCH 114/123] vaultwarden: remove with statements --- pkgs/tools/security/vaultwarden/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/security/vaultwarden/default.nix b/pkgs/tools/security/vaultwarden/default.nix index 0487f82e1876..137f9e6c9564 100644 --- a/pkgs/tools/security/vaultwarden/default.nix +++ b/pkgs/tools/security/vaultwarden/default.nix @@ -24,10 +24,10 @@ rustPlatform.buildRustPackage rec { env.VW_VERSION = version; nativeBuildInputs = [ pkg-config ]; - buildInputs = with lib; [ openssl ] - ++ optionals stdenv.isDarwin [ libiconv Security CoreServices SystemConfiguration ] - ++ optional (dbBackend == "mysql") libmysqlclient - ++ optional (dbBackend == "postgresql") postgresql; + buildInputs = [ openssl ] + ++ lib.optionals stdenv.isDarwin [ libiconv Security CoreServices SystemConfiguration ] + ++ lib.optional (dbBackend == "mysql") libmysqlclient + ++ lib.optional (dbBackend == "postgresql") postgresql; buildFeatures = dbBackend; From 3fb954dd4feb19640ad6c443e1a3ecb61a7dd6b0 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:19:07 -0700 Subject: [PATCH 115/123] monit: remove with statements --- pkgs/tools/system/monit/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/system/monit/default.nix b/pkgs/tools/system/monit/default.nix index 49db2fae93d9..ec7396ca3eb5 100644 --- a/pkgs/tools/system/monit/default.nix +++ b/pkgs/tools/system/monit/default.nix @@ -49,7 +49,7 @@ stdenv.mkDerivation rec { description = "Monitoring system"; license = lib.licenses.agpl3Plus; maintainers = with lib.maintainers; [ raskin wmertens ryantm ]; - platforms = with lib; platforms.linux ++ platforms.darwin; + platforms = lib.platforms.linux ++ lib.platforms.darwin; mainProgram = "monit"; }; } From f1ab9757fd6761df995fed469f2a3d44b25085e1 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:19:09 -0700 Subject: [PATCH 116/123] nvtop: remove with statements --- pkgs/tools/system/nvtop/build-nvtop.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/system/nvtop/build-nvtop.nix b/pkgs/tools/system/nvtop/build-nvtop.nix index 0feada287d87..f1f855b25383 100644 --- a/pkgs/tools/system/nvtop/build-nvtop.nix +++ b/pkgs/tools/system/nvtop/build-nvtop.nix @@ -53,9 +53,9 @@ stdenv.mkDerivation (finalAttrs: { ]; nativeBuildInputs = [ cmake gtest ] ++ lib.optional nvidia addDriverRunpath; - buildInputs = with lib; [ ncurses udev ] - ++ optional nvidia cudatoolkit - ++ optional needDrm libdrm + buildInputs = [ ncurses udev ] + ++ lib.optional nvidia cudatoolkit + ++ lib.optional needDrm libdrm ; # this helps cmake to find From 8e8bfb1443184f41a6826086197de867a5981639 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:19:15 -0700 Subject: [PATCH 117/123] rofi-systemd: remove with statements --- pkgs/tools/system/rofi-systemd/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/system/rofi-systemd/default.nix b/pkgs/tools/system/rofi-systemd/default.nix index b8be1adea984..9241a066e713 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 From 89bced95af9daacad013a333f334470e2722ff0d Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:19:17 -0700 Subject: [PATCH 118/123] rsyslog: remove with statements --- pkgs/tools/system/rsyslog/default.nix | 144 +++++++++++++------------- 1 file changed, 72 insertions(+), 72 deletions(-) diff --git a/pkgs/tools/system/rsyslog/default.nix b/pkgs/tools/system/rsyslog/default.nix index 8479e6840a53..a14b1d38e428 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 = [ ]; }; } From a77b1b3bc847da13f5c44219d400dc7d723be01a Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:19:18 -0700 Subject: [PATCH 119/123] asciidoc: remove with statements --- pkgs/tools/typesetting/asciidoc/default.nix | 33 ++++++++++----------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/pkgs/tools/typesetting/asciidoc/default.nix b/pkgs/tools/typesetting/asciidoc/default.nix index 1a7fde588c75..24e1c6bc1a30 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 ]; }; } From 65ec5b64ece70e4ac3a72a03c0a3e7aa6b0e68e0 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:19:38 -0700 Subject: [PATCH 120/123] texlive: remove with statements --- pkgs/tools/typesetting/tex/texlive/default.nix | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/tools/typesetting/tex/texlive/default.nix b/pkgs/tools/typesetting/tex/texlive/default.nix index e84f89cdd6af..acb4a20314ed 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; From ba93ec21612102f61dd3b19d1ff8efa84d707947 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:19:55 -0700 Subject: [PATCH 121/123] pkgs: remove with statements in aliases --- pkgs/top-level/aliases.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index a6403e6792eb..694dd8bd6f88 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 From 4363ce78b52fe40421e9da0545744e549f356dbc Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:20:31 -0700 Subject: [PATCH 122/123] theLoungePlugins: remove with statements --- pkgs/top-level/all-packages.nix | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 25a9db99e50e..20cebb8c7b7e 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 { }; From 086aa4f3a91c7ed2ba6dbaf8cbb808b3081d0b6d Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Fri, 16 Aug 2024 14:20:50 -0700 Subject: [PATCH 123/123] python3Packages: remove with statements in aliases --- pkgs/top-level/python-aliases.nix | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/pkgs/top-level/python-aliases.nix b/pkgs/top-level/python-aliases.nix index 65c3957f9504..cea0900e2e34 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