summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorBen Siraphob <bensiraphob@gmail.com>2021-01-24 00:15:07 +0700
committerBen Siraphob <bensiraphob@gmail.com>2021-01-24 00:16:29 +0700
commit2f78ee7e816ae39f86bae2e6c61b2d14d3fe3ff4 (patch)
treefd273f1e48a30237aa9b96342f6324757a4ca09f /pkgs
parentec334a1b01c491faa3463c96717b71921dddef2c (diff)
downloadnixpkgs-2f78ee7e816ae39f86bae2e6c61b2d14d3fe3ff4.tar
nixpkgs-2f78ee7e816ae39f86bae2e6c61b2d14d3fe3ff4.tar.gz
nixpkgs-2f78ee7e816ae39f86bae2e6c61b2d14d3fe3ff4.tar.bz2
nixpkgs-2f78ee7e816ae39f86bae2e6c61b2d14d3fe3ff4.tar.lz
nixpkgs-2f78ee7e816ae39f86bae2e6c61b2d14d3fe3ff4.tar.xz
nixpkgs-2f78ee7e816ae39f86bae2e6c61b2d14d3fe3ff4.tar.zst
nixpkgs-2f78ee7e816ae39f86bae2e6c61b2d14d3fe3ff4.zip
pkgs/development: stdenv.lib -> lib
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/development/androidndk-pkgs/androidndk-pkgs.nix4
-rw-r--r--pkgs/development/androidndk-pkgs/default.nix4
-rw-r--r--pkgs/development/beam-modules/build-erlang-mk.nix2
-rw-r--r--pkgs/development/beam-modules/build-hex.nix4
-rw-r--r--pkgs/development/beam-modules/build-mix.nix2
-rw-r--r--pkgs/development/beam-modules/build-rebar3.nix2
-rw-r--r--pkgs/development/beam-modules/default.nix22
-rw-r--r--pkgs/development/beam-modules/fetch-hex.nix4
-rw-r--r--pkgs/development/beam-modules/fetch-rebar-deps.nix6
-rw-r--r--pkgs/development/beam-modules/hex/default.nix6
-rw-r--r--pkgs/development/beam-modules/lib.nix4
-rw-r--r--pkgs/development/beam-modules/pc/default.nix2
-rw-r--r--pkgs/development/beam-modules/pgsql/default.nix6
-rw-r--r--pkgs/development/beam-modules/rebar3-release.nix2
-rw-r--r--pkgs/development/beam-modules/webdriver/default.nix6
-rw-r--r--pkgs/development/haskell-modules/configuration-nix.nix4
-rw-r--r--pkgs/development/haskell-modules/generic-builder.nix40
-rw-r--r--pkgs/development/haskell-modules/hoogle.nix4
-rw-r--r--pkgs/development/haskell-modules/make-package-set.nix8
-rw-r--r--pkgs/development/java-modules/build-maven-package.nix6
-rw-r--r--pkgs/development/java-modules/junit/default.nix8
-rw-r--r--pkgs/development/java-modules/maven-hello/default.nix8
-rw-r--r--pkgs/development/java-modules/maven-minimal.nix4
-rw-r--r--pkgs/development/libraries/SDL/default.nix2
-rw-r--r--pkgs/development/libraries/SDL2/default.nix2
-rw-r--r--pkgs/development/libraries/aravis/default.nix2
-rw-r--r--pkgs/development/libraries/atk/default.nix2
-rw-r--r--pkgs/development/libraries/cairo/default.nix4
-rw-r--r--pkgs/development/libraries/clutter-gst/default.nix2
-rw-r--r--pkgs/development/libraries/clutter-gtk/default.nix2
-rw-r--r--pkgs/development/libraries/gts/default.nix2
-rw-r--r--pkgs/development/libraries/irrlicht/default.nix2
-rw-r--r--pkgs/development/libraries/java/hsqldb/default.nix2
-rw-r--r--pkgs/development/libraries/java/junixsocket/default.nix2
-rw-r--r--pkgs/development/libraries/libgpod/default.nix2
-rw-r--r--pkgs/development/libraries/libre/default.nix2
-rw-r--r--pkgs/development/libraries/librem/default.nix4
-rw-r--r--pkgs/development/libraries/libsmartcols/default.nix2
-rw-r--r--pkgs/development/libraries/libsmi/default.nix2
-rw-r--r--pkgs/development/libraries/libsnark/default.nix2
-rw-r--r--pkgs/development/libraries/libvirt/default.nix2
-rw-r--r--pkgs/development/libraries/libxmi/default.nix2
-rw-r--r--pkgs/development/libraries/muparser/default.nix2
-rw-r--r--pkgs/development/libraries/qt-3/default.nix4
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/default.nix2
-rw-r--r--pkgs/development/libraries/qt-5/5.12/default.nix8
-rw-r--r--pkgs/development/libraries/qt-5/5.14/default.nix4
-rw-r--r--pkgs/development/libraries/qt-5/5.15/default.nix4
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtconnectivity.nix4
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtlocation.nix4
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtmacextras.nix4
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtmultimedia.nix4
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtwebengine.nix2
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtwebkit.nix4
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtwebview.nix4
-rw-r--r--pkgs/development/libraries/tokyo-tyrant/default.nix2
-rw-r--r--pkgs/development/libraries/wiredtiger/default.nix2
-rw-r--r--pkgs/development/libraries/wxwidgets/2.8/default.nix4
-rw-r--r--pkgs/development/libraries/wxwidgets/2.9/default.nix4
-rw-r--r--pkgs/development/libraries/wxwidgets/3.0/default.nix2
-rw-r--r--pkgs/development/libraries/wxwidgets/3.1/default.nix2
-rw-r--r--pkgs/development/libraries/xalanc/default.nix2
-rw-r--r--pkgs/development/libraries/xercesc/default.nix2
-rw-r--r--pkgs/development/misc/avr8-burn-omat/default.nix2
-rw-r--r--pkgs/development/misc/google-clasp/default.nix6
-rw-r--r--pkgs/development/misc/haskell/hasura/ci-info/default.nix4
-rw-r--r--pkgs/development/misc/haskell/hasura/graphql-engine/default.nix6
-rw-r--r--pkgs/development/misc/haskell/hasura/graphql-parser/default.nix4
-rw-r--r--pkgs/development/misc/haskell/hasura/pg-client/default.nix4
-rw-r--r--pkgs/development/misc/loc/default.nix4
-rw-r--r--pkgs/development/misc/msp430/mspdebug.nix18
-rw-r--r--pkgs/development/misc/resholve/deps.nix6
-rw-r--r--pkgs/development/misc/yelp-tools/default.nix2
-rw-r--r--pkgs/development/pharo/vm/build-vm-legacy.nix10
-rw-r--r--pkgs/development/pharo/vm/build-vm.nix4
-rw-r--r--pkgs/development/pharo/vm/share.nix4
-rw-r--r--pkgs/development/pharo/wrapper/default.nix12
-rw-r--r--pkgs/development/pure-modules/audio/default.nix8
-rw-r--r--pkgs/development/pure-modules/avahi/default.nix8
-rw-r--r--pkgs/development/pure-modules/csv/default.nix8
-rw-r--r--pkgs/development/pure-modules/doc/default.nix8
-rw-r--r--pkgs/development/pure-modules/fastcgi/default.nix8
-rw-r--r--pkgs/development/pure-modules/faust/default.nix8
-rw-r--r--pkgs/development/pure-modules/ffi/default.nix8
-rw-r--r--pkgs/development/pure-modules/gen/default.nix8
-rw-r--r--pkgs/development/pure-modules/gl/default.nix8
-rw-r--r--pkgs/development/pure-modules/glpk/default.nix6
-rw-r--r--pkgs/development/pure-modules/gplot/default.nix8
-rw-r--r--pkgs/development/pure-modules/gsl/default.nix8
-rw-r--r--pkgs/development/pure-modules/gtk/default.nix8
-rw-r--r--pkgs/development/pure-modules/liblo/default.nix8
-rw-r--r--pkgs/development/pure-modules/lilv/default.nix8
-rw-r--r--pkgs/development/pure-modules/lv2/default.nix8
-rw-r--r--pkgs/development/pure-modules/midi/default.nix8
-rw-r--r--pkgs/development/pure-modules/mpfr/default.nix8
-rw-r--r--pkgs/development/pure-modules/octave/default.nix8
-rw-r--r--pkgs/development/pure-modules/odbc/default.nix8
-rw-r--r--pkgs/development/pure-modules/pandoc/default.nix8
-rw-r--r--pkgs/development/pure-modules/rational/default.nix8
-rw-r--r--pkgs/development/pure-modules/readline/default.nix8
-rw-r--r--pkgs/development/pure-modules/sockets/default.nix8
-rw-r--r--pkgs/development/pure-modules/sql3/default.nix8
-rw-r--r--pkgs/development/pure-modules/stldict/default.nix8
-rw-r--r--pkgs/development/pure-modules/stllib/default.nix8
-rw-r--r--pkgs/development/pure-modules/tk/default.nix8
-rw-r--r--pkgs/development/pure-modules/xml/default.nix8
-rw-r--r--pkgs/development/web/deno/default.nix2
-rw-r--r--pkgs/development/web/grails/default.nix6
-rw-r--r--pkgs/development/web/insomnia/default.nix2
-rw-r--r--pkgs/development/web/kcgi/default.nix4
-rw-r--r--pkgs/development/web/kore/default.nix4
-rw-r--r--pkgs/development/web/nodejs/nodejs.nix4
-rw-r--r--pkgs/development/web/nodejs/v10.nix4
-rw-r--r--pkgs/development/web/nodejs/v12.nix4
-rw-r--r--pkgs/development/web/nodejs/v14.nix4
-rw-r--r--pkgs/development/web/postman/default.nix2
-rw-r--r--pkgs/development/web/remarkjs/default.nix4
-rw-r--r--pkgs/development/web/twitter-bootstrap/default.nix4
-rw-r--r--pkgs/development/web/woff2/default.nix4
-rw-r--r--pkgs/development/web/xmlindent/default.nix6
-rw-r--r--pkgs/top-level/all-packages.nix6
121 files changed, 324 insertions, 322 deletions
diff --git a/pkgs/development/androidndk-pkgs/androidndk-pkgs.nix b/pkgs/development/androidndk-pkgs/androidndk-pkgs.nix
index 995789b8c1b..04dfbcbedf0 100644
--- a/pkgs/development/androidndk-pkgs/androidndk-pkgs.nix
+++ b/pkgs/development/androidndk-pkgs/androidndk-pkgs.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , makeWrapper
 , runCommand, wrapBintoolsWith, wrapCCWith
 , buildAndroidndk, androidndk, targetAndroidndkPkgs
@@ -48,7 +48,7 @@ let
   hostInfo = ndkInfoFun stdenv.hostPlatform;
   targetInfo = ndkInfoFun stdenv.targetPlatform;
 
