about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorShawn8901 <shawn8901@googlemail.com>2023-01-21 23:06:40 +0100
committerShawn8901 <shawn8901@googlemail.com>2023-01-21 23:11:12 +0100
commit3866fa44a7f9fae7c83e53e7eea295e1f9212055 (patch)
tree516a1bc6c163a49132c65fb1a193757b103706b4 /pkgs
parent66ed9c811ea3f2a49443b8788b07244d9d982348 (diff)
treewide: remove global with lib; in pkgs/{audio,blockchain,editors}
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/audio/asunder/default.nix18
-rw-r--r--pkgs/applications/audio/carla/default.nix10
-rw-r--r--pkgs/applications/audio/cmus/default.nix8
-rw-r--r--pkgs/applications/audio/crip/default.nix8
-rw-r--r--pkgs/applications/audio/fmit/default.nix16
-rw-r--r--pkgs/applications/audio/goattracker/default.nix15
-rw-r--r--pkgs/applications/audio/musescore/darwin.nix6
-rw-r--r--pkgs/applications/audio/ncmpc/default.nix6
-rw-r--r--pkgs/applications/audio/renoise/default.nix6
-rw-r--r--pkgs/applications/blockchains/bitcoin-knots/default.nix23
-rw-r--r--pkgs/applications/blockchains/bitcoin-unlimited/default.nix14
-rw-r--r--pkgs/applications/blockchains/bitcoin/default.nix25
-rw-r--r--pkgs/applications/blockchains/btcdeb/default.nix3
-rw-r--r--pkgs/applications/blockchains/digibyte/default.nix12
-rw-r--r--pkgs/applications/blockchains/dogecoin/default.nix31
-rw-r--r--pkgs/applications/blockchains/elements/default.nix23
-rw-r--r--pkgs/applications/blockchains/litecoin/default.nix12
-rw-r--r--pkgs/applications/blockchains/particl-core/default.nix6
-rw-r--r--pkgs/applications/blockchains/vertcoin/default.nix12
-rw-r--r--pkgs/applications/blockchains/wownero/default.nix3
-rw-r--r--pkgs/applications/display-managers/lightdm/default.nix8
-rw-r--r--pkgs/applications/editors/codeblocks/default.nix14
-rw-r--r--pkgs/applications/editors/howl/default.nix4
-rw-r--r--pkgs/applications/editors/jetbrains/default.nix12
-rw-r--r--pkgs/applications/editors/jetbrains/linux.nix8
-rw-r--r--pkgs/applications/editors/jucipp/default.nix4
-rw-r--r--pkgs/applications/editors/kakoune/default.nix4
-rw-r--r--pkgs/applications/editors/nano/default.nix6
-rw-r--r--pkgs/applications/editors/neovim/wrapper.nix18
-rw-r--r--pkgs/applications/editors/rstudio/default.nix2
-rw-r--r--pkgs/applications/editors/vscode/extensions/ms-vsliveshare-vsliveshare/default.nix6
31 files changed, 145 insertions, 198 deletions
diff --git a/pkgs/applications/audio/asunder/default.nix b/pkgs/applications/audio/asunder/default.nix
index c3cba87e300c7..d6efada907632 100644
--- a/pkgs/applications/audio/asunder/default.nix
+++ b/pkgs/applications/audio/asunder/default.nix
@@ -9,8 +9,6 @@
 #, aacSupport ? false, TODO: neroAacEnc
 }:
 
