summary refs log tree commit diff
path: root/pkgs/applications/editors
diff options
context:
space:
mode:
authorBen Siraphob <bensiraphob@gmail.com>2021-01-15 20:21:58 +0700
committerBen Siraphob <bensiraphob@gmail.com>2021-01-16 17:58:11 +0700
commitbadf51221db8fae81bf9948c39eaf8342dfd5597 (patch)
tree34eeb35ca97f0b081da465e9ddd6c120a9d2b7df /pkgs/applications/editors
parenta9bb54359eeedf2594fdf191de5b673fd1dd102d (diff)
downloadnixpkgs-badf51221db8fae81bf9948c39eaf8342dfd5597.tar
nixpkgs-badf51221db8fae81bf9948c39eaf8342dfd5597.tar.gz
nixpkgs-badf51221db8fae81bf9948c39eaf8342dfd5597.tar.bz2
nixpkgs-badf51221db8fae81bf9948c39eaf8342dfd5597.tar.lz
nixpkgs-badf51221db8fae81bf9948c39eaf8342dfd5597.tar.xz
nixpkgs-badf51221db8fae81bf9948c39eaf8342dfd5597.tar.zst
nixpkgs-badf51221db8fae81bf9948c39eaf8342dfd5597.zip
treewide: stdenv.lib -> lib
Diffstat (limited to 'pkgs/applications/editors')
-rw-r--r--pkgs/applications/editors/aewan/default.nix6
-rw-r--r--pkgs/applications/editors/amp/default.nix2
-rw-r--r--pkgs/applications/editors/android-studio/common.nix4
-rw-r--r--pkgs/applications/editors/atom/default.nix4
-rw-r--r--pkgs/applications/editors/brackets/default.nix2
-rw-r--r--pkgs/applications/editors/code-browser/default.nix10
-rw-r--r--pkgs/applications/editors/codeblocks/default.nix6
-rw-r--r--pkgs/applications/editors/dhex/default.nix8
-rw-r--r--pkgs/applications/editors/eclipse/build-eclipse.nix8
-rw-r--r--pkgs/applications/editors/eclipse/default.nix8
-rw-r--r--pkgs/applications/editors/ed/default.nix8
-rw-r--r--pkgs/applications/editors/elvis/default.nix4
-rw-r--r--pkgs/applications/editors/emacs-modes/cedet/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/ess-R-object-popup/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/helm-words/default.nix4
-rw-r--r--pkgs/applications/editors/emacs-modes/hsc3/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/org-mac-link/default.nix4
-rw-r--r--pkgs/applications/editors/emacs-modes/perl-completion/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/prolog/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/railgun/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/rect-mark/default.nix4
-rw-r--r--pkgs/applications/editors/emacs-modes/sunrise-commander/default.nix4
-rw-r--r--pkgs/applications/editors/emacs-modes/tramp/default.nix4
-rw-r--r--pkgs/applications/editors/emacs-modes/zeitgeist/default.nix2
-rw-r--r--pkgs/applications/editors/flpsed/default.nix2
-rw-r--r--pkgs/applications/editors/gnome-builder/default.nix2
-rw-r--r--pkgs/applications/editors/gnome-latex/default.nix2
-rw-r--r--pkgs/applications/editors/gobby/default.nix2
-rw-r--r--pkgs/applications/editors/hexedit/default.nix6
-rw-r--r--pkgs/applications/editors/howl/default.nix4
-rw-r--r--pkgs/applications/editors/jed/default.nix4
-rw-r--r--pkgs/applications/editors/jetbrains/common.nix8
-rw-r--r--pkgs/applications/editors/jetbrains/default.nix26
-rw-r--r--pkgs/applications/editors/jove/default.nix4
-rw-r--r--pkgs/applications/editors/jucipp/default.nix10
-rw-r--r--pkgs/applications/editors/kakoune/default.nix4
-rw-r--r--pkgs/applications/editors/kakoune/plugins/kak-auto-pairs.nix2
-rw-r--r--pkgs/applications/editors/kakoune/plugins/kak-buffers.nix2
-rw-r--r--pkgs/applications/editors/kakoune/plugins/kak-fzf.nix4
-rw-r--r--pkgs/applications/editors/kakoune/plugins/kak-powerline.nix2
-rw-r--r--pkgs/applications/editors/kakoune/plugins/kak-prelude.nix2
-rw-r--r--pkgs/applications/editors/kakoune/plugins/kak-vertical-selection.nix2
-rw-r--r--pkgs/applications/editors/kakoune/plugins/quickscope.kak.nix2
-rw-r--r--pkgs/applications/editors/kdevelop5/kdevelop-pg-qt.nix2
-rw-r--r--pkgs/applications/editors/kodestudio/default.nix2
-rw-r--r--pkgs/applications/editors/lighttable/default.nix2
-rw-r--r--pkgs/applications/editors/manuskript/default.nix8
-rw-r--r--pkgs/applications/editors/monodevelop/default.nix2
-rw-r--r--pkgs/applications/editors/music/tuxguitar/default.nix2
-rw-r--r--pkgs/applications/editors/nano/default.nix10
-rw-r--r--pkgs/applications/editors/nano/nanorc/default.nix10
-rw-r--r--pkgs/applications/editors/nedit/default.nix2
-rw-r--r--pkgs/applications/editors/neovim/default.nix8
-rw-r--r--pkgs/applications/editors/neovim/neovim-remote.nix4
-rw-r--r--pkgs/applications/editors/neovim/wrapper.nix4
-rw-r--r--pkgs/applications/editors/netbeans/default.nix10
-rw-r--r--pkgs/applications/editors/nvi/default.nix4
-rw-r--r--pkgs/applications/editors/qxmledit/default.nix2
-rw-r--r--pkgs/applications/editors/rehex/default.nix8
-rw-r--r--pkgs/applications/editors/sublime/2/default.nix8
-rw-r--r--pkgs/applications/editors/sublime/3/common.nix14
-rw-r--r--pkgs/applications/editors/texmacs/common.nix4
-rw-r--r--pkgs/applications/editors/texmacs/darwin.nix6
-rw-r--r--pkgs/applications/editors/vbindiff/default.nix6
-rw-r--r--pkgs/applications/editors/vim/configurable.nix62
-rw-r--r--pkgs/applications/editors/vim/default.nix6
-rw-r--r--pkgs/applications/editors/vim/vimacs.nix2
-rw-r--r--pkgs/applications/editors/vis/default.nix6
-rw-r--r--pkgs/applications/editors/wxhexeditor/default.nix6
-rw-r--r--pkgs/applications/editors/zile/default.nix2
70 files changed, 198 insertions, 198 deletions
diff --git a/pkgs/applications/editors/aewan/default.nix b/pkgs/applications/editors/aewan/default.nix
index 56a144bdfb8..b9d350cbd43 100644
--- a/pkgs/applications/editors/aewan/default.nix
+++ b/pkgs/applications/editors/aewan/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, zlib, ncurses }:
+{ lib, stdenv, fetchurl, zlib, ncurses }:
 
 stdenv.mkDerivation rec {
   pname = "aewan";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Ascii-art Editor Without A Name";
     homepage = "http://aewan.sourceforge.net/";
-    license = stdenv.lib.licenses.gpl2Plus;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/applications/editors/amp/default.nix b/pkgs/applications/editors/amp/default.nix
index 54b3c646e25..88f22bf9e7d 100644
--- a/pkgs/applications/editors/amp/default.nix
+++ b/pkgs/applications/editors/amp/default.nix
@@ -15,7 +15,7 @@ rustPlatform.buildRustPackage rec {
   cargoSha256 = "09v991rl2w4c4jh7ga7q1lk6wyl2vr71j5cpniij8mcvszrz78qf";
 
   nativeBuildInputs = [ cmake pkgconfig python3 ];
-  buildInputs = [ openssl xorg.libxcb libgit2 ] ++ stdenv.lib.optionals stdenv.isDarwin
+  buildInputs = [ openssl xorg.libxcb libgit2 ] ++ lib.optionals stdenv.isDarwin
     (with darwin.apple_sdk.frameworks; [ curl Security AppKit ]);
 
   # Tests need to write to the theme directory in HOME.
diff --git a/pkgs/applications/editors/android-studio/common.nix b/pkgs/applications/editors/android-studio/common.nix
index d8f2d86daee..0ce0a37d876 100644
--- a/pkgs/applications/editors/android-studio/common.nix
+++ b/pkgs/applications/editors/android-studio/common.nix
@@ -72,7 +72,7 @@ let
       cp -r . $out
       wrapProgram $out/bin/studio.sh \
         --set ANDROID_EMULATOR_USE_SYSTEM_LIBS 1 \
-        --prefix PATH : "${stdenv.lib.makeBinPath [
+        --prefix PATH : "${lib.makeBinPath [
 
           # Checked in studio.sh
           coreutils
@@ -95,7 +95,7 @@ let
           git
           ps
         ]}" \
-        --prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [
+        --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [
 
           # Crash at startup without these
           fontconfig
diff --git a/pkgs/applications/editors/atom/default.nix b/pkgs/applications/editors/atom/default.nix
index 9d1d8d4113c..7a6d5b5cd91 100644
--- a/pkgs/applications/editors/atom/default.nix
+++ b/pkgs/applications/editors/atom/default.nix
@@ -15,7 +15,7 @@ let
   };
 
   common = pname: {version, sha256, beta ? null}:
-      let fullVersion = version + stdenv.lib.optionalString (beta != null) "-beta${toString beta}";
+      let fullVersion = version + lib.optionalString (beta != null) "-beta${toString beta}";
       name = "${pname}-${fullVersion}";
   in stdenv.mkDerivation {
     inherit name;
@@ -89,4 +89,4 @@ let
       platforms = platforms.x86_64;
     };
   };
-in stdenv.lib.mapAttrs common versions
+in lib.mapAttrs common versions
diff --git a/pkgs/applications/editors/brackets/default.nix b/pkgs/applications/editors/brackets/default.nix
index 9d5978e605a..95bf6f6d7aa 100644
--- a/pkgs/applications/editors/brackets/default.nix
+++ b/pkgs/applications/editors/brackets/default.nix
@@ -1,6 +1,6 @@
 { stdenv, lib, fetchurl, gtk2, glib, gdk-pixbuf, alsaLib, nss, nspr, gconf
 , cups, libgcrypt_1_5, systemd, dbus, libXdamage, expat }:
-with stdenv.lib;
+with lib;
 
 let
   bracketsLibs = makeLibraryPath [
diff --git a/pkgs/applications/editors/code-browser/default.nix b/pkgs/applications/editors/code-browser/default.nix
index 3eecc471db9..a4ae4a811bf 100644
--- a/pkgs/applications/editors/code-browser/default.nix
+++ b/pkgs/applications/editors/code-browser/default.nix
@@ -28,17 +28,17 @@ stdenv.mkDerivation rec {
                         gtk3
                         pkg-config
                       ]
-  ++ stdenv.lib.optionals withQt [ wrapQtAppsHook ];
-  buildInputs = stdenv.lib.optionals withQt [ qtbase ]
-                ++ stdenv.lib.optionals withGtk [ gtk3 ];
+  ++ lib.optionals withQt [ wrapQtAppsHook ];
+  buildInputs = lib.optionals withQt [ qtbase ]
+                ++ lib.optionals withGtk [ gtk3 ];
   makeFlags = [
     "prefix=$(out)"
     "COPPER=${copper}/bin/copper-elf64"
     "with-local-libs"
     "QINC=${qtbase.dev}/include"
   ]
-  ++ stdenv.lib.optionals withQt [ "UI=qt" ]
-  ++ stdenv.lib.optionals withGtk [ "UI=gtk" ];
+  ++ lib.optionals withQt [ "UI=qt" ]
+  ++ lib.optionals withGtk [ "UI=gtk" ];
   meta = with lib; {
     description = "Folding text editor, designed to hierarchically structure any kind of text file and especially source code";
     homepage = "https://tibleiz.net/code-browser/";
diff --git a/pkgs/applications/editors/codeblocks/default.nix b/pkgs/applications/editors/codeblocks/default.nix
index 4e2ac8a50f1..106ddb515ed 100644
--- a/pkgs/applications/editors/codeblocks/default.nix
+++ b/pkgs/applications/editors/codeblocks/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchurl, autoreconfHook, libtool, pkgconfig, file, zip, wxGTK, gtk2
+{ lib, stdenv, fetchurl, autoreconfHook, libtool, pkgconfig, file, zip, wxGTK, gtk2
 , contribPlugins ? false, hunspell, gamin, boost
 }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
-  name = "${pname}-${stdenv.lib.optionalString contribPlugins "full-"}${version}";
+  name = "${pname}-${lib.optionalString contribPlugins "full-"}${version}";
   version = "17.12";
   pname = "codeblocks";
 
diff --git a/pkgs/applications/editors/dhex/default.nix b/pkgs/applications/editors/dhex/default.nix
index c4f43e71fe6..743e55b0969 100644
--- a/pkgs/applications/editors/dhex/default.nix
+++ b/pkgs/applications/editors/dhex/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ncurses }:
+{ lib, stdenv, fetchurl, ncurses }:
 
 stdenv.mkDerivation rec {
   pname = "dhex";
@@ -26,8 +26,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A themeable hex editor with diff mode";
     homepage = "http://www.dettus.net/dhex/";
-    license = stdenv.lib.licenses.gpl2;
-    maintainers = with stdenv.lib.maintainers; [qknight];
-    platforms = with stdenv.lib.platforms; linux;
+    license = lib.licenses.gpl2;
+    maintainers = with lib.maintainers; [qknight];
+    platforms = with lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/editors/eclipse/build-eclipse.nix b/pkgs/applications/editors/eclipse/build-eclipse.nix
index 0282dc95f72..1ddb6707110 100644
--- a/pkgs/applications/editors/eclipse/build-eclipse.nix
+++ b/pkgs/applications/editors/eclipse/build-eclipse.nix
@@ -1,4 +1,4 @@
-{ stdenv, makeDesktopItem, freetype, fontconfig, libX11, libXrender
+{ lib, stdenv, makeDesktopItem, freetype, fontconfig, libX11, libXrender
 , zlib, jdk, glib, gtk, libXtst, gsettings-desktop-schemas, webkitgtk
 , makeWrapper, perl, ... }:
 
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
   buildInputs = [
     fontconfig freetype glib gsettings-desktop-schemas gtk jdk libX11
     libXrender libXtst makeWrapper zlib
-  ] ++ stdenv.lib.optional (webkitgtk != null) webkitgtk;
+  ] ++ lib.optional (webkitgtk != null) webkitgtk;
 
   buildCommand = ''
     # Unpack tarball.
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
     interpreter=$(echo ${stdenv.glibc.out}/lib/ld-linux*.so.2)
     libCairo=$out/eclipse/libcairo-swt.so
     patchelf --set-interpreter $interpreter $out/eclipse/eclipse
-    [ -f $libCairo ] && patchelf --set-rpath ${stdenv.lib.makeLibraryPath [ freetype fontconfig libX11 libXrender zlib ]} $libCairo
+    [ -f $libCairo ] && patchelf --set-rpath ${lib.makeLibraryPath [ freetype fontconfig libX11 libXrender zlib ]} $libCairo
 
     # Create wrapper script.  Pass -configuration to store
     # settings in ~/.eclipse/org.eclipse.platform_<version> rather
@@ -41,7 +41,7 @@ stdenv.mkDerivation rec {
 
     makeWrapper $out/eclipse/eclipse $out/bin/eclipse \
       --prefix PATH : ${jdk}/bin \
-      --prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath ([ glib gtk libXtst ] ++ stdenv.lib.optional (webkitgtk != null) webkitgtk)} \
+      --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath ([ glib gtk libXtst ] ++ lib.optional (webkitgtk != null) webkitgtk)} \
       --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" \
       --add-flags "-configuration \$HOME/.eclipse/''${productId}_$productVersion/configuration"
 
diff --git a/pkgs/applications/editors/eclipse/default.nix b/pkgs/applications/editors/eclipse/default.nix
index 586e2343cd3..cff482e887d 100644
--- a/pkgs/applications/editors/eclipse/default.nix
+++ b/pkgs/applications/editors/eclipse/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeDesktopItem, makeWrapper
+{ lib, stdenv, fetchurl, makeDesktopItem, makeWrapper
 , freetype, fontconfig, libX11, libXrender, zlib
 , glib, gtk3, gtk2, libXtst, jdk, jdk8, gsettings-desktop-schemas
 , webkitgtk ? null  # for internal web browser
@@ -148,7 +148,7 @@ in rec {
       pluginEnv = buildEnv {
         name = "eclipse-plugins";
         paths =
-          with stdenv.lib;
+          with lib;
             filter (x: x ? isEclipsePlugin) (closePropagation plugins);
       };
 
@@ -156,11 +156,11 @@ in rec {
       # add the property indicating the plugin directory.
       dropinPropName = "org.eclipse.equinox.p2.reconciler.dropins.directory";
       dropinProp = "-D${dropinPropName}=${pluginEnv}/eclipse/dropins";
-      jvmArgsText = stdenv.lib.concatStringsSep "\n" (jvmArgs ++ [dropinProp]);
+      jvmArgsText = lib.concatStringsSep "\n" (jvmArgs ++ [dropinProp]);
 
       # Base the derivation name on the name of the underlying
       # Eclipse.
-      name = (stdenv.lib.meta.appendToName "with-plugins" eclipse).name;
+      name = (lib.meta.appendToName "with-plugins" eclipse).name;
     in
       runCommand name { buildInputs = [ makeWrapper ]; } ''
         mkdir -p $out/bin $out/etc
diff --git a/pkgs/applications/editors/ed/default.nix b/pkgs/applications/editors/ed/default.nix
index 0fb48203b2f..3ceb037583a 100644
--- a/pkgs/applications/editors/ed/default.nix
+++ b/pkgs/applications/editors/ed/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, lzip
+{ lib, stdenv, fetchurl, lzip
 }:
 
 # Note: this package is used for bootstrapping fetchurl, and thus
@@ -33,14 +33,14 @@ stdenv.mkDerivation (rec {
       full-screen editors such as GNU Emacs or GNU Moe.
     '';
 
-    license = stdenv.lib.licenses.gpl3Plus;
+    license = lib.licenses.gpl3Plus;
 
     homepage = "https://www.gnu.org/software/ed/";
 
     maintainers = [ ];
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
-} // stdenv.lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) {
+} // lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) {
   # This may be moved above during a stdenv rebuild.
   preConfigure = ''
     configureFlagsArray+=("CC=$CC")
diff --git a/pkgs/applications/editors/elvis/default.nix b/pkgs/applications/editors/elvis/default.nix
index df8f255de5e..f63598a7c5e 100644
--- a/pkgs/applications/editors/elvis/default.nix
+++ b/pkgs/applications/editors/elvis/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, fetchpatch, stdenv, ncurses }:
+{ fetchurl, fetchpatch, lib, stdenv, ncurses }:
 
 stdenv.mkDerivation {
   name = "elvis-2.2_0";
@@ -41,6 +41,6 @@ stdenv.mkDerivation {
   meta = {
     homepage = "http://elvis.the-little-red-haired-girl.org/";
     description = "A vi clone for Unix and other operating systems";
-    license = stdenv.lib.licenses.free;
+    license = lib.licenses.free;
   };
 }
diff --git a/pkgs/applications/editors/emacs-modes/cedet/default.nix b/pkgs/applications/editors/emacs-modes/cedet/default.nix
index 45f20fccad9..9ba9e070d08 100644
--- a/pkgs/applications/editors/emacs-modes/cedet/default.nix
+++ b/pkgs/applications/editors/emacs-modes/cedet/default.nix
@@ -41,7 +41,7 @@ stdenv.mkDerivation rec {
       Development Environment), and COGRE (COnnected GRaph Editor).
     '';
 
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
 
     homepage = "http://cedet.sourceforge.net/";
 
diff --git a/pkgs/applications/editors/emacs-modes/ess-R-object-popup/default.nix b/pkgs/applications/editors/emacs-modes/ess-R-object-popup/default.nix
index 5beaed58240..5eb81197c8b 100644
--- a/pkgs/applications/editors/emacs-modes/ess-R-object-popup/default.nix
+++ b/pkgs/applications/editors/emacs-modes/ess-R-object-popup/default.nix
@@ -17,6 +17,6 @@ stdenv.mkDerivation {
   meta = {
     description = "Popup descriptions of R objects";
     homepage = "https://github.com/myuhe/ess-R-object-popup.el";
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/applications/editors/emacs-modes/helm-words/default.nix b/pkgs/applications/editors/emacs-modes/helm-words/default.nix
index 00879463276..a8a1274737a 100644
--- a/pkgs/applications/editors/emacs-modes/helm-words/default.nix
+++ b/pkgs/applications/editors/emacs-modes/helm-words/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
   meta = {
     description = "Emacs major mode for jade and stylus";
     homepage = "https://github.com/brianc/helm-words";
-    license = stdenv.lib.licenses.gpl3;
-    platforms = stdenv.lib.platforms.all;
+    license = lib.licenses.gpl3;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/applications/editors/emacs-modes/hsc3/default.nix b/pkgs/applications/editors/emacs-modes/hsc3/default.nix
index 6c2db85d794..972d3b8a6f9 100644
--- a/pkgs/applications/editors/emacs-modes/hsc3/default.nix
+++ b/pkgs/applications/editors/emacs-modes/hsc3/default.nix
@@ -23,6 +23,6 @@ in stdenv.mkDerivation {
   meta = {
     homepage = "http://rd.slavepianos.org/?t=hsc3";
     description = "hsc3 mode package for Emacs";
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/applications/editors/emacs-modes/org-mac-link/default.nix b/pkgs/applications/editors/emacs-modes/org-mac-link/default.nix
index 93af03ce229..dba6e10a590 100644
--- a/pkgs/applications/editors/emacs-modes/org-mac-link/default.nix
+++ b/pkgs/applications/editors/emacs-modes/org-mac-link/default.nix
@@ -25,7 +25,7 @@ stdenv.mkDerivation {
   meta = {
     description = "Insert org-mode links to items selected in various Mac apps";
     homepage = "https://orgmode.org/worg/org-contrib/org-mac-link.html";
-    license = stdenv.lib.licenses.gpl3;
-    platforms = stdenv.lib.platforms.all;
+    license = lib.licenses.gpl3;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/applications/editors/emacs-modes/perl-completion/default.nix b/pkgs/applications/editors/emacs-modes/perl-completion/default.nix
index 7f2454c811a..815783aabea 100644
--- a/pkgs/applications/editors/emacs-modes/perl-completion/default.nix
+++ b/pkgs/applications/editors/emacs-modes/perl-completion/default.nix
@@ -18,6 +18,6 @@ stdenv.mkDerivation {
   meta = {
     description = "Minor mode provides useful features for editing perl codes";
     homepage = "http://emacswiki.org/emacs/PerlCompletion";
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/applications/editors/emacs-modes/prolog/default.nix b/pkgs/applications/editors/emacs-modes/prolog/default.nix
index 66ab9830237..7be3b1ca3c7 100644
--- a/pkgs/applications/editors/emacs-modes/prolog/default.nix
+++ b/pkgs/applications/editors/emacs-modes/prolog/default.nix
@@ -17,6 +17,6 @@ stdenv.mkDerivation {
   meta = {
     homepage = "http://bruda.ca/emacs/prolog_mode_for_emacs/";
     description = "Prolog mode for Emacs";
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
   };
 }
diff --git a/pkgs/applications/editors/emacs-modes/railgun/default.nix b/pkgs/applications/editors/emacs-modes/railgun/default.nix
index 8ca8d1feaa1..4cf4d18d8cc 100644
--- a/pkgs/applications/editors/emacs-modes/railgun/default.nix
+++ b/pkgs/applications/editors/emacs-modes/railgun/default.nix
@@ -17,6 +17,6 @@ stdenv.mkDerivation {
   meta = {
     description = "Propel yourself through a rails project with the power of magnets";
     homepage = "https://github.com/mbriggs/railgun.el";
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/applications/editors/emacs-modes/rect-mark/default.nix b/pkgs/applications/editors/emacs-modes/rect-mark/default.nix
index 4320a88457a..d2785ef0363 100644
--- a/pkgs/applications/editors/emacs-modes/rect-mark/default.nix
+++ b/pkgs/applications/editors/emacs-modes/rect-mark/default.nix
@@ -25,8 +25,8 @@ stdenv.mkDerivation {
   meta = {
     description = "Mark a rectangle of text with highlighting";
     homepage = "http://emacswiki.org/emacs/RectangleMark";
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
 
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/applications/editors/emacs-modes/sunrise-commander/default.nix b/pkgs/applications/editors/emacs-modes/sunrise-commander/default.nix
index 7e611d68a0a..710c33a96ec 100644
--- a/pkgs/applications/editors/emacs-modes/sunrise-commander/default.nix
+++ b/pkgs/applications/editors/emacs-modes/sunrise-commander/default.nix
@@ -23,8 +23,8 @@ stdenv.mkDerivation {
   meta = {
     description = "Two-pane file manager for Emacs based on Dired and inspired by MC";
     homepage = "http://www.emacswiki.org/emacs/Sunrise_Commander";
-    license = stdenv.lib.licenses.gpl3Plus;
+    license = lib.licenses.gpl3Plus;
 
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/applications/editors/emacs-modes/tramp/default.nix b/pkgs/applications/editors/emacs-modes/tramp/default.nix
index b87390d4609..f67efb80bf9 100644
--- a/pkgs/applications/editors/emacs-modes/tramp/default.nix
+++ b/pkgs/applications/editors/emacs-modes/tramp/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Transparently access remote files from Emacs. Newer versions than built-in.";
     homepage = "https://www.gnu.org/software/tramp";
-    license = stdenv.lib.licenses.gpl3Plus;
-    platforms = stdenv.lib.platforms.all;
+    license = lib.licenses.gpl3Plus;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/applications/editors/emacs-modes/zeitgeist/default.nix b/pkgs/applications/editors/emacs-modes/zeitgeist/default.nix
index c771f5423a9..352c46718dd 100644
--- a/pkgs/applications/editors/emacs-modes/zeitgeist/default.nix
+++ b/pkgs/applications/editors/emacs-modes/zeitgeist/default.nix
@@ -20,6 +20,6 @@ stdenv.mkDerivation {
   meta = {
     description = "Integreate Emacs with Zeitgeist";
     homepage = "http://zeitgeist-project.com/";
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/applications/editors/flpsed/default.nix b/pkgs/applications/editors/flpsed/default.nix
index 871d8489f61..bffa5064389 100644
--- a/pkgs/applications/editors/flpsed/default.nix
+++ b/pkgs/applications/editors/flpsed/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   postPatch = ''
     # replace the execvp call to ghostscript
-    sed -e '/exec_gs/ {n; s|"gs"|"${stdenv.lib.getBin ghostscript}/bin/gs"|}' \
+    sed -e '/exec_gs/ {n; s|"gs"|"${lib.getBin ghostscript}/bin/gs"|}' \
         -i src/GsWidget.cxx
   '';
 
diff --git a/pkgs/applications/editors/gnome-builder/default.nix b/pkgs/applications/editors/gnome-builder/default.nix
index 6c91595c99a..4c36dcfda11 100644
--- a/pkgs/applications/editors/gnome-builder/default.nix
+++ b/pkgs/applications/editors/gnome-builder/default.nix
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
   version = "3.38.1";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "06wcyfrwcjyj2vcqyw0z3sy1r4qxpcdpwqq1qmpsaphpz8acycjn";
   };
 
diff --git a/pkgs/applications/editors/gnome-latex/default.nix b/pkgs/applications/editors/gnome-latex/default.nix
index 692e07e52ca..d9e09bf0d89 100644
--- a/pkgs/applications/editors/gnome-latex/default.nix
+++ b/pkgs/applications/editors/gnome-latex/default.nix
@@ -7,7 +7,7 @@ in stdenv.mkDerivation {
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0xqd49pgi82dygqnxj08i1v22b0vwwhx3zvdinhrx4jny339yam8";
   };
 
diff --git a/pkgs/applications/editors/gobby/default.nix b/pkgs/applications/editors/gobby/default.nix
index 4dc7ea33cdd..d4710094e4f 100644
--- a/pkgs/applications/editors/gobby/default.nix
+++ b/pkgs/applications/editors/gobby/default.nix
@@ -21,7 +21,7 @@ in stdenv.mkDerivation {
   meta = with lib; {
     homepage = "http://gobby.0x539.de/";
     description = "A GTK-based collaborative editor supporting multiple documents in one session and a multi-user chat";
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
     maintainers = [ maintainers.phreedom ];
     platforms = platforms.all;
   };
diff --git a/pkgs/applications/editors/hexedit/default.nix b/pkgs/applications/editors/hexedit/default.nix
index 916dd4a1594..56b721842a3 100644
--- a/pkgs/applications/editors/hexedit/default.nix
+++ b/pkgs/applications/editors/hexedit/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ncurses }:
+{ lib, stdenv, fetchurl, ncurses }:
 
 stdenv.mkDerivation rec {
   pname = "hexedit";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "View and edit files in hexadecimal or in ASCII";
     homepage = "http://prigaux.chez.com/hexedit.html";
-    license = stdenv.lib.licenses.gpl2Plus;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/applications/editors/howl/default.nix b/pkgs/applications/editors/howl/default.nix
index 975016d5541..f3671cc7b3a 100644
--- a/pkgs/applications/editors/howl/default.nix
+++ b/pkgs/applications/editors/howl/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, makeWrapper, pkgconfig, gtk3, librsvg }:
+{ lib, stdenv, fetchurl, makeWrapper, pkgconfig, gtk3, librsvg }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "howl";
diff --git a/pkgs/applications/editors/jed/default.nix b/pkgs/applications/editors/jed/default.nix
index e3be0139abf..7b197be0e6f 100644
--- a/pkgs/applications/editors/jed/default.nix
+++ b/pkgs/applications/editors/jed/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchzip
+{ lib, stdenv, fetchzip
 , pkg-config
 , gpm
 , libXext
@@ -51,7 +51,7 @@ stdenv.mkDerivation rec {
     install -D src/objs/rgrep $out/bin
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A programmable text editor written around S-Lang";
     longDescription = ''
       JED is a freely available text editor for Unix, VMS, MSDOS, OS/2, BeOS,
diff --git a/pkgs/applications/editors/jetbrains/common.nix b/pkgs/applications/editors/jetbrains/common.nix
index 43dbd137f78..62f1178866c 100644
--- a/pkgs/applications/editors/jetbrains/common.nix
+++ b/pkgs/applications/editors/jetbrains/common.nix
@@ -5,7 +5,7 @@
 
 { name, product, version, src, wmClass, jdk, meta }:
 
-with stdenv.lib;
+with lib;
 
 let loName = toLower product;
     hiName = toUpper product;
@@ -71,8 +71,8 @@ with stdenv; lib.makeOverridable mkDerivation rec {
     item=${desktopItem}
 
     makeWrapper "$out/$name/bin/${loName}.sh" "$out/bin/${execName}" \
-      --prefix PATH : "$out/libexec/${name}:${lib.optionalString (stdenv.isDarwin) "${jdk}/jdk/Contents/Home/bin:"}${stdenv.lib.makeBinPath [ jdk coreutils gnugrep which git ]}" \
-      --prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [
+      --prefix PATH : "$out/libexec/${name}:${lib.optionalString (stdenv.isDarwin) "${jdk}/jdk/Contents/Home/bin:"}${lib.makeBinPath [ jdk coreutils gnugrep which git ]}" \
+      --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [
         # Some internals want libstdc++.so.6
         stdenv.cc.cc.lib libsecret
         libnotify
@@ -86,6 +86,6 @@ with stdenv; lib.makeOverridable mkDerivation rec {
     ln -s "$item/share/applications" $out/share
   '';
 
-} // stdenv.lib.optionalAttrs (!(meta.license.free or true)) {
+} // lib.optionalAttrs (!(meta.license.free or true)) {
   preferLocalBuild = true;
 }
diff --git a/pkgs/applications/editors/jetbrains/default.nix b/pkgs/applications/editors/jetbrains/default.nix
index d805d179647..3c1224b91e7 100644
--- a/pkgs/applications/editors/jetbrains/default.nix
+++ b/pkgs/applications/editors/jetbrains/default.nix
@@ -5,7 +5,7 @@
 , vmopts ? null
 }:
 
-with stdenv.lib;
+with lib;
 
 let
   mkJetBrainsProduct = callPackage ./common.nix { inherit vmopts; };
@@ -271,7 +271,7 @@ in
     name = "clion-${version}";
     version = "2020.3.1"; /* updated by script */
     description  = "C/C++ IDE. New. Intelligent. Cross-platform";
-    license = stdenv.lib.licenses.unfree;
+    license = lib.licenses.unfree;
     src = fetchurl {
       url = "https://download.jetbrains.com/cpp/CLion-${version}.tar.gz";
       sha256 = "1jfvwir79s0kcqmlx6bbkmc42bplgl7814mnqfcsdzni1qv62pws"; /* updated by script */
@@ -284,7 +284,7 @@ in
     name = "datagrip-${version}";
     version = "2020.3.1"; /* updated by script */
     description = "Your Swiss Army Knife for Databases and SQL";
-    license = stdenv.lib.licenses.unfree;
+    license = lib.licenses.unfree;
     src = fetchurl {
       url = "https://download.jetbrains.com/datagrip/${name}.tar.gz";
       sha256 = "0jk7ywxk983ld5x71a59dh1hvlnli3sbvg7fbicahas5ml8clxfv"; /* updated by script */
@@ -297,7 +297,7 @@ in
     name = "goland-${version}";
     version = "2020.3.1"; /* updated by script */
     description = "Up and Coming Go IDE";
-    license = stdenv.lib.licenses.unfree;
+    license = lib.licenses.unfree;
     src = fetchurl {
       url = "https://download.jetbrains.com/go/${name}.tar.gz";
       sha256 = "12gi1a2bmafmy7qgqwv3a7b5b46dlhw4ahmkm5pkq6pmxl4y6dmk"; /* updated by script */
@@ -310,7 +310,7 @@ in
     name = "idea-community-${version}";
     version = "2020.3.1"; /* updated by script */
     description = "Integrated Development Environment (IDE) by Jetbrains, community edition";
-    license = stdenv.lib.licenses.asl20;
+    license = lib.licenses.asl20;
     src = fetchurl {
       url = "https://download.jetbrains.com/idea/ideaIC-${version}.tar.gz";
       sha256 = "0am4h8w1dmjl08iphqy78ivb91vkrvskg95dgm24zcj0n8rwmaq6"; /* updated by script */
@@ -323,7 +323,7 @@ in
     name = "idea-ultimate-${version}";
     version = "2020.3.1"; /* updated by script */
     description = "Integrated Development Environment (IDE) by Jetbrains, requires paid license";
-    license = stdenv.lib.licenses.unfree;
+    license = lib.licenses.unfree;
     src = fetchurl {
       url = "https://download.jetbrains.com/idea/ideaIU-${version}-no-jbr.tar.gz";
       sha256 = "1kwz0aq4b664awppakj4syppk218nynwxv4ngc7pa3k9v4g2sdah"; /* updated by script */
@@ -336,7 +336,7 @@ in
     name = "mps-${version}";
     version = "2020.2.3"; /* updated by script */
     description = "Create your own domain-specific language";
-    license = stdenv.lib.licenses.unfree;
+    license = lib.licenses.unfree;
     src = fetchurl {
       url = "https://download.jetbrains.com/mps/2020.2/MPS-${version}.tar.gz";
       sha256 = "1wd3d8pc155m54y5p2056p0x93v2nv9457i7la53ibbs7rj1j7kw"; /* updated by script */
@@ -349,7 +349,7 @@ in
     name = "phpstorm-${version}";
     version = "2020.3.1"; /* updated by script */
     description = "Professional IDE for Web and PHP developers";
-    license = stdenv.lib.licenses.unfree;
+    license = lib.licenses.unfree;
     src = fetchurl {
       url = "https://download.jetbrains.com/webide/PhpStorm-${version}.tar.gz";
       sha256 = "1c5j3mbg8scsl4c90cjahdk5gs5q72y5a8fhkqa9zmy6di42k99x"; /* updated by script */
@@ -362,7 +362,7 @@ in
     name = "pycharm-community-${version}";
     version = "2020.3.2"; /* updated by script */
     description = "PyCharm Community Edition";
-    license = stdenv.lib.licenses.asl20;
+    license = lib.licenses.asl20;
     src = fetchurl {
       url = "https://download.jetbrains.com/python/${name}.tar.gz";
       sha256 = "1z3w6aah635fdrhrzp5af6sgj269jk7mv8vgdd83gxillkx9vq9k"; /* updated by script */
@@ -375,7 +375,7 @@ in
     name = "pycharm-professional-${version}";
     version = "2020.3.2"; /* updated by script */
     description = "PyCharm Professional Edition";
-    license = stdenv.lib.licenses.unfree;
+    license = lib.licenses.unfree;
     src = fetchurl {
       url = "https://download.jetbrains.com/python/${name}.tar.gz";
       sha256 = "1fbb8v40q7vgn5v5dyxb211abr8swnxa3gw18kh3vlk6yc2crzfw"; /* updated by script */
@@ -388,7 +388,7 @@ in
     name = "rider-${version}";
     version = "2020.3.2"; /* updated by script */
     description = "A cross-platform .NET IDE based on the IntelliJ platform and ReSharper";
-    license = stdenv.lib.licenses.unfree;
+    license = lib.licenses.unfree;
     src = fetchurl {
       url = "https://download.jetbrains.com/rider/JetBrains.Rider-${version}.tar.gz";
       sha256 = "1dkgbd2nqkjcswf7j3pnrsaq9n5wk42abz2c4wgkrh1zrpgihd0j"; /* updated by script */
@@ -401,7 +401,7 @@ in
     name = "ruby-mine-${version}";
     version = "2020.3.1"; /* updated by script */
     description = "The Most Intelligent Ruby and Rails IDE";
-    license = stdenv.lib.licenses.unfree;
+    license = lib.licenses.unfree;
     src = fetchurl {
       url = "https://download.jetbrains.com/ruby/RubyMine-${version}.tar.gz";
       sha256 = "0drxzz6k0cmhir4szg8nwmsi9qh380vrryghmpvx9w83yrcain4c"; /* updated by script */
@@ -414,7 +414,7 @@ in
     name = "webstorm-${version}";
     version = "2020.3.1"; /* updated by script */
     description = "Professional IDE for Web and JavaScript development";
-    license = stdenv.lib.licenses.unfree;
+    license = lib.licenses.unfree;
     src = fetchurl {
       url = "https://download.jetbrains.com/webstorm/WebStorm-${version}.tar.gz";
       sha256 = "1bfq3xwnfz6f04d0lq584q7pg775a8y35b1b62w81dbfh43l4fj0"; /* updated by script */
diff --git a/pkgs/applications/editors/jove/default.nix b/pkgs/applications/editors/jove/default.nix
index 4a22c4d4d95..0b60b9474bd 100644
--- a/pkgs/applications/editors/jove/default.nix
+++ b/pkgs/applications/editors/jove/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub
+{ lib, stdenv, fetchFromGitHub
 , groff
 , ncurses
 , makeWrapper
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
       --prefix PATH ":" "$out/bin"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Jonathan's Own Version or Emacs";
     homepage = "https://github.com/jonmacs/jove";
     license = licenses.bsd2;
diff --git a/pkgs/applications/editors/jucipp/default.nix b/pkgs/applications/editors/jucipp/default.nix
index 53549986ed2..5f2cf75ff37 100644
--- a/pkgs/applications/editors/jucipp/default.nix
+++ b/pkgs/applications/editors/jucipp/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchgit, dconf, gtksourceview3, at-spi2-core, gtksourceviewmm,
+{ lib, stdenv, fetchgit, dconf, gtksourceview3, at-spi2-core, gtksourceviewmm,
   boost, epoxy, cmake, aspell, llvmPackages, libgit2, pkgconfig, pcre,
   libXdmcp, libxkbcommon, libpthreadstubs, wrapGAppsHook, aspellDicts, gtkmm3,
   coreutils, glibc, dbus, openssl, libxml2, gnumake, ctags }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "juicipp";
@@ -51,7 +51,7 @@ stdenv.mkDerivation rec {
   lintIncludes = let
     p = "arguments.emplace_back(\"-I";
     e = "\");";
-    v = stdenv.lib.getVersion llvmPackages.clang;
+    v = lib.getVersion llvmPackages.clang;
   in
     p+llvmPackages.libcxx+"/include/c++/v1"+e
     +p+llvmPackages.clang-unwrapped+"/lib/clang/"+v+"/include/"+e
@@ -61,11 +61,11 @@ stdenv.mkDerivation rec {
     sed -i 's|liblldb LIBLLDB_LIBRARIES|liblldb LIBNOTHING|g' CMakeLists.txt
     sed -i 's|> arguments;|> arguments; ${lintIncludes}|g' src/source_clang.cc
   '';
-  cmakeFlags = [ "-DLIBLLDB_LIBRARIES=${stdenv.lib.makeLibraryPath [ llvmPackages.lldb ]}/liblldb.so" ];
+  cmakeFlags = [ "-DLIBLLDB_LIBRARIES=${lib.makeLibraryPath [ llvmPackages.lldb ]}/liblldb.so" ];
   postInstall = ''
     mv $out/bin/juci $out/bin/.juci
     makeWrapper "$out/bin/.juci" "$out/bin/juci" \
-      --set PATH "${stdenv.lib.makeBinPath [ ctags coreutils llvmPackages.clang.cc cmake gnumake llvmPackages.clang.bintools llvmPackages.clang ]}" \
+      --set PATH "${lib.makeBinPath [ ctags coreutils llvmPackages.clang.cc cmake gnumake llvmPackages.clang.bintools llvmPackages.clang ]}" \
       --set NO_AT_BRIDGE 1 \
       --set ASPELL_CONF "dict-dir ${aspellDicts.en}/lib/aspell"
   '';
diff --git a/pkgs/applications/editors/kakoune/default.nix b/pkgs/applications/editors/kakoune/default.nix
index 67a2ac5fac7..3c0a8bafa7e 100644
--- a/pkgs/applications/editors/kakoune/default.nix
+++ b/pkgs/applications/editors/kakoune/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchFromGitHub, ncurses, asciidoc, docbook_xsl, libxslt, pkgconfig }:
+{ lib, stdenv, fetchFromGitHub, ncurses, asciidoc, docbook_xsl, libxslt, pkgconfig }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "kakoune-unwrapped";
diff --git a/pkgs/applications/editors/kakoune/plugins/kak-auto-pairs.nix b/pkgs/applications/editors/kakoune/plugins/kak-auto-pairs.nix
index 4b67f760976..c81244ba133 100644
--- a/pkgs/applications/editors/kakoune/plugins/kak-auto-pairs.nix
+++ b/pkgs/applications/editors/kakoune/plugins/kak-auto-pairs.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
     cp -r rc $out/share/kak/autoload/plugins/auto-pairs
   '';
 
-  meta = with stdenv.lib;
+  meta = with lib;
   { description = "Kakoune extension to enable automatic closing of pairs";
     homepage = "https://github.com/alexherbo2/auto-pairs.kak";
     license = licenses.unlicense;
diff --git a/pkgs/applications/editors/kakoune/plugins/kak-buffers.nix b/pkgs/applications/editors/kakoune/plugins/kak-buffers.nix
index eaf20aeadf8..9db9d4fab73 100644
--- a/pkgs/applications/editors/kakoune/plugins/kak-buffers.nix
+++ b/pkgs/applications/editors/kakoune/plugins/kak-buffers.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
     cp -r buffers.kak $out/share/kak/autoload/plugins
   '';
 
-  meta = with stdenv.lib;
+  meta = with lib;
   { description = "Ease navigation between opened buffers in Kakoune";
     homepage = "https://github.com/Delapouite/kakoune-buffers";
     license = licenses.mit;
diff --git a/pkgs/applications/editors/kakoune/plugins/kak-fzf.nix b/pkgs/applications/editors/kakoune/plugins/kak-fzf.nix
index 8a91f829c0c..1f6a4ea561f 100644
--- a/pkgs/applications/editors/kakoune/plugins/kak-fzf.nix
+++ b/pkgs/applications/editors/kakoune/plugins/kak-fzf.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchFromGitHub, fzf }:
 
-assert stdenv.lib.asserts.assertOneOf "fzf" fzf.pname [ "fzf" "skim" ];
+assert lib.asserts.assertOneOf "fzf" fzf.pname [ "fzf" "skim" ];
 
 stdenv.mkDerivation {
   name = "kak-fzf";
@@ -29,7 +29,7 @@ stdenv.mkDerivation {
     cp -r rc $out/share/kak/autoload/plugins/fzf
   '';
 
-  meta = with stdenv.lib;
+  meta = with lib;
   { description = "Kakoune plugin that brings integration with fzf";
     homepage = "https://github.com/andreyorst/fzf.kak";
     license = licenses.mit;
diff --git a/pkgs/applications/editors/kakoune/plugins/kak-powerline.nix b/pkgs/applications/editors/kakoune/plugins/kak-powerline.nix
index d328e47f7e1..6bd67da4228 100644
--- a/pkgs/applications/editors/kakoune/plugins/kak-powerline.nix
+++ b/pkgs/applications/editors/kakoune/plugins/kak-powerline.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
     cp -r rc $out/share/kak/autoload/plugins/powerline
   '';
 
-  meta = with stdenv.lib;
+  meta = with lib;
   { description = "Kakoune modeline, but with passion";
     homepage = "https://github.com/andreyorst/powerline.kak";
     license = licenses.mit;
diff --git a/pkgs/applications/editors/kakoune/plugins/kak-prelude.nix b/pkgs/applications/editors/kakoune/plugins/kak-prelude.nix
index 8fd5fba7d7e..40cd1bc9d27 100644
--- a/pkgs/applications/editors/kakoune/plugins/kak-prelude.nix
+++ b/pkgs/applications/editors/kakoune/plugins/kak-prelude.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
     cp -r rc $out/share/kak/autoload/plugins/prelude
   '';
 
-  meta = with stdenv.lib;
+  meta = with lib;
   { description = "Prelude of shell blocks for Kakoune.";
     homepage = "https://github.com/alexherbo2/prelude.kak";
     license = licenses.unlicense;
diff --git a/pkgs/applications/editors/kakoune/plugins/kak-vertical-selection.nix b/pkgs/applications/editors/kakoune/plugins/kak-vertical-selection.nix
index 7658ba0f7ad..ccc80ac8d81 100644
--- a/pkgs/applications/editors/kakoune/plugins/kak-vertical-selection.nix
+++ b/pkgs/applications/editors/kakoune/plugins/kak-vertical-selection.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
     cp -r vertical-selection.kak $out/share/kak/autoload/plugins
   '';
 
-  meta = with stdenv.lib;
+  meta = with lib;
   { description = "Select up and down lines that match the same pattern in Kakoune";
     homepage = "https://github.com/occivink/kakoune-vertical-selection";
     license = licenses.unlicense;
diff --git a/pkgs/applications/editors/kakoune/plugins/quickscope.kak.nix b/pkgs/applications/editors/kakoune/plugins/quickscope.kak.nix
index f2fb1f5d57c..deeaa8a9f15 100644
--- a/pkgs/applications/editors/kakoune/plugins/quickscope.kak.nix
+++ b/pkgs/applications/editors/kakoune/plugins/quickscope.kak.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
     sed -e 's,[|] *lua,|${lua5_3}/bin/lua,' quickscope.kak >$out/share/kak/autoload/plugins/quickscope.kak
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Highlight f and t jump positions";
     homepage = "https://sr.ht/~voroskoi/quickscope.kak/";
     license = licenses.unlicense;
diff --git a/pkgs/applications/editors/kdevelop5/kdevelop-pg-qt.nix b/pkgs/applications/editors/kdevelop5/kdevelop-pg-qt.nix
index 27cf579734e..4bd377444d0 100644
--- a/pkgs/applications/editors/kdevelop5/kdevelop-pg-qt.nix
+++ b/pkgs/applications/editors/kdevelop5/kdevelop-pg-qt.nix
@@ -26,6 +26,6 @@ stdenv.mkDerivation rec {
       It is used for some KDevelop-languagesupport-plugins (Ruby, PHP, CSS...).
     '';
     homepage = "https://www.kdevelop.org";
-    license = with stdenv.lib.licenses; [ lgpl2Plus ];
+    license = with lib.licenses; [ lgpl2Plus ];
   };
 }
diff --git a/pkgs/applications/editors/kodestudio/default.nix b/pkgs/applications/editors/kodestudio/default.nix
index d7f00a2e18a..e0704cdbc85 100644
--- a/pkgs/applications/editors/kodestudio/default.nix
+++ b/pkgs/applications/editors/kodestudio/default.nix
@@ -111,7 +111,7 @@ in
 
       # Wrap preload libXss
       wrapProgram $out/bin/kodestudio \
-          --prefix LD_PRELOAD : ${stdenv.lib.makeLibraryPath [ libXScrnSaver ]}/libXss.so.1
+          --prefix LD_PRELOAD : ${lib.makeLibraryPath [ libXScrnSaver ]}/libXss.so.1
     '';
 
     meta = with lib; {
diff --git a/pkgs/applications/editors/lighttable/default.nix b/pkgs/applications/editors/lighttable/default.nix
index ff5b6e3862e..52acc8ee50b 100644
--- a/pkgs/applications/editors/lighttable/default.nix
+++ b/pkgs/applications/editors/lighttable/default.nix
@@ -4,7 +4,7 @@
 }:
 
 let
-  libPath = stdenv.lib.makeLibraryPath [
+  libPath = lib.makeLibraryPath [
       stdenv.cc.cc zlib glib dbus gtk2 atk pango freetype libgnome-keyring3 nss
       fontconfig gdk-pixbuf cairo cups expat libgpgerror alsaLib nspr gnome2.GConf
       xorg.libXrender xorg.libX11 xorg.libXext xorg.libXdamage xorg.libXtst
diff --git a/pkgs/applications/editors/manuskript/default.nix b/pkgs/applications/editors/manuskript/default.nix
index deeb9b36c71..2dd9174d6dd 100644
--- a/pkgs/applications/editors/manuskript/default.nix
+++ b/pkgs/applications/editors/manuskript/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, zlib, fetchFromGitHub, python3Packages, wrapQtAppsHook }:
+{ lib, stdenv, zlib, fetchFromGitHub, python3Packages, wrapQtAppsHook }:
 
 python3Packages.buildPythonApplication rec {
   pname = "manuskript";
@@ -55,8 +55,8 @@ python3Packages.buildPythonApplication rec {
     outline your story. Organize your ideas about the world your
     characters live in.
     '';
-    license = stdenv.lib.licenses.gpl3;
-    maintainers = [ stdenv.lib.maintainers.steveej ];
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.gpl3;
+    maintainers = [ lib.maintainers.steveej ];
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/editors/monodevelop/default.nix b/pkgs/applications/editors/monodevelop/default.nix
index 9b576795be0..ed6695b9979 100644
--- a/pkgs/applications/editors/monodevelop/default.nix
+++ b/pkgs/applications/editors/monodevelop/default.nix
@@ -59,7 +59,7 @@ stdenv.mkDerivation rec {
     2a3,5
     > export MONO_GAC_PREFIX=${gnome-sharp}:${gtk-sharp-2_0}:\$MONO_GAC_PREFIX
     > export PATH=${mono}/bin:\$PATH
-    > export LD_LIBRARY_PATH=${stdenv.lib.makeLibraryPath [ glib gnome2.libgnomeui gnome2.gnome_vfs gnome-sharp gtk-sharp-2_0 gtk-sharp-2_0.gtk ]}:\$LD_LIBRARY_PATH
+    > export LD_LIBRARY_PATH=${lib.makeLibraryPath [ glib gnome2.libgnomeui gnome2.gnome_vfs gnome-sharp gtk-sharp-2_0 gtk-sharp-2_0.gtk ]}:\$LD_LIBRARY_PATH
     >
     EOF
     done
diff --git a/pkgs/applications/editors/music/tuxguitar/default.nix b/pkgs/applications/editors/music/tuxguitar/default.nix
index e7cd319b820..63be87ee86c 100644
--- a/pkgs/applications/editors/music/tuxguitar/default.nix
+++ b/pkgs/applications/editors/music/tuxguitar/default.nix
@@ -27,7 +27,7 @@ in stdenv.mkDerivation rec {
 
     wrapProgram $out/bin/tuxguitar \
       --set JAVA "${jdk}/bin/java" \
-      --prefix LD_LIBRARY_PATH : "$out/lib/:${stdenv.lib.makeLibraryPath [ swt alsaLib jack2 fluidsynth libpulseaudio ]}" \
+      --prefix LD_LIBRARY_PATH : "$out/lib/:${lib.makeLibraryPath [ swt alsaLib jack2 fluidsynth libpulseaudio ]}" \
       --prefix CLASSPATH : "${swt}/jars/swt.jar:$out/lib/tuxguitar.jar:$out/lib/itext.jar"
   '';
 
diff --git a/pkgs/applications/editors/nano/default.nix b/pkgs/applications/editors/nano/default.nix
index 980b297cecc..cb53eb9d9d4 100644
--- a/pkgs/applications/editors/nano/default.nix
+++ b/pkgs/applications/editors/nano/default.nix
@@ -1,10 +1,10 @@
-{ stdenv, fetchurl, fetchFromGitHub, ncurses, texinfo, writeScript
+{ lib, stdenv, fetchurl, fetchFromGitHub, ncurses, texinfo, writeScript
 , common-updater-scripts, git, nix, nixfmt, coreutils, gnused, nixosTests
 , gettext ? null, enableNls ? true, enableTiny ? false }:
 
 assert enableNls -> (gettext != null);
 
-with stdenv.lib;
+with lib;
 
 let
   nixSyntaxHighlight = fetchFromGitHub {
@@ -30,8 +30,8 @@ in stdenv.mkDerivation rec {
 
   configureFlags = [
     "--sysconfdir=/etc"
-    (stdenv.lib.enableFeature enableNls "nls")
-    (stdenv.lib.enableFeature enableTiny "tiny")
+    (lib.enableFeature enableNls "nls")
+    (lib.enableFeature enableTiny "tiny")
   ];
 
   postInstall = ''
@@ -47,7 +47,7 @@ in stdenv.mkDerivation rec {
       #!${stdenv.shell}
       set -o errexit
       PATH=${
-        stdenv.lib.makeBinPath [
+        lib.makeBinPath [
           common-updater-scripts
           git
           nixfmt
diff --git a/pkgs/applications/editors/nano/nanorc/default.nix b/pkgs/applications/editors/nano/nanorc/default.nix
index 54442fc21f4..fcec55871aa 100644
--- a/pkgs/applications/editors/nano/nanorc/default.nix
+++ b/pkgs/applications/editors/nano/nanorc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, writeScript, nixosTests, common-updater-scripts
+{ lib, stdenv, fetchFromGitHub, writeScript, nixosTests, common-updater-scripts
 , coreutils, git, gnused, nix, nixfmt }:
 
 let
@@ -26,7 +26,7 @@ in stdenv.mkDerivation rec {
     #!${stdenv.shell}
     set -o errexit
     PATH=${
-      stdenv.lib.makeBinPath [
+      lib.makeBinPath [
         common-updater-scripts
         coreutils
         git
@@ -51,8 +51,8 @@ in stdenv.mkDerivation rec {
   meta = {
     description = "Improved Nano Syntax Highlighting Files";
     homepage = "https://github.com/scopatz/nanorc";
-    license = stdenv.lib.licenses.gpl3;
-    maintainers = with stdenv.lib.maintainers; [ nequissimus ];
-    platforms = stdenv.lib.platforms.all;
+    license = lib.licenses.gpl3;
+    maintainers = with lib.maintainers; [ nequissimus ];
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/applications/editors/nedit/default.nix b/pkgs/applications/editors/nedit/default.nix
index feaba31734c..5a523c05d79 100644
--- a/pkgs/applications/editors/nedit/default.nix
+++ b/pkgs/applications/editors/nedit/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ motif libXpm ];
 
   # the linux config works fine on darwin too!
-  buildFlags = stdenv.lib.optional (stdenv.isLinux || stdenv.isDarwin) "linux";
+  buildFlags = lib.optional (stdenv.isLinux || stdenv.isDarwin) "linux";
 
   NIX_CFLAGS_COMPILE="-DBUILD_UNTESTED_NEDIT -L${motif}/lib";
 
diff --git a/pkgs/applications/editors/neovim/default.nix b/pkgs/applications/editors/neovim/default.nix
index b4ad25f60c2..427e11ca642 100644
--- a/pkgs/applications/editors/neovim/default.nix
+++ b/pkgs/applications/editors/neovim/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, gettext, msgpack, libtermkey, libiconv
+{ lib, stdenv, fetchFromGitHub, cmake, gettext, msgpack, libtermkey, libiconv
 , libuv, lua, ncurses, pkgconfig
 , unibilium, xsel, gperf
 , libvterm-neovim
@@ -9,7 +9,7 @@
 , nodejs ? null, fish ? null, python ? null
 }:
 
-with stdenv.lib;
+with lib;
 
 let
   neovimLuaEnv = lua.withPackages(ps:
@@ -104,11 +104,11 @@ in
     # triggers on buffer overflow bug while running tests
     hardeningDisable = [ "fortify" ];
 
-    preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
+    preConfigure = lib.optionalString stdenv.isDarwin ''
       substituteInPlace src/nvim/CMakeLists.txt --replace "    util" ""
     '';
 
-    postInstall = stdenv.lib.optionalString stdenv.isLinux ''
+    postInstall = lib.optionalString stdenv.isLinux ''
       sed -i -e "s|'xsel|'${xsel}/bin/xsel|g" $out/share/nvim/runtime/autoload/provider/clipboard.vim
     '';
 
diff --git a/pkgs/applications/editors/neovim/neovim-remote.nix b/pkgs/applications/editors/neovim/neovim-remote.nix
index 06beff03f90..1d82e70f5c4 100644
--- a/pkgs/applications/editors/neovim/neovim-remote.nix
+++ b/pkgs/applications/editors/neovim/neovim-remote.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchFromGitHub, pythonPackages }:
+{ lib, stdenv, fetchFromGitHub, pythonPackages }:
 
-with stdenv.lib;
+with lib;
 
 pythonPackages.buildPythonApplication rec {
   pname = "neovim-remote";
diff --git a/pkgs/applications/editors/neovim/wrapper.nix b/pkgs/applications/editors/neovim/wrapper.nix
index 111e84e6343..5c6c6c1a8d5 100644
--- a/pkgs/applications/editors/neovim/wrapper.nix
+++ b/pkgs/applications/editors/neovim/wrapper.nix
@@ -7,7 +7,7 @@
 , pythonPackages
 , python3Packages
 }:
-with stdenv.lib;
+with lib;
 
 neovim:
 
@@ -37,7 +37,7 @@ let
       [ "--set" "NVIM_SYSTEM_RPLUGIN_MANIFEST" "${placeholder "out"}/rplugin.vim" ];
   in
   symlinkJoin {
-      name = "neovim-${stdenv.lib.getVersion neovim}";
+      name = "neovim-${lib.getVersion neovim}";
       # Remove the symlinks created by symlinkJoin which we need to perform
       # extra actions upon
       postBuild = lib.optionalString stdenv.isLinux ''
diff --git a/pkgs/applications/editors/netbeans/default.nix b/pkgs/applications/editors/netbeans/default.nix
index eb4698c69d6..9206b296b9a 100644
--- a/pkgs/applications/editors/netbeans/default.nix
+++ b/pkgs/applications/editors/netbeans/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper, makeDesktopItem, which, unzip, libicns, imagemagick
+{ lib, stdenv, fetchurl, makeWrapper, makeDesktopItem, which, unzip, libicns, imagemagick
 , jdk, perl, python
 }:
 
@@ -34,7 +34,7 @@ stdenv.mkDerivation {
     mkdir -pv $out/bin
     cp -a netbeans $out
     makeWrapper $out/netbeans/bin/netbeans $out/bin/netbeans \
-      --prefix PATH : ${stdenv.lib.makeBinPath [ jdk which ]} \
+      --prefix PATH : ${lib.makeBinPath [ jdk which ]} \
       --prefix JAVA_HOME : ${jdk.home} \
       --add-flags "--jdkhome ${jdk.home}"
 
@@ -61,8 +61,8 @@ stdenv.mkDerivation {
   meta = {
     description = "An integrated development environment for Java, C, C++ and PHP";
     homepage = "https://netbeans.apache.org/";
-    license = stdenv.lib.licenses.asl20;
-    maintainers = with stdenv.lib.maintainers; [ sander rszibele asbachb ];
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.asl20;
+    maintainers = with lib.maintainers; [ sander rszibele asbachb ];
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/applications/editors/nvi/default.nix b/pkgs/applications/editors/nvi/default.nix
index ed08954f8ba..328aad29efa 100644
--- a/pkgs/applications/editors/nvi/default.nix
+++ b/pkgs/applications/editors/nvi/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, ncurses }:
+{ fetchurl, lib, stdenv, ncurses }:
 
 stdenv.mkDerivation {
   name = "nvi-1.79";
@@ -50,7 +50,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = "http://www.bostic.com/vi/";
     description = "The Berkeley Vi Editor";
-    license = stdenv.lib.licenses.free;
+    license = lib.licenses.free;
     broken = true; # since 2020-02-08
   };
 }
diff --git a/pkgs/applications/editors/qxmledit/default.nix b/pkgs/applications/editors/qxmledit/default.nix
index 4023861cc37..fa4e73a3768 100644
--- a/pkgs/applications/editors/qxmledit/default.nix
+++ b/pkgs/applications/editors/qxmledit/default.nix
@@ -4,7 +4,7 @@
 stdenv.mkDerivation rec {
   name = "qxmledit-${version}" ;
   version = "0.9.15" ;
-  src = fetchFromGitHub ( stdenv.lib.importJSON ./qxmledit.json ) ;
+  src = fetchFromGitHub ( lib.importJSON ./qxmledit.json ) ;
   nativeBuildInputs = [ qmake ] ;
   buildInputs = [ qtbase qtxmlpatterns qtsvg qtscxml qtquick1 libGLU ] ;
   qmakeFlags = [ "CONFIG+=release" ] ;
diff --git a/pkgs/applications/editors/rehex/default.nix b/pkgs/applications/editors/rehex/default.nix
index ec85ffde488..df5fed210e6 100644
--- a/pkgs/applications/editors/rehex/default.nix
+++ b/pkgs/applications/editors/rehex/default.nix
@@ -24,13 +24,13 @@ stdenv.mkDerivation rec {
       'png2icns $@ $(ICONSET)/icon_16x16.png $(ICONSET)/icon_32x32.png $(ICONSET)/icon_128x128.png $(ICONSET)/icon_256x256.png $(ICONSET)/icon_512x512.png'
   '';
 
-  nativeBuildInputs = stdenv.lib.optionals (stdenv.isDarwin) [ libicns ];
+  nativeBuildInputs = lib.optionals (stdenv.isDarwin) [ libicns ];
 
   buildInputs = [ capstone jansson ]
-    ++ (stdenv.lib.optionals (!stdenv.isDarwin) [ wxGTK30 ])
-    ++ (stdenv.lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ Carbon Cocoa IOKit wxmac ]));
+    ++ (lib.optionals (!stdenv.isDarwin) [ wxGTK30 ])
+    ++ (lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ Carbon Cocoa IOKit wxmac ]));
 
-  makeFlags = [ "prefix=$(out)" ] ++ (stdenv.lib.optionals stdenv.isDarwin [ "-f Makefile.osx" ]);
+  makeFlags = [ "prefix=$(out)" ] ++ (lib.optionals stdenv.isDarwin [ "-f Makefile.osx" ]);
 
   meta = with lib; {
     description = "Reverse Engineers' Hex Editor";
diff --git a/pkgs/applications/editors/sublime/2/default.nix b/pkgs/applications/editors/sublime/2/default.nix
index b10008d0c49..e46d6ef97e4 100644
--- a/pkgs/applications/editors/sublime/2/default.nix
+++ b/pkgs/applications/editors/sublime/2/default.nix
@@ -1,6 +1,6 @@
-{ fetchurl, stdenv, glib, xorg, cairo, gtk2, makeDesktopItem }:
+{ fetchurl, lib, stdenv, glib, xorg, cairo, gtk2, makeDesktopItem }:
 let
-  libPath = stdenv.lib.makeLibraryPath [glib xorg.libX11 gtk2 cairo];
+  libPath = lib.makeLibraryPath [glib xorg.libX11 gtk2 cairo];
 in
 
 stdenv.mkDerivation rec {
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
     echo ${libPath}
     patchelf \
       --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
-      --set-rpath ${libPath}:${stdenv.cc.cc.lib}/lib${stdenv.lib.optionalString stdenv.is64bit "64"} \
+      --set-rpath ${libPath}:${stdenv.cc.cc.lib}/lib${lib.optionalString stdenv.is64bit "64"} \
       $out/sublime/sublime_text
 
     mkdir -p $out/share/icons
@@ -59,7 +59,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "Sophisticated text editor for code, markup and prose";
-    license = stdenv.lib.licenses.unfree;
+    license = lib.licenses.unfree;
     platforms = [ "x86_64-linux" "i686-linux" ];
   };
 }
diff --git a/pkgs/applications/editors/sublime/3/common.nix b/pkgs/applications/editors/sublime/3/common.nix
index 82d824b4877..cc8b835c137 100644
--- a/pkgs/applications/editors/sublime/3/common.nix
+++ b/pkgs/applications/editors/sublime/3/common.nix
@@ -8,7 +8,7 @@
 
 let
   pname = "sublimetext3";
-  packageAttribute = "sublime3${stdenv.lib.optionalString dev "-dev"}";
+  packageAttribute = "sublime3${lib.optionalString dev "-dev"}";
   binaries = [ "sublime_text" "plugin_host" "crash_reporter" ];
   primaryBinary = "sublime_text";
   primaryBinaryAliases = [ "subl" "sublime" "sublime3" ];
@@ -26,7 +26,7 @@ let
     else
       "x64";
 
-  libPath = stdenv.lib.makeLibraryPath [ xorg.libX11 glib gtk3 cairo pango ];
+  libPath = lib.makeLibraryPath [ xorg.libX11 glib gtk3 cairo pango ];
   redirects = [ "/usr/bin/pkexec=${pkexecPath}" ];
 in let
   binaryPackage = stdenv.mkDerivation {
@@ -66,7 +66,7 @@ in let
       for binary in ${ builtins.concatStringsSep " " binaries }; do
         patchelf \
           --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
-          --set-rpath ${libPath}:${stdenv.cc.cc.lib}/lib${stdenv.lib.optionalString stdenv.is64bit "64"} \
+          --set-rpath ${libPath}:${stdenv.cc.cc.lib}/lib${lib.optionalString stdenv.is64bit "64"} \
           $binary
       done
 
@@ -93,7 +93,7 @@ in let
 
     postFixup = ''
       wrapProgram $out/sublime_bash \
-        --set LD_PRELOAD "${stdenv.cc.cc.lib}/lib${stdenv.lib.optionalString stdenv.is64bit "64"}/libgcc_s.so.1"
+        --set LD_PRELOAD "${stdenv.cc.cc.lib}/lib${lib.optionalString stdenv.is64bit "64"}/libgcc_s.so.1"
 
       wrapProgram $out/${primaryBinary} \
         --set LD_PRELOAD "${libredirect}/lib/libredirect.so" \
@@ -102,7 +102,7 @@ in let
         "''${gappsWrapperArgs[@]}"
 
       # Without this, plugin_host crashes, even though it has the rpath
-      wrapProgram $out/plugin_host --prefix LD_PRELOAD : ${stdenv.cc.cc.lib}/lib${stdenv.lib.optionalString stdenv.is64bit "64"}/libgcc_s.so.1:${openssl.out}/lib/libssl.so:${bzip2.out}/lib/libbz2.so
+      wrapProgram $out/plugin_host --prefix LD_PRELOAD : ${stdenv.cc.cc.lib}/lib${lib.optionalString stdenv.is64bit "64"}/libgcc_s.so.1:${openssl.out}/lib/libssl.so:${bzip2.out}/lib/libbz2.so
     '';
   };
 in stdenv.mkDerivation (rec {
@@ -131,7 +131,7 @@ in stdenv.mkDerivation (rec {
   passthru.updateScript = writeScript "${pname}-update-script" ''
     #!${stdenv.shell}
     set -o errexit
-    PATH=${stdenv.lib.makeBinPath [ common-updater-scripts curl gnugrep ]}
+    PATH=${lib.makeBinPath [ common-updater-scripts curl gnugrep ]}
 
     latestVersion=$(curl -s ${versionUrl})
 
@@ -140,7 +140,7 @@ in stdenv.mkDerivation (rec {
         exit 0
     fi
 
-    for platform in ${stdenv.lib.concatStringsSep " " meta.platforms}; do
+    for platform in ${lib.concatStringsSep " " meta.platforms}; do
         # The script will not perform an update when the version attribute is up to date from previous platform run
         # We need to clear it before each run
         update-source-version ${packageAttribute}.${primaryBinary} 0 0000000000000000000000000000000000000000000000000000000000000000 --file=${versionFile} --version-key=buildVersion --system=$platform
diff --git a/pkgs/applications/editors/texmacs/common.nix b/pkgs/applications/editors/texmacs/common.nix
index 9479295e747..3ffcc8ecf45 100644
--- a/pkgs/applications/editors/texmacs/common.nix
+++ b/pkgs/applications/editors/texmacs/common.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, tex, extraFonts, chineseFonts, japaneseFonts, koreanFonts }:
+{ lib, stdenv, fetchurl, tex, extraFonts, chineseFonts, japaneseFonts, koreanFonts }:
 rec {
   extraFontsSrc = fetchurl {
     url = "ftp://ftp.texmacs.org/pub/TeXmacs/fonts/TeXmacs-extra-fonts-1.0-noarch.tar.gz";
@@ -63,6 +63,6 @@ rec {
     collaborative authoring are planned for later.
   '';
     homepage = "http://texmacs.org/";
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
   };
 }
diff --git a/pkgs/applications/editors/texmacs/darwin.nix b/pkgs/applications/editors/texmacs/darwin.nix
index a5117f3a678..ff090dd3259 100644
--- a/pkgs/applications/editors/texmacs/darwin.nix
+++ b/pkgs/applications/editors/texmacs/darwin.nix
@@ -1,4 +1,4 @@
-{ stdenv, callPackage, fetchurl,
+{ lib, stdenv, callPackage, fetchurl,
   guile_1_8, qt4, zlib, freetype, CoreFoundation, Cocoa, gettext, libiconv, ghostscript,
   tex ? null,
   aspell ? null,
@@ -49,12 +49,12 @@ stdenv.mkDerivation {
     "${ghostscript}/bin:" +
     (if aspell == null then "" else "${aspell}/bin:") +
     (if tex == null then "" else "${tex}/bin:") +
-    (if netpbm == null then "" else "${stdenv.lib.getBin netpbm}/bin:") +
+    (if netpbm == null then "" else "${lib.getBin netpbm}/bin:") +
     (if imagemagick == null then "" else "${imagemagick}/bin:");
 
   enableParallelBuilding = true;
 
   meta = common.meta // {
-    platforms = stdenv.lib.platforms.darwin;
+    platforms = lib.platforms.darwin;
   };
 }
diff --git a/pkgs/applications/editors/vbindiff/default.nix b/pkgs/applications/editors/vbindiff/default.nix
index 110b7caaf81..9a103867fbc 100644
--- a/pkgs/applications/editors/vbindiff/default.nix
+++ b/pkgs/applications/editors/vbindiff/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ncurses }:
+{ lib, stdenv, fetchurl, ncurses }:
 
 stdenv.mkDerivation rec {
   pname = "vbindiff";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A terminal visual binary diff viewer";
     homepage = "https://www.cjmweb.net/vbindiff/";
-    license = stdenv.lib.licenses.gpl2Plus;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/applications/editors/vim/configurable.nix b/pkgs/applications/editors/vim/configurable.nix
index aa8120470d1..eb015550c39 100644
--- a/pkgs/applications/editors/vim/configurable.nix
+++ b/pkgs/applications/editors/vim/configurable.nix
@@ -1,4 +1,4 @@
-{ source ? "default", callPackage, stdenv, ncurses, pkgconfig, gettext
+{ source ? "default", callPackage, lib, stdenv, ncurses, pkgconfig, gettext
 , writeText, config, glib, gtk2-x11, gtk3-x11, lua, python3, perl, tcl, ruby
 , libX11, libXext, libSM, libXpm, libXt, libXaw, libXau, libXmu
 , libICE
@@ -72,7 +72,7 @@ in stdenv.mkDerivation rec {
     default = common.src; # latest release
   };
 
-  patches = [ ./cflags-prune.diff ] ++ stdenv.lib.optional ftNixSupport ./ft-nix-support.patch;
+  patches = [ ./cflags-prune.diff ] ++ lib.optional ftNixSupport ./ft-nix-support.patch;
 
   configureFlags = [
     "--enable-gui=${guiSupport}"
@@ -95,50 +95,50 @@ in stdenv.mkDerivation rec {
     "--disable-carbon_check"
     "--disable-gtktest"
   ]
-  ++ stdenv.lib.optional stdenv.isDarwin
+  ++ lib.optional stdenv.isDarwin
      (if darwinSupport then "--enable-darwin" else "--disable-darwin")
-  ++ stdenv.lib.optionals luaSupport [
+  ++ lib.optionals luaSupport [
     "--with-lua-prefix=${lua}"
     "--enable-luainterp"
-  ] ++ stdenv.lib.optional lua.pkgs.isLuaJIT [
+  ] ++ lib.optional lua.pkgs.isLuaJIT [
     "--with-luajit"
   ]
-  ++ stdenv.lib.optionals pythonSupport [
+  ++ lib.optionals pythonSupport [
     "--enable-python3interp=yes"
     "--with-python3-config-dir=${python3}/lib"
     # Disables Python 2
     "--disable-pythoninterp"
   ]
-  ++ stdenv.lib.optional nlsSupport          "--enable-nls"
-  ++ stdenv.lib.optional perlSupport         "--enable-perlinterp"
-  ++ stdenv.lib.optional rubySupport         "--enable-rubyinterp"
-  ++ stdenv.lib.optional tclSupport          "--enable-tclinterp"
-  ++ stdenv.lib.optional multibyteSupport    "--enable-multibyte"
-  ++ stdenv.lib.optional cscopeSupport       "--enable-cscope"
-  ++ stdenv.lib.optional netbeansSupport     "--enable-netbeans"
-  ++ stdenv.lib.optional ximSupport          "--enable-xim";
+  ++ lib.optional nlsSupport          "--enable-nls"
+  ++ lib.optional perlSupport         "--enable-perlinterp"
+  ++ lib.optional rubySupport         "--enable-rubyinterp"
+  ++ lib.optional tclSupport          "--enable-tclinterp"
+  ++ lib.optional multibyteSupport    "--enable-multibyte"
+  ++ lib.optional cscopeSupport       "--enable-cscope"
+  ++ lib.optional netbeansSupport     "--enable-netbeans"
+  ++ lib.optional ximSupport          "--enable-xim";
 
   nativeBuildInputs = [
     pkgconfig
   ]
-  ++ stdenv.lib.optional wrapPythonDrv makeWrapper
-  ++ stdenv.lib.optional nlsSupport gettext
-  ++ stdenv.lib.optional perlSupport perl
-  ++ stdenv.lib.optional (guiSupport == "gtk3") wrapGAppsHook
+  ++ lib.optional wrapPythonDrv makeWrapper
+  ++ lib.optional nlsSupport gettext
+  ++ lib.optional perlSupport perl
+  ++ lib.optional (guiSupport == "gtk3") wrapGAppsHook
   ;
 
   buildInputs = [ ncurses libX11 libXext libSM libXpm libXt libXaw libXau
     libXmu glib libICE ]
-    ++ stdenv.lib.optional (guiSupport == "gtk2") gtk2-x11
-    ++ stdenv.lib.optional (guiSupport == "gtk3") gtk3-x11
-    ++ stdenv.lib.optionals darwinSupport [ CoreServices CoreData Cocoa Foundation libobjc ]
-    ++ stdenv.lib.optional luaSupport lua
-    ++ stdenv.lib.optional pythonSupport python3
-    ++ stdenv.lib.optional tclSupport tcl
-    ++ stdenv.lib.optional rubySupport ruby;
+    ++ lib.optional (guiSupport == "gtk2") gtk2-x11
+    ++ lib.optional (guiSupport == "gtk3") gtk3-x11
+    ++ lib.optionals darwinSupport [ CoreServices CoreData Cocoa Foundation libobjc ]
+    ++ lib.optional luaSupport lua
+    ++ lib.optional pythonSupport python3
+    ++ lib.optional tclSupport tcl
+    ++ lib.optional rubySupport ruby;
 
   preConfigure = ''
-    '' + stdenv.lib.optionalString ftNixSupport ''
+    '' + lib.optionalString ftNixSupport ''
       cp ${vimPlugins.vim-nix.src}/ftplugin/nix.vim runtime/ftplugin/nix.vim
       cp ${vimPlugins.vim-nix.src}/indent/nix.vim runtime/indent/nix.vim
       cp ${vimPlugins.vim-nix.src}/syntax/nix.vim runtime/syntax/nix.vim
@@ -150,20 +150,20 @@ in stdenv.mkDerivation rec {
 
   postInstall = ''
     ln -s $out/bin/vim $out/bin/vi
-  '' + stdenv.lib.optionalString stdenv.isLinux ''
+  '' + lib.optionalString stdenv.isLinux ''
     patchelf --set-rpath \
-      "$(patchelf --print-rpath $out/bin/vim):${stdenv.lib.makeLibraryPath buildInputs}" \
+      "$(patchelf --print-rpath $out/bin/vim):${lib.makeLibraryPath buildInputs}" \
       "$out"/bin/vim
     if [[ -e "$out"/bin/gvim ]]; then
       patchelf --set-rpath \
-        "$(patchelf --print-rpath $out/bin/vim):${stdenv.lib.makeLibraryPath buildInputs}" \
+        "$(patchelf --print-rpath $out/bin/vim):${lib.makeLibraryPath buildInputs}" \
         "$out"/bin/gvim
     fi
 
     ln -sfn '${nixosRuntimepath}' "$out"/share/vim/vimrc
-  '' + stdenv.lib.optionalString wrapPythonDrv ''
+  '' + lib.optionalString wrapPythonDrv ''
     wrapProgram "$out/bin/vim" --prefix PATH : "${python3}/bin"
-  '' + stdenv.lib.optionalString (guiSupport == "gtk3") ''
+  '' + lib.optionalString (guiSupport == "gtk3") ''
 
     rewrap () {
       rm -f "$out/bin/$1"
diff --git a/pkgs/applications/editors/vim/default.nix b/pkgs/applications/editors/vim/default.nix
index 95d2076153c..9b141992435 100644
--- a/pkgs/applications/editors/vim/default.nix
+++ b/pkgs/applications/editors/vim/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, callPackage, ncurses, gettext, pkgconfig
+{ lib, stdenv, fetchurl, callPackage, ncurses, gettext, pkgconfig
 # default vimrc
 , vimrc ? fetchurl {
     name = "default-vimrc";
@@ -19,12 +19,12 @@ stdenv.mkDerivation {
 
   nativeBuildInputs = [ gettext pkgconfig ];
   buildInputs = [ ncurses ]
-    ++ stdenv.lib.optionals stdenv.hostPlatform.isDarwin [ Carbon Cocoa ];
+    ++ lib.optionals stdenv.hostPlatform.isDarwin [ Carbon Cocoa ];
 
   configureFlags = [
     "--enable-multibyte"
     "--enable-nls"
-  ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+  ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     "vim_cv_toupper_broken=no"
     "--with-tlib=ncurses"
     "vim_cv_terminfo=yes"
diff --git a/pkgs/applications/editors/vim/vimacs.nix b/pkgs/applications/editors/vim/vimacs.nix
index cb77e60cf00..628b4c46cba 100644
--- a/pkgs/applications/editors/vim/vimacs.nix
+++ b/pkgs/applications/editors/vim/vimacs.nix
@@ -29,6 +29,6 @@ stdenv.mkDerivation rec {
     description = "Vim-Improved eMACS: Emacs emulation for Vim";
     homepage = "http://algorithm.com.au/code/vimacs";
     license = licenses.gpl2Plus;
-    maintainers = with stdenv.lib.maintainers; [ millerjason ];
+    maintainers = with lib.maintainers; [ millerjason ];
   };
 }
diff --git a/pkgs/applications/editors/vis/default.nix b/pkgs/applications/editors/vis/default.nix
index bd6eba94907..f1211269234 100644
--- a/pkgs/applications/editors/vis/default.nix
+++ b/pkgs/applications/editors/vis/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     libtermkey
     lua
     lpeg
-  ] ++ stdenv.lib.optionals stdenv.isLinux [
+  ] ++ lib.optionals stdenv.isLinux [
     acl
     libselinux
   ];
@@ -51,10 +51,10 @@ stdenv.mkDerivation rec {
     comment = meta.description;
     desktopName = "vis";
     genericName = "Text editor";
-    categories = stdenv.lib.concatStringsSep ";" [
+    categories = lib.concatStringsSep ";" [
       "Application" "Development" "IDE"
     ];
-    mimeType = stdenv.lib.concatStringsSep ";" [
+    mimeType = lib.concatStringsSep ";" [
       "text/plain" "application/octet-stream"
     ];
     startupNotify = "false";
diff --git a/pkgs/applications/editors/wxhexeditor/default.nix b/pkgs/applications/editors/wxhexeditor/default.nix
index 9b0fd592a6a..09037b2f0c3 100644
--- a/pkgs/applications/editors/wxhexeditor/default.nix
+++ b/pkgs/applications/editors/wxhexeditor/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fetchpatch, wxGTK, autoconf, automake, libtool, python, gettext }:
+{ lib, stdenv, fetchFromGitHub, fetchpatch, wxGTK, autoconf, automake, libtool, python, gettext }:
 
 stdenv.mkDerivation rec {
   pname = "wxHexEditor";
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
       wxHexEditor could edit HDD/SDD disk devices or partitions in raw up to exabyte sizes.
     '';
     homepage = "http://www.wxhexeditor.org/";
-    license = stdenv.lib.licenses.gpl2;
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/editors/zile/default.nix b/pkgs/applications/editors/zile/default.nix
index 81c86fb400e..7d36a2fd7f5 100644
--- a/pkgs/applications/editors/zile/default.nix
+++ b/pkgs/applications/editors/zile/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ perl pkg-config ]
     # `help2man' wants to run Zile, which won't work when the
     # newly-produced binary can't be run at build-time.
-    ++ stdenv.lib.optional
+    ++ lib.optional
          (stdenv.hostPlatform == stdenv.buildPlatform)
          help2man;