-  prefix = stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) (stdenv.targetPlatform.config + "-");
+  prefix = lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform) (stdenv.targetPlatform.config + "-");
 in
 
 rec {
diff --git a/pkgs/development/androidndk-pkgs/default.nix b/pkgs/development/androidndk-pkgs/default.nix
index 10819d49ed3..5f71304d385 100644
--- a/pkgs/development/androidndk-pkgs/default.nix
+++ b/pkgs/development/androidndk-pkgs/default.nix
@@ -1,4 +1,4 @@
-{ androidenv, buildPackages, pkgs, targetPackages
+{ lib, androidenv, buildPackages, pkgs, targetPackages
 }:
 
 {
@@ -17,6 +17,7 @@
       };
     in
     import ./androidndk-pkgs.nix {
+      inherit lib;
       inherit (buildPackages)
         makeWrapper;
       inherit (pkgs)
@@ -46,6 +47,7 @@
       };
     in
     import ./androidndk-pkgs.nix {
+      inherit lib;
       inherit (buildPackages)
         makeWrapper;
       inherit (pkgs)
diff --git a/pkgs/development/beam-modules/build-erlang-mk.nix b/pkgs/development/beam-modules/build-erlang-mk.nix
index c2d1ebabae2..a94524276b2 100644
--- a/pkgs/development/beam-modules/build-erlang-mk.nix
+++ b/pkgs/development/beam-modules/build-erlang-mk.nix
@@ -15,7 +15,7 @@
 , buildFlags ? []
 , ... }@attrs:
 
-with stdenv.lib;
+with lib;
 
 let
   debugInfoFlag = lib.optionalString (enableDebugInfo || erlang.debugInfo) "+debug_info";
diff --git a/pkgs/development/beam-modules/build-hex.nix b/pkgs/development/beam-modules/build-hex.nix
index 27ce64582f3..e0d9dfc4288 100644
--- a/pkgs/development/beam-modules/build-hex.nix
+++ b/pkgs/development/beam-modules/build-hex.nix
@@ -1,11 +1,11 @@
-{ stdenv, buildRebar3, fetchHex }:
+{ lib, stdenv, buildRebar3, fetchHex }:
 
 { name, version, sha256
 , builder ? buildRebar3
 , hexPkg ? name
 , ... }@attrs:
 
-with stdenv.lib;
+with lib;
 
 let
   pkg = self: builder (attrs // {
diff --git a/pkgs/development/beam-modules/build-mix.nix b/pkgs/development/beam-modules/build-mix.nix
index 9aebad2dabf..45f5e367442 100644
--- a/pkgs/development/beam-modules/build-mix.nix
+++ b/pkgs/development/beam-modules/build-mix.nix
@@ -15,7 +15,7 @@
 , enableDebugInfo ? false
 , ... }@attrs:
 
-with stdenv.lib;
+with lib;
 
 let
 
diff --git a/pkgs/development/beam-modules/build-rebar3.nix b/pkgs/development/beam-modules/build-rebar3.nix
index 224d111026a..63832dc91ac 100644
--- a/pkgs/development/beam-modules/build-rebar3.nix
+++ b/pkgs/development/beam-modules/build-rebar3.nix
@@ -14,7 +14,7 @@
 , enableDebugInfo ? false
 , ... }@attrs:
 
-with stdenv.lib;
+with lib;
 
 let
   debugInfoFlag = lib.optionalString (enableDebugInfo || erlang.debugInfo) "debug-info";
diff --git a/pkgs/development/beam-modules/default.nix b/pkgs/development/beam-modules/default.nix
index a5de4dfb3bb..4c25522635e 100644
--- a/pkgs/development/beam-modules/default.nix
+++ b/pkgs/development/beam-modules/default.nix
@@ -1,12 +1,12 @@
-{ stdenv, pkgs, erlang }:
+{ lib, stdenv, pkgs, erlang }:
 
 let
-  inherit (stdenv.lib) makeExtensible;
+  inherit (lib) makeExtensible;
 
-  lib = pkgs.callPackage ./lib.nix {};
+  lib' = pkgs.callPackage ./lib.nix {};
 
   # FIXME: add support for overrideScope
-  callPackageWithScope = scope: drv: args: stdenv.lib.callPackageWith scope drv args;
+  callPackageWithScope = scope: drv: args: lib'.callPackageWith scope drv args;
   mkScope = scope: pkgs // scope;
 
   packages = self:
@@ -38,27 +38,27 @@ let
         # BEAM-based languages.
         elixir = elixir_1_11;
 
-        elixir_1_11 = lib.callElixir ../interpreters/elixir/1.11.nix {
+        elixir_1_11 = lib'.callElixir ../interpreters/elixir/1.11.nix {
           inherit erlang;
           debugInfo = true;
         };
 
-        elixir_1_10 = lib.callElixir ../interpreters/elixir/1.10.nix {
+        elixir_1_10 = lib'.callElixir ../interpreters/elixir/1.10.nix {
           inherit erlang;
           debugInfo = true;
         };
 
-        elixir_1_9 = lib.callElixir ../interpreters/elixir/1.9.nix {
+        elixir_1_9 = lib'.callElixir ../interpreters/elixir/1.9.nix {
           inherit erlang;
           debugInfo = true;
         };
 
-        elixir_1_8 = lib.callElixir ../interpreters/elixir/1.8.nix {
+        elixir_1_8 = lib'.callElixir ../interpreters/elixir/1.8.nix {
           inherit erlang;
           debugInfo = true;
         };
 
-        elixir_1_7 = lib.callElixir ../interpreters/elixir/1.7.nix {
+        elixir_1_7 = lib'.callElixir ../interpreters/elixir/1.7.nix {
           inherit erlang;
           debugInfo = true;
         };
@@ -67,8 +67,8 @@ let
         # https://hexdocs.pm/elixir/compatibility-and-deprecations.html
 
         lfe = lfe_1_3;
-        lfe_1_2 = lib.callLFE ../interpreters/lfe/1.2.nix { inherit erlang buildRebar3 buildHex; };
-        lfe_1_3 = lib.callLFE ../interpreters/lfe/1.3.nix { inherit erlang buildRebar3 buildHex; };
+        lfe_1_2 = lib'.callLFE ../interpreters/lfe/1.2.nix { inherit erlang buildRebar3 buildHex; };
+        lfe_1_3 = lib'.callLFE ../interpreters/lfe/1.3.nix { inherit erlang buildRebar3 buildHex; };
 
         # Non hex packages. Examples how to build Rebar/Mix packages with and
         # without helper functions buildRebar3 and buildMix.
diff --git a/pkgs/development/beam-modules/fetch-hex.nix b/pkgs/development/beam-modules/fetch-hex.nix
index c55a7a80ff3..7f84e236070 100644
--- a/pkgs/development/beam-modules/fetch-hex.nix
+++ b/pkgs/development/beam-modules/fetch-hex.nix
@@ -1,10 +1,10 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 { pkg, version, sha256
 , meta ? {}
 }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation ({
   name = "hex-source-${pkg}-${version}";
diff --git a/pkgs/development/beam-modules/fetch-rebar-deps.nix b/pkgs/development/beam-modules/fetch-rebar-deps.nix
index 389e07beca6..d858b3d81af 100644
--- a/pkgs/development/beam-modules/fetch-rebar-deps.nix
+++ b/pkgs/development/beam-modules/fetch-rebar-deps.nix
@@ -1,10 +1,10 @@
-{ stdenv, rebar3 }:
+{ lib, stdenv, rebar3 }:
 
 { name, version, sha256, src
 , meta ? {}
 }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation ({
   name = "rebar-deps-${name}-${version}";
@@ -28,6 +28,6 @@ stdenv.mkDerivation ({
   outputHashMode = "recursive";
   outputHash = sha256;
 
-  impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars;
+  impureEnvVars = lib.fetchers.proxyImpureEnvVars;
   inherit meta;
 })
diff --git a/pkgs/development/beam-modules/hex/default.nix b/pkgs/development/beam-modules/hex/default.nix
index 26070ce73bf..e12f0ba4b74 100644
--- a/pkgs/development/beam-modules/hex/default.nix
+++ b/pkgs/development/beam-modules/hex/default.nix
@@ -45,13 +45,13 @@ let
 
     meta = {
       description = "Package manager for the Erlang VM https://hex.pm";
-      license = stdenv.lib.licenses.mit;
+      license = lib.licenses.mit;
       homepage = "https://github.com/hexpm/hex";
-      maintainers = with stdenv.lib.maintainers; [ ericbmerritt ];
+      maintainers = with lib.maintainers; [ ericbmerritt ];
     };
 
     passthru = {
       env = shell self;
     };
 };
-in stdenv.lib.fix pkg
+in lib.fix pkg
diff --git a/pkgs/development/beam-modules/lib.nix b/pkgs/development/beam-modules/lib.nix
index db40c47794f..7ae2e0e2606 100644
--- a/pkgs/development/beam-modules/lib.nix
+++ b/pkgs/development/beam-modules/lib.nix
@@ -1,4 +1,4 @@
-{ pkgs, stdenv }:
+{ pkgs, lib, stdenv }:
 
 rec {
 
@@ -7,7 +7,7 @@ rec {
   callPackageWith = autoArgs: fn: args:
     let
       f = if pkgs.lib.isFunction fn then fn else import fn;
-      auto = builtins.intersectAttrs (stdenv.lib.functionArgs f) autoArgs;
+      auto = builtins.intersectAttrs (lib.functionArgs f) autoArgs;
     in f (auto // args);
 
   callPackage = callPackageWith pkgs;
diff --git a/pkgs/development/beam-modules/pc/default.nix b/pkgs/development/beam-modules/pc/default.nix
index fac3b298835..8b5836f4c62 100644
--- a/pkgs/development/beam-modules/pc/default.nix
+++ b/pkgs/development/beam-modules/pc/default.nix
@@ -7,7 +7,7 @@ buildHex {
 
   meta = {
     description = "a rebar3 port compiler for native code";
-    license = stdenv.lib.licenses.mit;
+    license = lib.licenses.mit;
     homepage = "https://github.com/blt/port_compiler";
   };
 }
diff --git a/pkgs/development/beam-modules/pgsql/default.nix b/pkgs/development/beam-modules/pgsql/default.nix
index c7e7aee1001..e64476212dd 100644
--- a/pkgs/development/beam-modules/pgsql/default.nix
+++ b/pkgs/development/beam-modules/pgsql/default.nix
@@ -21,9 +21,9 @@ let
 
     meta = {
       description = "Erlang PostgreSQL Driver";
-      license = stdenv.lib.licenses.mit;
+      license = lib.licenses.mit;
       homepage = "https://github.com/semiocast/pgsql";
-      maintainers = with stdenv.lib.maintainers; [ ericbmerritt ];
+      maintainers = with lib.maintainers; [ ericbmerritt ];
     };
 
     passthru = {
@@ -31,4 +31,4 @@ let
     };
 
 };
-in stdenv.lib.fix pkg
+in lib.fix pkg
diff --git a/pkgs/development/beam-modules/rebar3-release.nix b/pkgs/development/beam-modules/rebar3-release.nix
index 1ec9f244d6c..bbc130725c0 100644
--- a/pkgs/development/beam-modules/rebar3-release.nix
+++ b/pkgs/development/beam-modules/rebar3-release.nix
@@ -15,7 +15,7 @@
 , enableDebugInfo ? false
 , ... }@attrs:
 
-with stdenv.lib;
+with lib;
 
 let
   shell = drv: stdenv.mkDerivation {
diff --git a/pkgs/development/beam-modules/webdriver/default.nix b/pkgs/development/beam-modules/webdriver/default.nix
index 8f06f8ed7a8..da6cb127342 100644
--- a/pkgs/development/beam-modules/webdriver/default.nix
+++ b/pkgs/development/beam-modules/webdriver/default.nix
@@ -27,9 +27,9 @@ let
 
     meta = {
       description = "WebDriver implementation in Erlang";
-      license = stdenv.lib.licenses.mit;
+      license = lib.licenses.mit;
       homepage = "https://github.com/Quviq/webdrv";
-      maintainers = with stdenv.lib.maintainers; [ ericbmerritt ];
+      maintainers = with lib.maintainers; [ ericbmerritt ];
     };
 
     passthru = {
@@ -37,4 +37,4 @@ let
     };
 
 };
-in stdenv.lib.fix pkg
+in lib.fix pkg
diff --git a/pkgs/development/haskell-modules/configuration-nix.nix b/pkgs/development/haskell-modules/configuration-nix.nix
index a4674e356cc..06578f56535 100644
--- a/pkgs/development/haskell-modules/configuration-nix.nix
+++ b/pkgs/development/haskell-modules/configuration-nix.nix
@@ -610,12 +610,12 @@ self: super: builtins.intersectAttrs super {
 
   git-annex = with pkgs;
     if (!stdenv.isLinux) then
-      let path = stdenv.lib.makeBinPath [ coreutils ];
+      let path = lib.makeBinPath [ coreutils ];
       in overrideCabal (addBuildTool super.git-annex makeWrapper) (_drv: {
         # This is an instance of https://github.com/NixOS/nix/pull/1085
         # Fails with:
         #   gpg: can't connect to the agent: File name too long
-        postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
+        postPatch = lib.optionalString stdenv.isDarwin ''
           substituteInPlace Test.hs \
             --replace ', testCase "crypto" test_crypto' ""
         '';
diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix
index bf4f7bd3bbf..582cf6df010 100644
--- a/pkgs/development/haskell-modules/generic-builder.nix
+++ b/pkgs/development/haskell-modules/generic-builder.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildPackages, buildHaskellPackages, ghc
+{ lib, stdenv, buildPackages, buildHaskellPackages, ghc
 , jailbreak-cabal, hscolour, cpphs, nodejs
 , ghcWithHoogle, ghcWithPackages
 }:
@@ -22,10 +22,10 @@ in
 , buildFlags ? []
 , haddockFlags ? []
 , description ? null
-, doCheck ? !isCross && stdenv.lib.versionOlder "7.4" ghc.version
+, doCheck ? !isCross && lib.versionOlder "7.4" ghc.version
 , doBenchmark ? false
 , doHoogle ? true
-, doHaddockQuickjump ? doHoogle && stdenv.lib.versionAtLeast ghc.version "8.6"
+, doHaddockQuickjump ? doHoogle && lib.versionAtLeast ghc.version "8.6"
 , editedCabalFile ? null
 # aarch64 outputs otherwise exceed 2GB limit
 , enableLibraryProfiling ? !(ghc.isGhcjs or stdenv.targetPlatform.isAarch64 or false)
@@ -36,14 +36,14 @@ in
 , enableSharedLibraries ? !stdenv.hostPlatform.isStatic && (ghc.enableShared or false)
 , enableDeadCodeElimination ? (!stdenv.isDarwin)  # TODO: use -dead_strip for darwin
 , enableStaticLibraries ? !(stdenv.hostPlatform.isWindows or stdenv.hostPlatform.isWasm)
-, enableHsc2hsViaAsm ? stdenv.hostPlatform.isWindows && stdenv.lib.versionAtLeast ghc.version "8.4"
+, enableHsc2hsViaAsm ? stdenv.hostPlatform.isWindows && lib.versionAtLeast ghc.version "8.4"
 , extraLibraries ? [], librarySystemDepends ? [], executableSystemDepends ? []
 # On macOS, statically linking against system frameworks is not supported;
 # see https://developer.apple.com/library/content/qa/qa1118/_index.html
 # They must be propagated to the environment of any executable linking with the library
 , libraryFrameworkDepends ? [], executableFrameworkDepends ? []
 , homepage ? "https://hackage.haskell.org/package/${pname}"
-, platforms ? with stdenv.lib.platforms; all # GHC can cross-compile
+, platforms ? with lib.platforms; all # GHC can cross-compile
 , hydraPlatforms ? null
 , hyperlinkSource ? true
 , isExecutable ? false, isLibrary ? !isExecutable
@@ -71,7 +71,7 @@ in
 , shellHook ? ""
 , coreSetup ? false # Use only core packages to build Setup.hs.
 , useCpphs ? false
-, hardeningDisable ? stdenv.lib.optional (ghc.isHaLVM or false) "all"
+, hardeningDisable ? lib.optional (ghc.isHaLVM or false) "all"
 , enableSeparateBinOutput ? false
 , enableSeparateDataOutput ? false
 , enableSeparateDocOutput ? doHaddock
@@ -95,7 +95,7 @@ assert stdenv.hostPlatform.isWasm -> enableStaticLibraries == false;
 
 let
 
-  inherit (stdenv.lib) optional optionals optionalString versionOlder versionAtLeast
+  inherit (lib) optional optionals optionalString versionOlder versionAtLeast
                        concatStringsSep enableFeature optionalAttrs;
 
   isGhcjs = ghc.isGhcjs or false;
@@ -182,7 +182,7 @@ let
   parallelBuildingFlags = "-j$NIX_BUILD_CORES" + optionalString stdenv.isLinux " +RTS -A64M -RTS";
 
   crossCabalFlagsString =
-    stdenv.lib.optionalString isCross (" " + stdenv.lib.concatStringsSep " " crossCabalFlags);
+    lib.optionalString isCross (" " + lib.concatStringsSep " " crossCabalFlags);
 
   buildFlagsString = optionalString (buildFlags != []) (" " + concatStringsSep " " buildFlags);
 
@@ -213,7 +213,7 @@ let
     (enableFeature doBenchmark "benchmarks")
     "--enable-library-vanilla"  # TODO: Should this be configurable?
     (enableFeature enableLibraryForGhci "library-for-ghci")
-  ] ++ optionals (enableDeadCodeElimination && (stdenv.lib.versionOlder "8.0.1" ghc.version)) [
+  ] ++ optionals (enableDeadCodeElimination && (lib.versionOlder "8.0.1" ghc.version)) [
      "--ghc-option=-split-sections"
   ] ++ optionals dontStrip [
     "--disable-library-stripping"
@@ -283,7 +283,7 @@ let
       continue
     fi
   '';
-in stdenv.lib.fix (drv:
+in lib.fix (drv:
 
 assert allPkgconfigDepends != [] -> pkg-config != null;
 
@@ -423,7 +423,7 @@ stdenv.mkDerivation ({
 
     echo configureFlags: $configureFlags
     ${setupCommand} configure $configureFlags 2>&1 | ${coreutils}/bin/tee "$NIX_BUILD_TOP/cabal-configure.log"
-    ${stdenv.lib.optionalString (!allowInconsistentDependencies) ''
+    ${lib.optionalString (!allowInconsistentDependencies) ''
       if ${gnugrep}/bin/egrep -q -z 'Warning:.*depends on multiple versions' "$NIX_BUILD_TOP/cabal-configure.log"; then
         echo >&2 "*** abort because of serious configure-time warning from Cabal"
         exit 1
@@ -455,7 +455,7 @@ stdenv.mkDerivation ({
         ${optionalString doHoogle "--hoogle"} \
         ${optionalString doHaddockQuickjump "--quickjump"} \
         ${optionalString (isLibrary && hyperlinkSource) "--hyperlink-source"} \
-        ${stdenv.lib.concatStringsSep " " haddockFlags}
+        ${lib.concatStringsSep " " haddockFlags}
     ''}
     runHook postHaddock
   '';
@@ -492,7 +492,7 @@ stdenv.mkDerivation ({
       done
     ''}
     ${optionalString doCoverage "mkdir -p $out/share && cp -r dist/hpc $out/share"}
-    ${optionalString (enableSharedExecutables && isExecutable && !isGhcjs && stdenv.isDarwin && stdenv.lib.versionOlder ghc.version "7.10") ''
+    ${optionalString (enableSharedExecutables && isExecutable && !isGhcjs && stdenv.isDarwin && lib.versionOlder ghc.version "7.10") ''
       for exe in "${binDir}/"* ; do
         install_name_tool -add_rpath "$out/lib/ghc-${ghc.version}/${pname}-${version}" "$exe"
       done
@@ -535,7 +535,7 @@ stdenv.mkDerivation ({
         pkg-configDepends
         setupHaskellDepends
         ;
-    } // stdenv.lib.optionalAttrs doCheck {
+    } // lib.optionalAttrs doCheck {
       inherit
         testDepends
         testFrameworkDepends
@@ -544,7 +544,7 @@ stdenv.mkDerivation ({
         testSystemDepends
         testToolDepends
         ;
-    } // stdenv.lib.optionalAttrs doBenchmark {
+    } // lib.optionalAttrs doBenchmark {
       inherit
         benchmarkDepends
         benchmarkFrameworkDepends
@@ -561,7 +561,7 @@ stdenv.mkDerivation ({
       inherit propagatedBuildInputs otherBuildInputs allPkgconfigDepends;
       haskellBuildInputs = isHaskellPartition.right;
       systemBuildInputs = isHaskellPartition.wrong;
-      isHaskellPartition = stdenv.lib.partition
+      isHaskellPartition = lib.partition
         isHaskellPkg
         (propagatedBuildInputs ++ otherBuildInputs ++ depsBuildBuild ++ nativeBuildInputs);
     };
@@ -608,13 +608,13 @@ stdenv.mkDerivation ({
         ghcEnv = withPackages (_:
           otherBuildInputsHaskell ++
           propagatedBuildInputs ++
-          stdenv.lib.optionals (!isCross) setupHaskellDepends);
+          lib.optionals (!isCross) setupHaskellDepends);
 
-        ghcCommandCaps = stdenv.lib.toUpper ghcCommand';
+        ghcCommandCaps = lib.toUpper ghcCommand';
       in stdenv.mkDerivation ({
         inherit name shellHook;
 
-        depsBuildBuild = stdenv.lib.optional isCross ghcEnvForBuild;
+        depsBuildBuild = lib.optional isCross ghcEnvForBuild;
         nativeBuildInputs =
           [ ghcEnv ] ++ optional (allPkgconfigDepends != []) pkg-config ++
           collectedToolDepends;
@@ -623,7 +623,7 @@ stdenv.mkDerivation ({
         phases = ["installPhase"];
         installPhase = "echo $nativeBuildInputs $buildInputs > $out";
         LANG = "en_US.UTF-8";
-        LOCALE_ARCHIVE = stdenv.lib.optionalString (stdenv.hostPlatform.libc == "glibc") "${buildPackages.glibcLocales}/lib/locale/locale-archive";
+        LOCALE_ARCHIVE = lib.optionalString (stdenv.hostPlatform.libc == "glibc") "${buildPackages.glibcLocales}/lib/locale/locale-archive";
         "NIX_${ghcCommandCaps}" = "${ghcEnv}/bin/${ghcCommand}";
         "NIX_${ghcCommandCaps}PKG" = "${ghcEnv}/bin/${ghcCommand}-pkg";
         # TODO: is this still valid?
diff --git a/pkgs/development/haskell-modules/hoogle.nix b/pkgs/development/haskell-modules/hoogle.nix
index 0f620d46ccc..f47ac076f13 100644
--- a/pkgs/development/haskell-modules/hoogle.nix
+++ b/pkgs/development/haskell-modules/hoogle.nix
@@ -120,7 +120,7 @@ buildPackages.stdenv.mkDerivation {
   meta = {
     description = "A local Hoogle database";
     platforms = ghc.meta.platforms;
-    hydraPlatforms = with stdenv.lib.platforms; none;
-    maintainers = with stdenv.lib.maintainers; [ ttuegel ];
+    hydraPlatforms = with lib.platforms; none;
+    maintainers = with lib.maintainers; [ ttuegel ];
   };
 }
diff --git a/pkgs/development/haskell-modules/make-package-set.nix b/pkgs/development/haskell-modules/make-package-set.nix
index 91937b88eaf..28b48bfcbc4 100644
--- a/pkgs/development/haskell-modules/make-package-set.nix
+++ b/pkgs/development/haskell-modules/make-package-set.nix
@@ -41,7 +41,7 @@ self:
 let
   inherit (stdenv) buildPlatform hostPlatform;
 
-  inherit (stdenv.lib) fix' extends makeOverridable;
+  inherit (lib) fix' extends makeOverridable;
   inherit (haskellLib) overrideCabal;
 
   mkDerivationImpl = pkgs.callPackage ./generic-builder.nix {
@@ -84,8 +84,8 @@ let
       # lost on `.override`) but determine the auto-args based on `drv` (the problem here
       # is that nix has no way to "passthrough" args while preserving the reflection
       # info that callPackage uses to determine the arguments).
-      drv = if stdenv.lib.isFunction fn then fn else import fn;
-      auto = builtins.intersectAttrs (stdenv.lib.functionArgs drv) scope;
+      drv = if lib.isFunction fn then fn else import fn;
+      auto = builtins.intersectAttrs (lib.functionArgs drv) scope;
 
       # this wraps the `drv` function to add a `overrideScope` function to the result.
       drvScope = allArgs: drv allArgs // {
@@ -98,7 +98,7 @@ let
           # nothing.
           in callPackageWithScope newScope drv manualArgs;
       };
-    in stdenv.lib.makeOverridable drvScope (auto // manualArgs);
+    in lib.makeOverridable drvScope (auto // manualArgs);
 
   mkScope = scope: let
       ps = pkgs.__splicedPackages;
diff --git a/pkgs/development/java-modules/build-maven-package.nix b/pkgs/development/java-modules/build-maven-package.nix
index a7196c6e031..cb895d9c672 100644
--- a/pkgs/development/java-modules/build-maven-package.nix
+++ b/pkgs/development/java-modules/build-maven-package.nix
@@ -1,11 +1,11 @@
-{ stdenv, maven, pkgs }:
+{ lib, stdenv, maven, pkgs }:
 { mavenDeps, src, name, meta, m2Path, skipTests ? true, quiet ? true, ... }:
 
 with builtins;
-with stdenv.lib;
+with lib;
 
 let
-  mavenMinimal = import ./maven-minimal.nix { inherit pkgs stdenv; };
+  mavenMinimal = import ./maven-minimal.nix { inherit lib pkgs stdenv; };
 in stdenv.mkDerivation rec {
   inherit mavenDeps src name meta m2Path;
 
diff --git a/pkgs/development/java-modules/junit/default.nix b/pkgs/development/java-modules/junit/default.nix
index dbbce6b6262..c4b02071ec0 100644
--- a/pkgs/development/java-modules/junit/default.nix
+++ b/pkgs/development/java-modules/junit/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, pkgs, mavenbuild, fetchMaven }:
+{ lib, stdenv, pkgs, mavenbuild, fetchMaven }:
 
 with pkgs.javaPackages;
 
@@ -21,9 +21,9 @@ in rec {
     meta = {
       homepage = "https://junit.org/junit4/";
       description = "Simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks";
-      license = stdenv.lib.licenses.epl10;
-      platforms = stdenv.lib.platforms.all;
-      maintainers = with stdenv.lib.maintainers;
+      license = lib.licenses.epl10;
+      platforms = lib.platforms.all;
+      maintainers = with lib.maintainers;
         [ nequissimus ];
     };
   };
diff --git a/pkgs/development/java-modules/maven-hello/default.nix b/pkgs/development/java-modules/maven-hello/default.nix
index b4639d9ee1d..e0087e857a4 100644
--- a/pkgs/development/java-modules/maven-hello/default.nix
+++ b/pkgs/development/java-modules/maven-hello/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, pkgs, mavenbuild }:
+{ lib, stdenv, pkgs, mavenbuild }:
 
 with pkgs.javaPackages;
 
@@ -20,9 +20,9 @@ in rec {
     meta = {
       homepage = "https://github.com/NeQuissimus/maven-hello/";
       description = "Maven Hello World";
-      license = stdenv.lib.licenses.unlicense;
-      platforms = stdenv.lib.platforms.all;
-      maintainers = with stdenv.lib.maintainers;
+      license = lib.licenses.unlicense;
+      platforms = lib.platforms.all;
+      maintainers = with lib.maintainers;
         [ nequissimus ];
     };
   };
diff --git a/pkgs/development/java-modules/maven-minimal.nix b/pkgs/development/java-modules/maven-minimal.nix
index 52edcd2104f..9019e3ba28e 100644
--- a/pkgs/development/java-modules/maven-minimal.nix
+++ b/pkgs/development/java-modules/maven-minimal.nix
@@ -1,6 +1,6 @@
-{ stdenv, pkgs }:
+{ lib, stdenv, pkgs }:
 
-with stdenv.lib;
+with lib;
 with pkgs.javaPackages;
 
 let
diff --git a/pkgs/development/libraries/SDL/default.nix b/pkgs/development/libraries/SDL/default.nix
index 252d38d1192..b51bc3f7cdd 100644
--- a/pkgs/development/libraries/SDL/default.nix
+++ b/pkgs/development/libraries/SDL/default.nix
@@ -1,5 +1,5 @@
 { lib, stdenv, config, fetchurl, fetchpatch, pkg-config, audiofile, libcap, libiconv
-, libGLSupported ? lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
+, libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
 , openglSupport ? libGLSupported, libGL, libGLU
 , alsaSupport ? stdenv.isLinux && !stdenv.hostPlatform.isAndroid, alsaLib
 , x11Support ? !stdenv.isCygwin && !stdenv.hostPlatform.isAndroid
diff --git a/pkgs/development/libraries/SDL2/default.nix b/pkgs/development/libraries/SDL2/default.nix
index ddde76cac64..5212421a7b8 100644
--- a/pkgs/development/libraries/SDL2/default.nix
+++ b/pkgs/development/libraries/SDL2/default.nix
@@ -1,5 +1,5 @@
 { lib, stdenv, config, fetchurl, pkg-config
-, libGLSupported ? lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
+, libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
 , openglSupport ? libGLSupported, libGL
 , alsaSupport ? stdenv.isLinux && !stdenv.hostPlatform.isAndroid, alsaLib
 , x11Support ? !stdenv.isCygwin && !stdenv.hostPlatform.isAndroid
diff --git a/pkgs/development/libraries/aravis/default.nix b/pkgs/development/libraries/aravis/default.nix
index 62a5c54e676..e2371292e12 100644
--- a/pkgs/development/libraries/aravis/default.nix
+++ b/pkgs/development/libraries/aravis/default.nix
@@ -20,7 +20,7 @@
 let
   gstreamerAtLeastVersion1 =
     lib.all
-      (pkg: pkg != null && lib.versionAtLeast (stdenv.lib.getVersion pkg) "1.0")
+      (pkg: pkg != null && lib.versionAtLeast (lib.getVersion pkg) "1.0")
       [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad ];
 in
   assert enableGstPlugin -> lib.all (pkg: pkg != null) [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad ];
diff --git a/pkgs/development/libraries/atk/default.nix b/pkgs/development/libraries/atk/default.nix
index 4cb2d6b2aec..53eb4459770 100644
--- a/pkgs/development/libraries/atk/default.nix
+++ b/pkgs/development/libraries/atk/default.nix
@@ -55,7 +55,7 @@ stdenv.mkDerivation rec {
     license = lib.licenses.lgpl2Plus;
 
     maintainers = with lib.maintainers; [ raskin ];
-    platforms = lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
   };
 
 }
diff --git a/pkgs/development/libraries/cairo/default.nix b/pkgs/development/libraries/cairo/default.nix
index 26e37738d55..839b7e9f40b 100644
--- a/pkgs/development/libraries/cairo/default.nix
+++ b/pkgs/development/libraries/cairo/default.nix
@@ -3,7 +3,7 @@
 , x11Support? !stdenv.isDarwin, libXext, libXrender
 , gobjectSupport ? true, glib
 , xcbSupport ? x11Support, libxcb, xcbutil # no longer experimental since 1.12
-, libGLSupported ? lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
+, libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
 , glSupport ? x11Support && config.cairo.gl or (libGLSupported && stdenv.isLinux)
 , libGL ? null # libGLU libGL is no longer a big dependency
 , pdfSupport ? true
@@ -20,7 +20,7 @@ in stdenv.mkDerivation rec {
   inherit version;
 
   src = fetchurl {
-    url = "https://cairographics.org/${if lib.mod (builtins.fromJSON (stdenv.lib.versions.minor version)) 2 == 0 then "releases" else "snapshots"}/${pname}-${version}.tar.xz";
+    url = "https://cairographics.org/${if lib.mod (builtins.fromJSON (lib.versions.minor version)) 2 == 0 then "releases" else "snapshots"}/${pname}-${version}.tar.xz";
     sha256 = "0c930mk5xr2bshbdljv005j3j8zr47gqmkry3q6qgvqky6rjjysy";
   };
 
diff --git a/pkgs/development/libraries/clutter-gst/default.nix b/pkgs/development/libraries/clutter-gst/default.nix
index 264c382338c..166d4e12c25 100644
--- a/pkgs/development/libraries/clutter-gst/default.nix
+++ b/pkgs/development/libraries/clutter-gst/default.nix
@@ -30,6 +30,6 @@ stdenv.mkDerivation rec {
     license = lib.licenses.lgpl2Plus;
 
     maintainers = with lib.maintainers; [ lethalman ];
-    platforms = lib.platforms.gnu ++ stdenv.lib.platforms.linux;  # arbitrary choice
+    platforms = lib.platforms.gnu ++ lib.platforms.linux;  # arbitrary choice
   };
 }
diff --git a/pkgs/development/libraries/clutter-gtk/default.nix b/pkgs/development/libraries/clutter-gtk/default.nix
index 902a2af62bd..0dfb8c7b9df 100644
--- a/pkgs/development/libraries/clutter-gtk/default.nix
+++ b/pkgs/development/libraries/clutter-gtk/default.nix
@@ -32,6 +32,6 @@ stdenv.mkDerivation rec {
     homepage = "http://www.clutter-project.org/";
     license = lib.licenses.lgpl2Plus;
     maintainers = with lib.maintainers; [ lethalman ];
-    platforms = lib.platforms.gnu ++ stdenv.lib.platforms.linux;  # arbitrary choice
+    platforms = lib.platforms.gnu ++ lib.platforms.linux;  # arbitrary choice
   };
 }
diff --git a/pkgs/development/libraries/gts/default.nix b/pkgs/development/libraries/gts/default.nix
index 3204811ec6b..815dfb634c9 100644
--- a/pkgs/development/libraries/gts/default.nix
+++ b/pkgs/development/libraries/gts/default.nix
@@ -43,6 +43,6 @@ stdenv.mkDerivation rec {
     '';
 
     maintainers = [ lib.maintainers.viric ];
-    platforms = lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
   };
 }
diff --git a/pkgs/development/libraries/irrlicht/default.nix b/pkgs/development/libraries/irrlicht/default.nix
index 5214fa9e149..e283a290947 100644
--- a/pkgs/development/libraries/irrlicht/default.nix
+++ b/pkgs/development/libraries/irrlicht/default.nix
@@ -33,6 +33,6 @@ stdenv.mkDerivation rec {
     homepage = "http://irrlicht.sourceforge.net/";
     license = lib.licenses.zlib;
     description = "Open source high performance realtime 3D engine written in C++";
-    platforms = lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
   };
 }
diff --git a/pkgs/development/libraries/java/hsqldb/default.nix b/pkgs/development/libraries/java/hsqldb/default.nix
index 433cf75ad5a..32b00062239 100644
--- a/pkgs/development/libraries/java/hsqldb/default.nix
+++ b/pkgs/development/libraries/java/hsqldb/default.nix
@@ -3,7 +3,7 @@
 stdenv.mkDerivation rec {
   pname = "hsqldb";
   version = "2.5.1";
-  underscoreMajMin = lib.strings.replaceChars ["."] ["_"] (stdenv.lib.versions.majorMinor version);
+  underscoreMajMin = lib.strings.replaceChars ["."] ["_"] (lib.versions.majorMinor version);
 
   src = fetchurl {
     url = "mirror://sourceforge/project/hsqldb/hsqldb/hsqldb_${underscoreMajMin}/hsqldb-${version}.zip";
diff --git a/pkgs/development/libraries/java/junixsocket/default.nix b/pkgs/development/libraries/java/junixsocket/default.nix
index b9b00223186..7a7d6a933bc 100644
--- a/pkgs/development/libraries/java/junixsocket/default.nix
+++ b/pkgs/development/libraries/java/junixsocket/default.nix
@@ -37,6 +37,6 @@ stdenv.mkDerivation rec {
     description = "A Java/JNI library for using Unix Domain Sockets from Java";
     homepage = "https://github.com/kohlschutter/junixsocket";
     license = lib.licenses.asl20;
-    platforms = lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
   };
 }
diff --git a/pkgs/development/libraries/libgpod/default.nix b/pkgs/development/libraries/libgpod/default.nix
index c7c9de67592..49dcec3ee78 100644
--- a/pkgs/development/libraries/libgpod/default.nix
+++ b/pkgs/development/libraries/libgpod/default.nix
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
     homepage = "https://gtkpod.sourceforge.net/";
     description = "Library used by gtkpod to access the contents of an ipod";
     license = "LGPL";
-    platforms = lib.platforms.gnu ++ stdenv.lib.platforms.linux;
+    platforms = lib.platforms.gnu ++ lib.platforms.linux;
     maintainers = [ ];
   };
 }
diff --git a/pkgs/development/libraries/libre/default.nix b/pkgs/development/libraries/libre/default.nix
index d2f6e31596f..e960fe8f4b2 100644
--- a/pkgs/development/libraries/libre/default.nix
+++ b/pkgs/development/libraries/libre/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ zlib openssl ];
   makeFlags = [ "USE_ZLIB=1" "USE_OPENSSL=1" "PREFIX=$(out)" ]
   ++ lib.optional (stdenv.cc.cc != null) "SYSROOT_ALT=${stdenv.cc.cc}"
-  ++ lib.optional (stdenv.cc.libc != null) "SYSROOT=${stdenv.lib.getDev stdenv.cc.libc}"
+  ++ lib.optional (stdenv.cc.libc != null) "SYSROOT=${lib.getDev stdenv.cc.libc}"
   ;
   meta = {
     description = "A library for real-time communications with async IO support and a complete SIP stack";
diff --git a/pkgs/development/libraries/librem/default.nix b/pkgs/development/libraries/librem/default.nix
index 4e8d6fca616..6dd44a0f202 100644
--- a/pkgs/development/libraries/librem/default.nix
+++ b/pkgs/development/libraries/librem/default.nix
@@ -12,8 +12,8 @@ stdenv.mkDerivation rec {
     "LIBRE_INC=${libre}/include/re"
     ''PREFIX=$(out)''
   ]
-  ++ lib.optional (stdenv.cc.cc != null) "SYSROOT_ALT=${stdenv.lib.getDev stdenv.cc.cc}"
-  ++ lib.optional (stdenv.cc.libc != null) "SYSROOT=${stdenv.lib.getDev stdenv.cc.libc}"
+  ++ lib.optional (stdenv.cc.cc != null) "SYSROOT_ALT=${lib.getDev stdenv.cc.cc}"
+  ++ lib.optional (stdenv.cc.libc != null) "SYSROOT=${lib.getDev stdenv.cc.libc}"
   ;
   meta = {
     description = " A library for real-time audio and video processing";
diff --git a/pkgs/development/libraries/libsmartcols/default.nix b/pkgs/development/libraries/libsmartcols/default.nix
index a3a19522f69..3ef1f314899 100644
--- a/pkgs/development/libraries/libsmartcols/default.nix
+++ b/pkgs/development/libraries/libsmartcols/default.nix
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
     description = "smart column output alignment library";
     homepage = https://github.com/karelzak/util-linux/tree/master/libsmartcols;
     license = lib.licenses.gpl2Plus;
-    platforms = lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
     maintainers = with lib.maintainers; [ rb2k ];
   };
 }
diff --git a/pkgs/development/libraries/libsmi/default.nix b/pkgs/development/libraries/libsmi/default.nix
index ab9d7d85c86..9b71a91efed 100644
--- a/pkgs/development/libraries/libsmi/default.nix
+++ b/pkgs/development/libraries/libsmi/default.nix
@@ -13,6 +13,6 @@ stdenv.mkDerivation rec {
     description = "A Library to Access SMI MIB Information";
     homepage = "https://www.ibr.cs.tu-bs.de/projects/libsmi/index.html";
     license = licenses.free;
-    platforms = lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
   };
 }
diff --git a/pkgs/development/libraries/libsnark/default.nix b/pkgs/development/libraries/libsnark/default.nix
index fc3e15f688d..3864a99f5e9 100644
--- a/pkgs/development/libraries/libsnark/default.nix
+++ b/pkgs/development/libraries/libsnark/default.nix
@@ -24,6 +24,6 @@ in stdenv.mkDerivation rec {
     description = "C++ library for zkSNARKs";
     homepage = "https://github.com/scipr-lab/libsnark";
     license = licenses.mit;
-    platforms = lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
   };
 }
diff --git a/pkgs/development/libraries/libvirt/default.nix b/pkgs/development/libraries/libvirt/default.nix
index b162ab50810..f3f48cec770 100644
--- a/pkgs/development/libraries/libvirt/default.nix
+++ b/pkgs/development/libraries/libvirt/default.nix
@@ -92,7 +92,7 @@ in stdenv.mkDerivation rec {
       --replace 'lxc_path,' '"/run/libvirt/nix-emulators/libvirt_lxc",'
     patchShebangs . # fixes /usr/bin/python references
   ''
-  + (lib.concatStringsSep "\n" (stdenv.lib.mapAttrsToList patchBuilder overrides));
+  + (lib.concatStringsSep "\n" (lib.mapAttrsToList patchBuilder overrides));
 
   mesonAutoFeatures = "auto";
 
diff --git a/pkgs/development/libraries/libxmi/default.nix b/pkgs/development/libraries/libxmi/default.nix
index cc1ae013a0e..037e7036f49 100644
--- a/pkgs/development/libraries/libxmi/default.nix
+++ b/pkgs/development/libraries/libxmi/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
     description = "Library for rasterizing 2-D vector graphics";
     homepage = "https://www.gnu.org/software/libxmi/";
     license = lib.licenses.gpl2Plus;
-    platforms = lib.platforms.gnu ++ stdenv.lib.platforms.linux;  # arbitrary choice
+    platforms = lib.platforms.gnu ++ lib.platforms.linux;  # arbitrary choice
     maintainers = [ ];
   };
 }
diff --git a/pkgs/development/libraries/muparser/default.nix b/pkgs/development/libraries/muparser/default.nix
index b1951bdb226..85c9f781cc6 100644
--- a/pkgs/development/libraries/muparser/default.nix
+++ b/pkgs/development/libraries/muparser/default.nix
@@ -18,6 +18,6 @@ stdenv.mkDerivation rec {
     homepage = "http://muparser.sourceforge.net";
     description = "An extensible high performance math expression parser library written in C++";
     license = lib.licenses.mit;
-    platforms = lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
   };
 }
diff --git a/pkgs/development/libraries/qt-3/default.nix b/pkgs/development/libraries/qt-3/default.nix
index 0bc7d938be6..b2d818a2972 100644
--- a/pkgs/development/libraries/qt-3/default.nix
+++ b/pkgs/development/libraries/qt-3/default.nix
@@ -6,8 +6,8 @@
 , cursorSupport ? true, libXcursor ? null
 , threadSupport ? true
 , mysqlSupport ? false, libmysqlclient ? null
-, libGLSupported ? lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
-, openglSupport ? lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
+, libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
+, openglSupport ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
 , libGL ? null, libGLU ? null, libXmu ? null
 , xlibsWrapper, xorgproto, zlib, libjpeg, libpng, which
 }:
diff --git a/pkgs/development/libraries/qt-4.x/4.8/default.nix b/pkgs/development/libraries/qt-4.x/4.8/default.nix
index 9ddb2cc5bac..7dddd2bc67d 100644
--- a/pkgs/development/libraries/qt-4.x/4.8/default.nix
+++ b/pkgs/development/libraries/qt-4.x/4.8/default.nix
@@ -4,7 +4,7 @@
 , libmng, which, libGLU, openssl, dbus, cups, pkg-config
 , libtiff, glib, icu, libmysqlclient, postgresql, sqlite, perl, coreutils, libXi
 , alsaLib
-, libGLSupported ? lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
+, libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
 , flashplayerFix ? false, gdk-pixbuf
 , gtkStyle ? stdenv.hostPlatform == stdenv.buildPlatform, gtk2
 , gnomeStyle ? false, libgnomeui, GConf, gnome_vfs
diff --git a/pkgs/development/libraries/qt-5/5.12/default.nix b/pkgs/development/libraries/qt-5/5.12/default.nix
index 87a88ddf9b0..cf5a0de11ad 100644
--- a/pkgs/development/libraries/qt-5/5.12/default.nix
+++ b/pkgs/development/libraries/qt-5/5.12/default.nix
@@ -16,7 +16,7 @@ top-level attribute to `top-level/all-packages.nix`.
 
 {
   newScope,
-  stdenv, fetchurl, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper,
+  lib, stdenv, fetchurl, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper,
   bison, cups ? null, harfbuzz, libGL, perl,
   gstreamer, gst-plugins-base, gtk3, dconf,
   llvmPackages_5,
@@ -27,7 +27,7 @@ top-level attribute to `top-level/all-packages.nix`.
   debug ? false,
 }:
 
-with stdenv.lib;
+with lib;
 
 let
 
@@ -119,7 +119,7 @@ let
     import ../qtModule.nix
     {
       inherit perl;
-      inherit (stdenv) lib;
+      inherit lib;
       # Use a variant of mkDerivation that does not include wrapQtApplications
       # to avoid cyclic dependencies between Qt modules.
       mkDerivation =
@@ -136,7 +136,7 @@ let
 
       mkDerivationWith =
         import ../mkDerivation.nix
-        { inherit (stdenv) lib; inherit debug; inherit (self) wrapQtAppsHook; };
+        { inherit lib; inherit debug; inherit (self) wrapQtAppsHook; };
 
       mkDerivation = mkDerivationWith stdenvActual.mkDerivation;
 
diff --git a/pkgs/development/libraries/qt-5/5.14/default.nix b/pkgs/development/libraries/qt-5/5.14/default.nix
index 926510293b5..7139a3b7354 100644
--- a/pkgs/development/libraries/qt-5/5.14/default.nix
+++ b/pkgs/development/libraries/qt-5/5.14/default.nix
@@ -16,7 +16,7 @@ top-level attribute to `top-level/all-packages.nix`.
 
 {
   newScope,
-  stdenv, fetchurl, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper,
+  lib, stdenv, fetchurl, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper,
   bison, cups ? null, harfbuzz, libGL, perl,
   gstreamer, gst-plugins-base, gtk3, dconf,
   llvmPackages_5,
@@ -27,7 +27,7 @@ top-level attribute to `top-level/all-packages.nix`.
   debug ? false,
 }:
 
-with stdenv.lib;
+with lib;
 
 let
 
diff --git a/pkgs/development/libraries/qt-5/5.15/default.nix b/pkgs/development/libraries/qt-5/5.15/default.nix
index 08fd3a9720c..a3a0496f160 100644
--- a/pkgs/development/libraries/qt-5/5.15/default.nix
+++ b/pkgs/development/libraries/qt-5/5.15/default.nix
@@ -16,7 +16,7 @@ top-level attribute to `top-level/all-packages.nix`.
 
 {
   newScope,
-  stdenv, fetchurl, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper,
+  lib, stdenv, fetchurl, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper,
   bison, cups ? null, harfbuzz, libGL, perl,
   gstreamer, gst-plugins-base, gtk3, dconf,
   llvmPackages_5,
@@ -27,7 +27,7 @@ top-level attribute to `top-level/all-packages.nix`.
   debug ? false,
 }:
 
-with stdenv.lib;
+with lib;
 
 let
 
diff --git a/pkgs/development/libraries/qt-5/modules/qtconnectivity.nix b/pkgs/development/libraries/qt-5/modules/qtconnectivity.nix
index 36a736d03dc..f6aeb23fb7b 100644
--- a/pkgs/development/libraries/qt-5/modules/qtconnectivity.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtconnectivity.nix
@@ -1,8 +1,8 @@
-{ qtModule, stdenv, qtbase, qtdeclarative, bluez }:
+{ qtModule, lib, stdenv, qtbase, qtdeclarative, bluez }:
 
 qtModule {
   name = "qtconnectivity";
   qtInputs = [ qtbase qtdeclarative ];
-  buildInputs = stdenv.lib.optional stdenv.isLinux bluez;
+  buildInputs = lib.optional stdenv.isLinux bluez;
   outputs = [ "out" "dev" "bin" ];
 }
diff --git a/pkgs/development/libraries/qt-5/modules/qtlocation.nix b/pkgs/development/libraries/qt-5/modules/qtlocation.nix
index a80785d8099..182b5f5bc33 100644
--- a/pkgs/development/libraries/qt-5/modules/qtlocation.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtlocation.nix
@@ -1,10 +1,10 @@
-{ stdenv, qtModule, qtbase, qtmultimedia }:
+{ lib, stdenv, qtModule, qtbase, qtmultimedia }:
 
 qtModule {
   name = "qtlocation";
   qtInputs = [ qtbase qtmultimedia ];
   outputs = [ "bin" "out" "dev" ];
-  qmakeFlags = stdenv.lib.optional stdenv.isDarwin [
+  qmakeFlags = lib.optional stdenv.isDarwin [
      # boost uses std::auto_ptr which has been disabled in clang with libcxx
      # This flag re-enables this feature
      # https://libcxx.llvm.org/docs/UsingLibcxx.html#c-17-specific-configuration-macros
diff --git a/pkgs/development/libraries/qt-5/modules/qtmacextras.nix b/pkgs/development/libraries/qt-5/modules/qtmacextras.nix
index 11964caf17b..6639e4c8d69 100644
--- a/pkgs/development/libraries/qt-5/modules/qtmacextras.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtmacextras.nix
@@ -1,9 +1,9 @@
-{ stdenv, qtModule, qtbase }:
+{ lib, stdenv, qtModule, qtbase }:
 
 qtModule {
   name = "qtmacextras";
   qtInputs = [ qtbase ];
-  meta = with stdenv.lib; {
+  meta = with lib; {
     maintainers = with maintainers; [ periklis ];
     platforms = platforms.darwin;
   };
diff --git a/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix b/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix
index b9e757833b3..eb2c3bc7431 100644
--- a/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix
@@ -1,8 +1,8 @@
-{ qtModule, stdenv, qtbase, qtdeclarative, pkg-config
+{ qtModule, lib, stdenv, qtbase, qtdeclarative, pkg-config
 , alsaLib, gstreamer, gst-plugins-base, libpulseaudio, wayland
 }:
 
-with stdenv.lib;
+with lib;
 
 qtModule {
   name = "qtmultimedia";
diff --git a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix
index e6ab23073b1..1ad254ffcd0 100644
--- a/pkgs/development/libraries/qt-5/modules/qtwebengine.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtwebengine.nix
@@ -18,7 +18,7 @@
 , lib, stdenv, fetchpatch
 }:
 
-with stdenv.lib;
+with lib;
 
 qtModule {
   name = "qtwebengine";
diff --git a/pkgs/development/libraries/qt-5/modules/qtwebkit.nix b/pkgs/development/libraries/qt-5/modules/qtwebkit.nix
index d8d53690b24..ed41a4ac9bc 100644
--- a/pkgs/development/libraries/qt-5/modules/qtwebkit.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtwebkit.nix
@@ -43,7 +43,7 @@ qtModule {
 
   # QtWebKit overrides qmake's default_pre and default_post features,
   # so its custom qmake files must be found first at the front of QMAKEPATH.
-  preConfigure = stdenv.lib.optionalString (!usingAnnulenWebkitFork) ''
+  preConfigure = lib.optionalString (!usingAnnulenWebkitFork) ''
     QMAKEPATH="$PWD/Tools/qmake''${QMAKEPATH:+:}$QMAKEPATH"
     fixQtBuiltinPaths . '*.pr?'
     # Fix hydra's "Log limit exceeded"
@@ -72,6 +72,6 @@ qtModule {
   preFixup = ''rm -rf "$(pwd)" && mkdir "$(pwd)" '';
 
   meta = {
-    maintainers = with stdenv.lib.maintainers; [ abbradar periklis ];
+    maintainers = with lib.maintainers; [ abbradar periklis ];
   };
 }
diff --git a/pkgs/development/libraries/qt-5/modules/qtwebview.nix b/pkgs/development/libraries/qt-5/modules/qtwebview.nix
index 906d750c5d3..4034dce49f5 100644
--- a/pkgs/development/libraries/qt-5/modules/qtwebview.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtwebview.nix
@@ -1,6 +1,6 @@
-{ darwin, stdenv, qtModule, qtdeclarative, qtwebengine }:
+{ darwin, lib, stdenv, qtModule, qtdeclarative, qtwebengine }:
 
-with stdenv.lib;
+with lib;
 
 qtModule {
   name = "qtwebview";
diff --git a/pkgs/development/libraries/tokyo-tyrant/default.nix b/pkgs/development/libraries/tokyo-tyrant/default.nix
index e5aeae6aae0..6431e6a1a7a 100644
--- a/pkgs/development/libraries/tokyo-tyrant/default.nix
+++ b/pkgs/development/libraries/tokyo-tyrant/default.nix
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
 
     license = lib.licenses.lgpl21Plus;
 
-    platforms = lib.platforms.gnu ++ stdenv.lib.platforms.linux;         # arbitrary choice
+    platforms = lib.platforms.gnu ++ lib.platforms.linux;         # arbitrary choice
     maintainers = [ ];
   };
 }
diff --git a/pkgs/development/libraries/wiredtiger/default.nix b/pkgs/development/libraries/wiredtiger/default.nix
index 7b636e984de..469da2523d9 100644
--- a/pkgs/development/libraries/wiredtiger/default.nix
+++ b/pkgs/development/libraries/wiredtiger/default.nix
@@ -14,7 +14,7 @@ let
   mkEnable = mkFlag "enable-" "disable-";
   mkWith = mkFlag "with-" "without-";
 
-  shouldUsePkg = pkg: if pkg != null && lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) pkg.meta.platforms then pkg else null;
+  shouldUsePkg = pkg: if pkg != null && lib.any (lib.meta.platformMatch stdenv.hostPlatform) pkg.meta.platforms then pkg else null;
 
   optLz4 = shouldUsePkg lz4;
   optSnappy = shouldUsePkg snappy;
diff --git a/pkgs/development/libraries/wxwidgets/2.8/default.nix b/pkgs/development/libraries/wxwidgets/2.8/default.nix
index 93529ef430f..8029477708d 100644
--- a/pkgs/development/libraries/wxwidgets/2.8/default.nix
+++ b/pkgs/development/libraries/wxwidgets/2.8/default.nix
@@ -1,7 +1,7 @@
 { lib, stdenv, fetchurl, pkg-config, gtk2, libXinerama, libSM, libXxf86vm, xorgproto
 , libX11, cairo
-, libGLSupported ? lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
-, withMesa ? lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
+, libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
+, withMesa ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
 , libGLU ? null, libGL ? null
 , compat24 ? false, compat26 ? true, unicode ? true,
 }:
diff --git a/pkgs/development/libraries/wxwidgets/2.9/default.nix b/pkgs/development/libraries/wxwidgets/2.9/default.nix
index 358b45fbf0c..77e0e20eaf5 100644
--- a/pkgs/development/libraries/wxwidgets/2.9/default.nix
+++ b/pkgs/development/libraries/wxwidgets/2.9/default.nix
@@ -1,7 +1,7 @@
 { lib, stdenv, fetchurl, pkg-config, gtk2, libXinerama, libSM, libXxf86vm, xorgproto
 , setfile
-, libGLSupported ? lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
-, withMesa ? lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
+, libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
+, withMesa ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
 , libGLU ? null, libGL ? null
 , compat24 ? false, compat26 ? true, unicode ? true
 , Carbon ? null, Cocoa ? null, Kernel ? null, QuickTime ? null, AGL ? null
diff --git a/pkgs/development/libraries/wxwidgets/3.0/default.nix b/pkgs/development/libraries/wxwidgets/3.0/default.nix
index c97a9778d5d..a1c2820a5fd 100644
--- a/pkgs/development/libraries/wxwidgets/3.0/default.nix
+++ b/pkgs/development/libraries/wxwidgets/3.0/default.nix
@@ -2,7 +2,7 @@
 , libXinerama, libSM, libXxf86vm
 , gtk2, gtk3
 , xorgproto, gst_all_1, setfile
-, libGLSupported ? lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
+, libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
 , withMesa ? libGLSupported
 , libGLU ? null, libGL ? null
 , compat24 ? false, compat26 ? true, unicode ? true
diff --git a/pkgs/development/libraries/wxwidgets/3.1/default.nix b/pkgs/development/libraries/wxwidgets/3.1/default.nix
index cbacf4ec762..cab0197c939 100644
--- a/pkgs/development/libraries/wxwidgets/3.1/default.nix
+++ b/pkgs/development/libraries/wxwidgets/3.1/default.nix
@@ -12,7 +12,7 @@
 , xorgproto
 , gst_all_1
 , setfile
-, libGLSupported ? lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
+, libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
 , withMesa ? libGLSupported
 , libGLU ? null
 , libGL ? null
diff --git a/pkgs/development/libraries/xalanc/default.nix b/pkgs/development/libraries/xalanc/default.nix
index 242788723fb..b757b737f97 100644
--- a/pkgs/development/libraries/xalanc/default.nix
+++ b/pkgs/development/libraries/xalanc/default.nix
@@ -26,7 +26,7 @@ in stdenv.mkDerivation rec {
     homepage = "http://xalan.apache.org/";
     description = "A XSLT processor for transforming XML documents";
     license = lib.licenses.asl20;
-    platforms = lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
     maintainers = [ lib.maintainers.jagajaga ];
   };
 }
diff --git a/pkgs/development/libraries/xercesc/default.nix b/pkgs/development/libraries/xercesc/default.nix
index dec42c0243e..f5109a1ebd6 100644
--- a/pkgs/development/libraries/xercesc/default.nix
+++ b/pkgs/development/libraries/xercesc/default.nix
@@ -17,6 +17,6 @@ stdenv.mkDerivation rec {
     homepage = "https://xerces.apache.org/xerces-c/";
     description = "Validating XML parser written in a portable subset of C++";
     license = lib.licenses.asl20;
-    platforms = lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
   };
 }
diff --git a/pkgs/development/misc/avr8-burn-omat/default.nix b/pkgs/development/misc/avr8-burn-omat/default.nix
index 1f504ac280e..0a9d666f8b7 100644
--- a/pkgs/development/misc/avr8-burn-omat/default.nix
+++ b/pkgs/development/misc/avr8-burn-omat/default.nix
@@ -27,7 +27,7 @@ stdenv.mkDerivation {
   meta = with lib; {
     description = "GUI tool for avrdude";
     homepage = "http://avr8-burn-o-mat.aaabbb.de/avr8_burn_o_mat_avrdude_gui_en.html";
-    license = stdenv.lib.licenses.gpl3;
+    license = lib.licenses.gpl3;
     platforms = platforms.all;
   };
 }
diff --git a/pkgs/development/misc/google-clasp/default.nix b/pkgs/development/misc/google-clasp/default.nix
index 1e138aaa8f7..12598e9fd86 100644
--- a/pkgs/development/misc/google-clasp/default.nix
+++ b/pkgs/development/misc/google-clasp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, pkgs }:
+{ lib, stdenv, pkgs }:
 let
   version = "2.2.1";
 in
@@ -12,8 +12,8 @@ in
   meta = {
     description = "Command Line tool for Google Apps Script Projects";
     homepage = "https://developers.google.com/apps-script/guides/clasp";
-    license = stdenv.lib.licenses.asl20;
-    maintainers = [ stdenv.lib.maintainers.michojel ];
+    license = lib.licenses.asl20;
+    maintainers = [ lib.maintainers.michojel ];
     priority = 100;
   };
 }
diff --git a/pkgs/development/misc/haskell/hasura/ci-info/default.nix b/pkgs/development/misc/haskell/hasura/ci-info/default.nix
index 53c85a2e5ba..55b070a9f77 100644
--- a/pkgs/development/misc/haskell/hasura/ci-info/default.nix
+++ b/pkgs/development/misc/haskell/hasura/ci-info/default.nix
@@ -1,5 +1,5 @@
 { mkDerivation, aeson, aeson-casing, base, fetchgit, hashable
-, hpack, stdenv, template-haskell, text, th-lift-instances
+, hpack, lib, stdenv, template-haskell, text, th-lift-instances
 , unordered-containers
 }:
 mkDerivation {
@@ -18,5 +18,5 @@ mkDerivation {
   libraryToolDepends = [ hpack ];
   prePatch = "hpack";
   homepage = "https://github.com/hasura/ci-info-hs#readme";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/pkgs/development/misc/haskell/hasura/graphql-engine/default.nix b/pkgs/development/misc/haskell/hasura/graphql-engine/default.nix
index 055459514e4..3cf840c15e1 100644
--- a/pkgs/development/misc/haskell/hasura/graphql-engine/default.nix
+++ b/pkgs/development/misc/haskell/hasura/graphql-engine/default.nix
@@ -13,7 +13,7 @@
 , optparse-applicative, pem, pg-client, postgresql-binary
 , postgresql-libpq, process, profunctors, psqueues, QuickCheck
 , regex-tdfa, safe, scientific, semver, shakespeare, split
-, Spock-core, stdenv, stm, stm-containers, template-haskell, text
+, Spock-core, lib, stdenv, stm, stm-containers, template-haskell, text
 , text-builder, text-conversions, th-lift-instances, these, time
 , transformers, transformers-base, unix, unordered-containers
 , uri-encode, uuid, vector, wai, wai-websockets, warp, websockets
@@ -68,8 +68,8 @@ mkDerivation {
   doCheck = false;
   homepage = "https://www.hasura.io";
   description = "GraphQL API over Postgres";
-  license = stdenv.lib.licenses.asl20;
-  maintainers = with stdenv.lib.maintainers; [ offline ];
+  license = lib.licenses.asl20;
+  maintainers = with lib.maintainers; [ offline ];
   hydraPlatforms = [];
   broken = true;
 }
diff --git a/pkgs/development/misc/haskell/hasura/graphql-parser/default.nix b/pkgs/development/misc/haskell/hasura/graphql-parser/default.nix
index 991b5384d5c..82314a7485b 100644
--- a/pkgs/development/misc/haskell/hasura/graphql-parser/default.nix
+++ b/pkgs/development/misc/haskell/hasura/graphql-parser/default.nix
@@ -1,6 +1,6 @@
 { mkDerivation, aeson, attoparsec, base, bytestring, containers
 , criterion, fetchgit, filepath, hedgehog, hpack, prettyprinter
-, protolude, regex-tdfa, scientific, stdenv, template-haskell, text
+, protolude, regex-tdfa, scientific, lib, stdenv, template-haskell, text
 , text-builder, th-lift-instances, unordered-containers, vector
 }:
 mkDerivation {
@@ -32,5 +32,5 @@ mkDerivation {
   doCheck = false;
   prePatch = "hpack";
   homepage = "https://github.com/hasura/graphql-parser-hs#readme";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/pkgs/development/misc/haskell/hasura/pg-client/default.nix b/pkgs/development/misc/haskell/hasura/pg-client/default.nix
index 725e5e7f640..aa780abd8e9 100644
--- a/pkgs/development/misc/haskell/hasura/pg-client/default.nix
+++ b/pkgs/development/misc/haskell/hasura/pg-client/default.nix
@@ -2,7 +2,7 @@
 , criterion, fetchgit, file-embed, hashable, hashtables, hasql
 , hasql-pool, hasql-transaction, monad-control, mtl
 , postgresql-binary, postgresql-libpq, resource-pool, retry
-, scientific, stdenv, template-haskell, text, text-builder, th-lift
+, scientific, lib, stdenv, template-haskell, text, text-builder, th-lift
 , th-lift-instances, time, transformers-base, uuid, vector
 }:
 mkDerivation {
@@ -26,5 +26,5 @@ mkDerivation {
     hasql-transaction mtl postgresql-libpq text text-builder
   ];
   homepage = "https://github.com/hasura/platform";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/pkgs/development/misc/loc/default.nix b/pkgs/development/misc/loc/default.nix
index 33de722baa2..74b5ca09d2a 100644
--- a/pkgs/development/misc/loc/default.nix
+++ b/pkgs/development/misc/loc/default.nix
@@ -18,8 +18,8 @@ buildRustPackage rec {
   meta = with lib; {
     homepage = "https://github.com/cgag/loc";
     description = "Count lines of code quickly";
-    license = stdenv.lib.licenses.mit;
-    maintainers = with stdenv.lib.maintainers; [ ];
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ ];
     platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/misc/msp430/mspdebug.nix b/pkgs/development/misc/msp430/mspdebug.nix
index f8616ff0bc4..122b3cec4b7 100644
--- a/pkgs/development/misc/msp430/mspdebug.nix
+++ b/pkgs/development/misc/msp430/mspdebug.nix
@@ -25,13 +25,13 @@ stdenv.mkDerivation rec {
   };
 
   enableParallelBuilding = true;
-  nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin pkg-config
-  ++ stdenv.lib.optional (enableMspds && stdenv.isLinux) autoPatchelfHook;
+  nativeBuildInputs = lib.optional stdenv.isDarwin pkg-config
+  ++ lib.optional (enableMspds && stdenv.isLinux) autoPatchelfHook;
   buildInputs = [ libusb-compat-0_1 ]
-  ++ stdenv.lib.optional stdenv.isDarwin hidapi
-  ++ stdenv.lib.optional enableReadline readline;
+  ++ lib.optional stdenv.isDarwin hidapi
+  ++ lib.optional enableReadline readline;
 
-  postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
+  postPatch = lib.optionalString stdenv.isDarwin ''
     # TODO: remove once a new 0.26+ release is made
     substituteInPlace drivers/tilib_api.c --replace .so ${stdenv.hostPlatform.extensions.sharedLibrary}
 
@@ -40,8 +40,8 @@ stdenv.mkDerivation rec {
   '';
 
   # TODO: wrap with MSPDEBUG_TILIB_PATH env var instead of these rpath fixups in 0.26+
-  runtimeDependencies = stdenv.lib.optional enableMspds mspds;
-  postFixup = stdenv.lib.optionalString (enableMspds && stdenv.isDarwin) ''
+  runtimeDependencies = lib.optional enableMspds mspds;
+  postFixup = lib.optionalString (enableMspds && stdenv.isDarwin) ''
     # autoPatchelfHook only works on linux so...
     for dep in $runtimeDependencies; do
       install_name_tool -add_rpath $dep/lib $out/bin/$pname
@@ -50,8 +50,8 @@ stdenv.mkDerivation rec {
 
   installFlags = [ "PREFIX=$(out)" "INSTALL=install" ];
   makeFlags = [ "UNAME_S=$(unameS)" ] ++
-    stdenv.lib.optional (!enableReadline) "WITHOUT_READLINE=1";
-  unameS = stdenv.lib.optionalString stdenv.isDarwin "Darwin";
+    lib.optional (!enableReadline) "WITHOUT_READLINE=1";
+  unameS = lib.optionalString stdenv.isDarwin "Darwin";
 
   meta = with lib; {
     description = "A free programmer, debugger, and gdb proxy for MSP430 MCUs";
diff --git a/pkgs/development/misc/resholve/deps.nix b/pkgs/development/misc/resholve/deps.nix
index 9be283e4933..86bcba57075 100644
--- a/pkgs/development/misc/resholve/deps.nix
+++ b/pkgs/development/misc/resholve/deps.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , python27Packages
 , fetchFromGitHub
 , makeWrapper
@@ -106,12 +106,12 @@ rec {
     _NIX_SHELL_LIBCMARK = "${cmark}/lib/libcmark${stdenv.hostPlatform.extensions.sharedLibrary}";
 
     # See earlier note on glibcLocales
-    LOCALE_ARCHIVE = stdenv.lib.optionalString (stdenv.buildPlatform.libc == "glibc") "${glibcLocales}/lib/locale/locale-archive";
+    LOCALE_ARCHIVE = lib.optionalString (stdenv.buildPlatform.libc == "glibc") "${glibcLocales}/lib/locale/locale-archive";
 
     meta = {
       description = "A new unix shell";
       homepage = "https://www.oilshell.org/";
-      license = with stdenv.lib.licenses; [
+      license = with lib.licenses; [
         psfl # Includes a portion of the python interpreter and standard library
         asl20 # Licence for Oil itself
       ];
diff --git a/pkgs/development/misc/yelp-tools/default.nix b/pkgs/development/misc/yelp-tools/default.nix
index fae1c1731ae..9d5eb2af496 100644
--- a/pkgs/development/misc/yelp-tools/default.nix
+++ b/pkgs/development/misc/yelp-tools/default.nix
@@ -5,7 +5,7 @@ stdenv.mkDerivation rec {
   version = "3.38.0";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/yelp-tools/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/yelp-tools/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1c045c794sm83rrjan67jmsk20qacrw1m814p4nw85w5xsry8z30";
   };
 
diff --git a/pkgs/development/pharo/vm/build-vm-legacy.nix b/pkgs/development/pharo/vm/build-vm-legacy.nix
index d85dab861e7..bd5d1e91602 100644
--- a/pkgs/development/pharo/vm/build-vm-legacy.nix
+++ b/pkgs/development/pharo/vm/build-vm-legacy.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
 
   inherit name src;
 
-  pharo-share = import ./share.nix { inherit stdenv fetchurl unzip; };
+  pharo-share = import ./share.nix { inherit lib stdenv fetchurl unzip; };
 
   hardeningDisable = [ "format" "pic" ];
 
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ bash glibc openssl libGLU libGL freetype
                   xorg.libX11 xorg.libICE xorg.libSM alsaLib cairo pharo-share ];
 
-  LD_LIBRARY_PATH = stdenv.lib.makeLibraryPath
+  LD_LIBRARY_PATH = lib.makeLibraryPath
     [ cairo libGLU libGL freetype openssl libuuid alsaLib
       xorg.libICE xorg.libSM ];
 
@@ -89,9 +89,9 @@ stdenv.mkDerivation rec {
     license = licenses.mit;
     maintainers = [ maintainers.lukego ];
     # Pharo VM sources are packaged separately for darwin (OS X)
-    platforms = stdenv.lib.filter
-      (system: with stdenv.lib.systems.elaborate { inherit system; };
+    platforms = lib.filter
+      (system: with lib.systems.elaborate { inherit system; };
          isUnix && !isDarwin)
-      stdenv.lib.platforms.mesaPlatforms;
+      lib.platforms.mesaPlatforms;
   };
 }
diff --git a/pkgs/development/pharo/vm/build-vm.nix b/pkgs/development/pharo/vm/build-vm.nix
index 28525ac475e..5427e36746c 100644
--- a/pkgs/development/pharo/vm/build-vm.nix
+++ b/pkgs/development/pharo/vm/build-vm.nix
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
     else throw "Unsupported platform: only Linux/Darwin x86/x64 are supported.";
 
   # Shared data (for the sources file)
-  pharo-share = import ./share.nix { inherit stdenv fetchurl unzip; };
+  pharo-share = import ./share.nix { inherit lib stdenv fetchurl unzip; };
 
   # Note: -fPIC causes the VM to segfault.
   hardeningDisable = [ "format" "pic"
@@ -138,7 +138,7 @@ stdenv.mkDerivation rec {
     mkdir -p "$out/bin"
 
     # Note: include ELF rpath in LD_LIBRARY_PATH for finding libc.
-    libs=$out:$(patchelf --print-rpath "$out/pharo"):${stdenv.lib.makeLibraryPath libs}
+    libs=$out:$(patchelf --print-rpath "$out/pharo"):${lib.makeLibraryPath libs}
 
     # Create the script
     cat > "$out/bin/${cmd}" <<EOF
diff --git a/pkgs/development/pharo/vm/share.nix b/pkgs/development/pharo/vm/share.nix
index 2c8c376b7c1..720f2e39a7d 100644
--- a/pkgs/development/pharo/vm/share.nix
+++ b/pkgs/development/pharo/vm/share.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip }:
+{ lib, stdenv, fetchurl, unzip }:
 
 stdenv.mkDerivation rec {
   version = "1.0";
@@ -52,7 +52,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Shared files for Pharo";
     homepage = "https://pharo.org";
-    license = stdenv.lib.licenses.mit;
+    license = lib.licenses.mit;
     maintainers = [ ];
   };
 }
diff --git a/pkgs/development/pharo/wrapper/default.nix b/pkgs/development/pharo/wrapper/default.nix
index b9b147bf418..1f089295072 100644
--- a/pkgs/development/pharo/wrapper/default.nix
+++ b/pkgs/development/pharo/wrapper/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, file, makeDesktopItem, cog32, spur32, spur64 ? "none" }:
+{ lib, stdenv, file, makeDesktopItem, cog32, spur32, spur64 ? "none" }:
 
 stdenv.mkDerivation rec {
   name = "pharo";
@@ -50,13 +50,13 @@ stdenv.mkDerivation rec {
     '';
 
     homepage = "http://pharo.org";
-    license = stdenv.lib.licenses.mit;
-    maintainers = [ stdenv.lib.maintainers.lukego ];
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.lukego ];
     # Pharo VM sources are packaged separately for darwin (OS X)
-    platforms = stdenv.lib.filter
-      (system: with stdenv.lib.systems.elaborate { inherit system; };
+    platforms = lib.filter
+      (system: with lib.systems.elaborate { inherit system; };
          isUnix && !isDarwin)
-      stdenv.lib.platforms.mesaPlatforms;
+      lib.platforms.mesaPlatforms;
   };
 }
 
diff --git a/pkgs/development/pure-modules/audio/default.nix b/pkgs/development/pure-modules/audio/default.nix
index 7f5d6412fbb..34d405d6a39 100644
--- a/pkgs/development/pure-modules/audio/default.nix
+++ b/pkgs/development/pure-modules/audio/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, pure, portaudio, fftw, libsndfile, libsamplerate }:
+{ lib, stdenv, fetchurl, pkg-config, pure, portaudio, fftw, libsndfile, libsamplerate }:
 
 stdenv.mkDerivation rec {
   baseName = "audio";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A digital audio interface for the Pure programming language";
     homepage = "http://puredocs.bitbucket.org/pure-audio.html";
-    license = stdenv.lib.licenses.bsd3;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.bsd3;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/avahi/default.nix b/pkgs/development/pure-modules/avahi/default.nix
index 2bcc7407266..7b8cc1b00ac 100644
--- a/pkgs/development/pure-modules/avahi/default.nix
+++ b/pkgs/development/pure-modules/avahi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, pure, avahi }:
+{ lib, stdenv, fetchurl, pkg-config, pure, avahi }:
 
 stdenv.mkDerivation rec {
   baseName = "avahi";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A digital audio interface for the Pure programming language";
     homepage = "http://puredocs.bitbucket.org/pure-avahi.html";
-    license = stdenv.lib.licenses.lgpl3Plus;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.lgpl3Plus;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/csv/default.nix b/pkgs/development/pure-modules/csv/default.nix
index 2518424649b..f51739f0339 100644
--- a/pkgs/development/pure-modules/csv/default.nix
+++ b/pkgs/development/pure-modules/csv/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, pure }:
+{ lib, stdenv, fetchurl, pkg-config, pure }:
 
 stdenv.mkDerivation rec {
   baseName = "csv";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Comma Separated Value Interface for the Pure Programming Language";
     homepage = "http://puredocs.bitbucket.org/pure-csv.html";
-    license = stdenv.lib.licenses.free;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.free;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/doc/default.nix b/pkgs/development/pure-modules/doc/default.nix
index b25cf7c6572..aa678cb21a4 100644
--- a/pkgs/development/pure-modules/doc/default.nix
+++ b/pkgs/development/pure-modules/doc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, pure }:
+{ lib, stdenv, fetchurl, pkg-config, pure }:
 
 stdenv.mkDerivation rec {
   baseName = "doc";
@@ -17,8 +17,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A simple utility for literate programming and documenting source code written in the Pure programming language";
     homepage = "http://puredocs.bitbucket.org/pure-doc.html";
-    license = stdenv.lib.licenses.gpl3Plus;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.gpl3Plus;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/fastcgi/default.nix b/pkgs/development/pure-modules/fastcgi/default.nix
index 18d42aecf05..04ea1dde589 100644
--- a/pkgs/development/pure-modules/fastcgi/default.nix
+++ b/pkgs/development/pure-modules/fastcgi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, pure, fcgi }:
+{ lib, stdenv, fetchurl, pkg-config, pure, fcgi }:
 
 stdenv.mkDerivation rec {
   baseName = "fastcgi";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Lets you write FastCGI scripts with Pure, to be run by web servers like Apache";
     homepage = "http://puredocs.bitbucket.org/pure-fastcgi.html";
-    license = stdenv.lib.licenses.bsd3;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.bsd3;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/faust/default.nix b/pkgs/development/pure-modules/faust/default.nix
index e513ecc567d..4a3b12ea7fa 100644
--- a/pkgs/development/pure-modules/faust/default.nix
+++ b/pkgs/development/pure-modules/faust/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, pure, faust, libtool }:
+{ lib, stdenv, fetchurl, pkg-config, pure, faust, libtool }:
 
 stdenv.mkDerivation rec {
   baseName = "faust";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Lets you load and run Faust-generated signal processing modules in Pure";
     homepage = "http://puredocs.bitbucket.org/pure-faust.html";
-    license = stdenv.lib.licenses.lgpl3Plus;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.lgpl3Plus;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/ffi/default.nix b/pkgs/development/pure-modules/ffi/default.nix
index 7a42cde6558..3b076a4f38c 100644
--- a/pkgs/development/pure-modules/ffi/default.nix
+++ b/pkgs/development/pure-modules/ffi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, pure, libffi }:
+{ lib, stdenv, fetchurl, pkg-config, pure, libffi }:
 
 stdenv.mkDerivation rec {
   baseName = "ffi";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Provides an interface to libffi which enables you to call C functions from Pure and vice versa";
     homepage = "http://puredocs.bitbucket.org/pure-ffi.html";
-    license = stdenv.lib.licenses.lgpl3Plus;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.lgpl3Plus;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/gen/default.nix b/pkgs/development/pure-modules/gen/default.nix
index 3fcf8118a84..278c782da32 100644
--- a/pkgs/development/pure-modules/gen/default.nix
+++ b/pkgs/development/pure-modules/gen/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl,
+{ lib, stdenv, fetchurl,
   pkg-config, pure, haskellPackages }:
 
 stdenv.mkDerivation rec {
@@ -19,9 +19,9 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Pure interface generator";
     homepage = "http://puredocs.bitbucket.org/pure-gen.html";
-    license = stdenv.lib.licenses.free;
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.free;
+    platforms = lib.platforms.linux;
     hydraPlatforms = [];
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/gl/default.nix b/pkgs/development/pure-modules/gl/default.nix
index 20dd048e945..369dc1bc39b 100644
--- a/pkgs/development/pure-modules/gl/default.nix
+++ b/pkgs/development/pure-modules/gl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, pure, freeglut, libGLU, libGL, xlibsWrapper }:
+{ lib, stdenv, fetchurl, pkg-config, pure, freeglut, libGLU, libGL, xlibsWrapper }:
 
 stdenv.mkDerivation rec {
   baseName = "gl";
@@ -21,8 +21,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Fairly complete Pure bindings for the OpenGL graphics library, which allow you to do 2D and 3D graphics programming with Pure";
     homepage = "http://puredocs.bitbucket.org/pure-gl.html";
-    license = stdenv.lib.licenses.bsd3;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.bsd3;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/glpk/default.nix b/pkgs/development/pure-modules/glpk/default.nix
index 6cb620a4525..7b8c46ef47f 100644
--- a/pkgs/development/pure-modules/glpk/default.nix
+++ b/pkgs/development/pure-modules/glpk/default.nix
@@ -34,8 +34,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "GLPK interface for the Pure Programming Language";
     homepage = "http://puredocs.bitbucket.org/pure-glpk.html";
-    license = stdenv.lib.licenses.gpl3Plus;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.gpl3Plus;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/gplot/default.nix b/pkgs/development/pure-modules/gplot/default.nix
index ed919e94eea..ddae95c43f0 100644
--- a/pkgs/development/pure-modules/gplot/default.nix
+++ b/pkgs/development/pure-modules/gplot/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, pure, gnuplot }:
+{ lib, stdenv, fetchurl, pkg-config, pure, gnuplot }:
 
 stdenv.mkDerivation rec {
   baseName = "gplot";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A pure binding to gnuplot";
     homepage = "http://puredocs.bitbucket.org/pure-gplot.html";
-    license = stdenv.lib.licenses.lgpl3Plus;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.lgpl3Plus;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/gsl/default.nix b/pkgs/development/pure-modules/gsl/default.nix
index 3d11f29fed3..204aeb6bb74 100644
--- a/pkgs/development/pure-modules/gsl/default.nix
+++ b/pkgs/development/pure-modules/gsl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pure, pkg-config, gsl }:
+{ lib, stdenv, fetchurl, pure, pkg-config, gsl }:
 
 stdenv.mkDerivation rec {
   baseName = "gsl";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "GNU Scientific Library interface for Pure";
     homepage = "http://puredocs.bitbucket.org/pure-gsl.html";
-    license = stdenv.lib.licenses.gpl3Plus;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.gpl3Plus;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/gtk/default.nix b/pkgs/development/pure-modules/gtk/default.nix
index 55281957df6..8cc3781e825 100644
--- a/pkgs/development/pure-modules/gtk/default.nix
+++ b/pkgs/development/pure-modules/gtk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, pure, pure-ffi, gtk2 }:
+{ lib, stdenv, fetchurl, pkg-config, pure, pure-ffi, gtk2 }:
 
 stdenv.mkDerivation rec {
   baseName = "gtk";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A collection of bindings to use the GTK GUI toolkit version 2.x with Pure";
     homepage = "http://puredocs.bitbucket.org/pure-gtk.html";
-    license = stdenv.lib.licenses.lgpl3Plus;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.lgpl3Plus;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/liblo/default.nix b/pkgs/development/pure-modules/liblo/default.nix
index 864578ae007..40502bbc140 100644
--- a/pkgs/development/pure-modules/liblo/default.nix
+++ b/pkgs/development/pure-modules/liblo/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, pure, liblo }:
+{ lib, stdenv, fetchurl, pkg-config, pure, liblo }:
 
 stdenv.mkDerivation rec {
   baseName = "liblo";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A quick and dirty Pure wrapper for the liblo library, which implements Berkeley’s Open Sound Control (OSC) protocol";
     homepage = "http://puredocs.bitbucket.org/pure-liblo.html";
-    license = stdenv.lib.licenses.lgpl3Plus;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.lgpl3Plus;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/lilv/default.nix b/pkgs/development/pure-modules/lilv/default.nix
index 12a15b41a08..577170118bb 100644
--- a/pkgs/development/pure-modules/lilv/default.nix
+++ b/pkgs/development/pure-modules/lilv/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, pure, lilv, lv2, serd, sord, sratom }:
+{ lib, stdenv, fetchurl, pkg-config, pure, lilv, lv2, serd, sord, sratom }:
 
 stdenv.mkDerivation rec {
   baseName = "lilv";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A Pure module for David Robillard’s Lilv, a library for LV2 plugin host writers";
     homepage = "http://puredocs.bitbucket.org/pure-lilv.html";
-    license = stdenv.lib.licenses.bsd3;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.bsd3;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/lv2/default.nix b/pkgs/development/pure-modules/lv2/default.nix
index 590179516b5..800c3968431 100644
--- a/pkgs/development/pure-modules/lv2/default.nix
+++ b/pkgs/development/pure-modules/lv2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, pure, lv2 }:
+{ lib, stdenv, fetchurl, pkg-config, pure, lv2 }:
 
 stdenv.mkDerivation rec {
   baseName = "lv2";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A generic LV2 plugin wrapper for Pure which can be linked with batch-compiled Pure scripts to obtain LV2 plugin modules";
     homepage = "http://puredocs.bitbucket.org/pure-lv2.html";
-    license = stdenv.lib.licenses.bsd3;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.bsd3;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/midi/default.nix b/pkgs/development/pure-modules/midi/default.nix
index 86303c057d3..bbca0b08089 100644
--- a/pkgs/development/pure-modules/midi/default.nix
+++ b/pkgs/development/pure-modules/midi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, pure, portmidi }:
+{ lib, stdenv, fetchurl, pkg-config, pure, portmidi }:
 
 stdenv.mkDerivation rec {
   baseName = "midi";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A MIDI interface for the Pure programming language";
     homepage = "http://puredocs.bitbucket.org/pure-midi.html";
-    license = stdenv.lib.licenses.bsd3;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.bsd3;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/mpfr/default.nix b/pkgs/development/pure-modules/mpfr/default.nix
index a6496617558..8afb74027d7 100644
--- a/pkgs/development/pure-modules/mpfr/default.nix
+++ b/pkgs/development/pure-modules/mpfr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, pure }:
+{ lib, stdenv, fetchurl, pkg-config, pure }:
 
 stdenv.mkDerivation rec {
   baseName = "mpfr";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "This module makes the MPFR multiprecision floats available in Pure";
     homepage = "http://puredocs.bitbucket.org/pure-mpfr.html";
-    license = stdenv.lib.licenses.lgpl3Plus;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.lgpl3Plus;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/octave/default.nix b/pkgs/development/pure-modules/octave/default.nix
index 20f87fb9fc6..591555f39c8 100644
--- a/pkgs/development/pure-modules/octave/default.nix
+++ b/pkgs/development/pure-modules/octave/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, pure, octave }:
+{ lib, stdenv, fetchurl, pkg-config, pure, octave }:
 
 stdenv.mkDerivation rec {
   baseName = "octave";
@@ -18,10 +18,10 @@ stdenv.mkDerivation rec {
   meta = {
     description = "An Octave module for the Pure programming language";
     homepage = "http://puredocs.bitbucket.org/pure-octave.html";
-    license = stdenv.lib.licenses.gpl3Plus;
+    license = lib.licenses.gpl3Plus;
     # This is set to none for now because it does not work with the
     # current stable version of Octave.
-    platforms = stdenv.lib.platforms.none;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    platforms = lib.platforms.none;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/odbc/default.nix b/pkgs/development/pure-modules/odbc/default.nix
index 8b69c3a28dc..272c88a697c 100644
--- a/pkgs/development/pure-modules/odbc/default.nix
+++ b/pkgs/development/pure-modules/odbc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, pure, libiodbc }:
+{ lib, stdenv, fetchurl, pkg-config, pure, libiodbc }:
 
 stdenv.mkDerivation rec {
   baseName = "odbc";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A simple ODBC interface for the Pure programming language";
     homepage = "http://puredocs.bitbucket.org/pure-odbc.html";
-    license = stdenv.lib.licenses.lgpl3Plus;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.lgpl3Plus;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/pandoc/default.nix b/pkgs/development/pure-modules/pandoc/default.nix
index beef19d7c5e..bbf22e9c6fb 100644
--- a/pkgs/development/pure-modules/pandoc/default.nix
+++ b/pkgs/development/pure-modules/pandoc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, pure, pandoc, gawk, getopt }:
+{ lib, stdenv, fetchurl, pkg-config, pure, pandoc, gawk, getopt }:
 
 stdenv.mkDerivation rec {
   baseName = "pandoc";
@@ -22,8 +22,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Converts Sphinx-formatted Pure documentation files to Markdown and other formats using Pandoc";
     homepage = "http://puredocs.bitbucket.org/pure-pandoc.html";
-    license = stdenv.lib.licenses.gpl3Plus;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.gpl3Plus;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/rational/default.nix b/pkgs/development/pure-modules/rational/default.nix
index cfc11b7b0ee..99cefc9682a 100644
--- a/pkgs/development/pure-modules/rational/default.nix
+++ b/pkgs/development/pure-modules/rational/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, pure }:
+{ lib, stdenv, fetchurl, pkg-config, pure }:
 
 stdenv.mkDerivation rec {
   baseName = "rational";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A collection of utility functions for rational numbers, and a module for doing interval arithmetic in Pure";
     homepage = "http://puredocs.bitbucket.org/pure-rational.html";
-    license = stdenv.lib.licenses.gpl3Plus;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.gpl3Plus;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/readline/default.nix b/pkgs/development/pure-modules/readline/default.nix
index e112b3e3893..f3015e27535 100644
--- a/pkgs/development/pure-modules/readline/default.nix
+++ b/pkgs/development/pure-modules/readline/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, pure, readline }:
+{ lib, stdenv, fetchurl, pkg-config, pure, readline }:
 
 stdenv.mkDerivation rec {
   baseName = "readline";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A trivial wrapper around GNU readline, which gives Pure scripts access to the most important facilities of the readline interface";
     homepage = "http://puredocs.bitbucket.org/pure-readline.html";
-    license = stdenv.lib.licenses.free;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.free;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/sockets/default.nix b/pkgs/development/pure-modules/sockets/default.nix
index 75165be0447..5e1a01bc624 100644
--- a/pkgs/development/pure-modules/sockets/default.nix
+++ b/pkgs/development/pure-modules/sockets/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, pure }:
+{ lib, stdenv, fetchurl, pkg-config, pure }:
 
 stdenv.mkDerivation rec {
   baseName = "sockets";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A Pure interface to the Berkeley socket functions";
     homepage = "http://puredocs.bitbucket.org/pure-sockets.html";
-    license = stdenv.lib.licenses.gpl3Plus;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.gpl3Plus;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/sql3/default.nix b/pkgs/development/pure-modules/sql3/default.nix
index 8c917c6285c..009b367c691 100644
--- a/pkgs/development/pure-modules/sql3/default.nix
+++ b/pkgs/development/pure-modules/sql3/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, pure, sqlite }:
+{ lib, stdenv, fetchurl, pkg-config, pure, sqlite }:
 
 stdenv.mkDerivation rec {
   baseName = "sql3";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A SQLite module for the Pure programming language";
     homepage = "http://puredocs.bitbucket.org/pure-sql3.html";
-    license = stdenv.lib.licenses.bsd3;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.bsd3;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/stldict/default.nix b/pkgs/development/pure-modules/stldict/default.nix
index fba4a2de444..46b711d9fa6 100644
--- a/pkgs/development/pure-modules/stldict/default.nix
+++ b/pkgs/development/pure-modules/stldict/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, pure }:
+{ lib, stdenv, fetchurl, pkg-config, pure }:
 
 stdenv.mkDerivation rec {
   baseName = "stldict";
@@ -24,8 +24,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A Pure interface to the C++ dictionary containers map and unordered_map";
     homepage = "http://puredocs.bitbucket.org/pure-stldict.html";
-    license = stdenv.lib.licenses.lgpl3Plus;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.lgpl3Plus;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/stllib/default.nix b/pkgs/development/pure-modules/stllib/default.nix
index 6a7475a6913..009543ee71c 100644
--- a/pkgs/development/pure-modules/stllib/default.nix
+++ b/pkgs/development/pure-modules/stllib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, pure }:
+{ lib, stdenv, fetchurl, pkg-config, pure }:
 
 stdenv.mkDerivation rec {
   baseName = "stllib";
@@ -24,8 +24,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "An “umbrella” package that contains a pair of Pure addons, pure-stlvec and pure-stlmap";
     homepage = "http://puredocs.bitbucket.org/pure-stllib.html";
-    license = stdenv.lib.licenses.bsd3;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.bsd3;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/tk/default.nix b/pkgs/development/pure-modules/tk/default.nix
index 843c617c95f..4a2c86783c1 100644
--- a/pkgs/development/pure-modules/tk/default.nix
+++ b/pkgs/development/pure-modules/tk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, pure, tcl, tk, xlibsWrapper }:
+{ lib, stdenv, fetchurl, pkg-config, pure, tcl, tk, xlibsWrapper }:
 
 stdenv.mkDerivation rec {
   baseName = "tk";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A basic interface between Pure and Tcl/Tk";
     homepage = "http://puredocs.bitbucket.org/pure-tk.html";
-    license = stdenv.lib.licenses.bsd3;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.bsd3;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/pure-modules/xml/default.nix b/pkgs/development/pure-modules/xml/default.nix
index 62b41d28806..e9d35c4d1fb 100644
--- a/pkgs/development/pure-modules/xml/default.nix
+++ b/pkgs/development/pure-modules/xml/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, pure, libxml2, libxslt }:
+{ lib, stdenv, fetchurl, pkg-config, pure, libxml2, libxslt }:
 
 stdenv.mkDerivation rec {
   baseName = "xml";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A simplified interface to the Gnome libxml2 and libxslt libraries for Pure";
     homepage = "http://puredocs.bitbucket.org/pure-xml.html";
-    license = stdenv.lib.licenses.lgpl3Plus;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ asppsa ];
+    license = lib.licenses.lgpl3Plus;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ asppsa ];
   };
 }
diff --git a/pkgs/development/web/deno/default.nix b/pkgs/development/web/deno/default.nix
index b669d34739e..013b365bce8 100644
--- a/pkgs/development/web/deno/default.nix
+++ b/pkgs/development/web/deno/default.nix
@@ -32,7 +32,7 @@ rustPlatform.buildRustPackage rec {
   # Install completions post-install
   nativeBuildInputs = [ installShellFiles ];
 
-  buildInputs = stdenv.lib.optionals stdenv.isDarwin [ Security CoreServices ];
+  buildInputs = lib.optionals stdenv.isDarwin [ Security CoreServices ];
 
   # The rusty_v8 package will try to download a `librusty_v8.a` release at build time to our read-only filesystem
   # To avoid this we pre-download the file and place it in the locations it will require it in advance
diff --git a/pkgs/development/web/grails/default.nix b/pkgs/development/web/grails/default.nix
index 0668c5107b4..944520b47e2 100644
--- a/pkgs/development/web/grails/default.nix
+++ b/pkgs/development/web/grails/default.nix
@@ -6,8 +6,8 @@
 }:
 
 let
-  binpath = stdenv.lib.makeBinPath
-    ([ coreutils ncurses gnused gnugrep ] ++ stdenv.lib.optional (jdk != null) jdk);
+  binpath = lib.makeBinPath
+    ([ coreutils ncurses gnused gnugrep ] ++ lib.optional (jdk != null) jdk);
 in
 stdenv.mkDerivation rec {
   pname = "grails";
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     rm -f "$out"/bin/*.bat
     # Improve purity
     sed -i -e '2iPATH=${binpath}:\$PATH' "$out"/bin/grails
-  '' + stdenv.lib.optionalString (jdk != null) ''
+  '' + lib.optionalString (jdk != null) ''
     # Inject JDK path into grails
     sed -i -e '2iJAVA_HOME=${jdk.home}' "$out"/bin/grails
   '';
diff --git a/pkgs/development/web/insomnia/default.nix b/pkgs/development/web/insomnia/default.nix
index 3311253e202..b3a9ac0ce71 100644
--- a/pkgs/development/web/insomnia/default.nix
+++ b/pkgs/development/web/insomnia/default.nix
@@ -6,7 +6,7 @@
 , libudev0-shim, glibc, curl, openssl, autoPatchelfHook }:
 
 let
-  runtimeLibs = stdenv.lib.makeLibraryPath [
+  runtimeLibs = lib.makeLibraryPath [
     curl
     glibc
     libudev0-shim
diff --git a/pkgs/development/web/kcgi/default.nix b/pkgs/development/web/kcgi/default.nix
index cd4b70624f5..95765be46fd 100644
--- a/pkgs/development/web/kcgi/default.nix
+++ b/pkgs/development/web/kcgi/default.nix
@@ -3,7 +3,7 @@
 stdenv.mkDerivation rec {
   pname = "kcgi";
   version = "0.10.8";
-  underscoreVersion = stdenv.lib.replaceChars ["."] ["_"] version;
+  underscoreVersion = lib.replaceChars ["."] ["_"] version;
 
   src = fetchFromGitHub {
     owner = "kristapsdz";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   '';
 
   nativeBuildInputs = [ pkg-config ];
-  buildInputs = [ ] ++ stdenv.lib.optionals stdenv.isLinux [ libbsd ] ;
+  buildInputs = [ ] ++ lib.optionals stdenv.isLinux [ libbsd ] ;
 
   dontAddPrefix = true;
 
diff --git a/pkgs/development/web/kore/default.nix b/pkgs/development/web/kore/default.nix
index d3efdc53ca4..bc8113fc6a1 100644
--- a/pkgs/development/web/kore/default.nix
+++ b/pkgs/development/web/kore/default.nix
@@ -28,8 +28,8 @@ stdenv.mkDerivation rec {
   '';
 
   # added to fix build w/gcc7 and clang5
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-Wno-error=pointer-compare"
-    + stdenv.lib.optionalString stdenv.cc.isClang " -Wno-error=unknown-warning-option";
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=pointer-compare"
+    + lib.optionalString stdenv.cc.isClang " -Wno-error=unknown-warning-option";
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/web/nodejs/nodejs.nix b/pkgs/development/web/nodejs/nodejs.nix
index 5308149c26b..9cd21b0cb34 100644
--- a/pkgs/development/web/nodejs/nodejs.nix
+++ b/pkgs/development/web/nodejs/nodejs.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, openssl, python, zlib, libuv, util-linux, http-parser
+{ lib, stdenv, fetchurl, openssl, python, zlib, libuv, util-linux, http-parser
 , pkg-config, which
 # Updater dependencies
 , writeScript, coreutils, gnugrep, jq, curl, common-updater-scripts, nix, runtimeShell
@@ -7,7 +7,7 @@
 , procps, icu
 }:
 
-with stdenv.lib;
+with lib;
 
 { enableNpm ? true, version, sha256, patches ? [] } @args:
 
diff --git a/pkgs/development/web/nodejs/v10.nix b/pkgs/development/web/nodejs/v10.nix
index fa383e8f0c3..fd1127028bc 100644
--- a/pkgs/development/web/nodejs/v10.nix
+++ b/pkgs/development/web/nodejs/v10.nix
@@ -1,4 +1,4 @@
-{ callPackage, openssl, icu, python2, stdenv, enableNpm ? true }:
+{ callPackage, openssl, icu, python2, lib, stdenv, enableNpm ? true }:
 
 let
   buildNodejs = callPackage ./nodejs.nix {
@@ -10,5 +10,5 @@ in
     inherit enableNpm;
     version = "10.23.1";
     sha256 = "1ypddif8jc8qrw9n1f8zbpknjcbnjc9xhpm57hc5nqbrmzsidal8";
-    patches = stdenv.lib.optional stdenv.isDarwin ./bypass-xcodebuild.diff;
+    patches = lib.optional stdenv.isDarwin ./bypass-xcodebuild.diff;
   }
diff --git a/pkgs/development/web/nodejs/v12.nix b/pkgs/development/web/nodejs/v12.nix
index ab082612c9d..7afa3bfb6b5 100644
--- a/pkgs/development/web/nodejs/v12.nix
+++ b/pkgs/development/web/nodejs/v12.nix
@@ -1,4 +1,4 @@
-{ callPackage, openssl, icu, python2, stdenv, enableNpm ? true }:
+{ callPackage, openssl, icu, python2, lib, stdenv, enableNpm ? true }:
 
 let
   buildNodejs = callPackage ./nodejs.nix {
@@ -10,5 +10,5 @@ in
     inherit enableNpm;
     version = "12.20.1";
     sha256 = "0lqq6a2byw4qmig98j45gqnl0593xdhx1dr9k7x2nnvhblrfw3p0";
-    patches = stdenv.lib.optional stdenv.isDarwin ./bypass-xcodebuild.diff;
+    patches = lib.optional stdenv.isDarwin ./bypass-xcodebuild.diff;
   }
diff --git a/pkgs/development/web/nodejs/v14.nix b/pkgs/development/web/nodejs/v14.nix
index 64439688c16..410be6a2495 100644
--- a/pkgs/development/web/nodejs/v14.nix
+++ b/pkgs/development/web/nodejs/v14.nix
@@ -1,4 +1,4 @@
-{ callPackage, openssl, python3, stdenv, enableNpm ? true }:
+{ callPackage, openssl, python3, lib, stdenv, enableNpm ? true }:
 
 let
   buildNodejs = callPackage ./nodejs.nix {
@@ -10,5 +10,5 @@ in
     inherit enableNpm;
     version = "14.15.4";
     sha256 = "177cxp4fhmglyx035j8smiy1bp5fz6q2phlcl0a2mdbldkvfrdxd";
-    patches = stdenv.lib.optional stdenv.isDarwin ./bypass-xcodebuild.diff;
+    patches = lib.optional stdenv.isDarwin ./bypass-xcodebuild.diff;
   }
diff --git a/pkgs/development/web/postman/default.nix b/pkgs/development/web/postman/default.nix
index f05218a4cd5..02376c0bfe7 100644
--- a/pkgs/development/web/postman/default.nix
+++ b/pkgs/development/web/postman/default.nix
@@ -88,7 +88,7 @@ stdenv.mkDerivation rec {
     patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" _Postman
     for file in $(find . -type f \( -name \*.node -o -name _Postman -o -name \*.so\* \) ); do
       ORIGIN=$(patchelf --print-rpath $file); \
-      patchelf --set-rpath "${stdenv.lib.makeLibraryPath buildInputs}:$ORIGIN" $file
+      patchelf --set-rpath "${lib.makeLibraryPath buildInputs}:$ORIGIN" $file
     done
     popd
   '';
diff --git a/pkgs/development/web/remarkjs/default.nix b/pkgs/development/web/remarkjs/default.nix
index ff4cd324b5d..e3dea600b43 100644
--- a/pkgs/development/web/remarkjs/default.nix
+++ b/pkgs/development/web/remarkjs/default.nix
@@ -63,8 +63,8 @@ in stdenv.mkDerivation rec {
     homepage = "https://remarkjs.com";
     description = "A simple, in-browser, markdown-driven slideshow tool";
     maintainers = [];
-    platforms = stdenv.lib.platforms.linux;
-    license = stdenv.lib.licenses.mit;
+    platforms = lib.platforms.linux;
+    license = lib.licenses.mit;
     broken = true;
   };
 }
diff --git a/pkgs/development/web/twitter-bootstrap/default.nix b/pkgs/development/web/twitter-bootstrap/default.nix
index 14fd9a219ec..915cc16d2eb 100644
--- a/pkgs/development/web/twitter-bootstrap/default.nix
+++ b/pkgs/development/web/twitter-bootstrap/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip }:
+{ lib, stdenv, fetchurl, unzip }:
 
 stdenv.mkDerivation rec {
   pname = "bootstrap";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Front-end framework for faster and easier web development";
     homepage = "https://getbootstrap.com/";
-    license = stdenv.lib.licenses.mit;
+    license = lib.licenses.mit;
   };
 
 }
diff --git a/pkgs/development/web/woff2/default.nix b/pkgs/development/web/woff2/default.nix
index b264b216298..2f186344498 100644
--- a/pkgs/development/web/woff2/default.nix
+++ b/pkgs/development/web/woff2/default.nix
@@ -16,14 +16,14 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "lib" ];
 
   # Need to explicitly link to brotlicommon
-  patches = stdenv.lib.optional static ./brotli-static.patch;
+  patches = lib.optional static ./brotli-static.patch;
 
   nativeBuildInputs = [ cmake pkg-config ];
 
   cmakeFlags = [
     "-DCANONICAL_PREFIXES=ON"
     "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}"
-  ] ++ stdenv.lib.optional static "-DCMAKE_SKIP_RPATH:BOOL=TRUE";
+  ] ++ lib.optional static "-DCMAKE_SKIP_RPATH:BOOL=TRUE";
 
   propagatedBuildInputs = [ brotli ];
 
diff --git a/pkgs/development/web/xmlindent/default.nix b/pkgs/development/web/xmlindent/default.nix
index b093a8008da..f6df21d5766 100644
--- a/pkgs/development/web/xmlindent/default.nix
+++ b/pkgs/development/web/xmlindent/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, flex }:
+{ lib, stdenv, fetchurl, flex }:
 
 stdenv.mkDerivation rec {
   pname = "xmlindent";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "XML stream reformatter";
     homepage = "http://xmlindent.sourceforge.net/";
-    license = stdenv.lib.licenses.gpl3;
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.gpl3;
+    platforms = lib.platforms.linux;
     maintainers = [ ];
   };
 }
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 9c012242c38..fa9d86f9802 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -16152,7 +16152,7 @@ in
   qt512 = recurseIntoAttrs (makeOverridable
     (import ../development/libraries/qt-5/5.12) {
       inherit newScope;
-      inherit stdenv fetchurl fetchpatch fetchFromGitHub makeSetupHook makeWrapper;
+      inherit lib stdenv fetchurl fetchpatch fetchFromGitHub makeSetupHook makeWrapper;
       inherit bison;
       inherit cups;
       inherit dconf;
@@ -16167,7 +16167,7 @@ in
   qt514 = recurseIntoAttrs (makeOverridable
     (import ../development/libraries/qt-5/5.14) {
       inherit newScope;
-      inherit stdenv fetchurl fetchpatch fetchFromGitHub makeSetupHook makeWrapper;
+      inherit lib stdenv fetchurl fetchpatch fetchFromGitHub makeSetupHook makeWrapper;
       inherit bison;
       inherit cups;
       inherit dconf;
@@ -16182,7 +16182,7 @@ in
   qt515 = recurseIntoAttrs (makeOverridable
     (import ../development/libraries/qt-5/5.15) {
       inherit newScope;
-      inherit stdenv fetchurl fetchpatch fetchFromGitHub makeSetupHook makeWrapper;
+      inherit lib stdenv fetchurl fetchpatch fetchFromGitHub makeSetupHook makeWrapper;
       inherit bison;
       inherit cups;
       inherit dconf;