-with lib;
-
 stdenv.mkDerivation rec {
   version = "2.9.7";
   pname = "asunder";
@@ -23,20 +21,20 @@ stdenv.mkDerivation rec {
   buildInputs = [ gtk2 libcddb ];
 
   runtimeDeps =
-    optional mp3Support lame ++
-    optional oggSupport vorbis-tools ++
-    optional flacSupport flac ++
-    optional opusSupport opusTools ++
-    optional wavpackSupport wavpack ++
-    optional monkeysAudioSupport monkeysAudio ++
+    lib.optional mp3Support lame ++
+    lib.optional oggSupport vorbis-tools ++
+    lib.optional flacSupport flac ++
+    lib.optional opusSupport opusTools ++
+    lib.optional wavpackSupport wavpack ++
+    lib.optional monkeysAudioSupport monkeysAudio ++
     [ cdparanoia ];
 
   postInstall = ''
     wrapProgram "$out/bin/asunder" \
-      --prefix PATH : "${makeBinPath runtimeDeps}"
+      --prefix PATH : "${lib.makeBinPath runtimeDeps}"
   '';
 
-  meta = {
+  meta = with lib; {
     description = "A graphical Audio CD ripper and encoder for Linux";
     homepage = "http://littlesvr.ca/asunder/index.php";
     license = licenses.gpl2;
diff --git a/pkgs/applications/audio/carla/default.nix b/pkgs/applications/audio/carla/default.nix
index 82259d563ce90..70ef1ebdf6448 100644
--- a/pkgs/applications/audio/carla/default.nix
+++ b/pkgs/applications/audio/carla/default.nix
@@ -5,8 +5,6 @@
   withGtk2 ? true, gtk2 ? null,
   withGtk3 ? true, gtk3 ? null }:
 
-with lib;
-
 assert withFrontend -> python3Packages ? pyqt5;
 assert withQt -> qtbase != null;
 assert withQt -> wrapQtAppsHook != null;
@@ -30,13 +28,13 @@ stdenv.mkDerivation rec {
 
   pythonPath = with python3Packages; [
     rdflib pyliblo
-  ] ++ optional withFrontend pyqt5;
+  ] ++ lib.optional withFrontend pyqt5;
 
   buildInputs = [
     file liblo alsa-lib fluidsynth jack2 libpulseaudio libsndfile
-  ] ++ optional withQt qtbase
-    ++ optional withGtk2 gtk2
-    ++ optional withGtk3 gtk3;
+  ] ++ lib.optional withQt qtbase
+    ++ lib.optional withGtk2 gtk2
+    ++ lib.optional withGtk3 gtk3;
 
   propagatedBuildInputs = pythonPath;
 
diff --git a/pkgs/applications/audio/cmus/default.nix b/pkgs/applications/audio/cmus/default.nix
index 66c172ff01d8d..61ff53aa1d75e 100644
--- a/pkgs/applications/audio/cmus/default.nix
+++ b/pkgs/applications/audio/cmus/default.nix
@@ -39,8 +39,6 @@
 #, vtxSupport ? true, libayemu ? null
 }:
 
-with lib;
-
 assert samplerateSupport -> jackSupport;
 
 # vorbis and tremor are mutually exclusive
@@ -113,16 +111,16 @@ stdenv.mkDerivation rec {
 
   patches = [ ./option-debugging.patch ];
 
-  configurePhase = "./configure " + concatStringsSep " " ([
+  configurePhase = "./configure " + lib.concatStringsSep " " ([
     "prefix=$out"
     "CONFIG_WAV=y"
-  ] ++ concatMap (a: a.flags) opts);
+  ] ++ lib.concatMap (a: a.flags) opts);
 
   nativeBuildInputs = [ pkg-config ];
   buildInputs = [ ncurses ]
     ++ lib.optional stdenv.cc.isClang clangGCC
     ++ lib.optionals stdenv.isDarwin [ libiconv CoreAudio AudioUnit VideoToolbox ]
-    ++ flatten (concatMap (a: a.deps) opts);
+    ++ lib.flatten (lib.concatMap (a: a.deps) opts);
 
   makeFlags = [ "LD=$(CC)" ];
 
diff --git a/pkgs/applications/audio/crip/default.nix b/pkgs/applications/audio/crip/default.nix
index d41ebed096064..f837ad6603e3e 100644
--- a/pkgs/applications/audio/crip/default.nix
+++ b/pkgs/applications/audio/crip/default.nix
@@ -16,8 +16,6 @@
 , which
 }:
 
-with lib;
-
 stdenv.mkDerivation rec {
   pname = "crip";
   version = "3.9";
@@ -29,7 +27,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ perlPackages.perl perlPackages.CDDB_get ];
   nativeBuildInputs = [ makeWrapper ];
 
-  toolDeps = makeBinPath [
+  toolDeps = lib.makeBinPath [
     cdparanoia
     coreutils
     eject
@@ -46,7 +44,7 @@ stdenv.mkDerivation rec {
   installPhase = ''
     mkdir -p $out/bin/
 
-    for script in ${escapeShellArgs scripts}; do
+    for script in ${lib.escapeShellArgs scripts}; do
       cp $script $out/bin/
 
       substituteInPlace $out/bin/$script \
@@ -63,6 +61,6 @@ stdenv.mkDerivation rec {
     description = "Terminal-based ripper/encoder/tagger tool for creating Ogg Vorbis/FLAC files";
     license = lib.licenses.gpl1Only;
     platforms = lib.platforms.linux;
-    maintainers = [ maintainers.endgame ];
+    maintainers = [ lib.maintainers.endgame ];
   };
 }
diff --git a/pkgs/applications/audio/fmit/default.nix b/pkgs/applications/audio/fmit/default.nix
index 7e376c89d36a6..7fcfeb32fd3a2 100644
--- a/pkgs/applications/audio/fmit/default.nix
+++ b/pkgs/applications/audio/fmit/default.nix
@@ -7,8 +7,6 @@ assert alsaSupport -> alsa-lib != null;
 assert jackSupport -> libjack2 != null;
 assert portaudioSupport -> portaudio != null;
 
-with lib;
-
 mkDerivation rec {
   pname = "fmit";
   version = "1.2.14";
@@ -22,9 +20,9 @@ mkDerivation rec {
 
   nativeBuildInputs = [ qmake itstool wrapQtAppsHook ];
   buildInputs = [ fftw qtbase qtmultimedia ]
-    ++ optionals alsaSupport [ alsa-lib ]
-    ++ optionals jackSupport [ libjack2 ]
-    ++ optionals portaudioSupport [ portaudio ];
+    ++ lib.optionals alsaSupport [ alsa-lib ]
+    ++ lib.optionals jackSupport [ libjack2 ]
+    ++ lib.optionals portaudioSupport [ portaudio ];
 
   postPatch = ''
     substituteInPlace fmit.pro --replace '$$FMITVERSIONGITPRO' '${version}'
@@ -32,13 +30,13 @@ mkDerivation rec {
 
   preConfigure = ''
     qmakeFlags="$qmakeFlags \
-      CONFIG+=${optionalString alsaSupport "acs_alsa"} \
-      CONFIG+=${optionalString jackSupport "acs_jack"} \
-      CONFIG+=${optionalString portaudioSupport "acs_portaudio"} \
+      CONFIG+=${lib.optionalString alsaSupport "acs_alsa"} \
+      CONFIG+=${lib.optionalString jackSupport "acs_jack"} \
+      CONFIG+=${lib.optionalString portaudioSupport "acs_portaudio"} \
       PREFIXSHORTCUT=$out"
   '';
 
-  meta = {
+  meta = with lib; {
     description = "Free Musical Instrument Tuner";
     longDescription = ''
       FMIT is a graphical utility for tuning musical instruments, with error
diff --git a/pkgs/applications/audio/goattracker/default.nix b/pkgs/applications/audio/goattracker/default.nix
index 1fb848ae1eda5..b85aa4c0df762 100644
--- a/pkgs/applications/audio/goattracker/default.nix
+++ b/pkgs/applications/audio/goattracker/default.nix
@@ -8,12 +8,11 @@
 , isStereo ? false
 }:
 
-with lib;
 let
-  pname = "goattracker" + optionalString isStereo "-stereo";
+  pname = "goattracker" + lib.optionalString isStereo "-stereo";
   desktopItem = makeDesktopItem {
     name = pname;
-    desktopName = "GoatTracker 2" + optionalString isStereo " Stereo";
+    desktopName = "GoatTracker 2" + lib.optionalString isStereo " Stereo";
     genericName = "Music Tracker";
     exec = if isStereo
       then "gt2stereo"
@@ -30,7 +29,7 @@ in stdenv.mkDerivation rec {
     else "2.76"; # normal
 
   src = fetchurl {
-    url = "mirror://sourceforge/goattracker2/GoatTracker_${version}${optionalString isStereo "_Stereo"}.zip";
+    url = "mirror://sourceforge/goattracker2/GoatTracker_${version}${lib.optionalString isStereo "_Stereo"}.zip";
     sha256 = if isStereo
       then "1hiig2d152sv9kazwz33i56x1c54h5sh21ipkqnp6qlnwj8x1ksy"  # stereo
       else "0d7a3han4jw4bwiba3j87racswaajgl3pj4sb5lawdqdxicv3dn1"; # normal
@@ -63,11 +62,11 @@ in stdenv.mkDerivation rec {
 
   meta = {
     description = "A crossplatform music editor for creating Commodore 64 music. Uses reSID library by Dag Lem and supports alternatively HardSID & CatWeasel devices"
-      + optionalString isStereo " - Stereo version";
+      + lib.optionalString isStereo " - Stereo version";
     homepage = "https://cadaver.github.io/tools.html";
     downloadPage = "https://sourceforge.net/projects/goattracker2/";
-    license = licenses.gpl2Plus;
-    maintainers = with maintainers; [ fgaz ];
-    platforms = platforms.all;
+    license = lib.licenses.gpl2Plus;
+    maintainers = with lib.maintainers; [ fgaz ];
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/applications/audio/musescore/darwin.nix b/pkgs/applications/audio/musescore/darwin.nix
index add56f99d9b38..88b5d3b74c150 100644
--- a/pkgs/applications/audio/musescore/darwin.nix
+++ b/pkgs/applications/audio/musescore/darwin.nix
@@ -5,17 +5,15 @@ let
   appName = "MuseScore ${builtins.head versionComponents}";
 in
 
-with lib;
-
 stdenv.mkDerivation rec {
   pname = "musescore-darwin";
-  version = concatStringsSep "." versionComponents;
+  version = lib.concatStringsSep "." versionComponents;
 
   # The disk image contains the .app and a symlink to /Applications.
   sourceRoot = "${appName}.app";
 
   src = fetchurl {
-    url =  "https://github.com/musescore/MuseScore/releases/download/v${concatStringsSep "." (take 3 versionComponents)}/MuseScore-${version}.dmg";
+    url = "https://github.com/musescore/MuseScore/releases/download/v${lib.concatStringsSep "." (lib.take 3 versionComponents)}/MuseScore-${version}.dmg";
     sha256 = "sha256-lHckfhTTrDzaGwlbnZ5w0O1gMPbRmrmgATIGMY517l0=";
   };
 
diff --git a/pkgs/applications/audio/ncmpc/default.nix b/pkgs/applications/audio/ncmpc/default.nix
index 739d0c3c499ef..870691ae1c3f3 100644
--- a/pkgs/applications/audio/ncmpc/default.nix
+++ b/pkgs/applications/audio/ncmpc/default.nix
@@ -12,8 +12,6 @@
 , pcreSupport ? false, pcre ? null
 }:
 
-with lib;
-
 assert pcreSupport -> pcre != null;
 
 stdenv.mkDerivation rec {
@@ -28,13 +26,13 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ glib ncurses libmpdclient boost ]
-    ++ optional pcreSupport pcre;
+    ++ lib.optional pcreSupport pcre;
   nativeBuildInputs = [ meson ninja pkg-config gettext ];
 
   mesonFlags = [
     "-Dlirc=disabled"
     "-Ddocumentation=disabled"
-  ] ++ optional (!pcreSupport) "-Dregex=disabled";
+  ] ++ lib.optional (!pcreSupport) "-Dregex=disabled";
 
   meta = with lib; {
     description = "Curses-based interface for MPD (music player daemon)";
diff --git a/pkgs/applications/audio/renoise/default.nix b/pkgs/applications/audio/renoise/default.nix
index 1be3f53dce5f9..44dbff6077bcd 100644
--- a/pkgs/applications/audio/renoise/default.nix
+++ b/pkgs/applications/audio/renoise/default.nix
@@ -1,15 +1,13 @@
 { lib, stdenv, fetchurl, libX11, libXext, libXcursor, libXrandr, libjack2, alsa-lib
 , mpg123, releasePath ? null }:
 
-with lib;
-
 # To use the full release version:
 # 1) Sign into https://backstage.renoise.com and download the release version to some stable location.
 # 2) Override the releasePath attribute to point to the location of the newly downloaded bundle.
 # Note: Renoise creates an individual build for each license which screws somewhat with the
 # use of functions like requireFile as the hash will be different for every user.
 let
-  urlVersion = replaceStrings [ "." ] [ "_" ];
+  urlVersion = lib.replaceStrings [ "." ] [ "_" ];
 in
 
 stdenv.mkDerivation rec {
@@ -80,7 +78,7 @@ stdenv.mkDerivation rec {
     description = "Modern tracker-based DAW";
     homepage = "https://www.renoise.com/";
     sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
-    license = licenses.unfree;
+    license = lib.licenses.unfree;
     maintainers = [];
     platforms = [ "x86_64-linux" ];
   };
diff --git a/pkgs/applications/blockchains/bitcoin-knots/default.nix b/pkgs/applications/blockchains/bitcoin-knots/default.nix
index ae64247a8be2d..d1e419425570a 100644
--- a/pkgs/applications/blockchains/bitcoin-knots/default.nix
+++ b/pkgs/applications/blockchains/bitcoin-knots/default.nix
@@ -23,7 +23,6 @@
 , withWallet ? true
 }:
 
-with lib;
 stdenv.mkDerivation rec {
   pname = if withGui then "bitcoin-knots" else "bitcoind-knots";
   version = "23.0.knots20220529";
@@ -35,24 +34,24 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs =
     [ autoreconfHook pkg-config ]
-    ++ optionals stdenv.isLinux [ util-linux ]
-    ++ optionals stdenv.isDarwin [ hexdump ]
-    ++ optionals (stdenv.isDarwin && stdenv.isAarch64) [ autoSignDarwinBinariesHook ]
-    ++ optionals withGui [ wrapQtAppsHook ];
+    ++ lib.optionals stdenv.isLinux [ util-linux ]
+    ++ lib.optionals stdenv.isDarwin [ hexdump ]
+    ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ autoSignDarwinBinariesHook ]
+    ++ lib.optionals withGui [ wrapQtAppsHook ];
 
   buildInputs = [ boost libevent miniupnpc zeromq zlib ]
-    ++ optionals withWallet [ db48 sqlite ]
-    ++ optionals withGui [ qrencode qtbase qttools ];
+    ++ lib.optionals withWallet [ db48 sqlite ]
+    ++ lib.optionals withGui [ qrencode qtbase qttools ];
 
   configureFlags = [
     "--with-boost-libdir=${boost.out}/lib"
     "--disable-bench"
-  ] ++ optionals (!doCheck) [
+  ] ++ lib.optionals (!doCheck) [
     "--disable-tests"
     "--disable-gui-tests"
-  ] ++ optionals (!withWallet) [
+  ] ++ lib.optionals (!withWallet) [
     "--disable-wallet"
-  ] ++ optionals withGui [
+  ] ++ lib.optionals withGui [
     "--with-gui=qt5"
     "--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin"
   ];
@@ -65,7 +64,7 @@ stdenv.mkDerivation rec {
     [ "LC_ALL=en_US.UTF-8" ]
     # QT_PLUGIN_PATH needs to be set when executing QT, which is needed when testing Bitcoin's GUI.
     # See also https://github.com/NixOS/nixpkgs/issues/24256
-    ++ optional withGui "QT_PLUGIN_PATH=${qtbase}/${qtbase.qtPluginPrefix}";
+    ++ lib.optional withGui "QT_PLUGIN_PATH=${qtbase}/${qtbase.qtPluginPrefix}";
 
   enableParallelBuilding = true;
 
@@ -73,7 +72,7 @@ stdenv.mkDerivation rec {
     smoke-test = nixosTests.bitcoind-knots;
   };
 
-  meta = {
+  meta = with lib; {
     description = "A derivative of Bitcoin Core with a collection of improvements";
     homepage = "https://bitcoinknots.org/";
     maintainers = with maintainers; [ prusnak mmahut ];
diff --git a/pkgs/applications/blockchains/bitcoin-unlimited/default.nix b/pkgs/applications/blockchains/bitcoin-unlimited/default.nix
index d019c3f02d6d6..3fbf9615f7db1 100644
--- a/pkgs/applications/blockchains/bitcoin-unlimited/default.nix
+++ b/pkgs/applications/blockchains/bitcoin-unlimited/default.nix
@@ -3,10 +3,8 @@
 , withGui, wrapQtAppsHook ? null, qtbase ? null, qttools ? null
 , Foundation, ApplicationServices, AppKit }:
 
-with lib;
-
 stdenv.mkDerivation rec {
-  pname = "bitcoin" + optionalString (!withGui) "d" + "-unlimited";
+  pname = "bitcoin" + lib.optionalString (!withGui) "d" + "-unlimited";
   version = "1.10.0.0";
 
   src = fetchFromGitLab {
@@ -17,19 +15,19 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ pkg-config autoreconfHook python3 ]
-    ++ optionals withGui [ wrapQtAppsHook qttools ];
+    ++ lib.optionals withGui [ wrapQtAppsHook qttools ];
   buildInputs = [ openssl db48 boost zlib
                   miniupnpc util-linux protobuf libevent ]
-                  ++ optionals withGui [ qtbase qttools qrencode ]
-                  ++ optionals stdenv.isDarwin [ Foundation ApplicationServices AppKit ];
+                  ++ lib.optionals withGui [ qtbase qttools qrencode ]
+                  ++ lib.optionals stdenv.isDarwin [ Foundation ApplicationServices AppKit ];
 
   configureFlags = [ "--with-boost-libdir=${boost.out}/lib" ]
-                     ++ optionals withGui [ "--with-gui=qt5"
+                     ++ lib.optionals withGui [ "--with-gui=qt5"
                                             "--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin"
                                           ];
   enableParallelBuilding = true;
 
-  meta = {
+  meta = with lib; {
     description = "Peer-to-peer electronic cash system (Unlimited client)";
     longDescription= ''
       Bitcoin is a free open source peer-to-peer electronic cash system that is
diff --git a/pkgs/applications/blockchains/bitcoin/default.nix b/pkgs/applications/blockchains/bitcoin/default.nix
index de5ce51d06545..98483391973d0 100644
--- a/pkgs/applications/blockchains/bitcoin/default.nix
+++ b/pkgs/applications/blockchains/bitcoin/default.nix
@@ -23,7 +23,6 @@
 , withWallet ? true
 }:
 
-with lib;
 let
   desktop = fetchurl {
     # c2e5f3e is the last commit when the debian/bitcoin-qt.desktop file was changed
@@ -45,16 +44,16 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs =
     [ autoreconfHook pkg-config ]
-    ++ optionals stdenv.isLinux [ util-linux ]
-    ++ optionals stdenv.isDarwin [ hexdump ]
-    ++ optionals (stdenv.isDarwin && stdenv.isAarch64) [ autoSignDarwinBinariesHook ]
-    ++ optionals withGui [ wrapQtAppsHook ];
+    ++ lib.optionals stdenv.isLinux [ util-linux ]
+    ++ lib.optionals stdenv.isDarwin [ hexdump ]
+    ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ autoSignDarwinBinariesHook ]
+    ++ lib.optionals withGui [ wrapQtAppsHook ];
 
   buildInputs = [ boost libevent miniupnpc zeromq zlib ]
-    ++ optionals withWallet [ db48 sqlite ]
-    ++ optionals withGui [ qrencode qtbase qttools ];
+    ++ lib.optionals withWallet [ db48 sqlite ]
+    ++ lib.optionals withGui [ qrencode qtbase qttools ];
 
-  postInstall = optionalString withGui ''
+  postInstall = lib.optionalString withGui ''
     install -Dm644 ${desktop} $out/share/applications/bitcoin-qt.desktop
     substituteInPlace $out/share/applications/bitcoin-qt.desktop --replace "Icon=bitcoin128" "Icon=bitcoin"
     install -Dm644 share/pixmaps/bitcoin256.png $out/share/pixmaps/bitcoin.png
@@ -63,12 +62,12 @@ stdenv.mkDerivation rec {
   configureFlags = [
     "--with-boost-libdir=${boost.out}/lib"
     "--disable-bench"
-  ] ++ optionals (!doCheck) [
+  ] ++ lib.optionals (!doCheck) [
     "--disable-tests"
     "--disable-gui-tests"
-  ] ++ optionals (!withWallet) [
+  ] ++ lib.optionals (!withWallet) [
     "--disable-wallet"
-  ] ++ optionals withGui [
+  ] ++ lib.optionals withGui [
     "--with-gui=qt5"
     "--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin"
   ];
@@ -81,7 +80,7 @@ stdenv.mkDerivation rec {
     [ "LC_ALL=en_US.UTF-8" ]
     # QT_PLUGIN_PATH needs to be set when executing QT, which is needed when testing Bitcoin's GUI.
     # See also https://github.com/NixOS/nixpkgs/issues/24256
-    ++ optional withGui "QT_PLUGIN_PATH=${qtbase}/${qtbase.qtPluginPrefix}";
+    ++ lib.optional withGui "QT_PLUGIN_PATH=${qtbase}/${qtbase.qtPluginPrefix}";
 
   enableParallelBuilding = true;
 
@@ -89,7 +88,7 @@ stdenv.mkDerivation rec {
     smoke-test = nixosTests.bitcoind;
   };
 
-  meta = {
+  meta = with lib; {
     description = "Peer-to-peer electronic cash system";
     longDescription = ''
       Bitcoin is a free open source peer-to-peer electronic cash system that is
diff --git a/pkgs/applications/blockchains/btcdeb/default.nix b/pkgs/applications/blockchains/btcdeb/default.nix
index 4f8a08333a86b..f4c00d00858ea 100644
--- a/pkgs/applications/blockchains/btcdeb/default.nix
+++ b/pkgs/applications/blockchains/btcdeb/default.nix
@@ -5,7 +5,6 @@
 , openssl
 }:
 
-with lib;
 stdenv.mkDerivation rec {
   pname = "btcdeb";
   version = "unstable-2022-04-03";
@@ -20,7 +19,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkg-config autoreconfHook ];
   buildInputs = [ openssl ];
 
-  meta = {
+  meta = with lib; {
     description = "Bitcoin Script Debugger";
     homepage = "https://github.com/bitcoin-core/btcdeb";
     license = licenses.mit;
diff --git a/pkgs/applications/blockchains/digibyte/default.nix b/pkgs/applications/blockchains/digibyte/default.nix
index 90e84db3638e1..4e563d21fa22d 100644
--- a/pkgs/applications/blockchains/digibyte/default.nix
+++ b/pkgs/applications/blockchains/digibyte/default.nix
@@ -15,13 +15,11 @@
 , wrapQtAppsHook ? null
 }:
 
-with lib;
-
 stdenv.mkDerivation rec {
   pname = "digibyte";
   version = "7.17.3";
 
-  name = pname + toString (optional (!withGui) "d") + "-" + version;
+  name = pname + toString (lib.optional (!withGui) "d") + "-" + version;
 
   src = fetchFromGitHub {
     owner = "digibyte-core";
@@ -34,7 +32,7 @@ stdenv.mkDerivation rec {
     autoreconfHook
     pkg-config
     hexdump
-  ] ++ optionals withGui [
+  ] ++ lib.optionals withGui [
     wrapQtAppsHook
   ];
 
@@ -44,7 +42,7 @@ stdenv.mkDerivation rec {
     libevent
     db4
     zeromq
-  ] ++ optionals withGui [
+  ] ++ lib.optionals withGui [
     qtbase
     qttools
     protobuf
@@ -54,12 +52,12 @@ stdenv.mkDerivation rec {
 
   configureFlags = [
       "--with-boost-libdir=${boost.out}/lib"
-  ] ++ optionals withGui [
+  ] ++ lib.optionals withGui [
       "--with-gui=qt5"
       "--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin"
   ];
 
-  meta = {
+  meta = with lib; {
     description = "DigiByte (DGB) is a rapidly growing decentralized, global blockchain";
     homepage = "https://digibyte.io/";
     license = licenses.mit;
diff --git a/pkgs/applications/blockchains/dogecoin/default.nix b/pkgs/applications/blockchains/dogecoin/default.nix
index 6b6cfaa2398d4..421c2fe667e05 100644
--- a/pkgs/applications/blockchains/dogecoin/default.nix
+++ b/pkgs/applications/blockchains/dogecoin/default.nix
@@ -6,9 +6,8 @@
 , withGui, withUpnp ? true, withUtils ? true, withWallet ? true
 , withZmq ? true, zeromq, util-linux ? null, Cocoa ? null }:
 
-with lib;
 stdenv.mkDerivation rec {
-  pname = "dogecoin" + optionalString (!withGui) "d";
+  pname = "dogecoin" + lib.optionalString (!withGui) "d";
   version = "1.14.6";
 
   src = fetchFromGitHub {
@@ -18,32 +17,32 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-PmbmmA2Mq07dwB3cI7A9c/ewtu0I+sWvQT39Yekm/sU=";
   };
 
-  preConfigure = optionalString withGui ''
-    export LRELEASE=${getDev qttools}/bin/lrelease
+  preConfigure = lib.optionalString withGui ''
+    export LRELEASE=${lib.getDev qttools}/bin/lrelease
   '';
 
   nativeBuildInputs = [ pkg-config autoreconfHook util-linux ]
-    ++ optionals withGui [ wrapQtAppsHook qttools ];
+    ++ lib.optionals withGui [ wrapQtAppsHook qttools ];
 
   buildInputs = [ openssl protobuf boost zlib libevent ]
-    ++ optionals withGui [ qtbase qrencode ]
-    ++ optionals withUpnp [ miniupnpc ]
-    ++ optionals withWallet [ db5 ]
-    ++ optionals withZmq [ zeromq ]
-    ++ optionals stdenv.isDarwin [ Cocoa ];
+    ++ lib.optionals withGui [ qtbase qrencode ]
+    ++ lib.optionals withUpnp [ miniupnpc ]
+    ++ lib.optionals withWallet [ db5 ]
+    ++ lib.optionals withZmq [ zeromq ]
+    ++ lib.optionals stdenv.isDarwin [ Cocoa ];
 
   configureFlags = [
     "--with-incompatible-bdb"
     "--with-boost-libdir=${boost.out}/lib"
-  ] ++ optionals (!withGui) [ "--with-gui=no" ]
-    ++ optionals (!withUpnp) [ "--without-miniupnpc" ]
-    ++ optionals (!withUtils) [ "--without-utils" ]
-    ++ optionals (!withWallet) [ "--disable-wallet" ]
-    ++ optionals (!withZmq) [ "--disable-zmq" ];
+  ] ++ lib.optionals (!withGui) [ "--with-gui=no" ]
+    ++ lib.optionals (!withUpnp) [ "--without-miniupnpc" ]
+    ++ lib.optionals (!withUtils) [ "--without-utils" ]
+    ++ lib.optionals (!withWallet) [ "--disable-wallet" ]
+    ++ lib.optionals (!withZmq) [ "--disable-zmq" ];
 
   enableParallelBuilding = true;
 
-  meta = {
+  meta = with lib; {
     description = "Wow, such coin, much shiba, very rich";
     longDescription = ''
       Dogecoin is a decentralized, peer-to-peer digital currency that
diff --git a/pkgs/applications/blockchains/elements/default.nix b/pkgs/applications/blockchains/elements/default.nix
index 0ffaa4c83c01d..a39cbc341e894 100644
--- a/pkgs/applications/blockchains/elements/default.nix
+++ b/pkgs/applications/blockchains/elements/default.nix
@@ -22,7 +22,6 @@
 , withWallet ? true
 }:
 
-with lib;
 stdenv.mkDerivation rec {
   pname = if withGui then "elements" else "elementsd";
   version = "22.0.2";
@@ -36,24 +35,24 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs =
     [ autoreconfHook pkg-config ]
-    ++ optionals stdenv.isLinux [ util-linux ]
-    ++ optionals stdenv.isDarwin [ hexdump ]
-    ++ optionals (stdenv.isDarwin && stdenv.isAarch64) [ autoSignDarwinBinariesHook ]
-    ++ optionals withGui [ wrapQtAppsHook ];
+    ++ lib.optionals stdenv.isLinux [ util-linux ]
+    ++ lib.optionals stdenv.isDarwin [ hexdump ]
+    ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ autoSignDarwinBinariesHook ]
+    ++ lib.optionals withGui [ wrapQtAppsHook ];
 
   buildInputs = [ boost libevent miniupnpc zeromq zlib ]
-    ++ optionals withWallet [ db48 sqlite ]
-    ++ optionals withGui [ qrencode qtbase qttools ];
+    ++ lib.optionals withWallet [ db48 sqlite ]
+    ++ lib.optionals withGui [ qrencode qtbase qttools ];
 
   configureFlags = [
     "--with-boost-libdir=${boost.out}/lib"
     "--disable-bench"
-  ] ++ optionals (!doCheck) [
+  ] ++ lib.optionals (!doCheck) [
     "--disable-tests"
     "--disable-gui-tests"
-  ] ++ optionals (!withWallet) [
+  ] ++ lib.optionals (!withWallet) [
     "--disable-wallet"
-  ] ++ optionals withGui [
+  ] ++ lib.optionals withGui [
     "--with-gui=qt5"
     "--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin"
   ];
@@ -70,11 +69,11 @@ stdenv.mkDerivation rec {
     [ "LC_ALL=en_US.UTF-8" ]
     # QT_PLUGIN_PATH needs to be set when executing QT, which is needed when testing Bitcoin's GUI.
     # See also https://github.com/NixOS/nixpkgs/issues/24256
-    ++ optional withGui "QT_PLUGIN_PATH=${qtbase}/${qtbase.qtPluginPrefix}";
+    ++ lib.optional withGui "QT_PLUGIN_PATH=${qtbase}/${qtbase.qtPluginPrefix}";
 
   enableParallelBuilding = true;
 
-  meta = {
+  meta = with lib; {
     description = "Open Source implementation of advanced blockchain features extending the Bitcoin protocol";
     longDescription= ''
       The Elements blockchain platform is a collection of feature experiments and extensions to the
diff --git a/pkgs/applications/blockchains/litecoin/default.nix b/pkgs/applications/blockchains/litecoin/default.nix
index d150d7347493f..3eeeafe8d8153 100644
--- a/pkgs/applications/blockchains/litecoin/default.nix
+++ b/pkgs/applications/blockchains/litecoin/default.nix
@@ -9,10 +9,8 @@
 , fmt
 }:
 
-with lib;
-
 mkDerivation rec {
-  pname = "litecoin" + optionalString (!withGui) "d";
+  pname = "litecoin" + lib.optionalString (!withGui) "d";
   version = "0.21.2.1";
 
   src = fetchFromGitHub {
@@ -25,11 +23,11 @@ mkDerivation rec {
   nativeBuildInputs = [ pkg-config autoreconfHook ];
   buildInputs = [ openssl db48 boost zlib zeromq fmt
                   miniupnpc glib protobuf util-linux libevent ]
-                  ++ optionals stdenv.isDarwin [ AppKit ]
-                  ++ optionals withGui [ qtbase qttools qrencode ];
+                  ++ lib.optionals stdenv.isDarwin [ AppKit ]
+                  ++ lib.optionals withGui [ qtbase qttools qrencode ];
 
   configureFlags = [ "--with-boost-libdir=${boost.out}/lib" ]
-                   ++ optionals withGui [
+                   ++ lib.optionals withGui [
                       "--with-gui=qt5"
                       "--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin" ];
 
@@ -40,7 +38,7 @@ mkDerivation rec {
     ./src/test/test_litecoin
   '';
 
-  meta = {
+  meta = with lib; {
     broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin;
     description = "A lite version of Bitcoin using scrypt as a proof-of-work algorithm";
     longDescription= ''
diff --git a/pkgs/applications/blockchains/particl-core/default.nix b/pkgs/applications/blockchains/particl-core/default.nix
index c55d04b03a28a..942f0a71cbf4a 100644
--- a/pkgs/applications/blockchains/particl-core/default.nix
+++ b/pkgs/applications/blockchains/particl-core/default.nix
@@ -14,8 +14,6 @@
 , python3
 }:
 
-with lib;
-
 stdenv.mkDerivation rec {
   pname = "particl-core";
   version = "23.0.3.0";
@@ -33,7 +31,7 @@ stdenv.mkDerivation rec {
   configureFlags = [
     "--disable-bench"
     "--with-boost-libdir=${boost.out}/lib"
-  ] ++ optionals (!doCheck) [
+  ] ++ lib.optionals (!doCheck) [
     "--enable-tests=no"
   ];
 
@@ -42,7 +40,7 @@ stdenv.mkDerivation rec {
   preCheck = "patchShebangs test";
   enableParallelBuilding = true;
 
-  meta = {
+  meta = with lib; {
     broken = (stdenv.isLinux && stdenv.isAarch64);
     description = "Privacy-Focused Marketplace & Decentralized Application Platform";
     longDescription = ''
diff --git a/pkgs/applications/blockchains/vertcoin/default.nix b/pkgs/applications/blockchains/vertcoin/default.nix
index 87d9a8b64b21a..90e4dd14a6856 100644
--- a/pkgs/applications/blockchains/vertcoin/default.nix
+++ b/pkgs/applications/blockchains/vertcoin/default.nix
@@ -16,13 +16,11 @@
 , wrapQtAppsHook ? null
 }:
 
-with lib;
-
 stdenv.mkDerivation rec {
   pname = "vertcoin";
   version = "0.18.0";
 
-  name = pname + toString (optional (!withGui) "d") + "-" + version;
+  name = pname + toString (lib.optional (!withGui) "d") + "-" + version;
 
   src = fetchFromGitHub {
     owner = pname + "-project";
@@ -35,7 +33,7 @@ stdenv.mkDerivation rec {
     autoreconfHook
     pkg-config
     hexdump
-  ] ++ optionals withGui [
+  ] ++ lib.optionals withGui [
     wrapQtAppsHook
   ];
 
@@ -46,7 +44,7 @@ stdenv.mkDerivation rec {
     db4
     zeromq
     gmp
-  ] ++ optionals withGui [
+  ] ++ lib.optionals withGui [
     qtbase
     qttools
     protobuf
@@ -56,12 +54,12 @@ stdenv.mkDerivation rec {
 
   configureFlags = [
       "--with-boost-libdir=${boost.out}/lib"
-  ] ++ optionals withGui [
+  ] ++ lib.optionals withGui [
       "--with-gui=qt5"
       "--with-qt-bindir=${qtbase.dev}/bin:${qttools.dev}/bin"
   ];
 
-  meta = {
+  meta = with lib; {
     description = "A digital currency with mining decentralisation and ASIC resistance as a key focus";
     homepage = "https://vertcoin.org/";
     license = licenses.mit;
diff --git a/pkgs/applications/blockchains/wownero/default.nix b/pkgs/applications/blockchains/wownero/default.nix
index 14e17c766dd99..9c68a094b8787 100644
--- a/pkgs/applications/blockchains/wownero/default.nix
+++ b/pkgs/applications/blockchains/wownero/default.nix
@@ -2,7 +2,6 @@
 , readline, libsodium, rapidjson
 }:
 
-with lib;
 stdenv.mkDerivation rec {
   pname = "wownero";
   version = "0.8.0.1";
@@ -41,7 +40,7 @@ stdenv.mkDerivation rec {
     "-DMANUAL_SUBMODULES=ON"
   ];
 
-  meta = {
+  meta = with lib; {
     description = ''
       A privacy-centric memecoin that was fairly launched on April 1, 2018 with
       no pre-mine, stealth-mine or ICO
diff --git a/pkgs/applications/display-managers/lightdm/default.nix b/pkgs/applications/display-managers/lightdm/default.nix
index 348f4706411fd..8365ac3b5a22f 100644
--- a/pkgs/applications/display-managers/lightdm/default.nix
+++ b/pkgs/applications/display-managers/lightdm/default.nix
@@ -30,8 +30,6 @@
 , yelp-tools
 }:
 
-with lib;
-
 stdenv.mkDerivation rec {
   pname = "lightdm";
   version = "1.32.0";
@@ -69,7 +67,7 @@ stdenv.mkDerivation rec {
     libxklavier
     pam
     polkit
-  ] ++ optional withQt5 qtbase;
+  ] ++ lib.optional withQt5 qtbase;
 
   patches = [
     # Adds option to disable writing dmrc files
@@ -96,7 +94,7 @@ stdenv.mkDerivation rec {
     "--sysconfdir=/etc"
     "--disable-tests"
     "--disable-dmrc"
-  ] ++ optional withQt5 "--enable-liblightdm-qt5";
+  ] ++ lib.optional withQt5 "--enable-liblightdm-qt5";
 
   installFlags = [
     "sysconfdir=${placeholder "out"}/etc"
@@ -120,7 +118,7 @@ stdenv.mkDerivation rec {
   };
 
 
-  meta = {
+  meta = with lib; {
     homepage = "https://github.com/canonical/lightdm";
     description = "A cross-desktop display manager";
     platforms = platforms.linux;
diff --git a/pkgs/applications/editors/codeblocks/default.nix b/pkgs/applications/editors/codeblocks/default.nix
index 7a1c0af2c6430..441b224ef0226 100644
--- a/pkgs/applications/editors/codeblocks/default.nix
+++ b/pkgs/applications/editors/codeblocks/default.nix
@@ -2,8 +2,6 @@
 , contribPlugins ? false, hunspell, gamin, boost, wrapGAppsHook
 }:
 
-with lib;
-
 stdenv.mkDerivation rec {
   name = "${pname}-${lib.optionalString contribPlugins "full-"}${version}";
   version = "20.03";
@@ -16,7 +14,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkg-config file zip wrapGAppsHook ];
   buildInputs = [ wxGTK31 gtk3 ]
-    ++ optionals contribPlugins [ hunspell gamin boost ];
+    ++ lib.optionals contribPlugins [ hunspell gamin boost ];
   enableParallelBuilding = true;
   patches = [
     ./writable-projects.patch
@@ -56,16 +54,16 @@ stdenv.mkDerivation rec {
     })
   ];
   preConfigure = "substituteInPlace ./configure --replace /usr/bin/file ${file}/bin/file";
-  postConfigure = optionalString stdenv.isLinux "substituteInPlace libtool --replace ldconfig ${stdenv.cc.libc.bin}/bin/ldconfig";
-  configureFlags = [ "--enable-pch=no" ] ++ optionals contribPlugins [
-    ("--with-contrib-plugins" + optionalString stdenv.isDarwin "=all,-FileManager,-NassiShneiderman")
+  postConfigure = lib.optionalString stdenv.isLinux "substituteInPlace libtool --replace ldconfig ${stdenv.cc.libc.bin}/bin/ldconfig";
+  configureFlags = [ "--enable-pch=no" ] ++ lib.optionals contribPlugins [
+    ("--with-contrib-plugins" + lib.optionalString stdenv.isDarwin "=all,-FileManager,-NassiShneiderman")
     "--with-boost-libdir=${boost}/lib"
   ];
-  postInstall = optionalString stdenv.isDarwin ''
+  postInstall = lib.optionalString stdenv.isDarwin ''
     ln -s $out/lib/codeblocks/plugins $out/share/codeblocks/plugins
   '';
 
-  meta = {
+  meta = with lib; {
     maintainers = [ maintainers.linquize ];
     platforms = platforms.all;
     description = "The open source, cross platform, free C, C++ and Fortran IDE";
diff --git a/pkgs/applications/editors/howl/default.nix b/pkgs/applications/editors/howl/default.nix
index 2c959519f41fe..ff9a30074120e 100644
--- a/pkgs/applications/editors/howl/default.nix
+++ b/pkgs/applications/editors/howl/default.nix
@@ -1,7 +1,5 @@
 { lib, stdenv, fetchurl, makeWrapper, pkg-config, gtk3, librsvg }:
 
-with lib;
-
 stdenv.mkDerivation rec {
   pname = "howl";
   version = "0.6";
@@ -27,7 +25,7 @@ stdenv.mkDerivation rec {
       --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE"
   '';
 
-  meta = {
+  meta = with lib; {
     homepage = "https://howl.io/";
     description = "A general purpose, fast and lightweight editor with a keyboard-centric minimalistic user interface";
     license = licenses.mit;
diff --git a/pkgs/applications/editors/jetbrains/default.nix b/pkgs/applications/editors/jetbrains/default.nix
index 3af1c001c0817..913ef7570eeea 100644
--- a/pkgs/applications/editors/jetbrains/default.nix
+++ b/pkgs/applications/editors/jetbrains/default.nix
@@ -11,15 +11,13 @@
 , vmopts ? null
 }:
 
-with lib;
-
 let
   platforms = lib.platforms.linux ++ [ "x86_64-darwin" "aarch64-darwin" ];
   ideaPlatforms = [ "x86_64-darwin" "i686-darwin" "i686-linux" "x86_64-linux" "aarch64-darwin" ];
 
   inherit (stdenv.hostPlatform) system;
 
-  versions = builtins.fromJSON (readFile (./versions.json));
+  versions = builtins.fromJSON (lib.readFile (./versions.json));
   versionKey = if stdenv.isLinux then "linux" else system;
   products = versions.${versionKey} or (throw "Unsupported system: ${system}");
 
@@ -42,11 +40,11 @@ let
         maintainers = with maintainers; [ edwtjo mic92 ];
       };
     }).overrideAttrs (attrs: {
-      nativeBuildInputs = (attrs.nativeBuildInputs or []) ++ optionals (stdenv.isLinux) [
+      nativeBuildInputs = (attrs.nativeBuildInputs or []) ++ lib.optionals (stdenv.isLinux) [
         autoPatchelfHook
         patchelf
       ];
-      buildInputs = (attrs.buildInputs or []) ++ optionals (stdenv.isLinux) [
+      buildInputs = (attrs.buildInputs or []) ++ lib.optionals (stdenv.isLinux) [
         python3
         stdenv.cc.cc
         libdbusmenu
@@ -54,7 +52,7 @@ let
         expat
       ];
       dontAutoPatchelf = true;
-      postFixup = (attrs.postFixup or "") + optionalString (stdenv.isLinux) ''
+      postFixup = (attrs.postFixup or "") + lib.optionalString (stdenv.isLinux) ''
         (
           cd $out/clion
           # bundled cmake does not find libc
@@ -217,7 +215,7 @@ let
         '';
         maintainers = with maintainers; [ ];
       };
-    }).overrideAttrs (finalAttrs: previousAttrs: optionalAttrs cythonSpeedup {
+    }).overrideAttrs (finalAttrs: previousAttrs: lib.optionalAttrs cythonSpeedup {
       buildInputs = with python3.pkgs; [ python3 setuptools ];
       preInstall = ''
       echo "compiling cython debug speedups"
diff --git a/pkgs/applications/editors/jetbrains/linux.nix b/pkgs/applications/editors/jetbrains/linux.nix
index f1529b29f92dc..7443842e7bf9c 100644
--- a/pkgs/applications/editors/jetbrains/linux.nix
+++ b/pkgs/applications/editors/jetbrains/linux.nix
@@ -5,10 +5,8 @@
 
 { pname, product, productShort ? product, version, src, wmClass, jdk, meta, extraLdPath ? [], extraWrapperArgs ? [] }@args:
 
-with lib;
-
-let loName = toLower productShort;
-    hiName = toUpper productShort;
+let loName = lib.toLower productShort;
+    hiName = lib.toUpper productShort;
     vmoptsName = loName
                + lib.optionalString stdenv.hostPlatform.is64bit "64"
                + ".vmoptions";
@@ -29,7 +27,7 @@ with stdenv; lib.makeOverridable mkDerivation (rec {
     startupWMClass = wmClass;
   };
 
-  vmoptsFile = optionalString (vmopts != null) (writeText vmoptsName vmopts);
+  vmoptsFile = lib.optionalString (vmopts != null) (writeText vmoptsName vmopts);
 
   nativeBuildInputs = [ makeWrapper patchelf unzip ];
 
diff --git a/pkgs/applications/editors/jucipp/default.nix b/pkgs/applications/editors/jucipp/default.nix
index b06c93c103401..01ab62c6de4fb 100644
--- a/pkgs/applications/editors/jucipp/default.nix
+++ b/pkgs/applications/editors/jucipp/default.nix
@@ -3,13 +3,11 @@
   libXdmcp, libxkbcommon, libpthreadstubs, wrapGAppsHook, aspellDicts, gtkmm3,
   coreutils, glibc, dbus, openssl, libxml2, gnumake, ctags }:
 
-with lib;
-
 stdenv.mkDerivation rec {
   pname = "juicipp";
   version = "1.2.3";
 
-  meta = {
+  meta = with lib; {
     homepage = "https://github.com/cppit/jucipp";
     description = "A lightweight, platform independent C++-IDE with support for C++11, C++14, and experimental C++17 features depending on libclang version";
     license = licenses.mit;
diff --git a/pkgs/applications/editors/kakoune/default.nix b/pkgs/applications/editors/kakoune/default.nix
index 3366efb697a88..77d75eb131ff6 100644
--- a/pkgs/applications/editors/kakoune/default.nix
+++ b/pkgs/applications/editors/kakoune/default.nix
@@ -1,7 +1,5 @@
 { lib, stdenv, fetchFromGitHub }:
 
-with lib;
-
 stdenv.mkDerivation rec {
   pname = "kakoune-unwrapped";
   version = "2022.10.31";
@@ -33,7 +31,7 @@ stdenv.mkDerivation rec {
     ln -s --relative "$autoload_target" autoload
   '';
 
-  meta = {
+  meta = with lib; {
     homepage = "http://kakoune.org/";
     description = "A vim inspired text editor";
     license = licenses.publicDomain;
diff --git a/pkgs/applications/editors/nano/default.nix b/pkgs/applications/editors/nano/default.nix
index cfb1d17c91293..69c7f3eb7af34 100644
--- a/pkgs/applications/editors/nano/default.nix
+++ b/pkgs/applications/editors/nano/default.nix
@@ -4,8 +4,6 @@
 
 assert enableNls -> (gettext != null);
 
-with lib;
-
 let
   nixSyntaxHighlight = fetchFromGitHub {
     owner = "seitz";
@@ -23,7 +21,7 @@ in stdenv.mkDerivation rec {
     sha256 = "V7p1Hpt1GfD23e5QUgLjh8dd3kQMH3qhuTEMw4FAaDY=";
   };
 
-  nativeBuildInputs = [ texinfo ] ++ optional enableNls gettext;
+  nativeBuildInputs = [ texinfo ] ++ lib.optional enableNls gettext;
   buildInputs = [ ncurses ];
 
   outputs = [ "out" "info" ];
@@ -71,7 +69,7 @@ in stdenv.mkDerivation rec {
     '';
   };
 
-  meta = {
+  meta = with lib; {
     homepage = "https://www.nano-editor.org/";
     description = "A small, user-friendly console text editor";
     license = licenses.gpl3Plus;
diff --git a/pkgs/applications/editors/neovim/wrapper.nix b/pkgs/applications/editors/neovim/wrapper.nix
index 01a9cf98954b9..fac9b3c309900 100644
--- a/pkgs/applications/editors/neovim/wrapper.nix
+++ b/pkgs/applications/editors/neovim/wrapper.nix
@@ -5,8 +5,6 @@
 , python3Packages
 , callPackage
 }:
-with lib;
-
 neovim:
 
 let
@@ -32,7 +30,7 @@ let
   }@args:
   let
 
-    wrapperArgsStr = if isString wrapperArgs then wrapperArgs else lib.escapeShellArgs wrapperArgs;
+    wrapperArgsStr = if lib.isString wrapperArgs then wrapperArgs else lib.escapeShellArgs wrapperArgs;
 
     # If configure != {}, we can't generate the rplugin.vim file with e.g
     # NVIM_SYSTEM_RPLUGIN_MANIFEST *and* NVIM_RPLUGIN_MANIFEST env vars set in
@@ -43,7 +41,7 @@ let
     finalMakeWrapperArgs =
       [ "${neovim}/bin/nvim" "${placeholder "out"}/bin/nvim" ]
       ++ [ "--set" "NVIM_SYSTEM_RPLUGIN_MANIFEST" "${placeholder "out"}/rplugin.vim" ]
-      ++ optionals wrapRc [ "--add-flags" "-u ${writeText "init.vim" neovimRcContent}" ]
+      ++ lib.optionals wrapRc [ "--add-flags" "-u ${writeText "init.vim" neovimRcContent}" ]
       ;
   in
   assert withPython2 -> throw "Python2 support has been removed from the neovim wrapper, please remove withPython2 and python2Env.";
@@ -57,22 +55,22 @@ let
         substitute ${neovim}/share/applications/nvim.desktop $out/share/applications/nvim.desktop \
           --replace 'Name=Neovim' 'Name=Neovim wrapper'
       ''
-      + optionalString withPython3 ''
+      + lib.optionalString withPython3 ''
         makeWrapper ${python3Env.interpreter} $out/bin/nvim-python3 --unset PYTHONPATH
       ''
-      + optionalString (rubyEnv != null) ''
+      + lib.optionalString (rubyEnv != null) ''
         ln -s ${rubyEnv}/bin/neovim-ruby-host $out/bin/nvim-ruby
       ''
-      + optionalString withNodeJs ''
+      + lib.optionalString withNodeJs ''
         ln -s ${nodePackages.neovim}/bin/neovim-node-host $out/bin/nvim-node
       ''
-      + optionalString vimAlias ''
+      + lib.optionalString vimAlias ''
         ln -s $out/bin/nvim $out/bin/vim
       ''
-      + optionalString viAlias ''
+      + lib.optionalString viAlias ''
         ln -s $out/bin/nvim $out/bin/vi
       ''
-      + optionalString (manifestRc != null) (let
+      + lib.optionalString (manifestRc != null) (let
         manifestWrapperArgs =
           [ "${neovim}/bin/nvim" "${placeholder "out"}/bin/nvim-wrapper" ];
       in ''
diff --git a/pkgs/applications/editors/rstudio/default.nix b/pkgs/applications/editors/rstudio/default.nix
index 70e69503749b9..71633c8c8e4a9 100644
--- a/pkgs/applications/editors/rstudio/default.nix
+++ b/pkgs/applications/editors/rstudio/default.nix
@@ -206,7 +206,7 @@ in
       homepage = "https://www.rstudio.com/";
       license = licenses.agpl3Only;
       maintainers = with maintainers; [ ciil cfhammill ];
-      mainProgram = "rstudio" + optionalString server "-server";
+      mainProgram = "rstudio" + lib.optionalString server "-server";
       platforms = platforms.linux;
     };
 
diff --git a/pkgs/applications/editors/vscode/extensions/ms-vsliveshare-vsliveshare/default.nix b/pkgs/applications/editors/vscode/extensions/ms-vsliveshare-vsliveshare/default.nix
index 8aa121cbe2032..f1ce06b7ca0fa 100644
--- a/pkgs/applications/editors/vscode/extensions/ms-vsliveshare-vsliveshare/default.nix
+++ b/pkgs/applications/editors/vscode/extensions/ms-vsliveshare-vsliveshare/default.nix
@@ -7,8 +7,6 @@
 , desktop-file-utils, xprop, xsel
 }:
 
-with lib;
-
 let
   # https://docs.microsoft.com/en-us/visualstudio/liveshare/reference/linux#install-prerequisites-manually
   libs = [
@@ -118,12 +116,12 @@ in ((vscode-utils.override { stdenv = gccStdenv; }).buildVscodeMarketplaceExtens
     # which will break when copying over the files.
     mv dotnet_modules/vsls-agent{,-wrapped}
     makeWrapper $PWD/dotnet_modules/vsls-agent{-wrapped,} \
-      --prefix LD_LIBRARY_PATH : "${makeLibraryPath libs}" \
+      --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath libs}" \
       --set LD_PRELOAD $PWD/dotnet_modules/noop-syslog.so \
       --set DOTNET_ROOT ${dotnet-sdk_3}
   '';
 
-  meta = {
+  meta = with lib; {
     description = "Live Share lets you achieve greater confidence at speed by streamlining collaborative editing, debugging, and more in real-time during development";
     homepage = "https://aka.ms/vsls-docs";
     license = licenses.unfree;