summary refs log tree commit diff
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2021-01-24 00:09:45 +0100
committerJan Tojnar <jtojnar@gmail.com>2021-01-24 00:09:45 +0100
commit01ee4ea574a426a5d48cd503163233d13bea050d (patch)
tree8ccca2180720717625a6930efb35c11681968910
parent58752914f4b22a570ff7cba694df86aef20e255a (diff)
parentf1778cd90eea2c3d5dbca3aa55b6351697dad683 (diff)
downloadnixpkgs-01ee4ea574a426a5d48cd503163233d13bea050d.tar
nixpkgs-01ee4ea574a426a5d48cd503163233d13bea050d.tar.gz
nixpkgs-01ee4ea574a426a5d48cd503163233d13bea050d.tar.bz2
nixpkgs-01ee4ea574a426a5d48cd503163233d13bea050d.tar.lz
nixpkgs-01ee4ea574a426a5d48cd503163233d13bea050d.tar.xz
nixpkgs-01ee4ea574a426a5d48cd503163233d13bea050d.tar.zst
nixpkgs-01ee4ea574a426a5d48cd503163233d13bea050d.zip
Merge branch 'master' into staging-next
-rw-r--r--doc/using/overlays.xml35
-rw-r--r--lib/systems/architectures.nix2
-rw-r--r--lib/systems/default.nix19
-rw-r--r--lib/systems/examples.nix48
-rw-r--r--lib/systems/platforms.nix670
-rw-r--r--nixos/doc/manual/release-notes/rl-2103.xml36
-rw-r--r--nixos/modules/hardware/device-tree.nix8
-rw-r--r--nixos/modules/installer/netboot/netboot.nix2
-rw-r--r--nixos/modules/services/misc/nix-daemon.nix8
-rw-r--r--nixos/modules/services/networking/nomad.nix25
-rw-r--r--nixos/modules/system/activation/top-level.nix2
-rw-r--r--nixos/modules/system/boot/loader/generations-dir/generations-dir.nix2
-rw-r--r--nixos/modules/system/boot/loader/grub/grub.nix22
-rw-r--r--nixos/modules/system/boot/loader/raspberrypi/raspberrypi.nix2
-rw-r--r--nixos/release.nix4
-rw-r--r--nixos/tests/all-tests.nix1
-rw-r--r--nixos/tests/nomad.nix53
-rw-r--r--pkgs/applications/audio/virtual-ans/default.nix2
-rw-r--r--pkgs/applications/editors/android-studio/default.nix16
-rw-r--r--pkgs/applications/editors/atom/default.nix5
-rw-r--r--pkgs/applications/editors/cudatext/default.nix12
-rw-r--r--pkgs/applications/editors/cudatext/deps.json32
-rw-r--r--pkgs/applications/editors/cudatext/dont-check-update.patch12
-rw-r--r--pkgs/applications/editors/kakoune/plugins/kak-buffers.nix2
-rw-r--r--pkgs/applications/editors/kakoune/plugins/kak-powerline.nix2
-rw-r--r--pkgs/applications/editors/kakoune/plugins/kak-vertical-selection.nix2
-rw-r--r--pkgs/applications/editors/setzer/default.nix8
-rw-r--r--pkgs/applications/graphics/paraview/default.nix4
-rw-r--r--pkgs/applications/misc/genxword/default.nix4
-rw-r--r--pkgs/applications/networking/cluster/terraform-providers/libvirt/default.nix10
-rw-r--r--pkgs/applications/networking/irc/convos/default.nix19
-rw-r--r--pkgs/applications/office/pyspread/default.nix68
-rw-r--r--pkgs/applications/science/biology/migrate/default.nix4
-rw-r--r--pkgs/applications/science/biology/neuron/default.nix9
-rw-r--r--pkgs/applications/science/biology/raxml/default.nix10
-rw-r--r--pkgs/applications/science/chemistry/openmolcas/default.nix4
-rw-r--r--pkgs/applications/science/chemistry/quantum-espresso/default.nix7
-rw-r--r--pkgs/applications/science/chemistry/siesta/default.nix9
-rw-r--r--pkgs/applications/science/electronics/openems/default.nix5
-rw-r--r--pkgs/applications/science/math/cntk/default.nix6
-rw-r--r--pkgs/applications/science/math/getdp/default.nix4
-rw-r--r--pkgs/applications/science/math/scotch/default.nix4
-rw-r--r--pkgs/applications/science/molecular-dynamics/gromacs/default.nix4
-rw-r--r--pkgs/applications/science/molecular-dynamics/lammps/default.nix4
-rw-r--r--pkgs/applications/science/physics/elmerfem/default.nix4
-rw-r--r--pkgs/applications/system/glances/default.nix4
-rw-r--r--pkgs/applications/virtualization/crosvm/default.nix2
-rw-r--r--pkgs/applications/virtualization/docker/default.nix2
-rw-r--r--pkgs/applications/virtualization/vpcs/default.nix2
-rw-r--r--pkgs/build-support/bintools-wrapper/default.nix2
-rw-r--r--pkgs/build-support/cc-wrapper/default.nix28
-rw-r--r--pkgs/build-support/kernel/make-initrd.nix4
-rw-r--r--pkgs/build-support/vm/default.nix2
-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/compilers/elm/default.nix5
-rw-r--r--pkgs/development/compilers/elm/packages/elm-json.nix4
-rw-r--r--pkgs/development/compilers/gcc/common/platform-flags.nix2
-rw-r--r--pkgs/development/compilers/julia/1.0.nix2
-rw-r--r--pkgs/development/compilers/julia/1.3.nix2
-rw-r--r--pkgs/development/compilers/julia/1.5.nix2
-rw-r--r--pkgs/development/compilers/llvm/11/llvm.nix2
-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/interpreters/acl2/default.nix10
-rw-r--r--pkgs/development/interpreters/acl2/libipasirglucose4/default.nix4
-rw-r--r--pkgs/development/interpreters/alda/default.nix4
-rw-r--r--pkgs/development/interpreters/angelscript/2.22.nix8
-rw-r--r--pkgs/development/interpreters/angelscript/default.nix8
-rw-r--r--pkgs/development/interpreters/ceptre/default.nix4
-rw-r--r--pkgs/development/interpreters/chibi/default.nix8
-rw-r--r--pkgs/development/interpreters/cling/default.nix6
-rw-r--r--pkgs/development/interpreters/clips/default.nix4
-rw-r--r--pkgs/development/interpreters/clisp/default.nix46
-rw-r--r--pkgs/development/interpreters/clisp/hg.nix44
-rw-r--r--pkgs/development/interpreters/clojure/babashka.nix6
-rw-r--r--pkgs/development/interpreters/clojure/clooj.nix4
-rw-r--r--pkgs/development/interpreters/clojure/default.nix6
-rw-r--r--pkgs/development/interpreters/clojurescript/lumo/default.nix6
-rw-r--r--pkgs/development/interpreters/cyclone/default.nix8
-rw-r--r--pkgs/development/interpreters/dart/default.nix4
-rw-r--r--pkgs/development/interpreters/duktape/default.nix4
-rw-r--r--pkgs/development/interpreters/eff/default.nix4
-rw-r--r--pkgs/development/interpreters/elixir/generic-builder.nix8
-rw-r--r--pkgs/development/interpreters/erlang/generic-builder.nix8
-rw-r--r--pkgs/development/interpreters/evcxr/default.nix8
-rw-r--r--pkgs/development/interpreters/falcon/default.nix8
-rw-r--r--pkgs/development/interpreters/gnu-apl/default.nix8
-rw-r--r--pkgs/development/interpreters/groovy/default.nix4
-rw-r--r--pkgs/development/interpreters/gtk-server/default.nix4
-rw-r--r--pkgs/development/interpreters/guile/1.8.nix12
-rw-r--r--pkgs/development/interpreters/guile/2.0.nix20
-rw-r--r--pkgs/development/interpreters/guile/default.nix18
-rw-r--r--pkgs/development/interpreters/hugs/default.nix4
-rw-r--r--pkgs/development/interpreters/hy/default.nix4
-rw-r--r--pkgs/development/interpreters/icon-lang/default.nix6
-rw-r--r--pkgs/development/interpreters/io/default.nix4
-rw-r--r--pkgs/development/interpreters/j/default.nix6
-rw-r--r--pkgs/development/interpreters/janet/default.nix4
-rw-r--r--pkgs/development/interpreters/jimtcl/default.nix10
-rw-r--r--pkgs/development/interpreters/joker/default.nix4
-rw-r--r--pkgs/development/interpreters/jruby/default.nix4
-rw-r--r--pkgs/development/interpreters/jython/default.nix4
-rw-r--r--pkgs/development/interpreters/kona/default.nix4
-rw-r--r--pkgs/development/interpreters/lfe/generic-builder.nix6
-rw-r--r--pkgs/development/interpreters/lolcode/default.nix6
-rw-r--r--pkgs/development/interpreters/love/0.10.nix8
-rw-r--r--pkgs/development/interpreters/love/0.7.nix8
-rw-r--r--pkgs/development/interpreters/love/0.8.nix8
-rw-r--r--pkgs/development/interpreters/love/0.9.nix8
-rw-r--r--pkgs/development/interpreters/love/11.1.nix8
-rw-r--r--pkgs/development/interpreters/lua-5/default.nix2
-rw-r--r--pkgs/development/interpreters/lua-5/filesystem.nix2
-rw-r--r--pkgs/development/interpreters/lua-5/interpreter.nix8
-rw-r--r--pkgs/development/interpreters/lua-5/sockets.nix2
-rw-r--r--pkgs/development/interpreters/lua-5/wrapper.nix6
-rw-r--r--pkgs/development/interpreters/luajit/default.nix12
-rw-r--r--pkgs/development/interpreters/lush/default.nix8
-rw-r--r--pkgs/development/interpreters/maude/default.nix10
-rw-r--r--pkgs/development/interpreters/metamath/default.nix16
-rw-r--r--pkgs/development/interpreters/mujs/default.nix4
-rw-r--r--pkgs/development/interpreters/nix-exec/default.nix4
-rw-r--r--pkgs/development/interpreters/perl/wrapper.nix4
-rw-r--r--pkgs/development/interpreters/php/generic.nix2
-rw-r--r--pkgs/development/interpreters/picoc/default.nix4
-rw-r--r--pkgs/development/interpreters/picolisp/default.nix4
-rw-r--r--pkgs/development/interpreters/pixie/default.nix12
-rw-r--r--pkgs/development/interpreters/pixie/dust.nix6
-rw-r--r--pkgs/development/interpreters/proglodyte-wasm/default.nix4
-rw-r--r--pkgs/development/interpreters/pyrex/0.9.5.nix4
-rw-r--r--pkgs/development/interpreters/pyrex/0.9.6.nix4
-rw-r--r--pkgs/development/interpreters/python/cpython/2.7/default.nix14
-rw-r--r--pkgs/development/interpreters/python/cpython/default.nix14
-rw-r--r--pkgs/development/interpreters/python/pypy/default.nix10
-rw-r--r--pkgs/development/interpreters/python/pypy/prebuilt.nix6
-rw-r--r--pkgs/development/interpreters/python/tests.nix2
-rw-r--r--pkgs/development/interpreters/python/wrapper.nix6
-rw-r--r--pkgs/development/interpreters/qnial/default.nix8
-rw-r--r--pkgs/development/interpreters/quickjs/default.nix4
-rw-r--r--pkgs/development/interpreters/racket/default.nix20
-rw-r--r--pkgs/development/interpreters/rakudo/default.nix2
-rw-r--r--pkgs/development/interpreters/rakudo/moarvm.nix6
-rw-r--r--pkgs/development/interpreters/rakudo/nqp.nix2
-rw-r--r--pkgs/development/interpreters/rakudo/zef.nix4
-rw-r--r--pkgs/development/interpreters/rascal/default.nix8
-rw-r--r--pkgs/development/interpreters/rebol/default.nix2
-rw-r--r--pkgs/development/interpreters/red/default.nix4
-rw-r--r--pkgs/development/interpreters/regina/default.nix4
-rw-r--r--pkgs/development/interpreters/renpy/default.nix6
-rw-r--r--pkgs/development/interpreters/ruby/default.nix4
-rw-r--r--pkgs/development/interpreters/scheme48/default.nix6
-rw-r--r--pkgs/development/interpreters/scsh/default.nix4
-rw-r--r--pkgs/development/interpreters/self/default.nix4
-rw-r--r--pkgs/development/interpreters/shen-sbcl/default.nix4
-rw-r--r--pkgs/development/interpreters/shen-sources/default.nix4
-rw-r--r--pkgs/development/interpreters/spidermonkey/1.8.5.nix6
-rw-r--r--pkgs/development/interpreters/spidermonkey/38.nix8
-rw-r--r--pkgs/development/interpreters/spidermonkey/60.nix6
-rw-r--r--pkgs/development/interpreters/spidermonkey/68.nix6
-rw-r--r--pkgs/development/interpreters/spidermonkey/78.nix6
-rw-r--r--pkgs/development/interpreters/supercollider/default.nix6
-rw-r--r--pkgs/development/interpreters/tcl/generic.nix6
-rw-r--r--pkgs/development/interpreters/tclreadline/default.nix6
-rw-r--r--pkgs/development/interpreters/tinyscheme/default.nix4
-rw-r--r--pkgs/development/interpreters/unicon-lang/default.nix4
-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/boost/generic.nix7
-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/glibc/common.nix2
-rw-r--r--pkgs/development/libraries/globalarrays/default.nix4
-rw-r--r--pkgs/development/libraries/gtk/3.x.nix106
-rw-r--r--pkgs/development/libraries/gts/default.nix2
-rw-r--r--pkgs/development/libraries/hdf5-blosc/default.nix3
-rw-r--r--pkgs/development/libraries/intel-gmmlib/default.nix10
-rw-r--r--pkgs/development/libraries/intel-media-driver/default.nix4
-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/libgadu/default.nix20
-rw-r--r--pkgs/development/libraries/libgpod/default.nix2
-rw-r--r--pkgs/development/libraries/libpgf/default.nix26
-rw-r--r--pkgs/development/libraries/libre/default.nix2
-rw-r--r--pkgs/development/libraries/libredwg/default.nix4
-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/mtxclient/default.nix6
-rw-r--r--pkgs/development/libraries/muparser/default.nix2
-rw-r--r--pkgs/development/libraries/precice/default.nix4
-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.nix4
-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/science/math/scalapack/default.nix3
-rw-r--r--pkgs/development/libraries/simdjson/default.nix6
-rw-r--r--pkgs/development/libraries/spdlog/default.nix3
-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/python-modules/aioeafm/default.nix44
-rw-r--r--pkgs/development/python-modules/amcrest/default.nix43
-rw-r--r--pkgs/development/python-modules/cntk/default.nix8
-rw-r--r--pkgs/development/python-modules/pycfdns/default.nix34
-rw-r--r--pkgs/development/python-modules/pytile/default.nix9
-rw-r--r--pkgs/development/python-modules/pytorch/default.nix8
-rw-r--r--pkgs/development/python-modules/tensorflow/default.nix4
-rw-r--r--pkgs/development/python-modules/tokenizers/default.nix17
-rw-r--r--pkgs/development/python-modules/transformers/default.nix69
-rw-r--r--pkgs/development/r-modules/default.nix10
-rw-r--r--pkgs/development/tools/alloy/default.nix4
-rw-r--r--pkgs/development/tools/ammonite/default.nix6
-rw-r--r--pkgs/development/tools/analysis/autoflake/default.nix4
-rw-r--r--pkgs/development/tools/analysis/bingrep/default.nix4
-rw-r--r--pkgs/development/tools/analysis/cccc/default.nix8
-rw-r--r--pkgs/development/tools/analysis/checkstyle/default.nix4
-rw-r--r--pkgs/development/tools/analysis/clang-analyzer/default.nix8
-rw-r--r--pkgs/development/tools/analysis/coan/default.nix4
-rw-r--r--pkgs/development/tools/analysis/codeql/default.nix4
-rw-r--r--pkgs/development/tools/analysis/cov-build/default.nix8
-rw-r--r--pkgs/development/tools/analysis/coz/default.nix6
-rw-r--r--pkgs/development/tools/analysis/cppcheck/default.nix8
-rw-r--r--pkgs/development/tools/analysis/egypt/default.nix4
-rw-r--r--pkgs/development/tools/analysis/emma/default.nix6
-rw-r--r--pkgs/development/tools/analysis/evmdis/default.nix4
-rw-r--r--pkgs/development/tools/analysis/findbugs/default.nix4
-rw-r--r--pkgs/development/tools/analysis/flow/default.nix6
-rw-r--r--pkgs/development/tools/analysis/frama-c/default.nix6
-rw-r--r--pkgs/development/tools/analysis/garcosim/tracefilegen/default.nix4
-rw-r--r--pkgs/development/tools/analysis/garcosim/tracefilesim/default.nix4
-rw-r--r--pkgs/development/tools/analysis/hopper/default.nix2
-rw-r--r--pkgs/development/tools/analysis/hotspot/default.nix8
-rw-r--r--pkgs/development/tools/analysis/include-what-you-use/default.nix4
-rw-r--r--pkgs/development/tools/analysis/jdepend/default.nix4
-rw-r--r--pkgs/development/tools/analysis/kcov/default.nix4
-rw-r--r--pkgs/development/tools/analysis/lcov/default.nix6
-rw-r--r--pkgs/development/tools/analysis/makefile2graph/default.nix6
-rw-r--r--pkgs/development/tools/analysis/oclgrind/default.nix4
-rw-r--r--pkgs/development/tools/analysis/panopticon/default.nix4
-rw-r--r--pkgs/development/tools/analysis/pev/default.nix4
-rw-r--r--pkgs/development/tools/analysis/pmd/default.nix4
-rw-r--r--pkgs/development/tools/analysis/qcachegrind/default.nix6
-rw-r--r--pkgs/development/tools/analysis/radare2/default.nix10
-rw-r--r--pkgs/development/tools/analysis/randoop/default.nix4
-rw-r--r--pkgs/development/tools/analysis/rr/default.nix8
-rw-r--r--pkgs/development/tools/analysis/smatch/default.nix10
-rw-r--r--pkgs/development/tools/analysis/snowman/default.nix4
-rw-r--r--pkgs/development/tools/analysis/sparse/default.nix8
-rw-r--r--pkgs/development/tools/analysis/spin/default.nix8
-rw-r--r--pkgs/development/tools/analysis/splint/default.nix6
-rw-r--r--pkgs/development/tools/analysis/swarm/default.nix4
-rw-r--r--pkgs/development/tools/analysis/uefi-firmware-parser/default.nix4
-rw-r--r--pkgs/development/tools/analysis/valgrind/default.nix16
-rw-r--r--pkgs/development/tools/analysis/valkyrie/default.nix4
-rw-r--r--pkgs/development/tools/apktool/default.nix4
-rw-r--r--pkgs/development/tools/asn2quickder/default.nix4
-rw-r--r--pkgs/development/tools/avro-tools/default.nix2
-rw-r--r--pkgs/development/tools/azcopy/default.nix4
-rw-r--r--pkgs/development/tools/bazel-watcher/default.nix4
-rw-r--r--pkgs/development/tools/bazelisk/default.nix4
-rw-r--r--pkgs/development/tools/bloaty/default.nix4
-rw-r--r--pkgs/development/tools/boost-build/default.nix6
-rw-r--r--pkgs/development/tools/build-managers/apache-ant/1.9.nix8
-rw-r--r--pkgs/development/tools/build-managers/apache-ant/default.nix8
-rw-r--r--pkgs/development/tools/build-managers/apache-maven/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/arpa2cm/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/bam/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/bazel/bazel-remote/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/bazel/buildtools/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/bear/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/bloop/default.nix2
-rw-r--r--pkgs/development/tools/build-managers/bmake/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/boot/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/buck/default.nix6
-rw-r--r--pkgs/development/tools/build-managers/cmake/2.8.nix14
-rw-r--r--pkgs/development/tools/build-managers/colormake/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/doit/default.nix8
-rw-r--r--pkgs/development/tools/build-managers/dub/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/fac/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/gnumake/4.2/default.nix12
-rw-r--r--pkgs/development/tools/build-managers/gnumake/default.nix12
-rw-r--r--pkgs/development/tools/build-managers/gradle/default.nix6
-rw-r--r--pkgs/development/tools/build-managers/gup/default.nix6
-rw-r--r--pkgs/development/tools/build-managers/icmake/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/jam/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/kati/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/leiningen/default.nix10
-rw-r--r--pkgs/development/tools/build-managers/mill/default.nix6
-rw-r--r--pkgs/development/tools/build-managers/mk/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/msbuild/default.nix6
-rw-r--r--pkgs/development/tools/build-managers/ninja/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/pants/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/qbs/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/rebar/default.nix6
-rw-r--r--pkgs/development/tools/build-managers/rebar3/default.nix8
-rw-r--r--pkgs/development/tools/build-managers/redo-apenwarr/default.nix2
-rw-r--r--pkgs/development/tools/build-managers/redo-c/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/redo-sh/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/redo/default.nix8
-rw-r--r--pkgs/development/tools/build-managers/remake/default.nix8
-rw-r--r--pkgs/development/tools/build-managers/rocm-cmake/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/samurai/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/sbt-extras/default.nix12
-rw-r--r--pkgs/development/tools/build-managers/sbt/default.nix10
-rw-r--r--pkgs/development/tools/build-managers/scons/common.nix2
-rw-r--r--pkgs/development/tools/build-managers/shards/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/tup/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/waf/default.nix6
-rw-r--r--pkgs/development/tools/buildkit/default.nix6
-rw-r--r--pkgs/development/tools/cargo-web/default.nix6
-rw-r--r--pkgs/development/tools/cask/default.nix4
-rw-r--r--pkgs/development/tools/castxml/default.nix4
-rw-r--r--pkgs/development/tools/cdecl/default.nix8
-rw-r--r--pkgs/development/tools/chit/default.nix10
-rw-r--r--pkgs/development/tools/clang-tools/default.nix8
-rw-r--r--pkgs/development/tools/clog-cli/default.nix8
-rw-r--r--pkgs/development/tools/cloudfoundry-cli/default.nix4
-rw-r--r--pkgs/development/tools/clpm/default.nix4
-rw-r--r--pkgs/development/tools/cmake-language-server/default.nix2
-rw-r--r--pkgs/development/tools/compile-daemon/default.nix4
-rw-r--r--pkgs/development/tools/continuous-integration/buildkite-agent/default.nix6
-rw-r--r--pkgs/development/tools/continuous-integration/buildkite-agent/generic.nix8
-rw-r--r--pkgs/development/tools/continuous-integration/drone-cli/default.nix4
-rw-r--r--pkgs/development/tools/continuous-integration/drone/default.nix4
-rw-r--r--pkgs/development/tools/continuous-integration/gocd-agent/default.nix4
-rw-r--r--pkgs/development/tools/continuous-integration/gocd-server/default.nix4
-rw-r--r--pkgs/development/tools/continuous-integration/jenkins/default.nix6
-rw-r--r--pkgs/development/tools/continuous-integration/laminar/default.nix2
-rw-r--r--pkgs/development/tools/corgi/default.nix4
-rw-r--r--pkgs/development/tools/coursier/default.nix6
-rw-r--r--pkgs/development/tools/cppclean/default.nix4
-rw-r--r--pkgs/development/tools/cue/default.nix6
-rw-r--r--pkgs/development/tools/database/dbmate/default.nix4
-rw-r--r--pkgs/development/tools/database/ephemeralpg/default.nix6
-rw-r--r--pkgs/development/tools/database/pg_checksums/default.nix4
-rw-r--r--pkgs/development/tools/database/pgcli/default.nix6
-rw-r--r--pkgs/development/tools/database/pyrseas/default.nix6
-rw-r--r--pkgs/development/tools/database/shmig/default.nix2
-rw-r--r--pkgs/development/tools/database/sqlcheck/default.nix4
-rw-r--r--pkgs/development/tools/database/sqldeveloper/default.nix4
-rw-r--r--pkgs/development/tools/database/squirrel-sql/default.nix4
-rw-r--r--pkgs/development/tools/database/timescaledb-parallel-copy/default.nix4
-rw-r--r--pkgs/development/tools/database/timescaledb-tune/default.nix4
-rw-r--r--pkgs/development/tools/database/webdis/default.nix4
-rw-r--r--pkgs/development/tools/dcadec/default.nix4
-rw-r--r--pkgs/development/tools/deis/default.nix4
-rw-r--r--pkgs/development/tools/deisctl/default.nix4
-rw-r--r--pkgs/development/tools/delve/default.nix4
-rw-r--r--pkgs/development/tools/dep/default.nix4
-rw-r--r--pkgs/development/tools/devd/default.nix4
-rw-r--r--pkgs/development/tools/devpi-client/default.nix4
-rw-r--r--pkgs/development/tools/devpi-server/default.nix6
-rw-r--r--pkgs/development/tools/devtodo/default.nix4
-rw-r--r--pkgs/development/tools/diesel-cli/default.nix2
-rw-r--r--pkgs/development/tools/dive/default.nix6
-rw-r--r--pkgs/development/tools/documentation/antora/default.nix10
-rw-r--r--pkgs/development/tools/documentation/doxygen/default.nix18
-rw-r--r--pkgs/development/tools/documentation/gnome-doc-utils/default.nix6
-rw-r--r--pkgs/development/tools/documentation/gtk-doc/default.nix6
-rw-r--r--pkgs/development/tools/documentation/mdsh/default.nix4
-rw-r--r--pkgs/development/tools/documentation/mkdocs/default.nix2
-rw-r--r--pkgs/development/tools/dot-http/default.nix2
-rw-r--r--pkgs/development/tools/drip/default.nix4
-rw-r--r--pkgs/development/tools/drm_info/default.nix4
-rw-r--r--pkgs/development/tools/dtools/default.nix4
-rw-r--r--pkgs/development/tools/easyjson/default.nix4
-rw-r--r--pkgs/development/tools/eclipse-mat/default.nix4
-rw-r--r--pkgs/development/tools/electron/default.nix16
-rw-r--r--pkgs/development/tools/electron/generic.nix8
-rw-r--r--pkgs/development/tools/erlang/cuter/default.nix8
-rw-r--r--pkgs/development/tools/fac/default.nix4
-rw-r--r--pkgs/development/tools/fedpkg/default.nix4
-rw-r--r--pkgs/development/tools/flamegraph/default.nix4
-rw-r--r--pkgs/development/tools/flatpak-builder/default.nix4
-rw-r--r--pkgs/development/tools/flootty/default.nix4
-rw-r--r--pkgs/development/tools/flyway/default.nix4
-rw-r--r--pkgs/development/tools/fmbt/default.nix6
-rw-r--r--pkgs/development/tools/fusee-launcher/default.nix4
-rw-r--r--pkgs/development/tools/galen/default.nix4
-rw-r--r--pkgs/development/tools/gamecube-tools/default.nix4
-rw-r--r--pkgs/development/tools/gauge/default.nix4
-rw-r--r--pkgs/development/tools/gdm/default.nix4
-rw-r--r--pkgs/development/tools/git-ftp/default.nix4
-rw-r--r--pkgs/development/tools/git-quick-stats/default.nix6
-rw-r--r--pkgs/development/tools/git-series/default.nix4
-rw-r--r--pkgs/development/tools/github/cligh/default.nix4
-rw-r--r--pkgs/development/tools/github/github-release/default.nix4
-rw-r--r--pkgs/development/tools/glade/default.nix2
-rw-r--r--pkgs/development/tools/glide/default.nix4
-rw-r--r--pkgs/development/tools/gllvm/default.nix4
-rw-r--r--pkgs/development/tools/glock/default.nix6
-rw-r--r--pkgs/development/tools/glslviewer/default.nix6
-rw-r--r--pkgs/development/tools/gnome-desktop-testing/default.nix4
-rw-r--r--pkgs/development/tools/gnulib/default.nix6
-rw-r--r--pkgs/development/tools/go-bindata-assetfs/default.nix4
-rw-r--r--pkgs/development/tools/go-bindata/default.nix4
-rw-r--r--pkgs/development/tools/go-langserver/default.nix4
-rw-r--r--pkgs/development/tools/go-outline/default.nix6
-rw-r--r--pkgs/development/tools/go-protobuf/default.nix4
-rw-r--r--pkgs/development/tools/go-repo-root/default.nix4
-rw-r--r--pkgs/development/tools/go-symbols/default.nix6
-rw-r--r--pkgs/development/tools/go2nix/default.nix4
-rw-r--r--pkgs/development/tools/goa/default.nix4
-rw-r--r--pkgs/development/tools/gocode-gomod/default.nix4
-rw-r--r--pkgs/development/tools/gocode/default.nix4
-rw-r--r--pkgs/development/tools/goconvey/default.nix6
-rw-r--r--pkgs/development/tools/godef/default.nix6
-rw-r--r--pkgs/development/tools/godot/default.nix4
-rw-r--r--pkgs/development/tools/godot/headless.nix4
-rw-r--r--pkgs/development/tools/godot/server.nix4
-rw-r--r--pkgs/development/tools/golint/default.nix6
-rw-r--r--pkgs/development/tools/gomodifytags/default.nix6
-rw-r--r--pkgs/development/tools/google-app-engine-go-sdk/default.nix4
-rw-r--r--pkgs/development/tools/gopkgs/default.nix6
-rw-r--r--pkgs/development/tools/gosec/default.nix4
-rw-r--r--pkgs/development/tools/gotags/default.nix4
-rw-r--r--pkgs/development/tools/gotests/default.nix6
-rw-r--r--pkgs/development/tools/gotools/default.nix4
-rw-r--r--pkgs/development/tools/govendor/default.nix4
-rw-r--r--pkgs/development/tools/govers/default.nix4
-rw-r--r--pkgs/development/tools/gox/default.nix4
-rw-r--r--pkgs/development/tools/gpp/default.nix4
-rw-r--r--pkgs/development/tools/gron/default.nix4
-rw-r--r--pkgs/development/tools/guile/g-wrap/default.nix4
-rw-r--r--pkgs/development/tools/guile/guile-lint/default.nix4
-rw-r--r--pkgs/development/tools/haskell/dconf2nix/dconf2nix.nix4
-rw-r--r--pkgs/development/tools/haskell/haskell-language-server/default.nix4
-rw-r--r--pkgs/development/tools/haskell/haskell-language-server/hls-class-plugin.nix4
-rw-r--r--pkgs/development/tools/haskell/haskell-language-server/hls-eval-plugin.nix4
-rw-r--r--pkgs/development/tools/haskell/haskell-language-server/hls-explicit-imports-plugin.nix4
-rw-r--r--pkgs/development/tools/haskell/haskell-language-server/hls-hlint-plugin.nix4
-rw-r--r--pkgs/development/tools/haskell/haskell-language-server/hls-retrie-plugin.nix4
-rw-r--r--pkgs/development/tools/haskell/haskell-language-server/hls-tactics-plugin.nix4
-rw-r--r--pkgs/development/tools/haskell/hyper-haskell/default.nix6
-rw-r--r--pkgs/development/tools/haskell/ihaskell/wrapper.nix4
-rw-r--r--pkgs/development/tools/haskell/vaultenv/default.nix6
-rw-r--r--pkgs/development/tools/hcloud/default.nix6
-rw-r--r--pkgs/development/tools/hexio/default.nix6
-rw-r--r--pkgs/development/tools/iaca/2.1.nix4
-rw-r--r--pkgs/development/tools/iaca/3.0.nix4
-rw-r--r--pkgs/development/tools/icestorm/default.nix8
-rw-r--r--pkgs/development/tools/icr/default.nix2
-rw-r--r--pkgs/development/tools/imatix_gsl/default.nix4
-rw-r--r--pkgs/development/tools/irony-server/default.nix4
-rw-r--r--pkgs/development/tools/java/cfr/default.nix4
-rw-r--r--pkgs/development/tools/java/dex2jar/default.nix2
-rw-r--r--pkgs/development/tools/java/fastjar/default.nix6
-rw-r--r--pkgs/development/tools/java/jhiccup/default.nix8
-rw-r--r--pkgs/development/tools/java/visualvm/default.nix2
-rw-r--r--pkgs/development/tools/jbake/default.nix4
-rw-r--r--pkgs/development/tools/jbang/default.nix2
-rw-r--r--pkgs/development/tools/jd/default.nix4
-rw-r--r--pkgs/development/tools/jid/default.nix6
-rw-r--r--pkgs/development/tools/jira_cli/default.nix4
-rw-r--r--pkgs/development/tools/jl/default.nix6
-rw-r--r--pkgs/development/tools/jmespath/default.nix4
-rw-r--r--pkgs/development/tools/jo/default.nix4
-rw-r--r--pkgs/development/tools/jp/default.nix4
-rw-r--r--pkgs/development/tools/jq/default.nix6
-rw-r--r--pkgs/development/tools/just/default.nix4
-rw-r--r--pkgs/development/tools/k6/default.nix4
-rw-r--r--pkgs/development/tools/kafkacat/default.nix4
-rw-r--r--pkgs/development/tools/kind/default.nix12
-rw-r--r--pkgs/development/tools/krew/default.nix2
-rw-r--r--pkgs/development/tools/ktlint/default.nix4
-rw-r--r--pkgs/development/tools/kubectx/default.nix4
-rw-r--r--pkgs/development/tools/kubicorn/default.nix10
-rw-r--r--pkgs/development/tools/kubie/default.nix2
-rw-r--r--pkgs/development/tools/kythe/default.nix6
-rw-r--r--pkgs/development/tools/lattice-diamond/default.nix8
-rw-r--r--pkgs/development/tools/lazygit/default.nix4
-rw-r--r--pkgs/development/tools/leaps/default.nix6
-rw-r--r--pkgs/development/tools/libsigrok/default.nix4
-rw-r--r--pkgs/development/tools/libsigrokdecode/default.nix4
-rw-r--r--pkgs/development/tools/literate-programming/Literate/default.nix4
-rw-r--r--pkgs/development/tools/literate-programming/eweb/default.nix4
-rw-r--r--pkgs/development/tools/literate-programming/funnelweb/default.nix4
-rw-r--r--pkgs/development/tools/literate-programming/noweb/default.nix10
-rw-r--r--pkgs/development/tools/literate-programming/nuweb/default.nix4
-rw-r--r--pkgs/development/tools/makerpm/default.nix4
-rw-r--r--pkgs/development/tools/manul/default.nix4
-rw-r--r--pkgs/development/tools/mdk/default.nix6
-rw-r--r--pkgs/development/tools/minizinc/default.nix4
-rw-r--r--pkgs/development/tools/minizinc/ide.nix6
-rw-r--r--pkgs/development/tools/misc/abi-compliance-checker/default.nix4
-rw-r--r--pkgs/development/tools/misc/abi-dumper/default.nix4
-rw-r--r--pkgs/development/tools/misc/arcanist/default.nix10
-rw-r--r--pkgs/development/tools/misc/argbash/default.nix4
-rw-r--r--pkgs/development/tools/misc/asls/default.nix4
-rw-r--r--pkgs/development/tools/misc/autobuild/default.nix4
-rw-r--r--pkgs/development/tools/misc/autoconf-archive/default.nix4
-rw-r--r--pkgs/development/tools/misc/autoconf/2.13.nix6
-rw-r--r--pkgs/development/tools/misc/autoconf/2.64.nix6
-rw-r--r--pkgs/development/tools/misc/autoconf/2.69.nix6
-rw-r--r--pkgs/development/tools/misc/autoconf/default.nix6
-rw-r--r--pkgs/development/tools/misc/autogen/default.nix10
-rw-r--r--pkgs/development/tools/misc/automake/automake-1.11.x.nix6
-rw-r--r--pkgs/development/tools/misc/automake/automake-1.15.x.nix6
-rw-r--r--pkgs/development/tools/misc/automake/automake-1.16.x.nix6
-rw-r--r--pkgs/development/tools/misc/automoc4/default.nix4
-rw-r--r--pkgs/development/tools/misc/avrdude/default.nix8
-rw-r--r--pkgs/development/tools/misc/awf/default.nix4
-rw-r--r--pkgs/development/tools/misc/babeltrace/default.nix4
-rw-r--r--pkgs/development/tools/misc/bashdb/default.nix6
-rw-r--r--pkgs/development/tools/misc/bin_replace_string/default.nix4
-rw-r--r--pkgs/development/tools/misc/bossa/default.nix4
-rw-r--r--pkgs/development/tools/misc/bsdbuild/default.nix6
-rw-r--r--pkgs/development/tools/misc/cbrowser/default.nix8
-rw-r--r--pkgs/development/tools/misc/cc-tool/default.nix4
-rw-r--r--pkgs/development/tools/misc/ccache/default.nix4
-rw-r--r--pkgs/development/tools/misc/ccls/default.nix6
-rw-r--r--pkgs/development/tools/misc/cflow/default.nix8
-rw-r--r--pkgs/development/tools/misc/cgdb/default.nix4
-rw-r--r--pkgs/development/tools/misc/checkbashisms/default.nix6
-rw-r--r--pkgs/development/tools/misc/chrpath/default.nix4
-rw-r--r--pkgs/development/tools/misc/circleci-cli/default.nix4
-rw-r--r--pkgs/development/tools/misc/cl-launch/default.nix8
-rw-r--r--pkgs/development/tools/misc/cli11/default.nix4
-rw-r--r--pkgs/development/tools/misc/clojure-lsp/default.nix4
-rw-r--r--pkgs/development/tools/misc/coccinelle/default.nix8
-rw-r--r--pkgs/development/tools/misc/complexity/default.nix6
-rw-r--r--pkgs/development/tools/misc/cppi/default.nix6
-rw-r--r--pkgs/development/tools/misc/cproto/default.nix4
-rw-r--r--pkgs/development/tools/misc/creduce/default.nix6
-rw-r--r--pkgs/development/tools/misc/cscope/default.nix10
-rw-r--r--pkgs/development/tools/misc/csmith/default.nix4
-rw-r--r--pkgs/development/tools/misc/ctags/default.nix4
-rw-r--r--pkgs/development/tools/misc/cwebbin/default.nix4
-rw-r--r--pkgs/development/tools/misc/d-feet/default.nix6
-rw-r--r--pkgs/development/tools/misc/dbench/default.nix4
-rw-r--r--pkgs/development/tools/misc/ddd/default.nix6
-rw-r--r--pkgs/development/tools/misc/dejagnu/default.nix4
-rw-r--r--pkgs/development/tools/misc/dfu-programmer/default.nix4
-rw-r--r--pkgs/development/tools/misc/dfu-util/default.nix4
-rw-r--r--pkgs/development/tools/misc/dialog/default.nix12
-rw-r--r--pkgs/development/tools/misc/direvent/default.nix4
-rw-r--r--pkgs/development/tools/misc/distcc/default.nix6
-rw-r--r--pkgs/development/tools/misc/distcc/masq.nix4
-rw-r--r--pkgs/development/tools/misc/doclifter/default.nix4
-rw-r--r--pkgs/development/tools/misc/docopts/default.nix4
-rw-r--r--pkgs/development/tools/misc/drush/default.nix6
-rw-r--r--pkgs/development/tools/misc/editorconfig-core-c/default.nix4
-rw-r--r--pkgs/development/tools/misc/eggdbus/default.nix4
-rw-r--r--pkgs/development/tools/misc/elfinfo/default.nix4
-rw-r--r--pkgs/development/tools/misc/elfkickers/default.nix4
-rw-r--r--pkgs/development/tools/misc/epm/default.nix4
-rw-r--r--pkgs/development/tools/misc/findnewest/default.nix4
-rw-r--r--pkgs/development/tools/misc/fsatrace/default.nix4
-rw-r--r--pkgs/development/tools/misc/fswatch/default.nix6
-rw-r--r--pkgs/development/tools/misc/fujprog/default.nix6
-rw-r--r--pkgs/development/tools/misc/gdb/default.nix22
-rw-r--r--pkgs/development/tools/misc/gdbgui/default.nix6
-rw-r--r--pkgs/development/tools/misc/gengetopt/default.nix6
-rw-r--r--pkgs/development/tools/misc/global/default.nix4
-rw-r--r--pkgs/development/tools/misc/gnum4/default.nix8
-rw-r--r--pkgs/development/tools/misc/gob2/default.nix8
-rw-r--r--pkgs/development/tools/misc/gperf/3.0.x.nix6
-rw-r--r--pkgs/development/tools/misc/gperf/default.nix6
-rw-r--r--pkgs/development/tools/misc/gpshell/default.nix4
-rw-r--r--pkgs/development/tools/misc/gputils/default.nix4
-rw-r--r--pkgs/development/tools/misc/gtkdialog/default.nix6
-rw-r--r--pkgs/development/tools/misc/gtkperf/default.nix4
-rw-r--r--pkgs/development/tools/misc/help2man/default.nix6
-rw-r--r--pkgs/development/tools/misc/hound/default.nix8
-rw-r--r--pkgs/development/tools/misc/hydra-cli/default.nix2
-rw-r--r--pkgs/development/tools/misc/hydra/common.nix2
-rw-r--r--pkgs/development/tools/misc/icon-naming-utils/default.nix4
-rw-r--r--pkgs/development/tools/misc/igprof/default.nix8
-rw-r--r--pkgs/development/tools/misc/indent/default.nix10
-rw-r--r--pkgs/development/tools/misc/inotify-tools/default.nix4
-rw-r--r--pkgs/development/tools/misc/intel-gpu-tools/default.nix4
-rw-r--r--pkgs/development/tools/misc/intltool/default.nix6
-rw-r--r--pkgs/development/tools/misc/iozone/default.nix4
-rw-r--r--pkgs/development/tools/misc/itm-tools/default.nix4
-rw-r--r--pkgs/development/tools/misc/itstool/default.nix4
-rw-r--r--pkgs/development/tools/misc/jscoverage/default.nix6
-rw-r--r--pkgs/development/tools/misc/kconfig-frontends/default.nix6
-rw-r--r--pkgs/development/tools/misc/kdbg/default.nix4
-rw-r--r--pkgs/development/tools/misc/kibana/6.x.nix6
-rw-r--r--pkgs/development/tools/misc/kibana/7.x.nix6
-rw-r--r--pkgs/development/tools/misc/libtool/default.nix6
-rw-r--r--pkgs/development/tools/misc/libtool/libtool2.nix4
-rw-r--r--pkgs/development/tools/misc/libwhich/default.nix4
-rw-r--r--pkgs/development/tools/misc/loccount/default.nix4
-rw-r--r--pkgs/development/tools/misc/lsof/default.nix12
-rw-r--r--pkgs/development/tools/misc/ltrace/default.nix4
-rw-r--r--pkgs/development/tools/misc/lttng-tools/default.nix4
-rw-r--r--pkgs/development/tools/misc/lttng-ust/default.nix4
-rw-r--r--pkgs/development/tools/misc/lttv/default.nix4
-rw-r--r--pkgs/development/tools/misc/luarocks/default.nix4
-rw-r--r--pkgs/development/tools/misc/macdylibbundler/default.nix4
-rw-r--r--pkgs/development/tools/misc/micronucleus/default.nix2
-rw-r--r--pkgs/development/tools/misc/msitools/default.nix6
-rw-r--r--pkgs/development/tools/misc/nimlsp/default.nix4
-rw-r--r--pkgs/development/tools/misc/ninka/default.nix4
-rw-r--r--pkgs/development/tools/misc/nrfutil/default.nix4
-rw-r--r--pkgs/development/tools/misc/nxpmicro-mfgtools/default.nix4
-rw-r--r--pkgs/development/tools/misc/objconv/default.nix4
-rw-r--r--pkgs/development/tools/misc/opengrok/default.nix6
-rw-r--r--pkgs/development/tools/misc/pahole/default.nix4
-rw-r--r--pkgs/development/tools/misc/patchelf/default.nix4
-rw-r--r--pkgs/development/tools/misc/patchelf/unstable.nix6
-rw-r--r--pkgs/development/tools/misc/perfect-hash/default.nix4
-rw-r--r--pkgs/development/tools/misc/pkg-config/default.nix4
-rw-r--r--pkgs/development/tools/misc/pkgconf/default.nix4
-rw-r--r--pkgs/development/tools/misc/pmccabe/default.nix4
-rw-r--r--pkgs/development/tools/misc/prelink/default.nix6
-rw-r--r--pkgs/development/tools/misc/premake/3.nix6
-rw-r--r--pkgs/development/tools/misc/premake/5.nix6
-rw-r--r--pkgs/development/tools/misc/premake/default.nix6
-rw-r--r--pkgs/development/tools/misc/ptags/default.nix2
-rw-r--r--pkgs/development/tools/misc/pwndbg/default.nix4
-rw-r--r--pkgs/development/tools/misc/remarkable/remarkable-toolchain/default.nix4
-rw-r--r--pkgs/development/tools/misc/remarkable/remarkable2-toolchain/default.nix4
-rw-r--r--pkgs/development/tools/misc/rman/default.nix4
-rw-r--r--pkgs/development/tools/misc/rolespec/default.nix4
-rw-r--r--pkgs/development/tools/misc/saleae-logic/default.nix6
-rw-r--r--pkgs/development/tools/misc/scc/default.nix4
-rw-r--r--pkgs/development/tools/misc/sipp/default.nix4
-rw-r--r--pkgs/development/tools/misc/sloccount/default.nix6
-rw-r--r--pkgs/development/tools/misc/srecord/default.nix8
-rw-r--r--pkgs/development/tools/misc/stlink/default.nix4
-rw-r--r--pkgs/development/tools/misc/stm32cubemx/default.nix4
-rw-r--r--pkgs/development/tools/misc/stm32flash/default.nix6
-rw-r--r--pkgs/development/tools/misc/strace/default.nix6
-rw-r--r--pkgs/development/tools/misc/swig/2.x.nix4
-rw-r--r--pkgs/development/tools/misc/swig/3.x.nix4
-rw-r--r--pkgs/development/tools/misc/swig/4.nix4
-rw-r--r--pkgs/development/tools/misc/swig/default.nix6
-rw-r--r--pkgs/development/tools/misc/sysbench/default.nix6
-rw-r--r--pkgs/development/tools/misc/tcptrack/default.nix4
-rw-r--r--pkgs/development/tools/misc/teensy-loader-cli/default.nix4
-rw-r--r--pkgs/development/tools/misc/tet/default.nix6
-rw-r--r--pkgs/development/tools/misc/texi2html/default.nix6
-rw-r--r--pkgs/development/tools/misc/texinfo/common.nix6
-rw-r--r--pkgs/development/tools/misc/tie/default.nix4
-rw-r--r--pkgs/development/tools/misc/tokei/default.nix6
-rw-r--r--pkgs/development/tools/misc/uisp/default.nix6
-rw-r--r--pkgs/development/tools/misc/uncrustify/default.nix4
-rw-r--r--pkgs/development/tools/misc/unifdef/default.nix4
-rw-r--r--pkgs/development/tools/misc/universal-ctags/default.nix6
-rw-r--r--pkgs/development/tools/misc/unused/default.nix4
-rw-r--r--pkgs/development/tools/misc/usb-modeswitch/data.nix4
-rw-r--r--pkgs/development/tools/misc/usb-modeswitch/default.nix2
-rw-r--r--pkgs/development/tools/misc/vtable-dumper/default.nix4
-rw-r--r--pkgs/development/tools/misc/watson-ruby/default.nix4
-rw-r--r--pkgs/development/tools/misc/whatstyle/default.nix4
-rw-r--r--pkgs/development/tools/misc/xc3sprog/default.nix4
-rw-r--r--pkgs/development/tools/misc/ycmd/default.nix6
-rw-r--r--pkgs/development/tools/misc/yodl/default.nix4
-rw-r--r--pkgs/development/tools/modd/default.nix4
-rw-r--r--pkgs/development/tools/mustache-go/default.nix4
-rw-r--r--pkgs/development/tools/nemiver/default.nix2
-rw-r--r--pkgs/development/tools/neoload/default.nix6
-rw-r--r--pkgs/development/tools/node-webkit/nw12.nix4
-rw-r--r--pkgs/development/tools/nrpl/default.nix2
-rw-r--r--pkgs/development/tools/nwjs/default.nix4
-rw-r--r--pkgs/development/tools/ocaml/camlidl/default.nix4
-rw-r--r--pkgs/development/tools/ocaml/camlp4/default.nix6
-rw-r--r--pkgs/development/tools/ocaml/camlp5/default.nix6
-rw-r--r--pkgs/development/tools/ocaml/cppo/default.nix6
-rw-r--r--pkgs/development/tools/ocaml/dune/2.nix14
-rw-r--r--pkgs/development/tools/ocaml/findlib/default.nix8
-rw-r--r--pkgs/development/tools/ocaml/oasis/default.nix4
-rw-r--r--pkgs/development/tools/ocaml/obuild/default.nix6
-rw-r--r--pkgs/development/tools/ocaml/ocamlbuild/default.nix4
-rw-r--r--pkgs/development/tools/ocaml/ocamlify/default.nix6
-rw-r--r--pkgs/development/tools/ocaml/ocamlmod/default.nix4
-rw-r--r--pkgs/development/tools/ocaml/ocp-build/default.nix4
-rw-r--r--pkgs/development/tools/ocaml/ocsigen-i18n/default.nix6
-rw-r--r--pkgs/development/tools/ocaml/omake/0.9.8.6-rc1.nix4
-rw-r--r--pkgs/development/tools/ocaml/omake/default.nix4
-rw-r--r--pkgs/development/tools/ocaml/opaline/default.nix6
-rw-r--r--pkgs/development/tools/ocaml/opam/1.2.2.nix2
-rw-r--r--pkgs/development/tools/ocaml/opam/default.nix2
-rw-r--r--pkgs/development/tools/ocaml/utop/default.nix10
-rw-r--r--pkgs/development/tools/omniorb/default.nix4
-rw-r--r--pkgs/development/tools/omnisharp-roslyn/default.nix4
-rw-r--r--pkgs/development/tools/out-of-tree/default.nix2
-rw-r--r--pkgs/development/tools/packet/default.nix8
-rw-r--r--pkgs/development/tools/parsing/antlr/3.5.nix2
-rw-r--r--pkgs/development/tools/parsing/antlr/4.8.nix4
-rw-r--r--pkgs/development/tools/parsing/bison/default.nix8
-rw-r--r--pkgs/development/tools/parsing/flex/2.5.35.nix2
-rw-r--r--pkgs/development/tools/parsing/flex/2.6.1.nix6
-rw-r--r--pkgs/development/tools/parsing/flex/default.nix6
-rw-r--r--pkgs/development/tools/parsing/ragel/default.nix10
-rw-r--r--pkgs/development/tools/pgformatter/default.nix4
-rw-r--r--pkgs/development/tools/pgloader/default.nix2
-rw-r--r--pkgs/development/tools/phantomjs/default.nix2
-rw-r--r--pkgs/development/tools/phantomjs2/default.nix8
-rw-r--r--pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix16
-rw-r--r--pkgs/development/tools/poetry2nix/poetry2nix/pep425.nix6
-rw-r--r--pkgs/development/tools/poetry2nix/poetry2nix/pep508.nix2
-rw-r--r--pkgs/development/tools/profiling/EZTrace/default.nix6
-rw-r--r--pkgs/development/tools/profiling/oprofile/default.nix10
-rw-r--r--pkgs/development/tools/profiling/sysprof/capture.nix4
-rw-r--r--pkgs/development/tools/profiling/sysprof/default.nix2
-rw-r--r--pkgs/development/tools/purescript/spago/spago.nix4
-rw-r--r--pkgs/development/tools/py-spy/default.nix2
-rw-r--r--pkgs/development/tools/pydb/default.nix6
-rw-r--r--pkgs/development/tools/quilt/default.nix6
-rw-r--r--pkgs/development/tools/rdocker/default.nix4
-rw-r--r--pkgs/development/tools/react-native-debugger/default.nix2
-rw-r--r--pkgs/development/tools/repository-managers/nexus/default.nix2
-rw-r--r--pkgs/development/tools/rtags/default.nix4
-rw-r--r--pkgs/development/tools/rund/default.nix2
-rw-r--r--pkgs/development/tools/rust/cargo-asm/default.nix2
-rw-r--r--pkgs/development/tools/rust/cargo-c/default.nix2
-rw-r--r--pkgs/development/tools/rust/cargo-cache/default.nix2
-rw-r--r--pkgs/development/tools/rust/cargo-crev/default.nix2
-rw-r--r--pkgs/development/tools/rust/cargo-deny/default.nix2
-rw-r--r--pkgs/development/tools/rust/cargo-fund/default.nix2
-rw-r--r--pkgs/development/tools/rust/cargo-geiger/default.nix2
-rw-r--r--pkgs/development/tools/rust/cargo-generate/default.nix2
-rw-r--r--pkgs/development/tools/rust/cargo-inspect/default.nix2
-rw-r--r--pkgs/development/tools/rust/cargo-make/default.nix2
-rw-r--r--pkgs/development/tools/rust/cargo-raze/default.nix2
-rw-r--r--pkgs/development/tools/rust/cargo-udeps/default.nix2
-rw-r--r--pkgs/development/tools/rust/cbindgen/default.nix2
-rw-r--r--pkgs/development/tools/rust/maturin/default.nix4
-rw-r--r--pkgs/development/tools/rust/racer/default.nix2
-rw-r--r--pkgs/development/tools/rust/racerd/default.nix2
-rw-r--r--pkgs/development/tools/rust/rustup/default.nix2
-rw-r--r--pkgs/development/tools/sauce-connect/default.nix2
-rw-r--r--pkgs/development/tools/selenium/chromedriver/default.nix6
-rw-r--r--pkgs/development/tools/selenium/htmlunit-driver/default.nix4
-rw-r--r--pkgs/development/tools/selenium/selendroid/default.nix4
-rw-r--r--pkgs/development/tools/selenium/server/default.nix4
-rw-r--r--pkgs/development/tools/simavr/default.nix2
-rw-r--r--pkgs/development/tools/slimerjs/default.nix8
-rw-r--r--pkgs/development/tools/so/default.nix2
-rw-r--r--pkgs/development/tools/sourcetrail/default.nix12
-rw-r--r--pkgs/development/tools/sqsh/default.nix2
-rw-r--r--pkgs/development/tools/summon/default.nix2
-rw-r--r--pkgs/development/tools/sumneko-lua-language-server/default.nix4
-rw-r--r--pkgs/development/tools/the-way/default.nix4
-rw-r--r--pkgs/development/tools/trellis/default.nix6
-rw-r--r--pkgs/development/tools/tychus/default.nix6
-rw-r--r--pkgs/development/tools/uftrace/default.nix8
-rw-r--r--pkgs/development/tools/vcstool/default.nix2
-rw-r--r--pkgs/development/tools/vultr/default.nix6
-rw-r--r--pkgs/development/tools/wasm-pack/default.nix2
-rw-r--r--pkgs/development/tools/wiggle/default.nix6
-rw-r--r--pkgs/development/tools/wrangler/default.nix6
-rw-r--r--pkgs/development/tools/xcbuild/default.nix6
-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.nix15
-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/games/crawl/crawl_purify.patch20
-rw-r--r--pkgs/games/crawl/default.nix5
-rw-r--r--pkgs/misc/vscode-extensions/default.nix84
-rw-r--r--pkgs/os-specific/linux/exfat/default.nix2
-rw-r--r--pkgs/os-specific/linux/kernel-headers/default.nix2
-rw-r--r--pkgs/os-specific/linux/kernel/generic.nix18
-rw-r--r--pkgs/os-specific/linux/kernel/manual-config.nix30
-rw-r--r--pkgs/os-specific/linux/klibc/default.nix4
-rw-r--r--pkgs/os-specific/linux/nvidia-x11/default.nix3
-rw-r--r--pkgs/os-specific/linux/rtl8723bs/default.nix2
-rw-r--r--pkgs/os-specific/linux/rtl8812au/default.nix2
-rw-r--r--pkgs/os-specific/linux/uclibc/default.nix2
-rw-r--r--pkgs/servers/home-assistant/component-packages.nix6
-rw-r--r--pkgs/servers/http/lighttpd/default.nix4
-rw-r--r--pkgs/servers/monitoring/alertmanager-bot/default.nix20
-rw-r--r--pkgs/servers/monitoring/alertmanager-bot/deps.nix948
-rw-r--r--pkgs/stdenv/generic/make-derivation.nix4
-rw-r--r--pkgs/tools/audio/abcmidi/default.nix4
-rw-r--r--pkgs/tools/backup/stenc/default.nix19
-rw-r--r--pkgs/tools/misc/esphome/default.nix4
-rw-r--r--pkgs/tools/misc/hdf5/default.nix11
-rw-r--r--pkgs/tools/misc/hpcg/default.nix4
-rw-r--r--pkgs/tools/security/eschalot/default.nix6
-rw-r--r--pkgs/tools/system/ior/default.nix4
-rw-r--r--pkgs/top-level/all-packages.nix55
-rw-r--r--pkgs/top-level/default.nix24
-rw-r--r--pkgs/top-level/impure.nix34
-rw-r--r--pkgs/top-level/perl-packages.nix34
-rw-r--r--pkgs/top-level/python-packages.nix11
871 files changed, 3303 insertions, 3830 deletions
diff --git a/doc/using/overlays.xml b/doc/using/overlays.xml
index caacb0a0462..9ffbb4edd98 100644
--- a/doc/using/overlays.xml
+++ b/doc/using/overlays.xml
@@ -291,5 +291,40 @@ stdenv.mkDerivation {
 }
 </programlisting>
    </section>
+   <section xml:id="sec-overlays-alternatives-mpi">
+     <title>Switching the MPI implementation</title>
+     <para>
+       All programs that are built with
+       <link xlink:href="https://en.wikipedia.org/wiki/Message_Passing_Interface">MPI</link>
+       support use the generic attribute <varname>mpi</varname>
+       as an input. At the moment Nixpkgs natively provides two different
+       MPI implementations:
+       <itemizedlist>
+         <listitem>
+           <para>
+             <link xlink:href="https://www.open-mpi.org/">Open MPI</link>
+             (default), attribute name <varname>openmpi</varname>
+           </para>
+         </listitem>
+         <listitem>
+           <para>
+             <link xlink:href="https://www.mpich.org/">MPICH</link>,
+             attribute name <varname>mpich</varname>
+           </para>
+         </listitem>
+       </itemizedlist>
+     </para>
+     <para>
+       To provide MPI enabled applications that use <literal>MPICH</literal>, instead
+       of the default <literal>Open MPI</literal>, simply use the following overlay:
+     </para>
+     <programlisting>
+self: super:
+
+{
+  mpi = self.mpich;
+}
+     </programlisting>
+   </section>
  </section>
 </chapter>
diff --git a/lib/systems/architectures.nix b/lib/systems/architectures.nix
index 8e3a56b0d7c..ddc320d24e0 100644
--- a/lib/systems/architectures.nix
+++ b/lib/systems/architectures.nix
@@ -1,7 +1,7 @@
 { lib }:
 
 rec {
-  # platform.gcc.arch to its features (as in /proc/cpuinfo)
+  # gcc.arch to its features (as in /proc/cpuinfo)
   features = {
     default        = [ ];
     # x86_64 Intel
diff --git a/lib/systems/default.nix b/lib/systems/default.nix
index 4edcbeb36f1..1a89120e2bf 100644
--- a/lib/systems/default.nix
+++ b/lib/systems/default.nix
@@ -24,8 +24,6 @@ rec {
       # Either of these can be losslessly-extracted from `parsed` iff parsing succeeds.
       system = parse.doubleFromSystem final.parsed;
       config = parse.tripleFromSystem final.parsed;
-      # Just a guess, based on `system`
-      platform = platforms.select final;
       # Determine whether we are compatible with the provided CPU
       isCompatible = platform: parse.isCompatible final.parsed.cpu platform.parsed.cpu;
       # Derived meta-data
@@ -79,11 +77,20 @@ rec {
       };
       isStatic = final.isWasm || final.isRedox;
 
-      kernelArch =
+      # Just a guess, based on `system`
+      inherit
+        ({
+          linux-kernel = args.linux-kernel or {};
+          gcc = args.gcc or {};
+          rustc = args.rust or {};
+        } // platforms.select final)
+        linux-kernel gcc rustc;
+
+      linuxArch =
         if final.isAarch32 then "arm"
         else if final.isAarch64 then "arm64"
-        else if final.isx86_32 then "x86"
-        else if final.isx86_64 then "x86"
+        else if final.isx86_32 then "i386"
+        else if final.isx86_64 then "x86_64"
         else if final.isMips then "mips"
         else final.parsed.cpu.name;
 
@@ -129,7 +136,7 @@ rec {
         else throw "Don't know how to run ${final.config} executables.";
 
     } // mapAttrs (n: v: v final.parsed) inspect.predicates
-      // mapAttrs (n: v: v final.platform.gcc.arch or "default") architectures.predicates
+      // mapAttrs (n: v: v final.gcc.arch or "default") architectures.predicates
       // args;
   in assert final.useAndroidPrebuilt -> final.isAndroid;
      assert lib.foldl
diff --git a/lib/systems/examples.nix b/lib/systems/examples.nix
index 16002450f2d..de12e0b83c1 100644
--- a/lib/systems/examples.nix
+++ b/lib/systems/examples.nix
@@ -7,7 +7,6 @@ let
 
   riscv = bits: {
     config = "riscv${bits}-unknown-linux-gnu";
-    platform = platforms.riscv-multiplatform;
   };
 in
 
@@ -17,84 +16,68 @@ rec {
   #
   powernv = {
     config = "powerpc64le-unknown-linux-gnu";
-    platform = platforms.powernv;
   };
   musl-power = {
     config = "powerpc64le-unknown-linux-musl";
-    platform = platforms.powernv;
   };
 
   sheevaplug = {
     config = "armv5tel-unknown-linux-gnueabi";
-    platform = platforms.sheevaplug;
-  };
+  } // platforms.sheevaplug;
 
   raspberryPi = {
     config = "armv6l-unknown-linux-gnueabihf";
-    platform = platforms.raspberrypi;
-  };
+  } // platforms.raspberrypi;
 
   remarkable1 = {
     config = "armv7l-unknown-linux-gnueabihf";
-    platform = platforms.zero-gravitas;
-  };
+  } // platforms.zero-gravitas;
 
   remarkable2 = {
     config = "armv7l-unknown-linux-gnueabihf";
-    platform = platforms.zero-sugar;
-  };
+  } // platforms.zero-sugar;
 
   armv7l-hf-multiplatform = {
     config = "armv7l-unknown-linux-gnueabihf";
-    platform = platforms.armv7l-hf-multiplatform;
   };
 
   aarch64-multiplatform = {
     config = "aarch64-unknown-linux-gnu";
-    platform = platforms.aarch64-multiplatform;
   };
 
   armv7a-android-prebuilt = {
     config = "armv7a-unknown-linux-androideabi";
     sdkVer = "29";
     ndkVer = "21";
-    platform = platforms.armv7a-android;
     useAndroidPrebuilt = true;
-  };
+  } // platforms.armv7a-android;
 
   aarch64-android-prebuilt = {
     config = "aarch64-unknown-linux-android";
     sdkVer = "29";
     ndkVer = "21";
-    platform = platforms.aarch64-multiplatform;
     useAndroidPrebuilt = true;
   };
 
-  scaleway-c1 = armv7l-hf-multiplatform // rec {
-    platform = platforms.scaleway-c1;
-    inherit (platform.gcc) fpu;
-  };
+  scaleway-c1 = armv7l-hf-multiplatform // platforms.scaleway-c1;
 
   pogoplug4 = {
     config = "armv5tel-unknown-linux-gnueabi";
-    platform = platforms.pogoplug4;
-  };
+  } // platforms.pogoplug4;
 
   ben-nanonote = {
     config = "mipsel-unknown-linux-uclibc";
-    platform = platforms.ben_nanonote;
-  };
+  } // platforms.ben_nanonote;
 
   fuloongminipc = {
     config = "mipsel-unknown-linux-gnu";
-    platform = platforms.fuloong2f_n32;
-  };
+  } // platforms.fuloong2f_n32;
 
   muslpi = raspberryPi // {
     config = "armv6l-unknown-linux-musleabihf";
   };
 
-  aarch64-multiplatform-musl = aarch64-multiplatform // {
+  aarch64-multiplatform-musl = {
     config = "aarch64-unknown-linux-musl";
   };
 
@@ -110,13 +93,11 @@ rec {
   riscv64-embedded = {
     config = "riscv64-none-elf";
     libc = "newlib";
-    platform = platforms.riscv-multiplatform;
   };
 
   riscv32-embedded = {
     config = "riscv32-none-elf";
     libc = "newlib";
-    platform = platforms.riscv-multiplatform;
   };
 
   mmix = {
@@ -136,13 +117,11 @@ rec {
   vc4 = {
     config = "vc4-elf";
     libc = "newlib";
-    platform = {};
   };
 
   or1k = {
     config = "or1k-elf";
     libc = "newlib";
-    platform = {};
   };
 
   arm-embedded = {
@@ -204,7 +183,6 @@ rec {
     xcodeVer = "11.3.1";
     xcodePlatform = "iPhoneOS";
     useiOSPrebuilt = true;
-    platform = {};
   };
 
   iphone32 = {
@@ -214,7 +192,6 @@ rec {
     xcodeVer = "11.3.1";
     xcodePlatform = "iPhoneOS";
     useiOSPrebuilt = true;
-    platform = {};
   };
 
   iphone64-simulator = {
@@ -224,7 +201,6 @@ rec {
     xcodeVer = "11.3.1";
     xcodePlatform = "iPhoneSimulator";
     useiOSPrebuilt = true;
-    platform = {};
   };
 
   iphone32-simulator = {
@@ -234,7 +210,6 @@ rec {
     xcodeVer = "11.3.1";
     xcodePlatform = "iPhoneSimulator";
     useiOSPrebuilt = true;
-    platform = {};
   };
 
   #
@@ -245,7 +220,6 @@ rec {
   mingw32 = {
     config = "i686-w64-mingw32";
     libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
-    platform = {};
   };
 
   # 64 bit mingw-w64
@@ -253,7 +227,6 @@ rec {
     # That's the triplet they use in the mingw-w64 docs.
     config = "x86_64-w64-mingw32";
     libc = "msvcrt"; # This distinguishes the mingw (non posix) toolchain
-    platform = {};
   };
 
   # BSDs
@@ -275,6 +248,5 @@ rec {
   # Ghcjs
   ghcjs = {
     config = "js-unknown-ghcjs";
-    platform = {};
   };
 }
diff --git a/lib/systems/platforms.nix b/lib/systems/platforms.nix
index e869de488c1..f399c1873f5 100644
--- a/lib/systems/platforms.nix
+++ b/lib/systems/platforms.nix
@@ -1,39 +1,36 @@
 { lib }:
 rec {
-  pcBase = {
-    name = "pc";
-    kernelBaseConfig = "defconfig";
-    # Build whatever possible as a module, if not stated in the extra config.
-    kernelAutoModules = true;
-    kernelTarget = "bzImage";
-  };
-
-  pc64 = pcBase // { kernelArch = "x86_64"; };
-
-  pc32 = pcBase // { kernelArch = "i386"; };
-
-  pc32_simplekernel = pc32 // {
-    kernelAutoModules = false;
+  pc = {
+    linux-kernel = {
+      name = "pc";
+
+      baseConfig = "defconfig";
+      # Build whatever possible as a module, if not stated in the extra config.
+      autoModules = true;
+      target = "bzImage";
+    };
   };
 
-  pc64_simplekernel = pc64 // {
-    kernelAutoModules = false;
+  pc_simplekernel = lib.recursiveUpdate pc {
+    linux-kernel.autoModules = false;
   };
 
   powernv = {
-    name = "PowerNV";
-    kernelArch = "powerpc";
-    kernelBaseConfig = "powernv_defconfig";
-    kernelTarget = "zImage";
-    kernelInstallTarget = "install";
-    kernelFile = "vmlinux";
-    kernelAutoModules = true;
-    # avoid driver/FS trouble arising from unusual page size
-    kernelExtraConfig = ''
-      PPC_64K_PAGES n
-      PPC_4K_PAGES y
-      IPV6 y
-    '';
+    linux-kernel = {
+      name = "PowerNV";
+
+      baseConfig = "powernv_defconfig";
+      target = "zImage";
+      installTarget = "install";
+      file = "vmlinux";
+      autoModules = true;
+      # avoid driver/FS trouble arising from unusual page size
+      extraConfig = ''
+        PPC_64K_PAGES n
+        PPC_4K_PAGES y
+        IPV6 y
+      '';
+    };
   };
 
   ##
@@ -41,17 +38,121 @@ rec {
   ##
 
   pogoplug4 = {
-    name = "pogoplug4";
+    linux-kernel = {
+      name = "pogoplug4";
 
+      baseConfig = "multi_v5_defconfig";
+      autoModules = false;
+      extraConfig = ''
+        # Ubi for the mtd
+        MTD_UBI y
+        UBIFS_FS y
+        UBIFS_FS_XATTR y
+        UBIFS_FS_ADVANCED_COMPR y
+        UBIFS_FS_LZO y
+        UBIFS_FS_ZLIB y
+        UBIFS_FS_DEBUG n
+      '';
+      makeFlags = [ "LOADADDR=0x8000" ];
+      target = "uImage";
+      # TODO reenable once manual-config's config actually builds a .dtb and this is checked to be working
+      #DTB = true;
+    };
     gcc = {
       arch = "armv5te";
     };
+  };
+
+  sheevaplug = {
+    linux-kernel = {
+      name = "sheevaplug";
+
+      baseConfig = "multi_v5_defconfig";
+      autoModules = false;
+      extraConfig = ''
+        BLK_DEV_RAM y
+        BLK_DEV_INITRD y
+        BLK_DEV_CRYPTOLOOP m
+        BLK_DEV_DM m
+        DM_CRYPT m
+        MD y
+        REISERFS_FS m
+        BTRFS_FS m
+        XFS_FS m
+        JFS_FS m
+        EXT4_FS m
+        USB_STORAGE_CYPRESS_ATACB m
+
+        # mv cesa requires this sw fallback, for mv-sha1
+        CRYPTO_SHA1 y
+        # Fast crypto
+        CRYPTO_TWOFISH y
+        CRYPTO_TWOFISH_COMMON y
+        CRYPTO_BLOWFISH y
+        CRYPTO_BLOWFISH_COMMON y
+
+        IP_PNP y
+        IP_PNP_DHCP y
+        NFS_FS y
+        ROOT_NFS y
+        TUN m
+        NFS_V4 y
+        NFS_V4_1 y
+        NFS_FSCACHE y
+        NFSD m
+        NFSD_V2_ACL y
+        NFSD_V3 y
+        NFSD_V3_ACL y
+        NFSD_V4 y
+        NETFILTER y
+        IP_NF_IPTABLES y
+        IP_NF_FILTER y
+        IP_NF_MATCH_ADDRTYPE y
+        IP_NF_TARGET_LOG y
+        IP_NF_MANGLE y
+        IPV6 m
+        VLAN_8021Q m
+
+        CIFS y
+        CIFS_XATTR y
+        CIFS_POSIX y
+        CIFS_FSCACHE y
+        CIFS_ACL y
+
+        WATCHDOG y
+        WATCHDOG_CORE y
+        ORION_WATCHDOG m
+
+        ZRAM m
+        NETCONSOLE m
+
+        # Disable OABI to have seccomp_filter (required for systemd)
+        # https://github.com/raspberrypi/firmware/issues/651
+        OABI_COMPAT n
+
+        # Fail to build
+        DRM n
+        SCSI_ADVANSYS n
+        USB_ISP1362_HCD n
+        SND_SOC n
+        SND_ALI5451 n
+        FB_SAVAGE n
+        SCSI_NSP32 n
+        ATA_SFF n
+        SUNGEM n
+        IRDA n
+        ATM_HE n
+        SCSI_ACARD n
+        BLK_DEV_CMD640_ENHANCED n
+
+        FUSE_FS m
+
+        # systemd uses cgroups
+        CGROUPS y
+
+        # Latencytop
+        LATENCYTOP y
 
-    kernelBaseConfig = "multi_v5_defconfig";
-    kernelArch = "arm";
-    kernelAutoModules = false;
-    kernelExtraConfig =
-      ''
         # Ubi for the mtd
         MTD_UBI y
         UBIFS_FS y
@@ -60,137 +161,36 @@ rec {
         UBIFS_FS_LZO y
         UBIFS_FS_ZLIB y
         UBIFS_FS_DEBUG n
-      '';
-    kernelMakeFlags = [ "LOADADDR=0x8000" ];
-    kernelTarget = "uImage";
-    # TODO reenable once manual-config's config actually builds a .dtb and this is checked to be working
-    #kernelDTB = true;
-  };
 
-  sheevaplug = {
-    name = "sheevaplug";
-    kernelBaseConfig = "multi_v5_defconfig";
-    kernelArch = "arm";
-    kernelAutoModules = false;
-    kernelExtraConfig = ''
-      BLK_DEV_RAM y
-      BLK_DEV_INITRD y
-      BLK_DEV_CRYPTOLOOP m
-      BLK_DEV_DM m
-      DM_CRYPT m
-      MD y
-      REISERFS_FS m
-      BTRFS_FS m
-      XFS_FS m
-      JFS_FS m
-      EXT4_FS m
-      USB_STORAGE_CYPRESS_ATACB m
-
-      # mv cesa requires this sw fallback, for mv-sha1
-      CRYPTO_SHA1 y
-      # Fast crypto
-      CRYPTO_TWOFISH y
-      CRYPTO_TWOFISH_COMMON y
-      CRYPTO_BLOWFISH y
-      CRYPTO_BLOWFISH_COMMON y
-
-      IP_PNP y
-      IP_PNP_DHCP y
-      NFS_FS y
-      ROOT_NFS y
-      TUN m
-      NFS_V4 y
-      NFS_V4_1 y
-      NFS_FSCACHE y
-      NFSD m
-      NFSD_V2_ACL y
-      NFSD_V3 y
-      NFSD_V3_ACL y
-      NFSD_V4 y
-      NETFILTER y
-      IP_NF_IPTABLES y
-      IP_NF_FILTER y
-      IP_NF_MATCH_ADDRTYPE y
-      IP_NF_TARGET_LOG y
-      IP_NF_MANGLE y
-      IPV6 m
-      VLAN_8021Q m
-
-      CIFS y
-      CIFS_XATTR y
-      CIFS_POSIX y
-      CIFS_FSCACHE y
-      CIFS_ACL y
-
-      WATCHDOG y
-      WATCHDOG_CORE y
-      ORION_WATCHDOG m
-
-      ZRAM m
-      NETCONSOLE m
-
-      # Disable OABI to have seccomp_filter (required for systemd)
-      # https://github.com/raspberrypi/firmware/issues/651
-      OABI_COMPAT n
-
-      # Fail to build
-      DRM n
-      SCSI_ADVANSYS n
-      USB_ISP1362_HCD n
-      SND_SOC n
-      SND_ALI5451 n
-      FB_SAVAGE n
-      SCSI_NSP32 n
-      ATA_SFF n
-      SUNGEM n
-      IRDA n
-      ATM_HE n
-      SCSI_ACARD n
-      BLK_DEV_CMD640_ENHANCED n
-
-      FUSE_FS m
-
-      # systemd uses cgroups
-      CGROUPS y
-
-      # Latencytop
-      LATENCYTOP y
-
-      # Ubi for the mtd
-      MTD_UBI y
-      UBIFS_FS y
-      UBIFS_FS_XATTR y
-      UBIFS_FS_ADVANCED_COMPR y
-      UBIFS_FS_LZO y
-      UBIFS_FS_ZLIB y
-      UBIFS_FS_DEBUG n
-
-      # Kdb, for kernel troubles
-      KGDB y
-      KGDB_SERIAL_CONSOLE y
-      KGDB_KDB y
-    '';
-    kernelMakeFlags = [ "LOADADDR=0x0200000" ];
-    kernelTarget = "uImage";
-    kernelDTB = true; # Beyond 3.10
+        # Kdb, for kernel troubles
+        KGDB y
+        KGDB_SERIAL_CONSOLE y
+        KGDB_KDB y
+      '';
+      makeFlags = [ "LOADADDR=0x0200000" ];
+      target = "uImage";
+      DTB = true; # Beyond 3.10
+    };
     gcc = {
       arch = "armv5te";
     };
   };
 
   raspberrypi = {
-    name = "raspberrypi";
-    kernelBaseConfig = "bcm2835_defconfig";
-    kernelDTB = true;
-    kernelArch = "arm";
-    kernelAutoModules = true;
-    kernelPreferBuiltin = true;
-    kernelExtraConfig = ''
-      # Disable OABI to have seccomp_filter (required for systemd)
-      # https://github.com/raspberrypi/firmware/issues/651
-      OABI_COMPAT n
-    '';
-    kernelTarget = "zImage";
+    linux-kernel = {
+      name = "raspberrypi";
+
+      baseConfig = "bcm2835_defconfig";
+      DTB = true;
+      autoModules = true;
+      preferBuiltin = true;
+      extraConfig = ''
+        # Disable OABI to have seccomp_filter (required for systemd)
+        # https://github.com/raspberrypi/firmware/issues/651
+        OABI_COMPAT n
+      '';
+      target = "zImage";
+    };
     gcc = {
       arch = "armv6";
       fpu = "vfp";
@@ -201,13 +201,15 @@ rec {
   raspberrypi2 = armv7l-hf-multiplatform;
 
   zero-gravitas = {
-    name = "zero-gravitas";
-    kernelBaseConfig = "zero-gravitas_defconfig";
-    kernelArch = "arm";
-    # kernelTarget verified by checking /boot on reMarkable 1 device
-    kernelTarget = "zImage";
-    kernelAutoModules = false;
-    kernelDTB = true;
+    linux-kernel = {
+      name = "zero-gravitas";
+
+      baseConfig = "zero-gravitas_defconfig";
+      # Target verified by checking /boot on reMarkable 1 device
+      target = "zImage";
+      autoModules = false;
+      DTB = true;
+    };
     gcc = {
       fpu = "neon";
       cpu = "cortex-a9";
@@ -215,13 +217,15 @@ rec {
   };
 
   zero-sugar = {
-    name = "zero-sugar";
-    kernelBaseConfig = "zero-sugar_defconfig";
-    kernelArch = "arm";
-    kernelDTB = true;
-    kernelAutoModules = false;
-    kernelPreferBuiltin = true;
-    kernelTarget = "zImage";
+    linux-kernel = {
+      name = "zero-sugar";
+
+      baseConfig = "zero-sugar_defconfig";
+      DTB = true;
+      autoModules = false;
+      preferBuiltin = true;
+      target = "zImage";
+    };
     gcc = {
       cpu = "cortex-a7";
       fpu = "neon-vfpv4";
@@ -229,7 +233,7 @@ rec {
     };
   };
 
-  scaleway-c1 = armv7l-hf-multiplatform // {
+  scaleway-c1 = lib.recursiveUpdate armv7l-hf-multiplatform {
     gcc = {
       cpu = "cortex-a9";
       fpu = "vfpv3";
@@ -237,12 +241,11 @@ rec {
   };
 
   utilite = {
-    name = "utilite";
-    kernelBaseConfig = "multi_v7_defconfig";
-    kernelArch = "arm";
-    kernelAutoModules = false;
-    kernelExtraConfig =
-      ''
+    linux-kernel = {
+      name = "utilite";
+      maseConfig = "multi_v7_defconfig";
+      autoModules = false;
+      extraConfig = ''
         # Ubi for the mtd
         MTD_UBI y
         UBIFS_FS y
@@ -252,35 +255,37 @@ rec {
         UBIFS_FS_ZLIB y
         UBIFS_FS_DEBUG n
       '';
-    kernelMakeFlags = [ "LOADADDR=0x10800000" ];
-    kernelTarget = "uImage";
-    kernelDTB = true;
+      makeFlags = [ "LOADADDR=0x10800000" ];
+      target = "uImage";
+      DTB = true;
+    };
     gcc = {
       cpu = "cortex-a9";
       fpu = "neon";
     };
   };
 
-  guruplug = sheevaplug // {
+  guruplug = lib.recursiveUpdate sheevaplug {
     # Define `CONFIG_MACH_GURUPLUG' (see
     # <http://kerneltrap.org/mailarchive/git-commits-head/2010/5/19/33618>)
     # and other GuruPlug-specific things.  Requires the `guruplug-defconfig'
     # patch.
-
-    kernelBaseConfig = "guruplug_defconfig";
+    linux-kernel.baseConfig = "guruplug_defconfig";
   };
 
-  beaglebone = armv7l-hf-multiplatform // {
-    name = "beaglebone";
-    kernelBaseConfig = "bb.org_defconfig";
-    kernelAutoModules = false;
-    kernelExtraConfig = ""; # TBD kernel config
-    kernelTarget = "zImage";
+  beaglebone = lib.recursiveUpdate armv7l-hf-multiplatform {
+    linux-kernel = {
+      name = "beaglebone";
+      baseConfig = "bb.org_defconfig";
+      autoModules = false;
+      extraConfig = ""; # TBD kernel config
+      target = "zImage";
+    };
   };
 
   # https://developer.android.com/ndk/guides/abis#v7a
-  armv7a-android =  {
-    name = "armeabi-v7a";
+  armv7a-android = {
+    linux-kernel.name = "armeabi-v7a";
     gcc = {
       arch = "armv7-a";
       float-abi = "softfp";
@@ -289,29 +294,31 @@ rec {
   };
 
   armv7l-hf-multiplatform = {
-    name = "armv7l-hf-multiplatform";
-    kernelBaseConfig = "multi_v7_defconfig";
-    kernelArch = "arm";
-    kernelDTB = true;
-    kernelAutoModules = true;
-    kernelPreferBuiltin = true;
-    kernelTarget = "zImage";
-    kernelExtraConfig = ''
-      # Serial port for Raspberry Pi 3. Upstream forgot to add it to the ARMv7 defconfig.
-      SERIAL_8250_BCM2835AUX y
-      SERIAL_8250_EXTENDED y
-      SERIAL_8250_SHARE_IRQ y
-
-      # Fix broken sunxi-sid nvmem driver.
-      TI_CPTS y
-
-      # Hangs ODROID-XU4
-      ARM_BIG_LITTLE_CPUIDLE n
-
-      # Disable OABI to have seccomp_filter (required for systemd)
-      # https://github.com/raspberrypi/firmware/issues/651
-      OABI_COMPAT n
-    '';
+    linux-kernel = {
+      name = "armv7l-hf-multiplatform";
+      Major = "2.6"; # Using "2.6" enables 2.6 kernel syscalls in glibc.
+      baseConfig = "multi_v7_defconfig";
+      DTB = true;
+      autoModules = true;
+      PreferBuiltin = true;
+      target = "zImage";
+      extraConfig = ''
+        # Serial port for Raspberry Pi 3. Upstream forgot to add it to the ARMv7 defconfig.
+        SERIAL_8250_BCM2835AUX y
+        SERIAL_8250_EXTENDED y
+        SERIAL_8250_SHARE_IRQ y
+
+        # Fix broken sunxi-sid nvmem driver.
+        TI_CPTS y
+
+        # Hangs ODROID-XU4
+        ARM_BIG_LITTLE_CPUIDLE n
+
+        # Disable OABI to have seccomp_filter (required for systemd)
+        # https://github.com/raspberrypi/firmware/issues/651
+        OABI_COMPAT n
+      '';
+    };
     gcc = {
       # Some table about fpu flags:
       # http://community.arm.com/servlet/JiveServlet/showImage/38-1981-3827/blogentry-103749-004812900+1365712953_thumb.png
@@ -336,34 +343,35 @@ rec {
   };
 
   aarch64-multiplatform = {
-    name = "aarch64-multiplatform";
-    kernelBaseConfig = "defconfig";
-    kernelArch = "arm64";
-    kernelDTB = true;
-    kernelAutoModules = true;
-    kernelPreferBuiltin = true;
-    kernelExtraConfig = ''
-      # Raspberry Pi 3 stuff. Not needed for kernels >= 4.10.
-      ARCH_BCM2835 y
-      BCM2835_MBOX y
-      BCM2835_WDT y
-      RASPBERRYPI_FIRMWARE y
-      RASPBERRYPI_POWER y
-      SERIAL_8250_BCM2835AUX y
-      SERIAL_8250_EXTENDED y
-      SERIAL_8250_SHARE_IRQ y
-
-      # Cavium ThunderX stuff.
-      PCI_HOST_THUNDER_ECAM y
-
-      # Nvidia Tegra stuff.
-      PCI_TEGRA y
-
-      # The default (=y) forces us to have the XHCI firmware available in initrd,
-      # which our initrd builder can't currently do easily.
-      USB_XHCI_TEGRA m
-    '';
-    kernelTarget = "Image";
+    linux-kernel = {
+      name = "aarch64-multiplatform";
+      baseConfig = "defconfig";
+      DTB = true;
+      autoModules = true;
+      preferBuiltin = true;
+      extraConfig = ''
+        # Raspberry Pi 3 stuff. Not needed for   s >= 4.10.
+        ARCH_BCM2835 y
+        BCM2835_MBOX y
+        BCM2835_WDT y
+        RASPBERRYPI_FIRMWARE y
+        RASPBERRYPI_POWER y
+        SERIAL_8250_BCM2835AUX y
+        SERIAL_8250_EXTENDED y
+        SERIAL_8250_SHARE_IRQ y
+
+        # Cavium ThunderX stuff.
+        PCI_HOST_THUNDER_ECAM y
+
+        # Nvidia Tegra stuff.
+        PCI_TEGRA y
+
+        # The default (=y) forces us to have the XHCI firmware available in initrd,
+        # which our initrd builder can't currently do easily.
+        USB_XHCI_TEGRA m
+      '';
+      target = "Image";
+    };
     gcc = {
       arch = "armv8-a";
     };
@@ -374,8 +382,9 @@ rec {
   ##
 
   ben_nanonote = {
-    name = "ben_nanonote";
-    kernelArch = "mips";
+    linux-kernel = {
+      name = "ben_nanonote";
+    };
     gcc = {
       arch = "mips32";
       float = "soft";
@@ -383,75 +392,76 @@ rec {
   };
 
   fuloong2f_n32 = {
-    name = "fuloong2f_n32";
-    kernelBaseConfig = "lemote2f_defconfig";
-    kernelArch = "mips";
-    kernelAutoModules = false;
-    kernelExtraConfig = ''
-      MIGRATION n
-      COMPACTION n
-
-      # nixos mounts some cgroup
-      CGROUPS y
-
-      BLK_DEV_RAM y
-      BLK_DEV_INITRD y
-      BLK_DEV_CRYPTOLOOP m
-      BLK_DEV_DM m
-      DM_CRYPT m
-      MD y
-      REISERFS_FS m
-      EXT4_FS m
-      USB_STORAGE_CYPRESS_ATACB m
-
-      IP_PNP y
-      IP_PNP_DHCP y
-      IP_PNP_BOOTP y
-      NFS_FS y
-      ROOT_NFS y
-      TUN m
-      NFS_V4 y
-      NFS_V4_1 y
-      NFS_FSCACHE y
-      NFSD m
-      NFSD_V2_ACL y
-      NFSD_V3 y
-      NFSD_V3_ACL y
-      NFSD_V4 y
-
-      # Fail to build
-      DRM n
-      SCSI_ADVANSYS n
-      USB_ISP1362_HCD n
-      SND_SOC n
-      SND_ALI5451 n
-      FB_SAVAGE n
-      SCSI_NSP32 n
-      ATA_SFF n
-      SUNGEM n
-      IRDA n
-      ATM_HE n
-      SCSI_ACARD n
-      BLK_DEV_CMD640_ENHANCED n
-
-      FUSE_FS m
-
-      # Needed for udev >= 150
-      SYSFS_DEPRECATED_V2 n
-
-      VGA_CONSOLE n
-      VT_HW_CONSOLE_BINDING y
-      SERIAL_8250_CONSOLE y
-      FRAMEBUFFER_CONSOLE y
-      EXT2_FS y
-      EXT3_FS y
-      REISERFS_FS y
-      MAGIC_SYSRQ y
-
-      # The kernel doesn't boot at all, with FTRACE
-      FTRACE n
-    '';
-    kernelTarget = "vmlinux";
+    linux-kernel = {
+      name = "fuloong2f_n32";
+      baseConfig = "lemote2f_defconfig";
+      autoModules = false;
+      extraConfig = ''
+        MIGRATION n
+        COMPACTION n
+
+        # nixos mounts some cgroup
+        CGROUPS y
+
+        BLK_DEV_RAM y
+        BLK_DEV_INITRD y
+        BLK_DEV_CRYPTOLOOP m
+        BLK_DEV_DM m
+        DM_CRYPT m
+        MD y
+        REISERFS_FS m
+        EXT4_FS m
+        USB_STORAGE_CYPRESS_ATACB m
+
+        IP_PNP y
+        IP_PNP_DHCP y
+        IP_PNP_BOOTP y
+        NFS_FS y
+        ROOT_NFS y
+        TUN m
+        NFS_V4 y
+        NFS_V4_1 y
+        NFS_FSCACHE y
+        NFSD m
+        NFSD_V2_ACL y
+        NFSD_V3 y
+        NFSD_V3_ACL y
+        NFSD_V4 y
+
+        # Fail to build
+        DRM n
+        SCSI_ADVANSYS n
+        USB_ISP1362_HCD n
+        SND_SOC n
+        SND_ALI5451 n
+        FB_SAVAGE n
+        SCSI_NSP32 n
+        ATA_SFF n
+        SUNGEM n
+        IRDA n
+        ATM_HE n
+        SCSI_ACARD n
+        BLK_DEV_CMD640_ENHANCED n
+
+        FUSE_FS m
+
+        # Needed for udev >= 150
+        SYSFS_DEPRECATED_V2 n
+
+        VGA_CONSOLE n
+        VT_HW_CONSOLE_BINDING y
+        SERIAL_8250_CONSOLE y
+        FRAMEBUFFER_CONSOLE y
+        EXT2_FS y
+        EXT3_FS y
+        REISERFS_FS y
+        MAGIC_SYSRQ y
+
+        # The kernel doesn't boot at all, with FTRACE
+        FTRACE n
+      '';
+      target = "vmlinux";
+    };
     gcc = {
       arch = "loongson2f";
       float = "hard";
@@ -464,34 +474,36 @@ rec {
   ##
 
   riscv-multiplatform = {
-    name = "riscv-multiplatform";
-    kernelArch = "riscv";
-    kernelTarget = "vmlinux";
-    kernelAutoModules = true;
-    kernelBaseConfig = "defconfig";
-    kernelExtraConfig = ''
-      FTRACE n
-      SERIAL_OF_PLATFORM y
-    '';
+    linux-kernel = {
+      name = "riscv-multiplatform";
+      target = "vmlinux";
+      autoModules = true;
+      baseConfig = "defconfig";
+      extraConfig = ''
+        FTRACE n
+        SERIAL_OF_PLATFORM y
+      '';
+    };
   };
 
   select = platform:
     # x86
-    /**/ if platform.isx86_32 then pc32
-    else if platform.isx86_64 then pc64
+    /**/ if platform.isx86 then pc
 
     # ARM
     else if platform.isAarch32 then let
       version = platform.parsed.cpu.version or null;
-      in     if version == null then pcBase
+      in     if version == null then pc
         else if lib.versionOlder version "6" then sheevaplug
         else if lib.versionOlder version "7" then raspberrypi
         else armv7l-hf-multiplatform
     else if platform.isAarch64 then aarch64-multiplatform
 
+    else if platform.isRiscV then riscv-multiplatform
+
     else if platform.parsed.cpu == lib.systems.parse.cpuTypes.mipsel then fuloong2f_n32
 
     else if platform.parsed.cpu == lib.systems.parse.cpuTypes.powerpc64le then powernv
 
-    else pcBase;
+    else pc;
 }
diff --git a/nixos/doc/manual/release-notes/rl-2103.xml b/nixos/doc/manual/release-notes/rl-2103.xml
index 94e42369b60..09455611fba 100644
--- a/nixos/doc/manual/release-notes/rl-2103.xml
+++ b/nixos/doc/manual/release-notes/rl-2103.xml
@@ -420,6 +420,26 @@ http://some.json-exporter.host:7979/probe?target=https://example.com/some/json/e
    </listitem>
    <listitem>
      <para>
+       The attribute <varname>mpi</varname> is now consistently used to
+       provide a default, system-wide MPI implementation.
+       The default implementation is openmpi, which has been used before by
+       all derivations affects by this change.
+       Note that all packages that have used <varname>mpi ? null</varname> in the input
+       for optional MPI builds, have been changed to the boolean input paramater
+       <varname>useMpi</varname> to enable building with MPI.
+
+       Building all packages with <varname>mpich</varname> instead
+       of the default <varname>openmpi</varname> can now be achived like this:
+       <programlisting>
+self: super:
+{
+ mpi = super.mpich;
+}
+       </programlisting>
+     </para>
+   </listitem>
+   <listitem>
+     <para>
       The Searx module has been updated with the ability to configure the
       service declaratively and uWSGI integration.
       The option <literal>services.searx.configFile</literal> has been renamed
@@ -603,6 +623,22 @@ http://some.json-exporter.host:7979/probe?target=https://example.com/some/json/e
      <literal>/etc/netgroup</literal> defines network-wide groups and may affect to setups using NIS.
     </para>
    </listitem>
+   <listitem>
+    <para>
+     Platforms, like <varname>stdenv.hostPlatform</varname>, no longer have a <varname>platform</varname> attribute.
+     It has been (mostly) flattoned away:
+    </para>
+    <itemizedlist>
+     <listitem><para><varname>platform.gcc</varname> is now <varname>gcc</varname></para></listitem>
+     <listitem><para><literal>platform.kernel*</literal> is now <literal>linux-kernel.*</literal></para></listitem>
+    </itemizedlist>
+    <para>
+     Additionally, <varname>platform.kernelArch</varname> moved to the top level as <varname>linuxArch</varname> to match the other <literal>*Arch</literal> variables.
+    </para>
+    <para>
+     The <varname>platform</varname> grouping of these things never meant anything, and was just a historial/implementation artifact that was overdue removal.
+    </para>
+   </listitem>
   </itemizedlist>
  </section>
 </section>
diff --git a/nixos/modules/hardware/device-tree.nix b/nixos/modules/hardware/device-tree.nix
index e0ab37bca63..4aa1d6369d1 100644
--- a/nixos/modules/hardware/device-tree.nix
+++ b/nixos/modules/hardware/device-tree.nix
@@ -68,11 +68,11 @@ let
       patchShebangs scripts/*
       substituteInPlace scripts/Makefile.lib \
         --replace 'DTC_FLAGS += $(DTC_FLAGS_$(basetarget))' 'DTC_FLAGS += $(DTC_FLAGS_$(basetarget)) -@'
-      make ${pkgs.stdenv.hostPlatform.platform.kernelBaseConfig} ARCH="${pkgs.stdenv.hostPlatform.platform.kernelArch}"
-      make dtbs ARCH="${pkgs.stdenv.hostPlatform.platform.kernelArch}"
+      make ${pkgs.stdenv.hostPlatform.linux-kernel.baseConfig} ARCH="${pkgs.stdenv.hostPlatform.linuxArch}"
+      make dtbs ARCH="${pkgs.stdenv.hostPlatform.linuxArch}"
     '';
     installPhase = ''
-      make dtbs_install INSTALL_DTBS_PATH=$out/dtbs  ARCH="${pkgs.stdenv.hostPlatform.platform.kernelArch}"
+      make dtbs_install INSTALL_DTBS_PATH=$out/dtbs  ARCH="${pkgs.stdenv.hostPlatform.linuxArch}"
     '';
   };
 
@@ -115,7 +115,7 @@ in
   options = {
       hardware.deviceTree = {
         enable = mkOption {
-          default = pkgs.stdenv.hostPlatform.platform.kernelDTB or false;
+          default = pkgs.stdenv.hostPlatform.linux-kernel.DTB or false;
           type = types.bool;
           description = ''
             Build device tree files. These are used to describe the
diff --git a/nixos/modules/installer/netboot/netboot.nix b/nixos/modules/installer/netboot/netboot.nix
index 95eba86bcb6..fa074fdfcc6 100644
--- a/nixos/modules/installer/netboot/netboot.nix
+++ b/nixos/modules/installer/netboot/netboot.nix
@@ -88,7 +88,7 @@ with lib;
 
     system.build.netbootIpxeScript = pkgs.writeTextDir "netboot.ipxe" ''
       #!ipxe
-      kernel ${pkgs.stdenv.hostPlatform.platform.kernelTarget} init=${config.system.build.toplevel}/init initrd=initrd ${toString config.boot.kernelParams}
+      kernel ${pkgs.stdenv.hostPlatform.linux-kernel.target} init=${config.system.build.toplevel}/init initrd=initrd ${toString config.boot.kernelParams}
       initrd initrd
       boot
     '';
diff --git a/nixos/modules/services/misc/nix-daemon.nix b/nixos/modules/services/misc/nix-daemon.nix
index 0eeff31d6c4..64bdbf159d5 100644
--- a/nixos/modules/services/misc/nix-daemon.nix
+++ b/nixos/modules/services/misc/nix-daemon.nix
@@ -587,10 +587,10 @@ in
 
     nix.systemFeatures = mkDefault (
       [ "nixos-test" "benchmark" "big-parallel" "kvm" ] ++
-      optionals (pkgs.hostPlatform.platform ? gcc.arch) (
-        # a builder can run code for `platform.gcc.arch` and inferior architectures
-        [ "gccarch-${pkgs.hostPlatform.platform.gcc.arch}" ] ++
-        map (x: "gccarch-${x}") lib.systems.architectures.inferiors.${pkgs.hostPlatform.platform.gcc.arch}
+      optionals (pkgs.hostPlatform ? gcc.arch) (
+        # a builder can run code for `gcc.arch` and inferior architectures
+        [ "gccarch-${pkgs.hostPlatform.gcc.arch}" ] ++
+        map (x: "gccarch-${x}") lib.systems.architectures.inferiors.${pkgs.hostPlatform.gcc.arch}
       )
     );
 
diff --git a/nixos/modules/services/networking/nomad.nix b/nixos/modules/services/networking/nomad.nix
index e6bbb607aaa..dafdae0c327 100644
--- a/nixos/modules/services/networking/nomad.nix
+++ b/nixos/modules/services/networking/nomad.nix
@@ -49,12 +49,20 @@ in
         '';
       };
 
+      extraSettingsPaths = mkOption {
+        type = types.listOf types.path;
+        default = [];
+        description = ''
+          Additional settings paths used to configure nomad. These can be files or directories.
+        '';
+        example = literalExample ''
+          [ "/etc/nomad-mutable.json" "/run/keys/nomad-with-secrets.json" "/etc/nomad/config.d" ]
+        '';
+      };
+
       settings = mkOption {
         type = format.type;
-        default = {
-          # Agrees with `StateDirectory = "nomad"` set below.
-          data_dir = "/var/lib/nomad";
-        };
+        default = {};
         description = ''
           Configuration for Nomad. See the <link xlink:href="https://www.nomadproject.io/docs/configuration">documentation</link>
           for supported values.
@@ -77,6 +85,11 @@ in
 
   ##### implementation
   config = mkIf cfg.enable {
+    services.nomad.settings = {
+      # Agrees with `StateDirectory = "nomad"` set below.
+      data_dir = mkDefault "/var/lib/nomad";
+    };
+
     environment = {
       etc."nomad.json".source = format.generate "nomad.json" cfg.settings;
       systemPackages = [ cfg.package ];
@@ -99,7 +112,8 @@ in
       serviceConfig = {
         DynamicUser = cfg.dropPrivileges;
         ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
-        ExecStart = "${cfg.package}/bin/nomad agent -config=/etc/nomad.json";
+        ExecStart = "${cfg.package}/bin/nomad agent -config=/etc/nomad.json" +
+          concatMapStrings (path: " -config=${path}") cfg.extraSettingsPaths;
         KillMode = "process";
         KillSignal = "SIGINT";
         LimitNOFILE = 65536;
@@ -114,6 +128,7 @@ in
       } // (optionalAttrs cfg.enableDocker {
         SupplementaryGroups = "docker"; # space-separated string
       });
+
       unitConfig = {
         StartLimitIntervalSec = 10;
         StartLimitBurst = 3;
diff --git a/nixos/modules/system/activation/top-level.nix b/nixos/modules/system/activation/top-level.nix
index 03d7e749323..b0f77ca3fb8 100644
--- a/nixos/modules/system/activation/top-level.nix
+++ b/nixos/modules/system/activation/top-level.nix
@@ -190,7 +190,7 @@ in
 
     system.boot.loader.kernelFile = mkOption {
       internal = true;
-      default = pkgs.stdenv.hostPlatform.platform.kernelTarget;
+      default = pkgs.stdenv.hostPlatform.linux-kernel.target;
       type = types.str;
       description = ''
         Name of the kernel file to be passed to the bootloader.
diff --git a/nixos/modules/system/boot/loader/generations-dir/generations-dir.nix b/nixos/modules/system/boot/loader/generations-dir/generations-dir.nix
index 2d27611946e..fee567a510b 100644
--- a/nixos/modules/system/boot/loader/generations-dir/generations-dir.nix
+++ b/nixos/modules/system/boot/loader/generations-dir/generations-dir.nix
@@ -59,7 +59,7 @@ in
 
     system.build.installBootLoader = generationsDirBuilder;
     system.boot.loader.id = "generationsDir";
-    system.boot.loader.kernelFile = platform.kernelTarget;
+    system.boot.loader.kernelFile = linux-kernel.target;
 
   };
 }
diff --git a/nixos/modules/system/boot/loader/grub/grub.nix b/nixos/modules/system/boot/loader/grub/grub.nix
index df5dfaa554b..289c2b19986 100644
--- a/nixos/modules/system/boot/loader/grub/grub.nix
+++ b/nixos/modules/system/boot/loader/grub/grub.nix
@@ -327,6 +327,26 @@ in
         '';
       };
 
+      extraInstallCommands = mkOption {
+        default = "";
+        example = literalExample ''
+          # the example below generates detached signatures that GRUB can verify
+          # https://www.gnu.org/software/grub/manual/grub/grub.html#Using-digital-signatures
+          ''${pkgs.findutils}/bin/find /boot -not -path "/boot/efi/*" -type f -name '*.sig' -delete
+          old_gpg_home=$GNUPGHOME
+          export GNUPGHOME="$(mktemp -d)"
+          ''${pkgs.gnupg}/bin/gpg --import ''${priv_key} > /dev/null 2>&1
+          ''${pkgs.findutils}/bin/find /boot -not -path "/boot/efi/*" -type f -exec ''${pkgs.gnupg}/bin/gpg --detach-sign "{}" \; > /dev/null 2>&1
+          rm -rf $GNUPGHOME
+          export GNUPGHOME=$old_gpg_home
+        '';
+        type = types.lines;
+        description = ''
+          Additional shell commands inserted in the bootloader installer
+          script after generating menu entries.
+        '';
+      };
+
       extraPerEntryConfig = mkOption {
         default = "";
         example = "root (hd0)";
@@ -715,7 +735,7 @@ in
         ${optionalString cfg.enableCryptodisk "export GRUB_ENABLE_CRYPTODISK=y"}
       '' + flip concatMapStrings cfg.mirroredBoots (args: ''
         ${pkgs.perl}/bin/perl ${install-grub-pl} ${grubConfig args} $@
-      ''));
+      '') + cfg.extraInstallCommands);
 
       system.build.grub = grub;
 
diff --git a/nixos/modules/system/boot/loader/raspberrypi/raspberrypi.nix b/nixos/modules/system/boot/loader/raspberrypi/raspberrypi.nix
index ba936b26573..db22dd36cbe 100644
--- a/nixos/modules/system/boot/loader/raspberrypi/raspberrypi.nix
+++ b/nixos/modules/system/boot/loader/raspberrypi/raspberrypi.nix
@@ -103,6 +103,6 @@ in
 
     system.build.installBootLoader = builder;
     system.boot.loader.id = "raspberrypi";
-    system.boot.loader.kernelFile = platform.kernelTarget;
+    system.boot.loader.kernelFile = linux-kernel.target;
   };
 }
diff --git a/nixos/release.nix b/nixos/release.nix
index 1f5c1581269..109747945f7 100644
--- a/nixos/release.nix
+++ b/nixos/release.nix
@@ -79,7 +79,7 @@ let
     in
       tarball //
         { meta = {
-            description = "NixOS system tarball for ${system} - ${stdenv.hostPlatform.platform.name}";
+            description = "NixOS system tarball for ${system} - ${stdenv.hostPlatform.linux-kernel.name}";
             maintainers = map (x: lib.maintainers.${x}) maintainers;
           };
           inherit config;
@@ -105,7 +105,7 @@ let
         modules = makeModules module {};
       };
       build = configEvaled.config.system.build;
-      kernelTarget = configEvaled.pkgs.stdenv.hostPlatform.platform.kernelTarget;
+      kernelTarget = configEvaled.pkgs.stdenv.hostPlatform.linux-kernel.target;
     in
       pkgs.symlinkJoin {
         name = "netboot";
diff --git a/nixos/tests/all-tests.nix b/nixos/tests/all-tests.nix
index 966c7844657..523d3c051e0 100644
--- a/nixos/tests/all-tests.nix
+++ b/nixos/tests/all-tests.nix
@@ -272,6 +272,7 @@ in
   nginx-variants = handleTest ./nginx-variants.nix {};
   nix-ssh-serve = handleTest ./nix-ssh-serve.nix {};
   nixos-generate-config = handleTest ./nixos-generate-config.nix {};
+  nomad = handleTest ./nomad.nix {};
   novacomd = handleTestOn ["x86_64-linux"] ./novacomd.nix {};
   nsd = handleTest ./nsd.nix {};
   nzbget = handleTest ./nzbget.nix {};
diff --git a/nixos/tests/nomad.nix b/nixos/tests/nomad.nix
new file mode 100644
index 00000000000..bd052152bd6
--- /dev/null
+++ b/nixos/tests/nomad.nix
@@ -0,0 +1,53 @@
+import ./make-test-python.nix (
+  { lib, ... }: {
+    name = "nomad";
+    nodes = {
+      server = { pkgs, lib, ... }: {
+        networking = {
+          interfaces.eth1.ipv4.addresses = lib.mkOverride 0 [{
+            address = "192.168.1.1";
+            prefixLength = 16;
+          }];
+        };
+
+        environment.etc."nomad.custom.json".source =
+          (pkgs.formats.json { }).generate "nomad.custom.json" {
+            region = "universe";
+            datacenter = "earth";
+          };
+
+        services.nomad = {
+          enable = true;
+
+          settings = {
+            server = {
+              enabled = true;
+              bootstrap_expect = 1;
+            };
+          };
+
+          extraSettingsPaths = [ "/etc/nomad.custom.json" ];
+          enableDocker = false;
+        };
+      };
+    };
+
+    testScript = ''
+      server.wait_for_unit("nomad.service")
+
+      # wait for healthy server
+      server.wait_until_succeeds(
+          "[ $(nomad operator raft list-peers | grep true | wc -l) == 1 ]"
+      )
+
+      # wait for server liveness
+      server.succeed("[ $(nomad server members | grep -o alive | wc -l) == 1 ]")
+
+      # check the region
+      server.succeed("nomad server members | grep -o universe")
+
+      # check the datacenter
+      server.succeed("[ $(nomad server members | grep -o earth | wc -l) == 1 ]")
+    '';
+  }
+)
diff --git a/pkgs/applications/audio/virtual-ans/default.nix b/pkgs/applications/audio/virtual-ans/default.nix
index dd7e8b062da..1cb9c0f18bf 100644
--- a/pkgs/applications/audio/virtual-ans/default.nix
+++ b/pkgs/applications/audio/virtual-ans/default.nix
@@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
   startScript = if stdenv.isx86_32 then "START_LINUX_X86"
     else        if stdenv.isx86_64 then "START_LINUX_X86_64"
     #else        if stdenv.isDarwin then "START_MACOS.app" # disabled because I cannot test on Darwin
-    else abort "Unsupported platform: ${stdenv.platform.kernelArch}.";
+    else abort "Unsupported platform: ${stdenv.hostPlatform.linuxArch}.";
 
   linuxExecutable = if stdenv.isx86_32 then "pixilang_linux_x86"
     else            if stdenv.isx86_64 then "pixilang_linux_x86_64"
diff --git a/pkgs/applications/editors/android-studio/default.nix b/pkgs/applications/editors/android-studio/default.nix
index d1eb7e58ef8..cbc5198f2f3 100644
--- a/pkgs/applications/editors/android-studio/default.nix
+++ b/pkgs/applications/editors/android-studio/default.nix
@@ -9,18 +9,18 @@ let
     inherit buildFHSUserEnv;
   };
   stableVersion = {
-    version = "4.1.1.0"; # "Android Studio 4.1.1"
-    build = "201.6953283";
-    sha256Hash = "sha256-aAMhhJWcVFdvEZt8fI3tF12Eg3TzlU+kUFMNeCYN1os=";
+    version = "4.1.2.0"; # "Android Studio 4.1.2"
+    build = "201.7042882";
+    sha256Hash = "1f9bclvyvm3sg9an7wxlfwd8jwnb9cl726dvggmysa6r7shc7xw9";
   };
   betaVersion = {
-    version = "4.2.0.18"; # "Android Studio 4.2 Beta 2"
-    build = "202.7008469";
-    sha256Hash = "0323i4mcib84z7bsy801640gadd2k8ps7vr9jbdpb6i9gma6klmh";
+    version = "4.2.0.19"; # "Android Studio 4.2 Beta 3"
+    build = "202.7033425";
+    sha256Hash = "037r99hn16y0fy6z6k90qf6yx5a4vvx6bl9rdyagdm16ry4bpiw4";
   };
   latestVersion = { # canary & dev
-    version = "2020.3.1.3"; # "Android Studio Arctic Fox Canary 3"
-    sha256Hash = "1nx78j3pqr8qgwprnzfy17w9jmkgiqnlbsw91jnslr9p9fd0ixcx";
+    version = "2020.3.1.4"; # "Android Studio Arctic Fox Canary 4"
+    sha256Hash = "05drh4grq0b37qg5nspf2c6vmvcc9x71al3xwc2ddjhmyj0f9sk4";
   };
 in {
   # Attributes are named by their corresponding release channels
diff --git a/pkgs/applications/editors/atom/default.nix b/pkgs/applications/editors/atom/default.nix
index 7a6d5b5cd91..e7a9a26f066 100644
--- a/pkgs/applications/editors/atom/default.nix
+++ b/pkgs/applications/editors/atom/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, pkgs, fetchurl, wrapGAppsHook, gvfs, gtk3, atomEnv }:
+{ lib, stdenv, pkgs, fetchurl, wrapGAppsHook, glib, gtk3, atomEnv }:
 
 let
   versions = {
@@ -54,7 +54,8 @@ let
 
     preFixup = ''
       gappsWrapperArgs+=(
-        --prefix "PATH" : "${gvfs}/bin"
+        # needed for gio executable to be able to delete files
+        --prefix "PATH" : "${glib.bin}/bin"
       )
     '';
 
diff --git a/pkgs/applications/editors/cudatext/default.nix b/pkgs/applications/editors/cudatext/default.nix
index bcdff1eff1f..2d9138bc32e 100644
--- a/pkgs/applications/editors/cudatext/default.nix
+++ b/pkgs/applications/editors/cudatext/default.nix
@@ -38,24 +38,20 @@ let
 in
 stdenv.mkDerivation rec {
   pname = "cudatext";
-  version = "1.118.2";
+  version = "1.122.3";
 
   src = fetchFromGitHub {
     owner = "Alexey-T";
     repo = "CudaText";
     rev = version;
-    sha256 = "0d6f4qfs7vifz7qkw2vkdjgd5w717wfpnxbc4qa4hs4g6y86ywmm";
+    sha256 = "1h56hj433z0n4l97zl1cwkjv0qvz4qmvf469zzjzf1nj4zj8px2b";
   };
 
-  patches = [
-    # Don't check for update
-    ./dont-check-update.patch
-  ];
-
   postPatch = ''
     substituteInPlace app/proc_globdata.pas \
       --replace "/usr/share/cudatext" "$out/share/cudatext" \
-      --replace "libpython3.so" "${python3}/lib/libpython3.so"
+      --replace "libpython3.so" "${python3}/lib/libpython${python3.pythonVersion}.so" \
+      --replace "AllowProgramUpdates:= true;" "AllowProgramUpdates:= false;"
   '';
 
   nativeBuildInputs = [ lazarus fpc ]
diff --git a/pkgs/applications/editors/cudatext/deps.json b/pkgs/applications/editors/cudatext/deps.json
index fc82ec4b8d1..89f6dbc75fa 100644
--- a/pkgs/applications/editors/cudatext/deps.json
+++ b/pkgs/applications/editors/cudatext/deps.json
@@ -1,33 +1,33 @@
 {
   "EncConv": {
     "owner": "Alexey-T",
-    "rev": "2020.06.15",
-    "sha256": "07dpvq3ppfq3b70i1smkf7vwdlzq8qnxs3fk94hi9h1z36bz2rw3"
+    "rev": "2021.01.01",
+    "sha256": "18fp7yz2rl80a6xw7v4bgc4092l74fb6p6z4yf312r7gw7b8naq6"
   },
   "ATBinHex-Lazarus": {
     "owner": "Alexey-T",
-    "rev": "2020.09.05",
-    "sha256": "022yx5vic4hnc9lz53wvr4h7hf0h71801dzlilj55x5mf8p59072"
+    "rev": "2020.11.22",
+    "sha256": "0dkvzm32ls03pfp40fxvsyrkfmyznc5yrj65cp4a8pp9kpkvzlz7"
   },
   "ATFlatControls": {
     "owner": "Alexey-T",
-    "rev": "2020.11.02",
-    "sha256": "0shihlm1hg74m04qyrj2iic2ik0x7qggihmnylvvdry3y79d07fy"
+    "rev": "2021.01.12",
+    "sha256": "1mavv3krs4srdp362prf4sncssxjh11la5j4lkx0wk5csrmd1pc9"
   },
   "ATSynEdit": {
     "owner": "Alexey-T",
-    "rev": "6560bc35a2cf31399be8713ac189216afabf9f01",
-    "sha256": "1bjnd6pcd9ddkvl7ma05z7f8svq609kljwc7gvbszc76hdb8d54x"
+    "rev": "2021.01.19",
+    "sha256": "0lpgfwljwh9mypscbpj5c7fivhza0hizjgqypval3v0209cx38d1"
   },
   "ATSynEdit_Cmp": {
     "owner": "Alexey-T",
-    "rev": "2459ea2a2e50050f7e6ee59a17a52aae05ca4433",
-    "sha256": "155cwcmr9f23j4x13pidvb3vcgglawkxxpizjw90ajwhmg831acr"
+    "rev": "2021.01.17",
+    "sha256": "14i4jdpbmh6sjpvbwipdvvmmqqw8wg592b34a9wdf2f9qxq2p4ly"
   },
   "EControl": {
     "owner": "Alexey-T",
-    "rev": "2020.10.04",
-    "sha256": "0ypbaca3y5biw2207yh3x5p28gm8g51qf7glm5622w3cgbrf9mdq"
+    "rev": "2021.01.12",
+    "sha256": "107zyd65vc72fl4mvyirhv2a9m47l9bs6gwqiwar7hrn02zns6bq"
   },
   "ATSynEdit_Ex": {
     "owner": "Alexey-T",
@@ -36,8 +36,8 @@
   },
   "Python-for-Lazarus": {
     "owner": "Alexey-T",
-    "rev": "2020.10.23",
-    "sha256": "1lljldqnixlh0j05fh594gccwzkgcxa50byq8wr9ld5ik5sf8khn"
+    "rev": "2021.01.16",
+    "sha256": "07qv3x1cm3r12gxfnqzxly6nff39bghwwgxzl2lxi1qbpqhcs2l5"
   },
   "Emmet-Pascal": {
     "owner": "Alexey-T",
@@ -46,8 +46,8 @@
   },
   "CudaText-lexers": {
     "owner": "Alexey-T",
-    "rev": "2020.08.10",
-    "sha256": "1gzs2psyfhb9si1qyacxzfjb3dz2v255hv7y4jlkbxdxv0kckqr6"
+    "rev": "2021.01.16",
+    "sha256": "13zyg0cm1c1662l3f7sy462pbc39l1cwm5214nx8ijngf8kgn2zh"
   },
   "bgrabitmap": {
     "owner": "bgrabitmap",
diff --git a/pkgs/applications/editors/cudatext/dont-check-update.patch b/pkgs/applications/editors/cudatext/dont-check-update.patch
deleted file mode 100644
index 5c896bc046c..00000000000
--- a/pkgs/applications/editors/cudatext/dont-check-update.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff --git i/app/formmain.pas w/app/formmain.pas
-index f6f37febb..cf993d75e 100644
---- i/app/formmain.pas
-+++ w/app/formmain.pas
-@@ -2156,6 +2156,7 @@ begin
-     false
-     {$endif};
-     *)
-+  mnuHelpCheckUpd.Enabled:=false;
- 
-   with AppPanels[cPaneSide] do
-   begin
diff --git a/pkgs/applications/editors/kakoune/plugins/kak-buffers.nix b/pkgs/applications/editors/kakoune/plugins/kak-buffers.nix
index 9db9d4fab73..7075ae3ef0a 100644
--- a/pkgs/applications/editors/kakoune/plugins/kak-buffers.nix
+++ b/pkgs/applications/editors/kakoune/plugins/kak-buffers.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ stdenv, fetchFromGitHub, lib }:
 stdenv.mkDerivation {
   name = "kak-buffers";
   version = "2019-04-03";
diff --git a/pkgs/applications/editors/kakoune/plugins/kak-powerline.nix b/pkgs/applications/editors/kakoune/plugins/kak-powerline.nix
index 731bb9e46d1..318ae2958b6 100644
--- a/pkgs/applications/editors/kakoune/plugins/kak-powerline.nix
+++ b/pkgs/applications/editors/kakoune/plugins/kak-powerline.nix
@@ -1,4 +1,4 @@
-{ stdenv, git, fetchFromGitHub }:
+{ stdenv, git, fetchFromGitHub, lib }:
 stdenv.mkDerivation {
   name = "kak-powerline";
   version = "2020-08-22";
diff --git a/pkgs/applications/editors/kakoune/plugins/kak-vertical-selection.nix b/pkgs/applications/editors/kakoune/plugins/kak-vertical-selection.nix
index ccc80ac8d81..2ef9d44854f 100644
--- a/pkgs/applications/editors/kakoune/plugins/kak-vertical-selection.nix
+++ b/pkgs/applications/editors/kakoune/plugins/kak-vertical-selection.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ stdenv, fetchFromGitHub, lib }:
 stdenv.mkDerivation {
   name = "kak-vertical-selection";
   version = "2019-04-11";
diff --git a/pkgs/applications/editors/setzer/default.nix b/pkgs/applications/editors/setzer/default.nix
index 5c62dc06a7d..334f8b79c4b 100644
--- a/pkgs/applications/editors/setzer/default.nix
+++ b/pkgs/applications/editors/setzer/default.nix
@@ -18,13 +18,13 @@
 
 python3.pkgs.buildPythonApplication rec {
   pname = "setzer";
-  version = "0.4.0";
+  version = "0.4.1";
 
   src = fetchFromGitHub {
     owner = "cvfosammmm";
     repo = "Setzer";
     rev = "v${version}";
-    sha256 = "036xbg65h255zlvz9l86sw6w9l4qfyf13x8p8ml7dj52hcdfvyb9";
+    sha256 = "1rcx2c07jg1ij81pnvg3px49hfbjmkagn68d3gp79z3gcajbp2av";
   };
 
   format = "other";
@@ -55,6 +55,10 @@ python3.pkgs.buildPythonApplication rec {
     pycairo
   ];
 
+  checkPhase = ''
+    meson test --print-errorlogs
+  '';
+
   meta = with lib; {
     description = "LaTeX editor written in Python with Gtk";
     homepage = src.meta.homepage;
diff --git a/pkgs/applications/graphics/paraview/default.nix b/pkgs/applications/graphics/paraview/default.nix
index 6e4738dd07c..7bbff5499f6 100644
--- a/pkgs/applications/graphics/paraview/default.nix
+++ b/pkgs/applications/graphics/paraview/default.nix
@@ -1,6 +1,6 @@
 { boost, cmake, fetchFromGitHub, ffmpeg, qtbase, qtx11extras,
   qttools, qtxmlpatterns, qtsvg, gdal, gfortran, libXt, makeWrapper,
-  mkDerivation, ninja, openmpi, python3, lib, stdenv, tbb, libGLU, libGL }:
+  mkDerivation, ninja, mpi, python3, lib, stdenv, tbb, libGLU, libGL }:
 
 mkDerivation rec {
   pname = "paraview";
@@ -65,7 +65,7 @@ mkDerivation rec {
   buildInputs = [
     libGLU libGL
     libXt
-    openmpi
+    mpi
     tbb
     boost
     ffmpeg
diff --git a/pkgs/applications/misc/genxword/default.nix b/pkgs/applications/misc/genxword/default.nix
index 215542003ad..f443618c685 100644
--- a/pkgs/applications/misc/genxword/default.nix
+++ b/pkgs/applications/misc/genxword/default.nix
@@ -10,13 +10,13 @@
 
 python3.pkgs.buildPythonApplication rec {
   pname = "genxword";
-  version = "2.0.1";
+  version = "2.1.0";
 
   src = fetchFromGitHub {
     owner = "riverrun";
     repo = pname;
     rev = "v${version}";
-    sha256 = "00czdvyb5wnrk3x0g529afisl8v4frfys9ih0nzf1fs4jkzjcijg";
+    sha256 = "17h8saja45bv612yk0pra9ncbp2mjnx5n10q25nqhl765ks4bmb5";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/applications/networking/cluster/terraform-providers/libvirt/default.nix b/pkgs/applications/networking/cluster/terraform-providers/libvirt/default.nix
index 6efdf77bfce..6a1f895c053 100644
--- a/pkgs/applications/networking/cluster/terraform-providers/libvirt/default.nix
+++ b/pkgs/applications/networking/cluster/terraform-providers/libvirt/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, buildGoPackage, fetchFromGitHub, libvirt, pkg-config, makeWrapper, cdrtools }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub, fetchpatch, libvirt, pkg-config, makeWrapper, cdrtools }:
 
 # USAGE:
 # install the following package globally or in nix-shell:
@@ -23,6 +23,14 @@ buildGoPackage rec {
 
   goPackagePath = "github.com/dmacvicar/terraform-provider-libvirt";
 
+  patches = [
+    (fetchpatch {
+      name = "base_volume_copy.patch";
+      url = "https://github.com/cyril-s/terraform-provider-libvirt/commit/52df264e8a28c40ce26e2b614ee3daea882931c3.patch";
+      sha256 = "1fg7ii2fi4c93hl41nhcncy9bpw3avbh6yiq99p1vkf87hhrw72n";
+    })
+  ];
+
   src = fetchFromGitHub {
     owner = "dmacvicar";
     repo = "terraform-provider-libvirt";
diff --git a/pkgs/applications/networking/irc/convos/default.nix b/pkgs/applications/networking/irc/convos/default.nix
index 5312bf9c147..9a42d0aa99b 100644
--- a/pkgs/applications/networking/irc/convos/default.nix
+++ b/pkgs/applications/networking/irc/convos/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, perl, perlPackages, makeWrapper, shortenPerlShebang
+{ lib, stdenv, fetchFromGitHub, perl, perlPackages, makeWrapper, shortenPerlShebang, openssl
 , nixosTests
 }:
 
@@ -6,26 +6,28 @@ with lib;
 
 perlPackages.buildPerlPackage rec {
   pname = "convos";
-  version = "5.00";
+  version = "5.11";
 
   src = fetchFromGitHub {
     owner = "Nordaaker";
     repo = pname;
     rev = version;
-    sha256 = "0mdbh9q1vclwgnjwvb3z637s7v804h65zxazbhmd7qi3zislnhg1";
+    sha256 = "08k8dqdgz2b3p8g1zfg9i74r5nm1w0sqdm759d1f3jcyp737r47x";
   };
 
   nativeBuildInputs = [ makeWrapper ]
     ++ optional stdenv.isDarwin [ shortenPerlShebang ];
 
   buildInputs = with perlPackages; [
-    CryptEksblowfish FileHomeDir FileReadBackwards
+    CryptEksblowfish FileHomeDir FileReadBackwards HTTPAcceptLanguage
     IOSocketSSL IRCUtils JSONValidator LinkEmbedder ModuleInstall
     Mojolicious MojoliciousPluginOpenAPI MojoliciousPluginWebpack
     ParseIRC TextMarkdown TimePiece UnicodeUTF8
     CpanelJSONXS EV
   ];
 
+  propagatedBuildInputs = [ openssl ];
+
   checkInputs = with perlPackages; [ TestDeep TestMore ];
 
   postPatch = ''
@@ -43,6 +45,15 @@ perlPackages.buildPerlPackage rec {
     substituteInPlace t/web-register-open-to-public.t \
       --replace '!127.0.0.1!' '!localhost!'
 
+    # A webirc test fails to resolve "localhost" likely due to sandboxing, we
+    # remove this test.
+    #
+    rm t/irc-webirc.t
+
+    # A web-user test fails on Darwin, we remove it.
+    #
+    rm t/web-user.t
+
     # Module::Install is a runtime dependency not covered by the tests, so we add
     # a test for it.
     #
diff --git a/pkgs/applications/office/pyspread/default.nix b/pkgs/applications/office/pyspread/default.nix
new file mode 100644
index 00000000000..5b7a80747d0
--- /dev/null
+++ b/pkgs/applications/office/pyspread/default.nix
@@ -0,0 +1,68 @@
+{ lib
+, buildPythonApplication
+, fetchPypi
+, makePythonPath
+, dateutil
+, matplotlib
+, numpy
+, pyenchant
+, pyqt5
+, pytest
+, python
+, qtsvg
+, runtimeShell
+, wrapQtAppsHook
+}:
+
+buildPythonApplication rec {
+  pname = "pyspread";
+  version = "1.99.5";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "sha256-05bC+Uvx72FAh3qxkgXm8jdb/gHRv1D/M7tjOEdE3Xg=";
+  };
+
+  pythonLibs = [
+    dateutil
+    matplotlib
+    numpy
+    pyenchant
+    pyqt5
+  ];
+
+  nativeBuildInputs = [ wrapQtAppsHook ];
+  buildInputs = pythonLibs ++ [
+    qtsvg
+  ];
+
+  doCheck = false; # it fails miserably with a core dump
+
+  fixupPhase = ''
+    runHook preFixup
+    sed -i -e "s|#!/bin/bash|#!${runtimeShell}|" $out/bin/pyspread
+    wrapProgram $out/bin/pyspread \
+      --prefix PYTHONPATH ':' $(toPythonPath $out):${makePythonPath pythonLibs} \
+      --prefix PATH ':' ${python}/bin/ \
+      ''${qtWrapperArgs[@]}
+    runHook postFixup
+  '';
+
+  meta = with lib; {
+    homepage = "https://pyspread.gitlab.io/";
+    description = "A Python-oriented spreadsheet application";
+    longDescription = ''
+      pyspread is a non-traditional spreadsheet application that is based on and
+      written in the programming language Python. The goal of pyspread is to be
+      the most pythonic spreadsheet.
+
+      pyspread expects Python expressions in its grid cells, which makes a
+      spreadsheet specific language obsolete. Each cell returns a Python object
+      that can be accessed from other cells. These objects can represent
+      anything including lists or matrices.
+    '';
+    license = with licenses; gpl3Plus;
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = with platforms; all;
+  };
+}
diff --git a/pkgs/applications/science/biology/migrate/default.nix b/pkgs/applications/science/biology/migrate/default.nix
index 0e2aa1c1a79..ba55898e4f9 100644
--- a/pkgs/applications/science/biology/migrate/default.nix
+++ b/pkgs/applications/science/biology/migrate/default.nix
@@ -1,4 +1,4 @@
-{ gccStdenv, fetchurl, zlib, openmpi }:
+{ gccStdenv, fetchurl, zlib, mpi }:
 
 gccStdenv.mkDerivation rec {
   version = "3.7.2";
@@ -9,7 +9,7 @@ gccStdenv.mkDerivation rec {
     sha256 = "1p2364ffjc56i82snzvjpy6pkf6wvqwvlvlqxliscx2c303fxs8v";
   };
 
-  buildInputs = [ zlib openmpi ];
+  buildInputs = [ zlib mpi ];
   setSourceRoot = ''sourceRoot=$(echo */src)'';
   buildFlags = [ "thread" "mpis" ];
   preInstall = "mkdir -p $out/man/man1";
diff --git a/pkgs/applications/science/biology/neuron/default.nix b/pkgs/applications/science/biology/neuron/default.nix
index 154965b1521..7bfef3a82fe 100644
--- a/pkgs/applications/science/biology/neuron/default.nix
+++ b/pkgs/applications/science/biology/neuron/default.nix
@@ -8,7 +8,8 @@
 , readline
 , which
 , python ? null
-, mpi ? null
+, useMpi ? false
+, mpi
 , iv
 }:
 
@@ -17,7 +18,8 @@ stdenv.mkDerivation rec {
   version = "7.5";
 
   nativeBuildInputs = [ which pkg-config automake autoconf libtool ];
-  buildInputs = [ ncurses readline python mpi iv ];
+  buildInputs = [ ncurses readline python iv ]
+    ++ lib.optional useMpi mpi;
 
   src = fetchurl {
     url = "https://www.neuron.yale.edu/ftp/neuron/versions/v${version}/nrn-${version}.tar.gz";
@@ -54,7 +56,7 @@ stdenv.mkDerivation rec {
   configureFlags = with lib;
                     [ "--with-readline=${readline}" "--with-iv=${iv}" ]
                     ++  optionals (python != null)  [ "--with-nrnpython=${python.interpreter}" ]
-                    ++ (if mpi != null then ["--with-mpi" "--with-paranrn"]
+                    ++ (if useMpi then ["--with-mpi" "--with-paranrn"]
                         else ["--without-mpi"]);
 
 
@@ -84,4 +86,3 @@ stdenv.mkDerivation rec {
     platforms   = platforms.x86_64 ++ platforms.i686;
   };
 }
-
diff --git a/pkgs/applications/science/biology/raxml/default.nix b/pkgs/applications/science/biology/raxml/default.nix
index 4f9b5aca1b2..6e747e318f5 100644
--- a/pkgs/applications/science/biology/raxml/default.nix
+++ b/pkgs/applications/science/biology/raxml/default.nix
@@ -1,7 +1,7 @@
 { lib, stdenv
 , fetchFromGitHub
-, pkgs
-, mpi ? false
+, useMpi ? false
+, mpi
 }:
 
 stdenv.mkDerivation rec {
@@ -15,16 +15,16 @@ stdenv.mkDerivation rec {
     sha256 = "1jqjzhch0rips0vp04prvb8vmc20c5pdmsqn8knadcf91yy859fh";
   };
 
-  buildInputs = lib.optionals mpi [ pkgs.openmpi ];
+  buildInputs = lib.optionals useMpi [ mpi ];
 
   # TODO darwin, AVX and AVX2 makefile targets
-  buildPhase = if mpi then ''
+  buildPhase = if useMpi then ''
       make -f Makefile.MPI.gcc
     '' else ''
       make -f Makefile.SSE3.PTHREADS.gcc
     '';
 
-  installPhase = if mpi then ''
+  installPhase = if useMpi then ''
     mkdir -p $out/bin && cp raxmlHPC-MPI $out/bin
   '' else ''
     mkdir -p $out/bin && cp raxmlHPC-PTHREADS-SSE3 $out/bin
diff --git a/pkgs/applications/science/chemistry/openmolcas/default.nix b/pkgs/applications/science/chemistry/openmolcas/default.nix
index 1297e595b9a..4bd88456b8f 100644
--- a/pkgs/applications/science/chemistry/openmolcas/default.nix
+++ b/pkgs/applications/science/chemistry/openmolcas/default.nix
@@ -1,6 +1,6 @@
 { lib, stdenv, fetchFromGitLab, cmake, gfortran, perl
 , openblas, hdf5-cpp, python3, texlive
-, armadillo, openmpi, globalarrays, openssh
+, armadillo, mpi, globalarrays, openssh
 , makeWrapper, fetchpatch
 } :
 
@@ -33,7 +33,7 @@ in stdenv.mkDerivation {
     hdf5-cpp
     python
     armadillo
-    openmpi
+    mpi
     globalarrays
     openssh
   ];
diff --git a/pkgs/applications/science/chemistry/quantum-espresso/default.nix b/pkgs/applications/science/chemistry/quantum-espresso/default.nix
index c7b1f901046..6d70e9f984f 100644
--- a/pkgs/applications/science/chemistry/quantum-espresso/default.nix
+++ b/pkgs/applications/science/chemistry/quantum-espresso/default.nix
@@ -1,6 +1,7 @@
 { lib, stdenv, fetchurl
 , gfortran, fftw, blas, lapack
-, mpi ? null
+, useMpi ? false
+, mpi
 }:
 
 stdenv.mkDerivation rec {
@@ -21,9 +22,9 @@ stdenv.mkDerivation rec {
   '';
 
   buildInputs = [ fftw blas lapack gfortran ]
-    ++ (lib.optionals (mpi != null) [ mpi ]);
+    ++ (lib.optionals useMpi [ mpi ]);
 
-configureFlags = if (mpi != null) then [ "LD=${mpi}/bin/mpif90" ] else [ "LD=${gfortran}/bin/gfortran" ];
+configureFlags = if useMpi then [ "LD=${mpi}/bin/mpif90" ] else [ "LD=${gfortran}/bin/gfortran" ];
 
   makeFlags = [ "all" ];
 
diff --git a/pkgs/applications/science/chemistry/siesta/default.nix b/pkgs/applications/science/chemistry/siesta/default.nix
index 0df953f7106..02ff4c1ca44 100644
--- a/pkgs/applications/science/chemistry/siesta/default.nix
+++ b/pkgs/applications/science/chemistry/siesta/default.nix
@@ -1,6 +1,7 @@
 { lib, stdenv, fetchurl
-, gfortran, blas, lapack
-, mpi ? null, scalapack
+, gfortran, blas, lapack, scalapack
+, useMpi ? false
+, mpi
 }:
 
 stdenv.mkDerivation {
@@ -17,7 +18,7 @@ stdenv.mkDerivation {
   };
 
   buildInputs = [ blas lapack gfortran ]
-    ++ (lib.optionals (mpi != null) [ mpi scalapack ]);
+    ++ lib.optionals useMpi [ mpi scalapack ];
 
   enableParallelBuilding = true;
 
@@ -29,7 +30,7 @@ stdenv.mkDerivation {
     cp gfortran.make arch.make
   '';
 
-  preBuild = if (mpi != null) then ''
+  preBuild = if useMpi then ''
     makeFlagsArray=(
         CC="mpicc" FC="mpifort"
         FPPFLAGS="-DMPI" MPI_INTERFACE="libmpi_f90.a" MPI_INCLUDE="."
diff --git a/pkgs/applications/science/electronics/openems/default.nix b/pkgs/applications/science/electronics/openems/default.nix
index e1063f8e26c..64afe3222c2 100644
--- a/pkgs/applications/science/electronics/openems/default.nix
+++ b/pkgs/applications/science/electronics/openems/default.nix
@@ -11,16 +11,15 @@
 , cmake
 , octave
 , gl2ps
+, mpi
 , withQcsxcad ? true
 , withMPI ? false
 , withHyp2mat ? true
 , qcsxcad ? null
-, openmpi ? null
 , hyp2mat ? null
 }:
 
 assert withQcsxcad -> qcsxcad != null;
-assert withMPI -> openmpi != null;
 assert withHyp2mat -> hyp2mat != null;
 
 stdenv.mkDerivation {
@@ -50,7 +49,7 @@ stdenv.mkDerivation {
     csxcad
     (octave.override { inherit hdf5; }) ]
     ++ lib.optionals withQcsxcad [ qcsxcad ]
-    ++ lib.optionals withMPI [ openmpi ]
+    ++ lib.optionals withMPI [ mpi ]
     ++ lib.optionals withHyp2mat [ hyp2mat ];
 
   postFixup = ''
diff --git a/pkgs/applications/science/math/cntk/default.nix b/pkgs/applications/science/math/cntk/default.nix
index a348210179e..e15e2a43d77 100644
--- a/pkgs/applications/science/math/cntk/default.nix
+++ b/pkgs/applications/science/math/cntk/default.nix
@@ -1,5 +1,5 @@
 { lib, stdenv, fetchgit, fetchFromGitHub, cmake
-, openblas, blas, lapack, opencv3, libzip, boost, protobuf, openmpi
+, openblas, blas, lapack, opencv3, libzip, boost, protobuf, mpi
 , onebitSGDSupport ? false
 , cudaSupport ? false, addOpenGLRunpath, cudatoolkit, nvidia_x11
 , cudnnSupport ? cudaSupport, cudnn
@@ -33,7 +33,7 @@ in stdenv.mkDerivation rec {
   # Force OpenMPI to use g++ in PATH.
   OMPI_CXX = "g++";
 
-  buildInputs = [ openblas opencv3 libzip boost protobuf openmpi ]
+  buildInputs = [ openblas opencv3 libzip boost protobuf mpi ]
              ++ lib.optional cudaSupport cudatoolkit
              ++ lib.optional cudnnSupport cudnn;
 
@@ -43,7 +43,7 @@ in stdenv.mkDerivation rec {
     "--with-openblas=${openblas}"
     "--with-boost=${boost.dev}"
     "--with-protobuf=${protobuf}"
-    "--with-mpi=${openmpi}"
+    "--with-mpi=${mpi}"
     "--cuda=${if cudaSupport then "yes" else "no"}"
     # FIXME
     "--asgd=no"
diff --git a/pkgs/applications/science/math/getdp/default.nix b/pkgs/applications/science/math/getdp/default.nix
index 915c7e1147f..39d9c866cae 100644
--- a/pkgs/applications/science/math/getdp/default.nix
+++ b/pkgs/applications/science/math/getdp/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, cmake, gfortran, blas, lapack, openmpi, petsc, python3 }:
+{ lib, stdenv, fetchurl, cmake, gfortran, blas, lapack, mpi, petsc, python3 }:
 
 stdenv.mkDerivation rec {
   name = "getdp-${version}";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ cmake gfortran ];
-  buildInputs = [ blas lapack openmpi petsc python3 ];
+  buildInputs = [ blas lapack mpi petsc python3 ];
 
   meta = with lib; {
     description = "A General Environment for the Treatment of Discrete Problems";
diff --git a/pkgs/applications/science/math/scotch/default.nix b/pkgs/applications/science/math/scotch/default.nix
index 6f8753ff38a..b6613f25cbc 100644
--- a/pkgs/applications/science/math/scotch/default.nix
+++ b/pkgs/applications/science/math/scotch/default.nix
@@ -1,11 +1,11 @@
-{ lib, stdenv, fetchurl, bison, openmpi, flex, zlib}:
+{ lib, stdenv, fetchurl, bison, mpi, flex, zlib}:
 
 stdenv.mkDerivation rec {
   version = "6.0.4";
   pname = "scotch";
   src_name = "scotch_${version}";
 
-  buildInputs = [ bison openmpi flex zlib ];
+  buildInputs = [ bison mpi flex zlib ];
 
   src = fetchurl {
     url = "https://gforge.inria.fr/frs/download.php/file/34618/${src_name}.tar.gz";
diff --git a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
index c40faddbbf9..bdec2ccc669 100644
--- a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
+++ b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
@@ -3,10 +3,10 @@
 , cmake
 , hwloc
 , fftw
-, openmpi
 , perl
 , singlePrec ? true
 , mpiEnabled ? false
+, mpi
 , cpuAcceleration ? null
 }:
 
@@ -33,7 +33,7 @@ in stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ fftw perl hwloc ]
-  ++ (lib.optionals mpiEnabled [ openmpi ]);
+  ++ (lib.optionals mpiEnabled [ mpi ]);
 
   cmakeFlags = [
     "-DGMX_SIMD:STRING=${SIMD cpuAcceleration}"
diff --git a/pkgs/applications/science/molecular-dynamics/lammps/default.nix b/pkgs/applications/science/molecular-dynamics/lammps/default.nix
index 123afef03e8..51ce64115ea 100644
--- a/pkgs/applications/science/molecular-dynamics/lammps/default.nix
+++ b/pkgs/applications/science/molecular-dynamics/lammps/default.nix
@@ -1,6 +1,7 @@
 { lib, stdenv, fetchFromGitHub
 , libpng, gzip, fftw, blas, lapack
-, mpi ? null
+, withMPI ? false
+, mpi
 }:
 let packages = [
      "asphere" "body" "class2" "colloid" "compress" "coreshell"
@@ -8,7 +9,6 @@ let packages = [
      "opt" "peri" "qeq" "replica" "rigid" "shock" "snap" "srd" "user-reaxc"
     ];
     lammps_includes = "-DLAMMPS_EXCEPTIONS -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64";
-    withMPI = (mpi != null);
 in
 stdenv.mkDerivation rec {
   # LAMMPS has weird versioning converted to ISO 8601 format
diff --git a/pkgs/applications/science/physics/elmerfem/default.nix b/pkgs/applications/science/physics/elmerfem/default.nix
index 6fa25ce66ae..5033b28bd3b 100644
--- a/pkgs/applications/science/physics/elmerfem/default.nix
+++ b/pkgs/applications/science/physics/elmerfem/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, cmake, git, gfortran, openmpi, blas, liblapack, qt4, qwt6_qt4, pkg-config }:
+{ lib, stdenv, fetchFromGitHub, cmake, git, gfortran, mpi, blas, liblapack, qt4, qwt6_qt4, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "elmerfem";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   hardeningDisable = [ "format" ];
 
   nativeBuildInputs = [ cmake pkg-config git ];
-  buildInputs = [ gfortran openmpi blas liblapack qt4 qwt6_qt4 ];
+  buildInputs = [ gfortran mpi blas liblapack qt4 qwt6_qt4 ];
 
   preConfigure = ''
     patchShebangs ./
diff --git a/pkgs/applications/system/glances/default.nix b/pkgs/applications/system/glances/default.nix
index b0bd5cc8b15..0def36f0444 100644
--- a/pkgs/applications/system/glances/default.nix
+++ b/pkgs/applications/system/glances/default.nix
@@ -9,14 +9,14 @@
 
 buildPythonApplication rec {
   pname = "glances";
-  version = "3.1.5";
+  version = "3.1.6";
   disabled = isPyPy;
 
   src = fetchFromGitHub {
     owner = "nicolargo";
     repo = "glances";
     rev = "v${version}";
-    sha256 = "0l91nvlwyabxlsy5p533dqnc68mmvykfsrcsnxylcpjjl1nzy931";
+    sha256 = "sha256-uPqHXRwQQQZsttiLuqgr+dcAna+BVZtym4YEmTPLkXk=";
   };
 
   # Some tests fail in the sandbox (they e.g. require access to /sys/class/power_supply):
diff --git a/pkgs/applications/virtualization/crosvm/default.nix b/pkgs/applications/virtualization/crosvm/default.nix
index 3ad540e5307..848b93a5381 100644
--- a/pkgs/applications/virtualization/crosvm/default.nix
+++ b/pkgs/applications/virtualization/crosvm/default.nix
@@ -75,7 +75,7 @@ in
 
     CROSVM_CARGO_TEST_KERNEL_BINARY =
       lib.optionalString (stdenv.buildPlatform == stdenv.hostPlatform)
-        "${linux}/${stdenv.hostPlatform.platform.kernelTarget}";
+        "${linux}/${stdenv.hostPlatform.linux-kernel.target}";
 
     passthru = {
       inherit adhdSrc;
diff --git a/pkgs/applications/virtualization/docker/default.nix b/pkgs/applications/virtualization/docker/default.nix
index 28075360f69..ed30c380a2c 100644
--- a/pkgs/applications/virtualization/docker/default.nix
+++ b/pkgs/applications/virtualization/docker/default.nix
@@ -169,7 +169,7 @@ rec {
       substituteInPlace ./scripts/docs/generate-man.sh --replace "-v md2man" "-v go-md2man"
       substituteInPlace ./man/md2man-all.sh            --replace md2man go-md2man
     '' + optionalString buildxSupport ''
-      substituteInPlace ./components/cli/cli-plugins/manager/manager_unix.go --replace /usr/libexec/docker/cli-plugins \
+      substituteInPlace ./cli-plugins/manager/manager_unix.go --replace /usr/libexec/docker/cli-plugins \
           ${lib.strings.makeSearchPathOutput "bin" "libexec/docker/cli-plugins" [docker-buildx]}
     '';
 
diff --git a/pkgs/applications/virtualization/vpcs/default.nix b/pkgs/applications/virtualization/vpcs/default.nix
index 33d707a5007..8c41a1f4c27 100644
--- a/pkgs/applications/virtualization/vpcs/default.nix
+++ b/pkgs/applications/virtualization/vpcs/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   buildPhase = ''(
     cd src
-    ./mk.sh ${stdenv.buildPlatform.platform.kernelArch}
+    ./mk.sh ${stdenv.buildPlatform.linuxArch}
   )'';
 
   installPhase = ''
diff --git a/pkgs/build-support/bintools-wrapper/default.nix b/pkgs/build-support/bintools-wrapper/default.nix
index bd3ebdf800e..e0d43739668 100644
--- a/pkgs/build-support/bintools-wrapper/default.nix
+++ b/pkgs/build-support/bintools-wrapper/default.nix
@@ -190,7 +190,7 @@ stdenv.mkDerivation {
       else if targetPlatform.isRiscV then "lriscv"
       else throw "unknown emulation for platform: ${targetPlatform.config}";
     in if targetPlatform.useLLVM or false then ""
-       else targetPlatform.platform.bfdEmulation or (fmt + sep + arch);
+       else targetPlatform.bfdEmulation or (fmt + sep + arch);
 
   strictDeps = true;
   depsTargetTargetPropagated = extraPackages;
diff --git a/pkgs/build-support/cc-wrapper/default.nix b/pkgs/build-support/cc-wrapper/default.nix
index d1d5f8e6c86..e0153ffc17f 100644
--- a/pkgs/build-support/cc-wrapper/default.nix
+++ b/pkgs/build-support/cc-wrapper/default.nix
@@ -402,32 +402,32 @@ stdenv.mkDerivation {
     # Always add -march based on cpu in triple. Sometimes there is a
     # discrepency (x86_64 vs. x86-64), so we provide an "arch" arg in
     # that case.
-    + optionalString ((targetPlatform ? platform.gcc.arch) &&
-                      isGccArchSupported targetPlatform.platform.gcc.arch) ''
-      echo "-march=${targetPlatform.platform.gcc.arch}" >> $out/nix-support/cc-cflags-before
+    + optionalString ((targetPlatform ? gcc.arch) &&
+                      isGccArchSupported targetPlatform.gcc.arch) ''
+      echo "-march=${targetPlatform.gcc.arch}" >> $out/nix-support/cc-cflags-before
     ''
 
     # -mcpu is not very useful. You should use mtune and march
     # instead. It’s provided here for backwards compatibility.
-    + optionalString (targetPlatform ? platform.gcc.cpu) ''
-      echo "-mcpu=${targetPlatform.platform.gcc.cpu}" >> $out/nix-support/cc-cflags-before
+    + optionalString (targetPlatform ? gcc.cpu) ''
+      echo "-mcpu=${targetPlatform.gcc.cpu}" >> $out/nix-support/cc-cflags-before
     ''
 
     # -mfloat-abi only matters on arm32 but we set it here
     # unconditionally just in case. If the abi specifically sets hard
     # vs. soft floats we use it here.
-    + optionalString (targetPlatform ? platform.gcc.float-abi) ''
-      echo "-mfloat-abi=${targetPlatform.platform.gcc.float-abi}" >> $out/nix-support/cc-cflags-before
+    + optionalString (targetPlatform ? gcc.float-abi) ''
+      echo "-mfloat-abi=${targetPlatform.gcc.float-abi}" >> $out/nix-support/cc-cflags-before
     ''
-    + optionalString (targetPlatform ? platform.gcc.fpu) ''
-      echo "-mfpu=${targetPlatform.platform.gcc.fpu}" >> $out/nix-support/cc-cflags-before
+    + optionalString (targetPlatform ? gcc.fpu) ''
+      echo "-mfpu=${targetPlatform.gcc.fpu}" >> $out/nix-support/cc-cflags-before
     ''
-    + optionalString (targetPlatform ? platform.gcc.mode) ''
-      echo "-mmode=${targetPlatform.platform.gcc.mode}" >> $out/nix-support/cc-cflags-before
+    + optionalString (targetPlatform ? gcc.mode) ''
+      echo "-mmode=${targetPlatform.gcc.mode}" >> $out/nix-support/cc-cflags-before
     ''
-    + optionalString (targetPlatform ? platform.gcc.tune &&
-                      isGccArchSupported targetPlatform.platform.gcc.tune) ''
-      echo "-mtune=${targetPlatform.platform.gcc.tune}" >> $out/nix-support/cc-cflags-before
+    + optionalString (targetPlatform ? gcc.tune &&
+                      isGccArchSupported targetPlatform.gcc.tune) ''
+      echo "-mtune=${targetPlatform.gcc.tune}" >> $out/nix-support/cc-cflags-before
     ''
 
     # TODO: categorize these and figure out a better place for them
diff --git a/pkgs/build-support/kernel/make-initrd.nix b/pkgs/build-support/kernel/make-initrd.nix
index 901eb311a88..9af40d33242 100644
--- a/pkgs/build-support/kernel/make-initrd.nix
+++ b/pkgs/build-support/kernel/make-initrd.nix
@@ -56,13 +56,13 @@ in
 , prepend ? []
 
 # Whether to wrap the initramfs in a u-boot image.
-, makeUInitrd ? stdenvNoCC.hostPlatform.platform.kernelTarget == "uImage"
+, makeUInitrd ? stdenvNoCC.hostPlatform.linux-kernel.target == "uImage"
 
 # If generating a u-boot image, the architecture to use. The default
 # guess may not align with u-boot's nomenclature correctly, so it can
 # be overridden.
 # See https://gitlab.denx.de/u-boot/u-boot/-/blob/9bfb567e5f1bfe7de8eb41f8c6d00f49d2b9a426/common/image.c#L81-106 for a list.
-, uInitrdArch ? stdenvNoCC.hostPlatform.kernelArch
+, uInitrdArch ? stdenvNoCC.hostPlatform.linuxArch
 
 # The name of the compression, as recognised by u-boot.
 # See https://gitlab.denx.de/u-boot/u-boot/-/blob/9bfb567e5f1bfe7de8eb41f8c6d00f49d2b9a426/common/image.c#L195-204 for a list.
diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix
index 5f3c7e1d621..215782368f6 100644
--- a/pkgs/build-support/vm/default.nix
+++ b/pkgs/build-support/vm/default.nix
@@ -1,6 +1,6 @@
 { pkgs
 , kernel ? pkgs.linux
-, img ? pkgs.stdenv.hostPlatform.platform.kernelTarget
+, img ? pkgs.stdenv.hostPlatform.linux-kernel.target
 , storeDir ? builtins.storeDir
 , rootModules ?
     [ "virtio_pci" "virtio_mmio" "virtio_blk" "virtio_balloon" "virtio_rng" "ext4" "unix" "9p" "9pnet_virtio" "crc32c_generic" ]
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/compilers/elm/default.nix b/pkgs/development/compilers/elm/default.nix
index 459efde218a..7ee9e6e5d61 100644
--- a/pkgs/development/compilers/elm/default.nix
+++ b/pkgs/development/compilers/elm/default.nix
@@ -2,7 +2,8 @@
 , haskell, nodejs
 , fetchurl, fetchpatch, makeWrapper, writeScriptBin
   # Rust dependecies
-, rustPlatform, openssl, pkg-config }:
+, rustPlatform, openssl, pkg-config, Security
+}:
 let
   fetchElmDeps = import ./fetchElmDeps.nix { inherit stdenv lib fetchurl; };
 
@@ -96,7 +97,7 @@ let
 
   elmRustPackages =  {
     elm-json = import ./packages/elm-json.nix {
-      inherit rustPlatform fetchurl openssl stdenv pkg-config;
+      inherit lib rustPlatform fetchurl openssl stdenv pkg-config Security;
     } // {
       meta = with lib; {
         description = "Install, upgrade and uninstall Elm dependencies";
diff --git a/pkgs/development/compilers/elm/packages/elm-json.nix b/pkgs/development/compilers/elm/packages/elm-json.nix
index 7a8143174f9..810c1a91a00 100644
--- a/pkgs/development/compilers/elm/packages/elm-json.nix
+++ b/pkgs/development/compilers/elm/packages/elm-json.nix
@@ -1,4 +1,4 @@
-{ rustPlatform, fetchurl, openssl, stdenv, pkg-config }:
+{ lib, rustPlatform, fetchurl, openssl, stdenv, pkg-config, Security }:
 rustPlatform.buildRustPackage rec {
   pname = "elm-json";
   version = "0.2.7";
@@ -12,7 +12,7 @@ rustPlatform.buildRustPackage rec {
 
   nativeBuildInputs = [ pkg-config ];
 
-  buildInputs = [ openssl ];
+  buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security ];
 
   cargoSha256 = "0ylniriq073kpiykamkn9mxdaa6kyiza4pvf7gnfq2h1dvbqa6z7";
 
diff --git a/pkgs/development/compilers/gcc/common/platform-flags.nix b/pkgs/development/compilers/gcc/common/platform-flags.nix
index f3cdce41193..66af8c4a4cc 100644
--- a/pkgs/development/compilers/gcc/common/platform-flags.nix
+++ b/pkgs/development/compilers/gcc/common/platform-flags.nix
@@ -1,7 +1,7 @@
 { lib, targetPlatform }:
 
 let
-  p =  targetPlatform.platform.gcc or {}
+  p =  targetPlatform.gcc or {}
     // targetPlatform.parsed.abi;
 in lib.concatLists [
   (lib.optional (!targetPlatform.isx86_64 && p ? arch) "--with-arch=${p.arch}") # --with-arch= is unknown flag on x86_64
diff --git a/pkgs/development/compilers/julia/1.0.nix b/pkgs/development/compilers/julia/1.0.nix
index 77683e28628..98d7ce90de3 100644
--- a/pkgs/development/compilers/julia/1.0.nix
+++ b/pkgs/development/compilers/julia/1.0.nix
@@ -123,7 +123,7 @@ stdenv.mkDerivation rec {
     let
       arch = lib.head (lib.splitString "-" stdenv.system);
       march = {
-        x86_64 = stdenv.hostPlatform.platform.gcc.arch or "x86-64";
+        x86_64 = stdenv.hostPlatform.gcc.arch or "x86-64";
         i686 = "pentium4";
         aarch64 = "armv8-a";
       }.${arch}
diff --git a/pkgs/development/compilers/julia/1.3.nix b/pkgs/development/compilers/julia/1.3.nix
index 4ee9be5df2d..da60fa8b988 100644
--- a/pkgs/development/compilers/julia/1.3.nix
+++ b/pkgs/development/compilers/julia/1.3.nix
@@ -73,7 +73,7 @@ stdenv.mkDerivation rec {
     let
       arch = head (splitString "-" stdenv.system);
       march = {
-        x86_64 = stdenv.hostPlatform.platform.gcc.arch or "x86-64";
+        x86_64 = stdenv.hostPlatform.gcc.arch or "x86-64";
         i686 = "pentium4";
         aarch64 = "armv8-a";
       }.${arch}
diff --git a/pkgs/development/compilers/julia/1.5.nix b/pkgs/development/compilers/julia/1.5.nix
index c0cf86ca7ae..a523336b7b9 100644
--- a/pkgs/development/compilers/julia/1.5.nix
+++ b/pkgs/development/compilers/julia/1.5.nix
@@ -71,7 +71,7 @@ stdenv.mkDerivation rec {
     let
       arch = head (splitString "-" stdenv.system);
       march = {
-        x86_64 = stdenv.hostPlatform.platform.gcc.arch or "x86-64";
+        x86_64 = stdenv.hostPlatform.gcc.arch or "x86-64";
         i686 = "pentium4";
         aarch64 = "armv8-a";
       }.${arch}
diff --git a/pkgs/development/compilers/llvm/11/llvm.nix b/pkgs/development/compilers/llvm/11/llvm.nix
index 002d6f82a8e..868da1a5b20 100644
--- a/pkgs/development/compilers/llvm/11/llvm.nix
+++ b/pkgs/development/compilers/llvm/11/llvm.nix
@@ -122,7 +122,7 @@ in stdenv.mkDerivation (rec {
     "-DCAN_TARGET_i386=false"
   ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     "-DCMAKE_CROSSCOMPILING=True"
-    "-DLLVM_TABLEGEN=${buildPackages.llvm_10}/bin/llvm-tblgen"
+    "-DLLVM_TABLEGEN=${buildPackages.llvm_11}/bin/llvm-tblgen"
   ];
 
   postBuild = ''
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/interpreters/acl2/default.nix b/pkgs/development/interpreters/acl2/default.nix
index 83b54e442aa..c089916158b 100644
--- a/pkgs/development/interpreters/acl2/default.nix
+++ b/pkgs/development/interpreters/acl2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, callPackage, fetchFromGitHub, writeShellScriptBin, substituteAll
+{ lib, stdenv, callPackage, fetchFromGitHub, writeShellScriptBin, substituteAll
 , sbcl, bash, which, perl, nettools
 , openssl, glucose, minisat, abc-verifier, z3, python2
 , certifyBooks ? true
@@ -39,7 +39,7 @@ in stdenv.mkDerivation rec {
   buildInputs = [
     # ACL2 itself only needs a Common Lisp compiler/interpreter:
     sbcl
-  ] ++ stdenv.lib.optionals certifyBooks [
+  ] ++ lib.optionals certifyBooks [
     # To build community books, we need Perl and a couple of utilities:
     which perl nettools
     # Some of the books require one or more of these external tools:
@@ -55,7 +55,7 @@ in stdenv.mkDerivation rec {
   preConfigure = ''
     # When certifying books, ACL2 doesn't like $HOME not existing.
     export HOME=$(pwd)/fake-home
-  '' + stdenv.lib.optionalString certifyBooks ''
+  '' + lib.optionalString certifyBooks ''
     # Some books also care about $USER being nonempty.
     export USER=nobody
   '';
@@ -79,7 +79,7 @@ in stdenv.mkDerivation rec {
   installPhase = ''
     mkdir -p $out/bin
     ln -s $out/share/${pname}/saved_acl2           $out/bin/${pname}
-  '' + stdenv.lib.optionalString certifyBooks ''
+  '' + lib.optionalString certifyBooks ''
     ln -s $out/share/${pname}/books/build/cert.pl  $out/bin/${pname}-cert
     ln -s $out/share/${pname}/books/build/clean.pl $out/bin/${pname}-clean
   '';
@@ -100,7 +100,7 @@ in stdenv.mkDerivation rec {
     rm -rf $out/share/${pname}/books
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An interpreter and a prover for a Lisp dialect";
     longDescription = ''
       ACL2 is a logic and programming language in which you can model computer
diff --git a/pkgs/development/interpreters/acl2/libipasirglucose4/default.nix b/pkgs/development/interpreters/acl2/libipasirglucose4/default.nix
index 5186cd69584..b9a61b88a30 100644
--- a/pkgs/development/interpreters/acl2/libipasirglucose4/default.nix
+++ b/pkgs/development/interpreters/acl2/libipasirglucose4/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, zlib, unzip }:
+{ lib, stdenv, fetchurl, zlib, unzip }:
 
 stdenv.mkDerivation rec {
   pname = "libipasirglucose4";
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
     install -D libipasirglucose4.so $out/lib/libipasirglucose4.so
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Shared library providing IPASIR interface to the Glucose SAT solver";
     license = licenses.mit;
     platforms = platforms.unix;
diff --git a/pkgs/development/interpreters/alda/default.nix b/pkgs/development/interpreters/alda/default.nix
index b82b0b978f9..19e90a00e6c 100644
--- a/pkgs/development/interpreters/alda/default.nix
+++ b/pkgs/development/interpreters/alda/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, jre }:
+{ lib, stdenv, fetchurl, jre }:
 
 stdenv.mkDerivation rec {
   pname = "alda";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
     sed -i -e '1 s!java!${jre}/bin/java!' $out/bin/alda
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A music programming language for musicians";
     homepage = "https://alda.io";
     license = licenses.epl10;
diff --git a/pkgs/development/interpreters/angelscript/2.22.nix b/pkgs/development/interpreters/angelscript/2.22.nix
index 15e7f4dd5c1..922d964e8ab 100644
--- a/pkgs/development/interpreters/angelscript/2.22.nix
+++ b/pkgs/development/interpreters/angelscript/2.22.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, unzip}:
+{lib, stdenv, fetchurl, unzip}:
 let
   s = # Generated upstream information
   rec {
@@ -35,9 +35,9 @@ stdenv.mkDerivation {
   meta = {
     inherit (s) version;
     description = "Light-weight scripting library";
-    license = stdenv.lib.licenses.zlib ;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.zlib ;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.linux;
     badPlatforms = [ "aarch64-linux" ];
     downloadPage = "http://www.angelcode.com/angelscript/downloads.html";
     homepage="http://www.angelcode.com/angelscript/";
diff --git a/pkgs/development/interpreters/angelscript/default.nix b/pkgs/development/interpreters/angelscript/default.nix
index f4139a37eea..fb8c6b2844d 100644
--- a/pkgs/development/interpreters/angelscript/default.nix
+++ b/pkgs/development/interpreters/angelscript/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, unzip}:
+{lib, stdenv, fetchurl, unzip}:
 let
   s = # Generated upstream information
   rec {
@@ -29,9 +29,9 @@ stdenv.mkDerivation {
   meta = {
     inherit (s) version;
     description = "Light-weight scripting library";
-    license = stdenv.lib.licenses.zlib ;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.zlib ;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.linux;
     downloadPage = "http://www.angelcode.com/angelscript/downloads.html";
     homepage="http://www.angelcode.com/angelscript/";
   };
diff --git a/pkgs/development/interpreters/ceptre/default.nix b/pkgs/development/interpreters/ceptre/default.nix
index de12185b96f..a9b8f54ab87 100644
--- a/pkgs/development/interpreters/ceptre/default.nix
+++ b/pkgs/development/interpreters/ceptre/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, mlton }:
+{ lib, stdenv, fetchgit, mlton }:
 
 stdenv.mkDerivation {
   name = "ceptre-2016-11-27";
@@ -16,7 +16,7 @@ stdenv.mkDerivation {
     cp ceptre $out/bin
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A linear logic programming language for modeling generative interactive systems";
     homepage = "https://github.com/chrisamaphone/interactive-lp";
     maintainers = with maintainers; [ pSub ];
diff --git a/pkgs/development/interpreters/chibi/default.nix b/pkgs/development/interpreters/chibi/default.nix
index 7bf4c0fd52d..96c884ab602 100644
--- a/pkgs/development/interpreters/chibi/default.nix
+++ b/pkgs/development/interpreters/chibi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, makeWrapper }:
+{ lib, stdenv, fetchFromGitHub, makeWrapper }:
 let
   version = "0.9.1";
   name = "chibi-scheme-${version}";
@@ -9,9 +9,9 @@ stdenv.mkDerivation {
   meta = {
     homepage = "https://github.com/ashinn/chibi-scheme";
     description = "Small Footprint Scheme for use as a C Extension Language";
-    platforms = stdenv.lib.platforms.all;
-    license = stdenv.lib.licenses.bsd3;
-    maintainers = [ stdenv.lib.maintainers.DerGuteMoritz ];
+    platforms = lib.platforms.all;
+    license = lib.licenses.bsd3;
+    maintainers = [ lib.maintainers.DerGuteMoritz ];
   };
 
   src = fetchFromGitHub {
diff --git a/pkgs/development/interpreters/cling/default.nix b/pkgs/development/interpreters/cling/default.nix
index c22ad3f4cb0..8f80d2f4ee6 100644
--- a/pkgs/development/interpreters/cling/default.nix
+++ b/pkgs/development/interpreters/cling/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , python
 , libffi
 , git
@@ -50,7 +50,7 @@ let
       "-DCLING_INCLUDE_TESTS=ON"
     ];
 
-    meta = with stdenv.lib; {
+    meta = with lib; {
       description = "The Interactive C++ Interpreter";
       homepage = "https://root.cern/cling/";
       license = with licenses; [ lgpl21 ncsa ];
@@ -73,7 +73,7 @@ let
   flags = [
     "-nostdinc"
     "-nostdinc++"
-    "-isystem" "${stdenv.lib.getDev stdenv.cc.libc}/include"
+    "-isystem" "${lib.getDev stdenv.cc.libc}/include"
     "-I" "${unwrapped}/include"
     "-I" "${unwrapped}/lib/clang/5.0.2/include"
   ];
diff --git a/pkgs/development/interpreters/clips/default.nix b/pkgs/development/interpreters/clips/default.nix
index cf0710f36a1..d38fb8279f0 100644
--- a/pkgs/development/interpreters/clips/default.nix
+++ b/pkgs/development/interpreters/clips/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation {
   version = "6.30";
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
   installPhase = ''
     install -D -t $out/bin core/clips
   '';
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A Tool for Building Expert Systems";
     homepage = "http://www.clipsrules.net/";
     longDescription = ''
diff --git a/pkgs/development/interpreters/clisp/default.nix b/pkgs/development/interpreters/clisp/default.nix
index 1b7ff2c8cba..566d16179b5 100644
--- a/pkgs/development/interpreters/clisp/default.nix
+++ b/pkgs/development/interpreters/clisp/default.nix
@@ -3,7 +3,7 @@
 # - base (default): contains readline and i18n, regexp and syscalls modules
 #   by default
 # - full: contains base plus modules in withModules
-{ stdenv, fetchurl, libsigsegv, gettext, ncurses, readline, libX11
+{ lib, stdenv, fetchurl, libsigsegv, gettext, ncurses, readline, libX11
 , libXau, libXt, pcre, zlib, libXpm, xorgproto, libXext
 , libffi
 , libffcall
@@ -16,8 +16,8 @@
     "pcre"
     "rawsock"
   ]
-  ++ stdenv.lib.optionals stdenv.isLinux [ "bindings/glibc" "zlib" "wildcard" ]
-  ++ stdenv.lib.optional x11Support "clx/new-clx"
+  ++ lib.optionals stdenv.isLinux [ "bindings/glibc" "zlib" "wildcard" ]
+  ++ lib.optional x11Support "clx/new-clx"
 }:
 
 assert x11Support -> (libX11 != null && libXau != null && libXt != null
@@ -37,14 +37,14 @@ stdenv.mkDerivation rec {
   ffcallAvailable = stdenv.isLinux && (libffcall != null);
 
   buildInputs = [libsigsegv]
-  ++ stdenv.lib.optional (gettext != null) gettext
-  ++ stdenv.lib.optional (ncurses != null) ncurses
-  ++ stdenv.lib.optional (pcre != null) pcre
-  ++ stdenv.lib.optional (zlib != null) zlib
-  ++ stdenv.lib.optional (readline != null) readline
-  ++ stdenv.lib.optional (ffcallAvailable && (libffi != null)) libffi
-  ++ stdenv.lib.optional ffcallAvailable libffcall
-  ++ stdenv.lib.optionals x11Support [
+  ++ lib.optional (gettext != null) gettext
+  ++ lib.optional (ncurses != null) ncurses
+  ++ lib.optional (pcre != null) pcre
+  ++ lib.optional (zlib != null) zlib
+  ++ lib.optional (readline != null) readline
+  ++ lib.optional (ffcallAvailable && (libffi != null)) libffi
+  ++ lib.optional ffcallAvailable libffcall
+  ++ lib.optionals x11Support [
     libX11 libXau libXt libXpm xorgproto libXext
   ];
 
@@ -68,14 +68,14 @@ stdenv.mkDerivation rec {
   '';
 
   configureFlags = [ "builddir" ]
-  ++ stdenv.lib.optional (!dllSupport) "--without-dynamic-modules"
-  ++ stdenv.lib.optional (readline != null) "--with-readline"
+  ++ lib.optional (!dllSupport) "--without-dynamic-modules"
+  ++ lib.optional (readline != null) "--with-readline"
   # --with-dynamic-ffi can only exist with --with-ffcall - foreign.d does not compile otherwise
-  ++ stdenv.lib.optional (ffcallAvailable && (libffi != null)) "--with-dynamic-ffi"
-  ++ stdenv.lib.optional ffcallAvailable "--with-ffcall"
-  ++ stdenv.lib.optional (!ffcallAvailable) "--without-ffcall"
+  ++ lib.optional (ffcallAvailable && (libffi != null)) "--with-dynamic-ffi"
+  ++ lib.optional ffcallAvailable "--with-ffcall"
+  ++ lib.optional (!ffcallAvailable) "--without-ffcall"
   ++ builtins.map (x: "--with-module=" + x) withModules
-  ++ stdenv.lib.optional threadSupport "--with-threads=POSIX_THREADS";
+  ++ lib.optional threadSupport "--with-threads=POSIX_THREADS";
 
   preBuild = ''
     sed -e '/avcall.h/a\#include "config.h"' -i src/foreign.d
@@ -83,11 +83,11 @@ stdenv.mkDerivation rec {
   '';
 
   postInstall =
-    stdenv.lib.optionalString (withModules != [])
+    lib.optionalString (withModules != [])
       (''./clisp-link add "$out"/lib/clisp*/base "$(dirname "$out"/lib/clisp*/base)"/full''
-      + stdenv.lib.concatMapStrings (x: " " + x) withModules);
+      + lib.concatMapStrings (x: " " + x) withModules);
 
-  NIX_CFLAGS_COMPILE = "-O0 ${stdenv.lib.optionalString (!stdenv.is64bit) "-falign-functions=4"}";
+  NIX_CFLAGS_COMPILE = "-O0 ${lib.optionalString (!stdenv.is64bit) "-falign-functions=4"}";
 
   # TODO : make mod-check fails
   doCheck = false;
@@ -95,10 +95,10 @@ stdenv.mkDerivation rec {
   meta = {
     description = "ANSI Common Lisp Implementation";
     homepage = "http://clisp.cons.org";
-    maintainers = with stdenv.lib.maintainers; [raskin tohl];
-    platforms = stdenv.lib.platforms.unix;
+    maintainers = with lib.maintainers; [raskin tohl];
+    platforms = lib.platforms.unix;
     # problems on Darwin: https://github.com/NixOS/nixpkgs/issues/20062
     broken = stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isAarch64;
-    license = stdenv.lib.licenses.gpl2;
+    license = lib.licenses.gpl2;
   };
 }
diff --git a/pkgs/development/interpreters/clisp/hg.nix b/pkgs/development/interpreters/clisp/hg.nix
index 6898f84669f..83a1870d182 100644
--- a/pkgs/development/interpreters/clisp/hg.nix
+++ b/pkgs/development/interpreters/clisp/hg.nix
@@ -3,7 +3,7 @@
 # - base (default): contains readline and i18n, regexp and syscalls modules
 #   by default
 # - full: contains base plus modules in withModules
-{ stdenv, fetchhg, libsigsegv, gettext, ncurses, readline, libX11
+{ lib, stdenv, fetchhg, libsigsegv, gettext, ncurses, readline, libX11
 , libXau, libXt, pcre, zlib, libXpm, xorgproto, libXext
 , libffi, libffcall, automake
 , coreutils
@@ -15,8 +15,8 @@
     "pcre"
     "rawsock"
   ]
-  ++ stdenv.lib.optionals stdenv.isLinux [ "bindings/glibc" "zlib" ]
-  ++ stdenv.lib.optional x11Support "clx/new-clx"
+  ++ lib.optionals stdenv.isLinux [ "bindings/glibc" "zlib" ]
+  ++ lib.optional x11Support "clx/new-clx"
 }:
 
 assert x11Support -> (libX11 != null && libXau != null && libXt != null
@@ -38,14 +38,14 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ automake ]; # sometimes fails otherwise
   buildInputs = [libsigsegv]
-  ++ stdenv.lib.optional (gettext != null) gettext
-  ++ stdenv.lib.optional (ncurses != null) ncurses
-  ++ stdenv.lib.optional (pcre != null) pcre
-  ++ stdenv.lib.optional (zlib != null) zlib
-  ++ stdenv.lib.optional (readline != null) readline
-  ++ stdenv.lib.optional (ffcallAvailable && (libffi != null)) libffi
-  ++ stdenv.lib.optional ffcallAvailable libffcall
-  ++ stdenv.lib.optionals x11Support [
+  ++ lib.optional (gettext != null) gettext
+  ++ lib.optional (ncurses != null) ncurses
+  ++ lib.optional (pcre != null) pcre
+  ++ lib.optional (zlib != null) zlib
+  ++ lib.optional (readline != null) readline
+  ++ lib.optional (ffcallAvailable && (libffi != null)) libffi
+  ++ lib.optional ffcallAvailable libffcall
+  ++ lib.optionals x11Support [
     libX11 libXau libXt libXpm xorgproto libXext
   ];
 
@@ -63,14 +63,14 @@ stdenv.mkDerivation rec {
   '';
 
   configureFlags = [ "builddir" ]
-  ++ stdenv.lib.optional (!dllSupport) "--without-dynamic-modules"
-  ++ stdenv.lib.optional (readline != null) "--with-readline"
+  ++ lib.optional (!dllSupport) "--without-dynamic-modules"
+  ++ lib.optional (readline != null) "--with-readline"
   # --with-dynamic-ffi can only exist with --with-ffcall - foreign.d does not compile otherwise
-  ++ stdenv.lib.optional (ffcallAvailable && (libffi != null)) "--with-dynamic-ffi"
-  ++ stdenv.lib.optional ffcallAvailable "--with-ffcall"
-  ++ stdenv.lib.optional (!ffcallAvailable) "--without-ffcall"
+  ++ lib.optional (ffcallAvailable && (libffi != null)) "--with-dynamic-ffi"
+  ++ lib.optional ffcallAvailable "--with-ffcall"
+  ++ lib.optional (!ffcallAvailable) "--without-ffcall"
   ++ builtins.map (x: " --with-module=" + x) withModules
-  ++ stdenv.lib.optional threadSupport "--with-threads=POSIX_THREADS";
+  ++ lib.optional threadSupport "--with-threads=POSIX_THREADS";
 
   preBuild = ''
     sed -e '/avcall.h/a\#include "config.h"' -i src/foreign.d
@@ -79,11 +79,11 @@ stdenv.mkDerivation rec {
   '';
 
   postInstall =
-    stdenv.lib.optionalString (withModules != [])
+    lib.optionalString (withModules != [])
       (''./clisp-link add "$out"/lib/clisp*/base "$(dirname "$out"/lib/clisp*/base)"/full''
-      + stdenv.lib.concatMapStrings (x: " " + x) withModules);
+      + lib.concatMapStrings (x: " " + x) withModules);
 
-  NIX_CFLAGS_COMPILE = "-O0 ${stdenv.lib.optionalString (!stdenv.is64bit) "-falign-functions=4"}";
+  NIX_CFLAGS_COMPILE = "-O0 ${lib.optionalString (!stdenv.is64bit) "-falign-functions=4"}";
 
   # TODO : make mod-check fails
   doCheck = false;
@@ -91,8 +91,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "ANSI Common Lisp Implementation";
     homepage = "http://clisp.cons.org";
-    maintainers = with stdenv.lib.maintainers; [raskin tohl];
+    maintainers = with lib.maintainers; [raskin tohl];
     # problems on Darwin: https://github.com/NixOS/nixpkgs/issues/20062
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/pkgs/development/interpreters/clojure/babashka.nix b/pkgs/development/interpreters/clojure/babashka.nix
index a6beaf1a576..e10236fe1ee 100644
--- a/pkgs/development/interpreters/clojure/babashka.nix
+++ b/pkgs/development/interpreters/clojure/babashka.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, graalvm11-ce, glibcLocales }:
+{ lib, stdenv, fetchurl, graalvm11-ce, glibcLocales }:
 
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
   pname = "babashka";
   version = "0.2.3";
@@ -50,7 +50,7 @@ stdenv.mkDerivation rec {
     cp bb $out/bin/bb
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A Clojure babushka for the grey areas of Bash";
     longDescription = ''
       The main idea behind babashka is to leverage Clojure in places where you
diff --git a/pkgs/development/interpreters/clojure/clooj.nix b/pkgs/development/interpreters/clojure/clooj.nix
index d51fa76003b..57da5e862e9 100644
--- a/pkgs/development/interpreters/clojure/clooj.nix
+++ b/pkgs/development/interpreters/clojure/clooj.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, jre, makeWrapper }:
+{ lib, stdenv, fetchurl, jre, makeWrapper }:
 
 let version = "0.4.4"; in
 
@@ -25,6 +25,6 @@ stdenv.mkDerivation {
   meta = {
     description = "A lightweight IDE for Clojure";
     homepage = "https://github.com/arthuredelstein/clooj";
-    license = stdenv.lib.licenses.bsd3;
+    license = lib.licenses.bsd3;
   };
 }
diff --git a/pkgs/development/interpreters/clojure/default.nix b/pkgs/development/interpreters/clojure/default.nix
index 06e18c96ac3..ab542237859 100644
--- a/pkgs/development/interpreters/clojure/default.nix
+++ b/pkgs/development/interpreters/clojure/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, installShellFiles, jdk, rlwrap, makeWrapper }:
+{ lib, stdenv, fetchurl, installShellFiles, jdk, rlwrap, makeWrapper }:
 
 stdenv.mkDerivation rec {
   pname = "clojure";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   # See https://github.com/clojure/brew-install/blob/1.10.1/src/main/resources/clojure/install/linux-install.sh
   installPhase =
     let
-      binPath = stdenv.lib.makeBinPath [ rlwrap jdk ];
+      binPath = lib.makeBinPath [ rlwrap jdk ];
     in
     ''
       clojure_lib_dir=$out
@@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
       -Sverbose \
       -Scp $out/libexec/clojure-tools-${version}.jar
   '';
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A Lisp dialect for the JVM";
     homepage = "https://clojure.org/";
     license = licenses.epl10;
diff --git a/pkgs/development/interpreters/clojurescript/lumo/default.nix b/pkgs/development/interpreters/clojurescript/lumo/default.nix
index 61fd94c09bf..a269d0b158e 100644
--- a/pkgs/development/interpreters/clojurescript/lumo/default.nix
+++ b/pkgs/development/interpreters/clojurescript/lumo/default.nix
@@ -280,8 +280,8 @@ stdenv.mkDerivation {
       making it the fastest Clojure REPL in existence.
     '';
     homepage = "https://github.com/anmonteiro/lumo";
-    license = stdenv.lib.licenses.epl10;
-    maintainers = [ stdenv.lib.maintainers.hlolli ];
-    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+    license = lib.licenses.epl10;
+    maintainers = [ lib.maintainers.hlolli ];
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
   };
 }
diff --git a/pkgs/development/interpreters/cyclone/default.nix b/pkgs/development/interpreters/cyclone/default.nix
index 60a5fd9e65f..c0a11cf9f02 100644
--- a/pkgs/development/interpreters/cyclone/default.nix
+++ b/pkgs/development/interpreters/cyclone/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, libck, darwin }:
+{ lib, stdenv, fetchFromGitHub, libck, darwin }:
 
 let
   version = "0.21";
@@ -15,7 +15,7 @@ let
 
     enableParallelBuilding = true;
 
-    nativeBuildInputs = stdenv.lib.optionals stdenv.isDarwin [ darwin.cctools ];
+    nativeBuildInputs = lib.optionals stdenv.isDarwin [ darwin.cctools ];
 
     buildInputs = [ libck ];
 
@@ -36,13 +36,13 @@ stdenv.mkDerivation {
   enableParallelBuilding = true;
 
   nativeBuildInputs = [ bootstrap ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ darwin.cctools ];
+    ++ lib.optionals stdenv.isDarwin [ darwin.cctools ];
 
   buildInputs = [ libck ];
 
   makeFlags = [ "PREFIX=${placeholder "out"}" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://justinethier.github.io/cyclone/";
     description = "A brand-new compiler that allows practical application development using R7RS Scheme";
     license = licenses.mit;
diff --git a/pkgs/development/interpreters/dart/default.nix b/pkgs/development/interpreters/dart/default.nix
index 99e6d966283..7fa59a18c5f 100644
--- a/pkgs/development/interpreters/dart/default.nix
+++ b/pkgs/development/interpreters/dart/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip, version ? "2.7.2" }:
+{ lib, stdenv, fetchurl, unzip, version ? "2.7.2" }:
 
 let
 
@@ -80,7 +80,7 @@ let
 
 in
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation {
 
diff --git a/pkgs/development/interpreters/duktape/default.nix b/pkgs/development/interpreters/duktape/default.nix
index 8dbfee20641..f864f5bf6f9 100644
--- a/pkgs/development/interpreters/duktape/default.nix
+++ b/pkgs/development/interpreters/duktape/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "duktape";
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   '';
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An embeddable Javascript engine, with a focus on portability and compact footprint";
     homepage = "https://duktape.org/";
     downloadPage = "https://duktape.org/download.html";
diff --git a/pkgs/development/interpreters/eff/default.nix b/pkgs/development/interpreters/eff/default.nix
index cfd3bbbda4c..8dba500c15b 100644
--- a/pkgs/development/interpreters/eff/default.nix
+++ b/pkgs/development/interpreters/eff/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, which, ocamlPackages }:
+{ lib, stdenv, fetchFromGitHub, which, ocamlPackages }:
 
 let version = "5.0"; in
 
@@ -25,7 +25,7 @@ stdenv.mkDerivation {
   doCheck = true;
   checkTarget = "test";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.eff-lang.org";
     description = "A functional programming language based on algebraic effects and their handlers";
     longDescription = ''
diff --git a/pkgs/development/interpreters/elixir/generic-builder.nix b/pkgs/development/interpreters/elixir/generic-builder.nix
index 8dddd5befd4..358fff039c6 100644
--- a/pkgs/development/interpreters/elixir/generic-builder.nix
+++ b/pkgs/development/interpreters/elixir/generic-builder.nix
@@ -1,4 +1,4 @@
-{ pkgs, stdenv, fetchFromGitHub, erlang, makeWrapper,
+{ pkgs, lib, stdenv, fetchFromGitHub, erlang, makeWrapper,
   coreutils, curl, bash, debugInfo ? false }:
 
 { baseName ? "elixir"
@@ -10,7 +10,7 @@
 } @ args:
 
 let
-  inherit (stdenv.lib) getVersion versionAtLeast optional;
+  inherit (lib) getVersion versionAtLeast optional;
 
 in
   assert versionAtLeast (getVersion erlang) minimumOTPVersion;
@@ -46,7 +46,7 @@ in
        b=$(basename $f)
         if [ "$b" = mix ]; then continue; fi
         wrapProgram $f \
-          --prefix PATH ":" "${stdenv.lib.makeBinPath [ erlang coreutils curl bash ]}" \
+          --prefix PATH ":" "${lib.makeBinPath [ erlang coreutils curl bash ]}" \
           --set CURL_CA_BUNDLE /etc/ssl/certs/ca-certificates.crt
       done
 
@@ -55,7 +55,7 @@ in
     '';
 
     pos = builtins.unsafeGetAttrPos "sha256" args;
-    meta = with stdenv.lib; {
+    meta = with lib; {
       homepage = "https://elixir-lang.org/";
       description = "A functional, meta-programming aware language built on top of the Erlang VM";
 
diff --git a/pkgs/development/interpreters/erlang/generic-builder.nix b/pkgs/development/interpreters/erlang/generic-builder.nix
index 91ea2fe57ab..4429dc1eaf3 100644
--- a/pkgs/development/interpreters/erlang/generic-builder.nix
+++ b/pkgs/development/interpreters/erlang/generic-builder.nix
@@ -1,4 +1,4 @@
-{ pkgs, stdenv, fetchFromGitHub, makeWrapper, gawk, gnum4, gnused
+{ pkgs, lib, stdenv, fetchFromGitHub, makeWrapper, gawk, gnum4, gnused
 , libxml2, libxslt, ncurses, openssl, perl, autoconf
 # TODO: use jdk https://github.com/NixOS/nixpkgs/pull/89731
 , openjdk8 ? null # javacSupport
@@ -41,7 +41,7 @@ assert odbcSupport -> unixODBC != null;
 assert javacSupport -> openjdk8 != null;
 
 let
-  inherit (stdenv.lib) optional optionals optionalAttrs optionalString;
+  inherit (lib) optional optionals optionalAttrs optionalString;
   wxPackages2 = if stdenv.isDarwin then [ wxmac ] else wxPackages;
 
 in stdenv.mkDerivation ({
@@ -106,12 +106,12 @@ in stdenv.mkDerivation ({
   # Some erlang bin/ scripts run sed and awk
   postFixup = ''
     wrapProgram $out/lib/erlang/bin/erl --prefix PATH ":" "${gnused}/bin/"
-    wrapProgram $out/lib/erlang/bin/start_erl --prefix PATH ":" "${stdenv.lib.makeBinPath [ gnused gawk ]}"
+    wrapProgram $out/lib/erlang/bin/start_erl --prefix PATH ":" "${lib.makeBinPath [ gnused gawk ]}"
   '';
 
   setupHook = ./setup-hook.sh;
 
-  meta = with stdenv.lib; ({
+  meta = with lib; ({
     homepage = "https://www.erlang.org/";
     downloadPage = "https://www.erlang.org/download.html";
     description = "Programming language used for massively scalable soft real-time systems";
diff --git a/pkgs/development/interpreters/evcxr/default.nix b/pkgs/development/interpreters/evcxr/default.nix
index 60a284de3f1..fa428b98335 100644
--- a/pkgs/development/interpreters/evcxr/default.nix
+++ b/pkgs/development/interpreters/evcxr/default.nix
@@ -1,4 +1,4 @@
-{ cargo, fetchFromGitHub, makeWrapper, pkg-config, rustPlatform, stdenv, gcc, Security, cmake }:
+{ cargo, fetchFromGitHub, makeWrapper, pkg-config, rustPlatform, lib, stdenv, gcc, Security, cmake }:
 
 rustPlatform.buildRustPackage rec {
   pname = "evcxr";
@@ -16,11 +16,11 @@ rustPlatform.buildRustPackage rec {
   RUST_SRC_PATH = "${rustPlatform.rustLibSrc}";
 
   nativeBuildInputs = [ pkg-config makeWrapper cmake ];
-  buildInputs = stdenv.lib.optional stdenv.isDarwin Security;
+  buildInputs = lib.optional stdenv.isDarwin Security;
   postInstall = let
     wrap = exe: ''
       wrapProgram $out/bin/${exe} \
-        --prefix PATH : ${stdenv.lib.makeBinPath [ cargo gcc ]} \
+        --prefix PATH : ${lib.makeBinPath [ cargo gcc ]} \
         --set-default RUST_SRC_PATH "$RUST_SRC_PATH"
     '';
   in ''
@@ -29,7 +29,7 @@ rustPlatform.buildRustPackage rec {
     rm $out/bin/testing_runtime
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An evaluation context for Rust";
     homepage = "https://github.com/google/evcxr";
     license = licenses.asl20;
diff --git a/pkgs/development/interpreters/falcon/default.nix b/pkgs/development/interpreters/falcon/default.nix
index 9ff81553550..ecac643f1ea 100644
--- a/pkgs/development/interpreters/falcon/default.nix
+++ b/pkgs/development/interpreters/falcon/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, pkg-config, pcre, zlib, sqlite }:
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, pcre, zlib, sqlite }:
 
 stdenv.mkDerivation {
   pname = "falcon";
@@ -11,10 +11,10 @@ stdenv.mkDerivation {
     sha256 = "1x3gdcz1gqhi060ngqi0ghryf69v8bn50yrbzfad8bhblvhzzdlf";
   };
 
-  nativeBuildInputs = [ pkg-config ];
-  buildInputs = [ cmake pcre zlib sqlite ];
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ pcre zlib sqlite ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Programming language with macros and syntax at once";
     license = licenses.gpl2;
     maintainers = with maintainers; [ pSub ];
diff --git a/pkgs/development/interpreters/gnu-apl/default.nix b/pkgs/development/interpreters/gnu-apl/default.nix
index f01cfc2444b..9ae373ff7a8 100644
--- a/pkgs/development/interpreters/gnu-apl/default.nix
+++ b/pkgs/development/interpreters/gnu-apl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, readline, gettext, ncurses }:
+{ lib, stdenv, fetchurl, readline, gettext, ncurses }:
 
 stdenv.mkDerivation rec {
   pname = "gnu-apl";
@@ -12,14 +12,14 @@ stdenv.mkDerivation rec {
   buildInputs = [ readline gettext ncurses ];
 
   # Needed with GCC 8
-  NIX_CFLAGS_COMPILE = with stdenv.lib; toString ((optionals stdenv.cc.isGNU [
+  NIX_CFLAGS_COMPILE = with lib; toString ((optionals stdenv.cc.isGNU [
     "-Wno-error=int-in-bool-context"
     "-Wno-error=class-memaccess"
     "-Wno-error=restrict"
     "-Wno-error=format-truncation"
    ]) ++ optional stdenv.cc.isClang "-Wno-error=null-dereference");
 
-  patchPhase = stdenv.lib.optionalString stdenv.isDarwin ''
+  patchPhase = lib.optionalString stdenv.isDarwin ''
     substituteInPlace src/LApack.cc --replace "malloc.h" "malloc/malloc.h"
   '';
 
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
     find $out/share/doc/support-files -name 'Makefile*' -delete
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Free interpreter for the APL programming language";
     homepage    = "https://www.gnu.org/software/apl/";
     license     = licenses.gpl3Plus;
diff --git a/pkgs/development/interpreters/groovy/default.nix b/pkgs/development/interpreters/groovy/default.nix
index dd9cac84ddd..0e3a0a46afd 100644
--- a/pkgs/development/interpreters/groovy/default.nix
+++ b/pkgs/development/interpreters/groovy/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip, which, makeWrapper, jdk }:
+{ lib, stdenv, fetchurl, unzip, which, makeWrapper, jdk }:
 
 # at runtime, need jdk
 
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     done
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An agile dynamic language for the Java Platform";
     homepage = "http://groovy-lang.org/";
     license = licenses.asl20;
diff --git a/pkgs/development/interpreters/gtk-server/default.nix b/pkgs/development/interpreters/gtk-server/default.nix
index 7203ba31993..3841785e8ac 100644
--- a/pkgs/development/interpreters/gtk-server/default.nix
+++ b/pkgs/development/interpreters/gtk-server/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl
+{ lib, stdenv, fetchurl
 , glib
 , gtk3
 , libffcall
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
 
   configureOptions = [ "--with-gtk3" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "gtk-server for interpreted GUI programming";
     homepage = "http://www.gtk-server.org/";
     license = licenses.gpl2Plus;
diff --git a/pkgs/development/interpreters/guile/1.8.nix b/pkgs/development/interpreters/guile/1.8.nix
index b1c80b13af9..93eca9a73f1 100644
--- a/pkgs/development/interpreters/guile/1.8.nix
+++ b/pkgs/development/interpreters/guile/1.8.nix
@@ -1,4 +1,4 @@
-{ stdenv, pkgsBuildBuild, buildPackages
+{ lib, stdenv, pkgsBuildBuild, buildPackages
 , fetchurl, makeWrapper, gawk, pkg-config
 , libtool, readline, gmp
 }:
@@ -18,11 +18,11 @@ stdenv.mkDerivation rec {
   configureFlags = [ "--disable-error-on-warning" ]
     # Guile needs patching to preset results for the configure tests about
     # pthreads, which work only in native builds.
-    ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
+    ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
                           "--with-threads=no";
 
   depsBuildBuild = [ buildPackages.stdenv.cc ]
-    ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
+    ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
                            pkgsBuildBuild.guile_1_8;
   nativeBuildInputs = [ makeWrapper gawk pkg-config ];
   buildInputs = [ readline libtool ];
@@ -67,9 +67,9 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Embeddable Scheme implementation";
     homepage    = "https://www.gnu.org/software/guile/";
-    license     = stdenv.lib.licenses.lgpl2Plus;
-    maintainers = [ stdenv.lib.maintainers.ludo ];
-    platforms   = stdenv.lib.platforms.unix;
+    license     = lib.licenses.lgpl2Plus;
+    maintainers = [ lib.maintainers.ludo ];
+    platforms   = lib.platforms.unix;
 
     longDescription = ''
       GNU Guile is an interpreter for the Scheme programming language,
diff --git a/pkgs/development/interpreters/guile/2.0.nix b/pkgs/development/interpreters/guile/2.0.nix
index 1db5676a8c7..b93ec556cd4 100644
--- a/pkgs/development/interpreters/guile/2.0.nix
+++ b/pkgs/development/interpreters/guile/2.0.nix
@@ -1,4 +1,4 @@
-{ stdenv, pkgsBuildBuild, buildPackages
+{ lib, stdenv, pkgsBuildBuild, buildPackages
 , fetchpatch, fetchurl, makeWrapper, gawk, pkg-config
 , libffi, libtool, readline, gmp, boehmgc, libunistring
 , coverageAnalysis ? null
@@ -21,7 +21,7 @@
   setOutputFlags = false; # $dev gets into the library otherwise
 
   depsBuildBuild = [ buildPackages.stdenv.cc ]
-    ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
+    ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
                            pkgsBuildBuild.guile_2_0;
   nativeBuildInputs = [ makeWrapper gawk pkg-config ];
   buildInputs = [ readline libtool libunistring libffi ];
@@ -46,8 +46,8 @@
     })
     ./riscv.patch
   ] ++
-    (stdenv.lib.optional (coverageAnalysis != null) ./gcov-file-name.patch)
-    ++ stdenv.lib.optionals stdenv.isDarwin [
+    (lib.optional (coverageAnalysis != null) ./gcov-file-name.patch)
+    ++ lib.optionals stdenv.isDarwin [
       (fetchpatch {
         url = "https://gitlab.gnome.org/GNOME/gtk-osx/raw/52898977f165777ad9ef169f7d4818f2d4c9b731/patches/guile-clocktime.patch";
         sha256 = "12wvwdna9j8795x59ldryv9d84c1j3qdk2iskw09306idfsis207";
@@ -59,10 +59,10 @@
   # "libgcc_s.so.1 must be installed for pthread_cancel to work".
 
   # don't have "libgcc_s.so.1" on darwin
-  LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin && !stdenv.hostPlatform.isMusl) "-lgcc_s";
+  LDFLAGS = lib.optionalString (!stdenv.isDarwin && !stdenv.hostPlatform.isMusl) "-lgcc_s";
 
   configureFlags = [ "--with-libreadline-prefix" ]
-    ++ stdenv.lib.optionals stdenv.isSunOS [
+    ++ lib.optionals stdenv.isSunOS [
       # Make sure the right <gmp.h> is found, and not the incompatible
       # /usr/include/mp.h from OpenSolaris.  See
       # <https://lists.gnu.org/archive/html/hydra-users/2012-08/msg00000.html>
@@ -102,9 +102,9 @@
   meta = {
     description = "Embeddable Scheme implementation";
     homepage    = "https://www.gnu.org/software/guile/";
-    license     = stdenv.lib.licenses.lgpl3Plus;
-    maintainers = with stdenv.lib.maintainers; [ ludo lovek323 ];
-    platforms   = stdenv.lib.platforms.all;
+    license     = lib.licenses.lgpl3Plus;
+    maintainers = with lib.maintainers; [ ludo lovek323 ];
+    platforms   = lib.platforms.all;
 
     longDescription = ''
       GNU Guile is an implementation of the Scheme programming language, with
@@ -120,7 +120,7 @@
 
 //
 
-(stdenv.lib.optionalAttrs (!stdenv.isLinux) {
+(lib.optionalAttrs (!stdenv.isLinux) {
   # Work around <https://bugs.gnu.org/14201>.
   SHELL = stdenv.shell;
   CONFIG_SHELL = stdenv.shell;
diff --git a/pkgs/development/interpreters/guile/default.nix b/pkgs/development/interpreters/guile/default.nix
index 77483b2256a..ed685682db6 100644
--- a/pkgs/development/interpreters/guile/default.nix
+++ b/pkgs/development/interpreters/guile/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, pkgsBuildBuild, buildPackages
+{ lib, stdenv, pkgsBuildBuild, buildPackages
 , fetchurl, makeWrapper, gawk, pkg-config
 , libffi, libtool, readline, gmp, boehmgc, libunistring
 , coverageAnalysis ? null
@@ -23,7 +23,7 @@
   setOutputFlags = false; # $dev gets into the library otherwise
 
   depsBuildBuild = [ buildPackages.stdenv.cc ]
-    ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
+    ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
                            pkgsBuildBuild.guile;
   nativeBuildInputs = [ makeWrapper gawk pkg-config ];
   buildInputs = [ readline libtool libunistring libffi ];
@@ -48,8 +48,8 @@
 
   patches = [
     ./eai_system.patch
-  ] ++ stdenv.lib.optional (coverageAnalysis != null) ./gcov-file-name.patch
-    ++ stdenv.lib.optional stdenv.isDarwin (fetchpatch {
+  ] ++ lib.optional (coverageAnalysis != null) ./gcov-file-name.patch
+    ++ lib.optional stdenv.isDarwin (fetchpatch {
       url = "https://gitlab.gnome.org/GNOME/gtk-osx/raw/52898977f165777ad9ef169f7d4818f2d4c9b731/patches/guile-clocktime.patch";
       sha256 = "12wvwdna9j8795x59ldryv9d84c1j3qdk2iskw09306idfsis207";
     });
@@ -58,11 +58,11 @@
   # "libgcc_s.so.1 must be installed for pthread_cancel to work".
 
   # don't have "libgcc_s.so.1" on darwin
-  LDFLAGS = stdenv.lib.optionalString
+  LDFLAGS = lib.optionalString
     (!stdenv.isDarwin && !stdenv.hostPlatform.isStatic) "-lgcc_s";
 
   configureFlags = [ "--with-libreadline-prefix=${readline.dev}" ]
-    ++ stdenv.lib.optionals stdenv.isSunOS [
+    ++ lib.optionals stdenv.isSunOS [
       # Make sure the right <gmp.h> is found, and not the incompatible
       # /usr/include/mp.h from OpenSolaris.  See
       # <https://lists.gnu.org/archive/html/hydra-users/2012-08/msg00000.html>
@@ -101,9 +101,9 @@
   meta = {
     description = "Embeddable Scheme implementation";
     homepage    = "https://www.gnu.org/software/guile/";
-    license     = stdenv.lib.licenses.lgpl3Plus;
-    maintainers = with stdenv.lib.maintainers; [ ludo lovek323 vrthra ];
-    platforms   = stdenv.lib.platforms.all;
+    license     = lib.licenses.lgpl3Plus;
+    maintainers = with lib.maintainers; [ ludo lovek323 vrthra ];
+    platforms   = lib.platforms.all;
 
     longDescription = ''
       GNU Guile is an implementation of the Scheme programming language, with
diff --git a/pkgs/development/interpreters/hugs/default.nix b/pkgs/development/interpreters/hugs/default.nix
index 35463b16157..6af489473c9 100644
--- a/pkgs/development/interpreters/hugs/default.nix
+++ b/pkgs/development/interpreters/hugs/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, bison }:
+{ lib, stdenv, fetchurl, bison }:
 
 stdenv.mkDerivation {
 
@@ -39,7 +39,7 @@ stdenv.mkDerivation {
     "--enable-pthreads"                 # build Hugs using POSIX threads C library
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.haskell.org/hugs";
     description = "Haskell interpreter";
     maintainers = with maintainers; [ joachifm ];
diff --git a/pkgs/development/interpreters/hy/default.nix b/pkgs/development/interpreters/hy/default.nix
index a8890b048fb..6bfef26b4dd 100644
--- a/pkgs/development/interpreters/hy/default.nix
+++ b/pkgs/development/interpreters/hy/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, python3Packages }:
+{ lib, stdenv, python3Packages }:
 
 python3Packages.buildPythonApplication rec {
   pname = "hy";
@@ -27,7 +27,7 @@ python3Packages.buildPythonApplication rec {
     $out/bin/hy --help > /dev/null
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A LISP dialect embedded in Python";
     homepage = "http://hylang.org/";
     license = licenses.mit;
diff --git a/pkgs/development/interpreters/icon-lang/default.nix b/pkgs/development/interpreters/icon-lang/default.nix
index 30e260eee46..5481f7825c9 100644
--- a/pkgs/development/interpreters/icon-lang/default.nix
+++ b/pkgs/development/interpreters/icon-lang/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , libX11
 , libXt
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     sha256 = "1lj2f13pbaajcy4v3744bz46rghhw5sv4dwwfnzhsllbj5gnjsv2";
   };
 
-  buildInputs = stdenv.lib.optionals withGraphics [ libX11 libXt ];
+  buildInputs = lib.optionals withGraphics [ libX11 libXt ];
 
   configurePhase =
     let
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
     mv $out/doc $out/share/doc/icon
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A very high level general-purpose programming language";
     maintainers = with maintainers; [ vrthra yurrriq ];
     platforms = with platforms; linux ++ darwin ++ freebsd ++ netbsd ++ openbsd ++ cygwin ++ illumos;
diff --git a/pkgs/development/interpreters/io/default.nix b/pkgs/development/interpreters/io/default.nix
index a87b3ef8678..d0a3b20e503 100644
--- a/pkgs/development/interpreters/io/default.nix
+++ b/pkgs/development/interpreters/io/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, zlib, sqlite, gmp, libffi, cairo,
+{ lib, stdenv, fetchFromGitHub, cmake, zlib, sqlite, gmp, libffi, cairo,
   ncurses, freetype, libGLU, libGL, libpng, libtiff, libjpeg, readline, libsndfile,
   libxml2, freeglut, libsamplerate, pcre, libevent, libedit, yajl,
   python3, openssl, glfw, pkg-config, libpthreadstubs, libXdmcp, libmemcached
@@ -37,7 +37,7 @@ stdenv.mkDerivation {
   # for gcc5; c11 inline semantics breaks the build
   NIX_CFLAGS_COMPILE = "-fgnu89-inline";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Io programming language";
     homepage = "http://iolanguage.org/";
     license = licenses.bsd3;
diff --git a/pkgs/development/interpreters/j/default.nix b/pkgs/development/interpreters/j/default.nix
index b7f8b63d54a..ab64505e091 100644
--- a/pkgs/development/interpreters/j/default.nix
+++ b/pkgs/development/interpreters/j/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, readline, libedit, bc
+{ lib, stdenv, fetchFromGitHub, readline, libedit, bc
 , avxSupport ? stdenv.hostPlatform.avxSupport
 }:
 
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
   doCheck = true;
 
   # Causes build failure due to warning
-  hardeningDisable = stdenv.lib.optional stdenv.cc.isClang "strictoverflow";
+  hardeningDisable = lib.optional stdenv.cc.isClang "strictoverflow";
 
   buildPhase = ''
     export SOURCE_DIR=$(pwd)
@@ -68,7 +68,7 @@ stdenv.mkDerivation rec {
     cp -r $JLIB/bin "$out"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "J programming language, an ASCII-based APL successor";
     maintainers = with maintainers; [ raskin synthetica ];
     platforms = with platforms; linux ++ darwin;
diff --git a/pkgs/development/interpreters/janet/default.nix b/pkgs/development/interpreters/janet/default.nix
index fe0d3073acb..aefc158b000 100644
--- a/pkgs/development/interpreters/janet/default.nix
+++ b/pkgs/development/interpreters/janet/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, meson, ninja }:
+{ lib, stdenv, fetchFromGitHub, meson, ninja }:
 
 stdenv.mkDerivation rec {
   pname = "janet";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Janet programming language";
     homepage = "https://janet-lang.org/";
     license = licenses.mit;
diff --git a/pkgs/development/interpreters/jimtcl/default.nix b/pkgs/development/interpreters/jimtcl/default.nix
index d803fe43fd7..78b9e40b647 100644
--- a/pkgs/development/interpreters/jimtcl/default.nix
+++ b/pkgs/development/interpreters/jimtcl/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchFromGitHub, sqlite, readline, asciidoc, SDL, SDL_gfx }:
+{ lib, stdenv, fetchFromGitHub, sqlite, readline, asciidoc, SDL, SDL_gfx }:
 
 let
-  makeSDLFlags = map (p: "-I${stdenv.lib.getDev p}/include/SDL");
+  makeSDLFlags = map (p: "-I${lib.getDev p}/include/SDL");
 
 in stdenv.mkDerivation rec {
   pname = "jimtcl";
@@ -52,8 +52,8 @@ in stdenv.mkDerivation rec {
   meta = {
     description = "An open source small-footprint implementation of the Tcl programming language";
     homepage = "http://jim.tcl.tk/";
-    license = stdenv.lib.licenses.bsd2;
-    platforms = stdenv.lib.platforms.all;
-    maintainers = with stdenv.lib.maintainers; [ dbohdan vrthra ];
+    license = lib.licenses.bsd2;
+    platforms = lib.platforms.all;
+    maintainers = with lib.maintainers; [ dbohdan vrthra ];
   };
 }
diff --git a/pkgs/development/interpreters/joker/default.nix b/pkgs/development/interpreters/joker/default.nix
index 2eb01b37644..3d36dde8e0f 100644
--- a/pkgs/development/interpreters/joker/default.nix
+++ b/pkgs/development/interpreters/joker/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoModule, fetchFromGitHub }:
+{ lib, stdenv, buildGoModule, fetchFromGitHub }:
 
 buildGoModule rec {
   pname = "joker";
@@ -21,7 +21,7 @@ buildGoModule rec {
 
   subPackages = [ "." ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/candid82/joker";
     description = "A small Clojure interpreter and linter written in Go";
     license = licenses.epl10;
diff --git a/pkgs/development/interpreters/jruby/default.nix b/pkgs/development/interpreters/jruby/default.nix
index 9159f026e1f..f792471c061 100644
--- a/pkgs/development/interpreters/jruby/default.nix
+++ b/pkgs/development/interpreters/jruby/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, callPackage, fetchurl, makeWrapper, jre }:
+{ lib, stdenv, callPackage, fetchurl, makeWrapper, jre }:
 
 let
 # The version number here is whatever is reported by the RUBY_VERSION string
@@ -50,7 +50,7 @@ jruby = stdenv.mkDerivation rec {
     libPath = "lib/${rubyEngine}/${rubyVersion.libDir}";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Ruby interpreter written in Java";
     homepage = "http://jruby.org/";
     license = with licenses; [ cpl10 gpl2 lgpl21 ];
diff --git a/pkgs/development/interpreters/jython/default.nix b/pkgs/development/interpreters/jython/default.nix
index 35af365c1f7..61cc8f9cd0f 100644
--- a/pkgs/development/interpreters/jython/default.nix
+++ b/pkgs/development/interpreters/jython/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper, jre }:
+{ lib, stdenv, fetchurl, makeWrapper, jre }:
 
 stdenv.mkDerivation rec {
   pname = "jython";
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Python interpreter written in Java";
     homepage = "https://jython.org/";
-    license = stdenv.lib.licenses.psfl;
+    license = lib.licenses.psfl;
     platforms = jre.meta.platforms;
   };
 }
diff --git a/pkgs/development/interpreters/kona/default.nix b/pkgs/development/interpreters/kona/default.nix
index 041616cc1f6..15ce9321a8d 100644
--- a/pkgs/development/interpreters/kona/default.nix
+++ b/pkgs/development/interpreters/kona/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "kona";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   makeFlags = [ "PREFIX=$(out)" ];
   preInstall = ''mkdir -p "$out/bin"'';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An interpreter of K, APL-like programming language";
     homepage = "https://github.com/kevinlawler/kona/";
     maintainers = with maintainers; [ raskin ];
diff --git a/pkgs/development/interpreters/lfe/generic-builder.nix b/pkgs/development/interpreters/lfe/generic-builder.nix
index ba42c2d59d5..d6090152d15 100644
--- a/pkgs/development/interpreters/lfe/generic-builder.nix
+++ b/pkgs/development/interpreters/lfe/generic-builder.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, erlang, makeWrapper, coreutils, bash, buildRebar3, buildHex }:
+{ lib, stdenv, fetchFromGitHub, erlang, makeWrapper, coreutils, bash, buildRebar3, buildHex }:
 
 { baseName ? "lfe"
 , version
@@ -10,7 +10,7 @@
 }:
 
 let
-  inherit (stdenv.lib)
+  inherit (lib)
     assertMsg makeBinPath optionalString
     getVersion versionAtLeast versionOlder versions;
 
@@ -75,7 +75,7 @@ buildRebar3 {
     done
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description     = "The best of Erlang and of Lisp; at the same time!";
     longDescription = ''
       LFE, Lisp Flavoured Erlang, is a lisp syntax front-end to the Erlang
diff --git a/pkgs/development/interpreters/lolcode/default.nix b/pkgs/development/interpreters/lolcode/default.nix
index 180ce28c9ae..65653701b80 100644
--- a/pkgs/development/interpreters/lolcode/default.nix
+++ b/pkgs/development/interpreters/lolcode/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, pkg-config, doxygen, cmake, readline }:
+{ lib, stdenv, fetchurl, pkg-config, doxygen, cmake, readline }:
 
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
 
   pname = "lolcode";
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
     '';
     license = licenses.gpl3;
     maintainers = [ maintainers.AndersonTorres ];
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 
 }
diff --git a/pkgs/development/interpreters/love/0.10.nix b/pkgs/development/interpreters/love/0.10.nix
index 9319fa12406..ed002d99fbb 100644
--- a/pkgs/development/interpreters/love/0.10.nix
+++ b/pkgs/development/interpreters/love/0.10.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromBitbucket, pkg-config, SDL2, libGLU, libGL, openal, luajit,
+{ lib, stdenv, fetchFromBitbucket, pkg-config, SDL2, libGLU, libGL, openal, luajit,
   libdevil, freetype, physfs, libmodplug, mpg123, libvorbis, libogg,
   libtheora, which, autoconf, automake, libtool
 }:
@@ -34,8 +34,8 @@ stdenv.mkDerivation {
   meta = {
     homepage = "http://love2d.org";
     description = "A Lua-based 2D game engine/scripting language";
-    license = stdenv.lib.licenses.zlib;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.raskin ];
+    license = lib.licenses.zlib;
+    platforms = lib.platforms.linux;
+    maintainers = [ lib.maintainers.raskin ];
   };
 }
diff --git a/pkgs/development/interpreters/love/0.7.nix b/pkgs/development/interpreters/love/0.7.nix
index 2198ff962a1..6cba19bff0f 100644
--- a/pkgs/development/interpreters/love/0.7.nix
+++ b/pkgs/development/interpreters/love/0.7.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config
+{ lib, stdenv, fetchurl, pkg-config
 , SDL, libGLU, libGL, openal, lua
 , libdevil, freetype, physfs
 , libmodplug, mpg123, libvorbis, libogg
@@ -48,9 +48,9 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://love2d.org";
     description = "A Lua-based 2D game engine/scripting language";
-    license = stdenv.lib.licenses.zlib;
+    license = lib.licenses.zlib;
 
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.raskin ];
+    platforms = lib.platforms.linux;
+    maintainers = [ lib.maintainers.raskin ];
   };
 }
diff --git a/pkgs/development/interpreters/love/0.8.nix b/pkgs/development/interpreters/love/0.8.nix
index 866ce83adf1..8bad501170d 100644
--- a/pkgs/development/interpreters/love/0.8.nix
+++ b/pkgs/development/interpreters/love/0.8.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config
+{ lib, stdenv, fetchurl, pkg-config
 , SDL, libGLU, libGL, openal, lua
 , libdevil, freetype, physfs
 , libmodplug, mpg123, libvorbis, libogg
@@ -47,9 +47,9 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://love2d.org";
     description = "A Lua-based 2D game engine/scripting language";
-    license = stdenv.lib.licenses.zlib;
+    license = lib.licenses.zlib;
 
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.raskin ];
+    platforms = lib.platforms.linux;
+    maintainers = [ lib.maintainers.raskin ];
   };
 }
diff --git a/pkgs/development/interpreters/love/0.9.nix b/pkgs/development/interpreters/love/0.9.nix
index 315a07bd9ca..b7e20498a39 100644
--- a/pkgs/development/interpreters/love/0.9.nix
+++ b/pkgs/development/interpreters/love/0.9.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config
+{ lib, stdenv, fetchurl, pkg-config
 , SDL2, libGLU, libGL, openal, luajit
 , libdevil, freetype, physfs
 , libmodplug, mpg123, libvorbis, libogg
@@ -26,10 +26,10 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://love2d.org";
     description = "A Lua-based 2D game engine/scripting language";
-    license = stdenv.lib.licenses.zlib;
+    license = lib.licenses.zlib;
 
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.raskin ];
+    platforms = lib.platforms.linux;
+    maintainers = [ lib.maintainers.raskin ];
     broken = true;
   };
 }
diff --git a/pkgs/development/interpreters/love/11.1.nix b/pkgs/development/interpreters/love/11.1.nix
index 48ac142934b..bf76547a07a 100644
--- a/pkgs/development/interpreters/love/11.1.nix
+++ b/pkgs/development/interpreters/love/11.1.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromBitbucket, pkg-config, SDL2, libGLU, libGL, openal, luajit,
+{ lib, stdenv, fetchFromBitbucket, pkg-config, SDL2, libGLU, libGL, openal, luajit,
   libdevil, freetype, physfs, libmodplug, mpg123, libvorbis, libogg,
   libtheora, which, autoconf, automake, libtool
 }:
@@ -34,8 +34,8 @@ stdenv.mkDerivation {
   meta = {
     homepage = "http://love2d.org";
     description = "A Lua-based 2D game engine/scripting language";
-    license = stdenv.lib.licenses.zlib;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.raskin ];
+    license = lib.licenses.zlib;
+    platforms = lib.platforms.linux;
+    maintainers = [ lib.maintainers.raskin ];
   };
 }
diff --git a/pkgs/development/interpreters/lua-5/default.nix b/pkgs/development/interpreters/lua-5/default.nix
index d78d5ba0c2d..3a52d58ffab 100644
--- a/pkgs/development/interpreters/lua-5/default.nix
+++ b/pkgs/development/interpreters/lua-5/default.nix
@@ -40,7 +40,7 @@ in rec {
       sed -e 's/ALL_T *= */& $(LUA_SO)/' -i src/Makefile
     '';
 
-    postBuild = stdenv.lib.optionalString (!stdenv.isDarwin) ''
+    postBuild = lib.optionalString (!stdenv.isDarwin) ''
       ( cd src; make $makeFlags "''${makeFlagsArray[@]}" liblua.so )
     '';
   };
diff --git a/pkgs/development/interpreters/lua-5/filesystem.nix b/pkgs/development/interpreters/lua-5/filesystem.nix
index a3e633bbab1..d4e68b5cb76 100644
--- a/pkgs/development/interpreters/lua-5/filesystem.nix
+++ b/pkgs/development/interpreters/lua-5/filesystem.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
 
   meta = {
     homepage = "https://github.com/keplerproject/luafilesystem";
-    hydraPlatforms = stdenv.lib.platforms.linux;
+    hydraPlatforms = lib.platforms.linux;
     maintainers = [ ];
   };
 }
diff --git a/pkgs/development/interpreters/lua-5/interpreter.nix b/pkgs/development/interpreters/lua-5/interpreter.nix
index 98e4684e092..7e4283838a0 100644
--- a/pkgs/development/interpreters/lua-5/interpreter.nix
+++ b/pkgs/development/interpreters/lua-5/interpreter.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, readline
+{ lib, stdenv, fetchurl, readline
 , compat ? false
 , callPackage
 , packageOverrides ? (self: super: {})
@@ -50,7 +50,7 @@ self = stdenv.mkDerivation rec {
     runHook preConfigure
 
     makeFlagsArray+=(CFLAGS="-DLUA_USE_LINUX -O2 -fPIC${if compat then " -DLUA_COMPAT_ALL" else ""}" )
-    makeFlagsArray+=(${stdenv.lib.optionalString stdenv.isDarwin "CC=\"$CC\""}${stdenv.lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) " 'AR=${stdenv.hostPlatform.config}-ar rcu'"})
+    makeFlagsArray+=(${lib.optionalString stdenv.isDarwin "CC=\"$CC\""}${lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) " 'AR=${stdenv.hostPlatform.config}-ar rcu'"})
 
     installFlagsArray=( TO_BIN="lua luac" INSTALL_DATA='cp -d' \
       TO_LIB="${if stdenv.isDarwin then "liblua.${version}.dylib" else "liblua.a liblua.so liblua.so.${luaversion} liblua.so.${version}"}" )
@@ -107,8 +107,8 @@ self = stdenv.mkDerivation rec {
       management with incremental garbage collection, making it ideal
       for configuration, scripting, and rapid prototyping.
     '';
-    license = stdenv.lib.licenses.mit;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.mit;
+    platforms = lib.platforms.unix;
   };
 };
 in self
diff --git a/pkgs/development/interpreters/lua-5/sockets.nix b/pkgs/development/interpreters/lua-5/sockets.nix
index 73fbbc3e66a..d16f068883a 100644
--- a/pkgs/development/interpreters/lua-5/sockets.nix
+++ b/pkgs/development/interpreters/lua-5/sockets.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = "http://w3.impa.br/~diego/software/luasocket/";
-    hydraPlatforms = stdenv.lib.platforms.linux;
+    hydraPlatforms = lib.platforms.linux;
     maintainers = [ ];
   };
 }
diff --git a/pkgs/development/interpreters/lua-5/wrapper.nix b/pkgs/development/interpreters/lua-5/wrapper.nix
index 53ec2baeb5e..0459b67534d 100644
--- a/pkgs/development/interpreters/lua-5/wrapper.nix
+++ b/pkgs/development/interpreters/lua-5/wrapper.nix
@@ -1,4 +1,4 @@
-{ stdenv, lua, buildEnv, makeWrapper
+{ lib, stdenv, lua, buildEnv, makeWrapper
 , extraLibs ? []
 , extraOutputsToInstall ? []
 , postBuild ? ""
@@ -28,7 +28,7 @@ let
       addToLuaPath "$out"
 
       # take every binary from lua packages and put them into the env
-      for path in ${stdenv.lib.concatStringsSep " " paths}; do
+      for path in ${lib.concatStringsSep " " paths}; do
         nix_debug "looking for binaries in path = $path"
         if [ -d "$path/bin" ]; then
           cd "$path/bin"
@@ -37,7 +37,7 @@ let
               rm -f "$out/bin/$prg"
               if [ -x "$prg" ]; then
                 nix_debug "Making wrapper $prg"
-                makeWrapper "$path/bin/$prg" "$out/bin/$prg" --suffix LUA_PATH ';' "$LUA_PATH"   --suffix LUA_CPATH ';' "$LUA_CPATH" ${stdenv.lib.concatStringsSep " " makeWrapperArgs}
+                makeWrapper "$path/bin/$prg" "$out/bin/$prg" --suffix LUA_PATH ';' "$LUA_PATH"   --suffix LUA_CPATH ';' "$LUA_CPATH" ${lib.concatStringsSep " " makeWrapperArgs}
               fi
             fi
           done
diff --git a/pkgs/development/interpreters/luajit/default.nix b/pkgs/development/interpreters/luajit/default.nix
index e0e15ca3275..860642b0fd2 100644
--- a/pkgs/development/interpreters/luajit/default.nix
+++ b/pkgs/development/interpreters/luajit/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, buildPackages
+{ lib, stdenv, fetchFromGitHub, buildPackages
 , name ? "luajit-${version}"
 , isStable
 , sha256
@@ -26,7 +26,7 @@ assert enableValgrindSupport -> valgrind != null;
 let
   luaPackages = callPackage ../../lua-modules {lua=self; overrides=packageOverrides;};
 
-  XCFLAGS = with stdenv.lib;
+  XCFLAGS = with lib;
      optional (!enableFFI) "-DLUAJIT_DISABLE_FFI"
   ++ optional (!enableJIT) "-DLUAJIT_DISABLE_JIT"
   ++ optional enable52Compat "-DLUAJIT_ENABLE_LUA52COMPAT"
@@ -59,7 +59,7 @@ stdenv.mkDerivation rec {
 
   configurePhase = false;
 
-  buildInputs = stdenv.lib.optional enableValgrindSupport valgrind;
+  buildInputs = lib.optional enableValgrindSupport valgrind;
 
   buildFlags = [
     "amalg" # Build highly optimized version
@@ -70,14 +70,14 @@ stdenv.mkDerivation rec {
     "CROSS=${stdenv.cc.targetPrefix}"
     # TODO: when pointer size differs, we would need e.g. -m32
     "HOST_CC=${buildPackages.stdenv.cc}/bin/cc"
-  ] ++ stdenv.lib.optional enableJITDebugModule "INSTALL_LJLIBD=$(INSTALL_LMOD)";
+  ] ++ lib.optional enableJITDebugModule "INSTALL_LJLIBD=$(INSTALL_LMOD)";
   enableParallelBuilding = true;
   NIX_CFLAGS_COMPILE = XCFLAGS;
 
   postInstall = ''
     ( cd "$out/include"; ln -s luajit-*/* . )
     ln -s "$out"/bin/luajit-* "$out"/bin/lua
-  '' + stdenv.lib.optionalString (!isStable) ''
+  '' + lib.optionalString (!isStable) ''
     ln -s "$out"/bin/luajit-* "$out"/bin/luajit
   '';
 
@@ -99,7 +99,7 @@ stdenv.mkDerivation rec {
     interpreter = "${self}/bin/lua";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "High-performance JIT compiler for Lua 5.1";
     homepage    = "http://luajit.org";
     license     = licenses.mit;
diff --git a/pkgs/development/interpreters/lush/default.nix b/pkgs/development/interpreters/lush/default.nix
index a8db08e87a2..fe51d154956 100644
--- a/pkgs/development/interpreters/lush/default.nix
+++ b/pkgs/development/interpreters/lush/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, libX11, xorgproto, indent, readline, gsl, freeglut, libGLU, libGL, SDL
+{lib, stdenv, fetchurl, libX11, xorgproto, indent, readline, gsl, freeglut, libGLU, libGL, SDL
 , blas, libbfd, intltool, gettext, zlib, libSM}:
 
 stdenv.mkDerivation rec {
@@ -22,8 +22,8 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "Lisp Universal SHell";
-    license = stdenv.lib.licenses.gpl2Plus ;
-    maintainers = [ stdenv.lib.maintainers.raskin ];
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.gpl2Plus ;
+    maintainers = [ lib.maintainers.raskin ];
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/pkgs/development/interpreters/maude/default.nix b/pkgs/development/interpreters/maude/default.nix
index d824d29c35c..6dcb697d763 100644
--- a/pkgs/development/interpreters/maude/default.nix
+++ b/pkgs/development/interpreters/maude/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip, makeWrapper, flex, bison, ncurses, buddy, tecla
+{ lib, stdenv, fetchurl, unzip, makeWrapper, flex, bison, ncurses, buddy, tecla
 , libsigsegv, gmpxx, cln, yices
 }:
 
@@ -27,7 +27,7 @@ stdenv.mkDerivation {
   ];
 
   hardeningDisable = [ "stackprotector" ] ++
-    stdenv.lib.optionals stdenv.isi686 [ "pic" "fortify" ];
+    lib.optionals stdenv.isi686 [ "pic" "fortify" ];
 
   preConfigure = ''
     configureFlagsArray=(
@@ -54,7 +54,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = "http://maude.cs.illinois.edu/";
     description = "High-level specification language";
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
 
     longDescription = ''
       Maude is a high-performance reflective language and system
@@ -66,7 +66,7 @@ stdenv.mkDerivation {
       rewriting logic computation.
     '';
 
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = [ stdenv.lib.maintainers.peti ];
+    platforms = lib.platforms.unix;
+    maintainers = [ lib.maintainers.peti ];
   };
 }
diff --git a/pkgs/development/interpreters/metamath/default.nix b/pkgs/development/interpreters/metamath/default.nix
index cccb7434797..34591c4c84b 100644
--- a/pkgs/development/interpreters/metamath/default.nix
+++ b/pkgs/development/interpreters/metamath/default.nix
@@ -1,19 +1,21 @@
-{ stdenv, fetchFromGitHub, autoreconfHook }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
 
-stdenv.mkDerivation {
+let
+  version = "0.194";
+in stdenv.mkDerivation {
   pname = "metamath";
-  version = "0.193";
+  inherit version;
 
   buildInputs = [ autoreconfHook ];
 
   src = fetchFromGitHub {
     owner = "metamath";
     repo = "metamath-exe";
-    rev = "f973c81222ebe36580a24f0fa7bbb600990af7d6";
-    sha256 = "1s9hyknfvhj86g3giayyf3dxzg23iij0rs7bdvj075v9qbyhqn9b";
+    rev = "v${version}";
+    sha256 = "1bc5h2jdqbgna8zbhqyphlqcldz4vddg72r2rnjjjzxnxb2skvj7";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Interpreter for the metamath proof language";
     longDescription = ''
       The metamath program is an ASCII-based ANSI C program with a command-line
@@ -23,7 +25,7 @@ stdenv.mkDerivation {
     '';
     homepage = "http://us.metamath.org";
     downloadPage = "http://us.metamath.org/#downloads";
-    license = licenses.gpl2;
+    license = licenses.gpl2Only;
     maintainers = [ maintainers.taneb ];
     platforms = platforms.all;
   };
diff --git a/pkgs/development/interpreters/mujs/default.nix b/pkgs/development/interpreters/mujs/default.nix
index 692aed3e4ee..5e600a92fb7 100644
--- a/pkgs/development/interpreters/mujs/default.nix
+++ b/pkgs/development/interpreters/mujs/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, readline }:
+{ lib, stdenv, fetchurl, readline }:
 
 stdenv.mkDerivation rec {
   pname = "mujs";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   makeFlags = [ "prefix=$(out)" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://mujs.com/";
     description = "A lightweight, embeddable Javascript interpreter";
     platforms = platforms.unix;
diff --git a/pkgs/development/interpreters/nix-exec/default.nix b/pkgs/development/interpreters/nix-exec/default.nix
index de829c14c98..c2a3fa2c774 100644
--- a/pkgs/development/interpreters/nix-exec/default.nix
+++ b/pkgs/development/interpreters/nix-exec/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, nix, git }: let
+{ lib, stdenv, fetchurl, pkg-config, nix, git }: let
   version = "4.1.6";
 in stdenv.mkDerivation {
   pname = "nix-exec";
@@ -17,7 +17,7 @@ in stdenv.mkDerivation {
   meta = {
     description = "Run programs defined in nix expressions";
     homepage = "https://github.com/shlevy/nix-exec";
-    license = stdenv.lib.licenses.mit;
+    license = lib.licenses.mit;
     platforms = nix.meta.platforms;
     broken = true;
   };
diff --git a/pkgs/development/interpreters/perl/wrapper.nix b/pkgs/development/interpreters/perl/wrapper.nix
index 2e3d394f851..865d8fde9ea 100644
--- a/pkgs/development/interpreters/perl/wrapper.nix
+++ b/pkgs/development/interpreters/perl/wrapper.nix
@@ -1,4 +1,4 @@
-{ stdenv, perl, buildEnv, makeWrapper
+{ lib, stdenv, perl, buildEnv, makeWrapper
 , extraLibs ? []
 , extraOutputsToInstall ? []
 , postBuild ? ""
@@ -28,7 +28,7 @@ let
       mkdir -p "$out/bin"
 
       # take every binary from perl packages and put them into the env
-      for path in ${stdenv.lib.concatStringsSep " " paths}; do
+      for path in ${lib.concatStringsSep " " paths}; do
         if [ -d "$path/bin" ]; then
           cd "$path/bin"
           for prg in *; do
diff --git a/pkgs/development/interpreters/php/generic.nix b/pkgs/development/interpreters/php/generic.nix
index 2389b56bd6f..191d589aa90 100644
--- a/pkgs/development/interpreters/php/generic.nix
+++ b/pkgs/development/interpreters/php/generic.nix
@@ -269,7 +269,7 @@ let
             inherit ztsSupport;
           };
 
-          meta = with stdenv.lib; {
+          meta = with lib; {
             description = "An HTML-embedded scripting language";
             homepage = "https://www.php.net/";
             license = licenses.php301;
diff --git a/pkgs/development/interpreters/picoc/default.nix b/pkgs/development/interpreters/picoc/default.nix
index f7343f6e4d6..2c674754935 100644
--- a/pkgs/development/interpreters/picoc/default.nix
+++ b/pkgs/development/interpreters/picoc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, readline }:
+{ lib, stdenv, fetchFromGitHub, readline }:
 
 stdenv.mkDerivation rec {
   pname = "picoc";
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
     install -m644 *.h $out/include
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Very small C interpreter for scripting";
     longDescription = ''
       PicoC is a very small C interpreter for scripting. It was originally
diff --git a/pkgs/development/interpreters/picolisp/default.nix b/pkgs/development/interpreters/picolisp/default.nix
index 1511698c921..341797fa3f4 100644
--- a/pkgs/development/interpreters/picolisp/default.nix
+++ b/pkgs/development/interpreters/picolisp/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, jdk, w3m, openssl, makeWrapper }:
-with stdenv.lib;
+{ lib, stdenv, fetchurl, jdk, w3m, openssl, makeWrapper }:
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "picoLisp";
diff --git a/pkgs/development/interpreters/pixie/default.nix b/pkgs/development/interpreters/pixie/default.nix
index 02f561c004e..ca55eceaedb 100644
--- a/pkgs/development/interpreters/pixie/default.nix
+++ b/pkgs/development/interpreters/pixie/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, fetchurl, python2, makeWrapper, pkg-config, gcc,
+{ lib, stdenv, fetchgit, fetchurl, python2, makeWrapper, pkg-config, gcc,
   pypy, libffi, libedit, libuv, boost, zlib,
   variant ? "jit", buildWithPypy ? false }:
 
@@ -23,11 +23,11 @@ let
     sha256 = "0ylbqvhbcp5m09l15i2q2h3a0vjd055x2r37cq71lkhgmmaxrwbq";
   };
   libs = [ libffi libedit libuv boost.dev boost.out zlib ];
-  include-path = stdenv.lib.concatStringsSep ":"
+  include-path = lib.concatStringsSep ":"
                    (map (p: "${p}/include") libs);
-  library-path = stdenv.lib.concatStringsSep ":"
+  library-path = lib.concatStringsSep ":"
                    (map (p: "${p}/lib") libs);
-  bin-path = stdenv.lib.concatStringsSep ":"
+  bin-path = lib.concatStringsSep ":"
                (map (p: "${p}/bin") [ gcc ]);
   build = {flags, target}: stdenv.mkDerivation rec {
     pname = "pixie";
@@ -85,9 +85,9 @@ let
     meta = {
       description = "A clojure-like lisp, built with the pypy vm toolkit";
       homepage = "https://github.com/pixie-lang/pixie";
-      license = stdenv.lib.licenses.lgpl3;
+      license = lib.licenses.lgpl3;
       platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin"];
-      maintainers = with stdenv.lib.maintainers; [ bendlas ];
+      maintainers = with lib.maintainers; [ bendlas ];
     };
   };
 in build (builtins.getAttr variant variants)
diff --git a/pkgs/development/interpreters/pixie/dust.nix b/pkgs/development/interpreters/pixie/dust.nix
index 4a7f3423def..e6818cb03ed 100644
--- a/pkgs/development/interpreters/pixie/dust.nix
+++ b/pkgs/development/interpreters/pixie/dust.nix
@@ -1,4 +1,4 @@
-{ stdenv, pixie, fetchFromGitHub }:
+{ lib, stdenv, pixie, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   name = "dust-0-91";
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Provides tooling around pixie, e.g. a nicer repl, running tests and fetching dependencies";
     homepage = src.meta.homepage;
-    license = stdenv.lib.licenses.lgpl3;
-    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+    license = lib.licenses.lgpl3;
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
   };
 }
diff --git a/pkgs/development/interpreters/proglodyte-wasm/default.nix b/pkgs/development/interpreters/proglodyte-wasm/default.nix
index 3569f66aed0..2d4acbd398e 100644
--- a/pkgs/development/interpreters/proglodyte-wasm/default.nix
+++ b/pkgs/development/interpreters/proglodyte-wasm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, clang, python, v8, coreutils }:
+{ lib, stdenv, fetchFromGitHub, cmake, clang, python, v8, coreutils }:
 
 let
   sexpr_wasm_prototype = stdenv.mkDerivation {
@@ -51,7 +51,7 @@ stdenv.mkDerivation {
     make install
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "wasm runs WebAssembly from the command line";
     maintainers = with maintainers; [ proglodyte ];
     platforms = platforms.linux;
diff --git a/pkgs/development/interpreters/pyrex/0.9.5.nix b/pkgs/development/interpreters/pyrex/0.9.5.nix
index 40eb1daf49c..668adf2c44a 100644
--- a/pkgs/development/interpreters/pyrex/0.9.5.nix
+++ b/pkgs/development/interpreters/pyrex/0.9.5.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, python2Packages }:
+{ lib, stdenv, fetchurl, python2Packages }:
 
 let version = "0.9.5.1.1"; in
 
@@ -16,6 +16,6 @@ python2Packages.buildPythonPackage {
   meta = {
     homepage = "http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/";
     description = "A language for writing Python extension modules";
-    license = stdenv.lib.licenses.asl20;
+    license = lib.licenses.asl20;
   };
 }
diff --git a/pkgs/development/interpreters/pyrex/0.9.6.nix b/pkgs/development/interpreters/pyrex/0.9.6.nix
index e518edba1b3..2c4c74baecf 100644
--- a/pkgs/development/interpreters/pyrex/0.9.6.nix
+++ b/pkgs/development/interpreters/pyrex/0.9.6.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, python2Packages }:
+{ lib, stdenv, fetchurl, python2Packages }:
 
 let version = "0.9.6.4"; in
 
@@ -16,6 +16,6 @@ python2Packages.buildPythonPackage {
   meta = {
     homepage = "http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/";
     description = "A language for writing Python extension modules";
-    license = stdenv.lib.licenses.asl20;
+    license = lib.licenses.asl20;
   };
 }
diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix
index 4c0501aebcd..85af394e3f6 100644
--- a/pkgs/development/interpreters/python/cpython/2.7/default.nix
+++ b/pkgs/development/interpreters/python/cpython/2.7/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch
+{ lib, stdenv, fetchurl, fetchpatch
 , bzip2
 , expat
 , libffi
@@ -36,7 +36,7 @@ assert x11Support -> tcl != null
                   && xlibsWrapper != null
                   && libX11 != null;
 
-with stdenv.lib;
+with lib;
 
 let
   buildPackages = pkgsBuildHost;
@@ -215,7 +215,7 @@ let
   };
 
   # Python 2.7 needs this
-  crossCompileEnv = stdenv.lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform)
+  crossCompileEnv = lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform)
                       { _PYTHON_HOST_PLATFORM = stdenv.hostPlatform.config; };
 
   # Build the basic Python interpreter without modules that have
@@ -227,7 +227,7 @@ in with passthru; stdenv.mkDerivation ({
 
     inherit src patches buildInputs nativeBuildInputs preConfigure configureFlags;
 
-    LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s";
+    LDFLAGS = lib.optionalString (!stdenv.isDarwin) "-lgcc_s";
     inherit (mkPaths buildInputs) C_INCLUDE_PATH LIBRARY_PATH;
 
     NIX_CFLAGS_COMPILE = optionalString stdenv.isDarwin "-msse2"
@@ -298,9 +298,9 @@ in with passthru; stdenv.mkDerivation ({
         hierarchical packages; exception-based error handling; and very
         high level dynamic data types.
       '';
-      license = stdenv.lib.licenses.psfl;
-      platforms = stdenv.lib.platforms.all;
-      maintainers = with stdenv.lib.maintainers; [ fridh ];
+      license = lib.licenses.psfl;
+      platforms = lib.platforms.all;
+      maintainers = with lib.maintainers; [ fridh ];
       # Higher priority than Python 3.x so that `/bin/python` points to `/bin/python2`
       # in case both 2 and 3 are installed.
       priority = -100;
diff --git a/pkgs/development/interpreters/python/cpython/default.nix b/pkgs/development/interpreters/python/cpython/default.nix
index 347245f8a01..7bc6084f61d 100644
--- a/pkgs/development/interpreters/python/cpython/default.nix
+++ b/pkgs/development/interpreters/python/cpython/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch
+{ lib, stdenv, fetchurl, fetchpatch
 , bzip2
 , expat
 , libffi
@@ -54,7 +54,7 @@ assert x11Support -> tcl != null
 
 assert bluezSupport -> bluez != null;
 
-with stdenv.lib;
+with lib;
 
 let
   buildPackages = pkgsBuildHost;
@@ -369,14 +369,14 @@ in with passthru; stdenv.mkDerivation {
     find $out -type d -name __pycache__ -print0 | xargs -0 -I {} rm -rf "{}"
   '';
 
-  preFixup = stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
+  preFixup = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
     # Ensure patch-shebangs uses shebangs of host interpreter.
-    export PATH=${stdenv.lib.makeBinPath [ "$out" bash ]}:$PATH
+    export PATH=${lib.makeBinPath [ "$out" bash ]}:$PATH
   '';
 
   # Add CPython specific setup-hook that configures distutils.sysconfig to
   # always load sysconfigdata from host Python.
-  postFixup = stdenv.lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
+  postFixup = lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
     cat << "EOF" >> "$out/nix-support/setup-hook"
     ${sysconfigdataHook}
     EOF
@@ -385,8 +385,8 @@ in with passthru; stdenv.mkDerivation {
   # Enforce that we don't have references to the OpenSSL -dev package, which we
   # explicitly specify in our configure flags above.
   disallowedReferences =
-    stdenv.lib.optionals (openssl != null && !static) [ openssl.dev ]
-    ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+    lib.optionals (openssl != null && !static) [ openssl.dev ]
+    ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     # Ensure we don't have references to build-time packages.
     # These typically end up in shebangs.
     pythonForBuild buildPackages.bash
diff --git a/pkgs/development/interpreters/python/pypy/default.nix b/pkgs/development/interpreters/python/pypy/default.nix
index 9c6457d22aa..cfa1ac71891 100644
--- a/pkgs/development/interpreters/python/pypy/default.nix
+++ b/pkgs/development/interpreters/python/pypy/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, substituteAll, fetchurl
+{ lib, stdenv, substituteAll, fetchurl
 , zlib ? null, zlibSupport ? true, bzip2, pkg-config, libffi, libunwind, Security
 , sqlite, openssl, ncurses, python, expat, tcl, tk, tix, xlibsWrapper, libX11
 , self, gdbm, db, lzma
@@ -14,12 +14,12 @@
 , pythonVersion
 , sha256
 , passthruFun
-, pythonAttr ? "pypy${stdenv.lib.substring 0 1 pythonVersion}${stdenv.lib.substring 2 3 pythonVersion}"
+, pythonAttr ? "pypy${lib.substring 0 1 pythonVersion}${lib.substring 2 3 pythonVersion}"
 }:
 
 assert zlibSupport -> zlib != null;
 
-with stdenv.lib;
+with lib;
 
 let
   isPy3k = substring 0 1 pythonVersion == "3";
@@ -144,7 +144,7 @@ in with passthru; stdenv.mkDerivation rec {
     ln -s $out/${executable}-c/include $out/include/${libPrefix}
     ln -s $out/${executable}-c/lib-python/${if isPy3k then "3" else pythonVersion} $out/lib/${libPrefix}
 
-    ${stdenv.lib.optionalString stdenv.isDarwin ''
+    ${lib.optionalString stdenv.isDarwin ''
       install_name_tool -change @rpath/libpypy${optionalString isPy3k "3"}-c.dylib $out/lib/libpypy${optionalString isPy3k "3"}-c.dylib $out/bin/${executable}
     ''}
 
@@ -158,7 +158,7 @@ in with passthru; stdenv.mkDerivation rec {
   inherit passthru;
   enableParallelBuilding = true;  # almost no parallelization without STM
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://pypy.org/";
     description = "Fast, compliant alternative implementation of the Python language (${pythonVersion})";
     license = licenses.mit;
diff --git a/pkgs/development/interpreters/python/pypy/prebuilt.nix b/pkgs/development/interpreters/python/pypy/prebuilt.nix
index 1522047a380..6fd0ee2e925 100644
--- a/pkgs/development/interpreters/python/pypy/prebuilt.nix
+++ b/pkgs/development/interpreters/python/pypy/prebuilt.nix
@@ -22,7 +22,7 @@
 # This version of PyPy is primarily added to speed-up translation of
 # our PyPy source build when developing that expression.
 
-with stdenv.lib;
+with lib;
 
 let
   isPy3k = majorVersion == "3";
@@ -78,7 +78,7 @@ in with passthru; stdenv.mkDerivation {
 
     pushd $out
     find {lib,lib_pypy*} -name "*.so" -exec patchelf --remove-needed libncursesw.so.6 --replace-needed libtinfow.so.6 libncursesw.so.6 {} \;
-    find {lib,lib_pypy*} -name "*.so" -exec patchelf --set-rpath ${stdenv.lib.makeLibraryPath deps}:$out/lib {} \;
+    find {lib,lib_pypy*} -name "*.so" -exec patchelf --set-rpath ${lib.makeLibraryPath deps}:$out/lib {} \;
 
     echo "Removing bytecode"
     find . -name "__pycache__" -type d -depth -exec rm -rf {} \;
@@ -115,7 +115,7 @@ in with passthru; stdenv.mkDerivation {
 
   inherit passthru;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://pypy.org/";
     description = "Fast, compliant alternative implementation of the Python language (${pythonVersion})";
     license = licenses.mit;
diff --git a/pkgs/development/interpreters/python/tests.nix b/pkgs/development/interpreters/python/tests.nix
index a291919b327..61fc497024b 100644
--- a/pkgs/development/interpreters/python/tests.nix
+++ b/pkgs/development/interpreters/python/tests.nix
@@ -93,4 +93,4 @@ let
 
 
 
-in stdenv.lib.optionalAttrs (stdenv.hostPlatform == stdenv.buildPlatform ) (environmentTests // integrationTests)
+in lib.optionalAttrs (stdenv.hostPlatform == stdenv.buildPlatform ) (environmentTests // integrationTests)
diff --git a/pkgs/development/interpreters/python/wrapper.nix b/pkgs/development/interpreters/python/wrapper.nix
index dffad6b98f5..61ad4a8a6ad 100644
--- a/pkgs/development/interpreters/python/wrapper.nix
+++ b/pkgs/development/interpreters/python/wrapper.nix
@@ -1,4 +1,4 @@
-{ stdenv, python, buildEnv, makeWrapper
+{ lib, stdenv, python, buildEnv, makeWrapper
 , extraLibs ? []
 , extraOutputsToInstall ? []
 , postBuild ? ""
@@ -30,14 +30,14 @@ let
       fi
       mkdir -p "$out/bin"
 
-      for path in ${stdenv.lib.concatStringsSep " " paths}; do
+      for path in ${lib.concatStringsSep " " paths}; do
         if [ -d "$path/bin" ]; then
           cd "$path/bin"
           for prg in *; do
             if [ -f "$prg" ]; then
               rm -f "$out/bin/$prg"
               if [ -x "$prg" ]; then
-                makeWrapper "$path/bin/$prg" "$out/bin/$prg" --set NIX_PYTHONPREFIX "$out" --set NIX_PYTHONEXECUTABLE ${pythonExecutable} --set NIX_PYTHONPATH ${pythonPath} ${if permitUserSite then "" else ''--set PYTHONNOUSERSITE "true"''} ${stdenv.lib.concatStringsSep " " makeWrapperArgs}
+                makeWrapper "$path/bin/$prg" "$out/bin/$prg" --set NIX_PYTHONPREFIX "$out" --set NIX_PYTHONEXECUTABLE ${pythonExecutable} --set NIX_PYTHONPATH ${pythonPath} ${if permitUserSite then "" else ''--set PYTHONNOUSERSITE "true"''} ${lib.concatStringsSep " " makeWrapperArgs}
               fi
             fi
           done
diff --git a/pkgs/development/interpreters/qnial/default.nix b/pkgs/development/interpreters/qnial/default.nix
index 4ce4db5aca1..ba46989c94a 100644
--- a/pkgs/development/interpreters/qnial/default.nix
+++ b/pkgs/development/interpreters/qnial/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, unzip, pkg-config, makeWrapper, ncurses }:
+{ lib, stdenv, fetchFromGitHub, unzip, pkg-config, makeWrapper, ncurses }:
 
 stdenv.mkDerivation {
   pname = "qnial";
@@ -33,8 +33,8 @@ stdenv.mkDerivation {
   meta = {
     description = "An array language from Nial Systems";
     homepage = "https://github.com/vrthra/qnial";
-    license = stdenv.lib.licenses.artistic1;
-    maintainers = [ stdenv.lib.maintainers.vrthra ];
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.artistic1;
+    maintainers = [ lib.maintainers.vrthra ];
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/pkgs/development/interpreters/quickjs/default.nix b/pkgs/development/interpreters/quickjs/default.nix
index b1d03252d7e..b9d2b9deb79 100644
--- a/pkgs/development/interpreters/quickjs/default.nix
+++ b/pkgs/development/interpreters/quickjs/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "quickjs";
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
     out=$(mktemp) && qjsbnc -flto "$temp" -o "$out" && "$out" | grep -q "Output from compiled program"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A small and embeddable Javascript engine";
     homepage = "https://bellard.org/quickjs/";
     maintainers = with maintainers; [ stesie ];
diff --git a/pkgs/development/interpreters/racket/default.nix b/pkgs/development/interpreters/racket/default.nix
index 2c51c691a8b..8d33962f914 100644
--- a/pkgs/development/interpreters/racket/default.nix
+++ b/pkgs/development/interpreters/racket/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeFontsConf
+{ lib, stdenv, fetchurl, makeFontsConf
 , cacert
 , cairo, coreutils, fontconfig, freefont_ttf
 , glib, gmp
@@ -22,7 +22,7 @@ let
     fontDirectories = [ freefont_ttf ];
   };
 
-  libPath = stdenv.lib.makeLibraryPath [
+  libPath = lib.makeLibraryPath [
     cairo
     fontconfig
     glib
@@ -48,7 +48,7 @@ stdenv.mkDerivation rec {
   pname = "racket";
   version = "7.9"; # always change at once with ./minimal.nix
 
-  src = (stdenv.lib.makeOverridable ({ name, sha256 }:
+  src = (lib.makeOverridable ({ name, sha256 }:
     fetchurl {
       url = "https://mirror.racket-lang.org/installers/${version}/${name}-src.tgz";
       inherit sha256;
@@ -60,15 +60,15 @@ stdenv.mkDerivation rec {
 
   FONTCONFIG_FILE = fontsConf;
   LD_LIBRARY_PATH = libPath;
-  NIX_LDFLAGS = stdenv.lib.concatStringsSep " " [
-    (stdenv.lib.optionalString (stdenv.cc.isGNU && ! stdenv.isDarwin) "-lgcc_s")
-    (stdenv.lib.optionalString stdenv.isDarwin "-framework CoreFoundation")
+  NIX_LDFLAGS = lib.concatStringsSep " " [
+    (lib.optionalString (stdenv.cc.isGNU && ! stdenv.isDarwin) "-lgcc_s")
+    (lib.optionalString stdenv.isDarwin "-framework CoreFoundation")
   ];
 
   nativeBuildInputs = [ cacert wrapGAppsHook ];
 
   buildInputs = [ fontconfig libffi libtool sqlite gsettings-desktop-schemas gtk3 ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ libiconv CoreFoundation ];
+    ++ lib.optionals stdenv.isDarwin [ libiconv CoreFoundation ];
 
   preConfigure = ''
     unset AR
@@ -83,15 +83,15 @@ stdenv.mkDerivation rec {
 
   shared = if stdenv.isDarwin then "dylib" else "shared";
   configureFlags = [ "--enable-${shared}"  "--enable-lt=${libtool}/bin/libtool" ]
-                   ++ stdenv.lib.optional disableDocs [ "--disable-docs" ]
-                   ++ stdenv.lib.optional stdenv.isDarwin [ "--enable-xonx" ];
+                   ++ lib.optional disableDocs [ "--disable-docs" ]
+                   ++ lib.optional stdenv.isDarwin [ "--enable-xonx" ];
 
   configureScript = "../configure";
 
   enableParallelBuilding = false;
 
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A programmable programming language";
     longDescription = ''
       Racket is a full-spectrum programming language. It goes beyond
diff --git a/pkgs/development/interpreters/rakudo/default.nix b/pkgs/development/interpreters/rakudo/default.nix
index c645fae0d84..99a812905d4 100644
--- a/pkgs/development/interpreters/rakudo/default.nix
+++ b/pkgs/development/interpreters/rakudo/default.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
   # Some tests fail on Darwin
   doCheck = !stdenv.isDarwin;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Raku implementation on top of Moar virtual machine";
     homepage    = "https://www.rakudo.org";
     license     = licenses.artistic2;
diff --git a/pkgs/development/interpreters/rakudo/moarvm.nix b/pkgs/development/interpreters/rakudo/moarvm.nix
index 54b487c2595..f833c153b96 100644
--- a/pkgs/development/interpreters/rakudo/moarvm.nix
+++ b/pkgs/development/interpreters/rakudo/moarvm.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl
+{ lib, stdenv, fetchurl, perl
 , CoreServices, ApplicationServices }:
 
 stdenv.mkDerivation rec {
@@ -10,12 +10,12 @@ stdenv.mkDerivation rec {
     sha256 = "18iys1bdb92asggrsz7sg1hh76j7kq63c3fgg33fnla18qf4z488";
    };
 
-  buildInputs = [ perl ] ++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices ApplicationServices ];
+  buildInputs = [ perl ] ++ lib.optionals stdenv.isDarwin [ CoreServices ApplicationServices ];
   doCheck = false; # MoarVM does not come with its own test suite
 
   configureScript = "${perl}/bin/perl ./Configure.pl";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "VM with adaptive optimization and JIT compilation, built for Rakudo";
     homepage    = "https://www.moarvm.org/";
     license     = licenses.artistic2;
diff --git a/pkgs/development/interpreters/rakudo/nqp.nix b/pkgs/development/interpreters/rakudo/nqp.nix
index 04b628bc9da..b4b41fa8804 100644
--- a/pkgs/development/interpreters/rakudo/nqp.nix
+++ b/pkgs/development/interpreters/rakudo/nqp.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Not Quite Perl -- a lightweight Raku-like environment for virtual machines";
     homepage    = "https://github.com/perl6/nqp";
     license     = licenses.artistic2;
diff --git a/pkgs/development/interpreters/rakudo/zef.nix b/pkgs/development/interpreters/rakudo/zef.nix
index b2cea4ad473..860ffc0aea0 100644
--- a/pkgs/development/interpreters/rakudo/zef.nix
+++ b/pkgs/development/interpreters/rakudo/zef.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, rakudo, makeWrapper }:
+{ lib, stdenv, fetchFromGitHub, rakudo, makeWrapper }:
 
 stdenv.mkDerivation rec {
   pname = "zef";
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     wrapProgram $out/bin/zef --prefix RAKUDOLIB , "inst#$out"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Raku / Perl6 Module Management";
     homepage    = "https://github.com/ugexe/zef";
     license     = licenses.artistic2;
diff --git a/pkgs/development/interpreters/rascal/default.nix b/pkgs/development/interpreters/rascal/default.nix
index 8b802043fe3..cd2b74db052 100644
--- a/pkgs/development/interpreters/rascal/default.nix
+++ b/pkgs/development/interpreters/rascal/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper, jdk }:
+{ lib, stdenv, fetchurl, makeWrapper, jdk }:
 
 stdenv.mkDerivation rec {
   name = "rascal-0.6.2";
@@ -22,8 +22,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://www.rascal-mpl.org/";
     description = "Command-line REPL for the Rascal metaprogramming language";
-    license = stdenv.lib.licenses.epl10;
-    maintainers = [ stdenv.lib.maintainers.eelco ];
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.epl10;
+    maintainers = [ lib.maintainers.eelco ];
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/interpreters/rebol/default.nix b/pkgs/development/interpreters/rebol/default.nix
index 4206e1e1604..39a4108e041 100644
--- a/pkgs/development/interpreters/rebol/default.nix
+++ b/pkgs/development/interpreters/rebol/default.nix
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
     cp r3 $out/bin
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Relative expression based object language, a language where code is data";
     maintainers = with maintainers; [ vrthra ];
     platforms = [ "x86_64-linux" ];
diff --git a/pkgs/development/interpreters/red/default.nix b/pkgs/development/interpreters/red/default.nix
index 554dc81bffb..6689f7eb5c3 100644
--- a/pkgs/development/interpreters/red/default.nix
+++ b/pkgs/development/interpreters/red/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, stdenv_32bit, pkgsi686Linux, fetchFromGitHub, fetchurl }:
+{ lib, stdenv, stdenv_32bit, pkgsi686Linux, fetchFromGitHub, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "red";
@@ -77,7 +77,7 @@ stdenv.mkDerivation rec {
 
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = ''
       New programming language strongly inspired by Rebol, but with a
       broader field of usage thanks to its native-code compiler, from system
diff --git a/pkgs/development/interpreters/regina/default.nix b/pkgs/development/interpreters/regina/default.nix
index ec19b0679f4..79258d2cc0f 100644
--- a/pkgs/development/interpreters/regina/default.nix
+++ b/pkgs/development/interpreters/regina/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ncurses }:
+{ lib, stdenv, fetchurl, ncurses }:
 
 stdenv.mkDerivation rec {
   pname = "Regina-REXX";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     "--libdir=$(out)/lib"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "REXX interpreter";
     maintainers = [ maintainers.raskin ];
     platforms = platforms.linux;
diff --git a/pkgs/development/interpreters/renpy/default.nix b/pkgs/development/interpreters/renpy/default.nix
index 3768751efdc..ae5227fb198 100644
--- a/pkgs/development/interpreters/renpy/default.nix
+++ b/pkgs/development/interpreters/renpy/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, python2Packages, pkg-config, SDL2
+{ lib, stdenv, fetchurl, python2Packages, pkg-config, SDL2
 , libpng, ffmpeg_3, freetype, glew, libGL, libGLU, fribidi, zlib
 , glib
 }:
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   pname = "renpy";
   version = "7.3.5";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Ren'Py Visual Novel Engine";
     homepage = "https://renpy.org/";
     license = licenses.mit;
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
 
   pythonPath = [ pygame_sdl2 tkinter ];
 
-  RENPY_DEPS_INSTALL = stdenv.lib.concatStringsSep "::" (map (path: path) [
+  RENPY_DEPS_INSTALL = lib.concatStringsSep "::" (map (path: path) [
     SDL2 SDL2.dev libpng ffmpeg_3 ffmpeg_3.out freetype glew.dev glew.out libGLU libGL fribidi zlib
   ]);
 
diff --git a/pkgs/development/interpreters/ruby/default.nix b/pkgs/development/interpreters/ruby/default.nix
index 87aa5aca1e1..2678188e8cf 100644
--- a/pkgs/development/interpreters/ruby/default.nix
+++ b/pkgs/development/interpreters/ruby/default.nix
@@ -159,7 +159,7 @@ let
           export GEM_HOME="$out/${passthru.gemPath}"
         '';
 
-        installFlags = stdenv.lib.optional docSupport "install-doc";
+        installFlags = lib.optional docSupport "install-doc";
         # Bundler tries to create this directory
         postInstall = ''
           # Remove unnecessary groff reference from runtime closure, since it's big
@@ -208,7 +208,7 @@ let
 
         disallowedRequisites = op (!jitSupport) stdenv.cc.cc;
 
-        meta = with stdenv.lib; {
+        meta = with lib; {
           description = "The Ruby language";
           homepage    = "http://www.ruby-lang.org/en/";
           license     = licenses.ruby;
diff --git a/pkgs/development/interpreters/scheme48/default.nix b/pkgs/development/interpreters/scheme48/default.nix
index 5a1e3f265b2..ca34d5055c5 100644
--- a/pkgs/development/interpreters/scheme48/default.nix
+++ b/pkgs/development/interpreters/scheme48/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation {
   name = "scheme48-1.9.2";
@@ -6,8 +6,8 @@ stdenv.mkDerivation {
   meta = {
     homepage = "http://s48.org/";
     description = "Scheme 48";
-    platforms = with stdenv.lib.platforms; unix;
-    license = stdenv.lib.licenses.bsd3;
+    platforms = with lib.platforms; unix;
+    license = lib.licenses.bsd3;
   };
 
   src = fetchurl {
diff --git a/pkgs/development/interpreters/scsh/default.nix b/pkgs/development/interpreters/scsh/default.nix
index bb4f418f502..6dcb8bd27c5 100644
--- a/pkgs/development/interpreters/scsh/default.nix
+++ b/pkgs/development/interpreters/scsh/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, autoreconfHook, scheme48 }:
+{ lib, stdenv, fetchgit, autoreconfHook, scheme48 }:
 
 stdenv.mkDerivation {
   name = "scsh-0.7pre";
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
   buildInputs = [ scheme48 ];
   configureFlags = [ "--with-scheme48=${scheme48}" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A Scheme shell";
     homepage = "http://www.scsh.net/";
     license = licenses.bsd3;
diff --git a/pkgs/development/interpreters/self/default.nix b/pkgs/development/interpreters/self/default.nix
index 0d5cc061f59..58cac6bbe9b 100644
--- a/pkgs/development/interpreters/self/default.nix
+++ b/pkgs/development/interpreters/self/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, libX11, libXext, makeWrapper, ncurses, cmake }:
+{ lib, stdenv, fetchFromGitHub, libX11, libXext, makeWrapper, ncurses, cmake }:
 
 stdenv.mkDerivation rec {
   # The Self wrapper stores source in $XDG_DATA_HOME/self or ~/.local/share/self
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
       --set SELF_ROOT "$out"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A prototype-based dynamic object-oriented programming language, environment, and virtual machine";
     homepage = "https://selflanguage.org/";
     license = licenses.bsd3;
diff --git a/pkgs/development/interpreters/shen-sbcl/default.nix b/pkgs/development/interpreters/shen-sbcl/default.nix
index 6d10669d20d..f93e0ae5d95 100644
--- a/pkgs/development/interpreters/shen-sbcl/default.nix
+++ b/pkgs/development/interpreters/shen-sbcl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , shen-sources
 , sbcl
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     mkdir -p $out
     install -m755 -D bin/sbcl/shen $out/bin/shen-sbcl
   '';
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = https://shenlanguage.org;
     description = "Port of Shen running on Steel Bank Common Lisp";
     platforms = sbcl.meta.platforms;
diff --git a/pkgs/development/interpreters/shen-sources/default.nix b/pkgs/development/interpreters/shen-sources/default.nix
index f35631daa28..84839cf42de 100644
--- a/pkgs/development/interpreters/shen-sources/default.nix
+++ b/pkgs/development/interpreters/shen-sources/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 }:
 
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     cp . $out -R
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = https://shenlanguage.org;
     description = "Source code for the Shen Language";
     platforms = platforms.all;
diff --git a/pkgs/development/interpreters/spidermonkey/1.8.5.nix b/pkgs/development/interpreters/spidermonkey/1.8.5.nix
index 0588d564b1c..4892e0b8abe 100644
--- a/pkgs/development/interpreters/spidermonkey/1.8.5.nix
+++ b/pkgs/development/interpreters/spidermonkey/1.8.5.nix
@@ -28,7 +28,7 @@ stdenv.mkDerivation {
       url = "https://sources.debian.org/data/main/m/mozjs/1.8.5-1.0.0+dfsg-6/debian/patches/fix-811665.patch";
       sha256 = "1q8477xqxiy5d8376k5902l45gd0qkd4nxmhl8vr6rr1pxfcny99";
     })
-  ] ++ stdenv.lib.optionals stdenv.isAarch32 [
+  ] ++ lib.optionals stdenv.isAarch32 [
     # Explained below in configureFlags for ARM
     ./1.8.5-findvanilla.patch
     # Fix for hard float flags.
@@ -49,7 +49,7 @@ stdenv.mkDerivation {
   # of polkit, which is what matters most, it does not override the allocator
   # so the failure of that test does not matter much.
   configureFlags = [ "--enable-threadsafe" "--with-system-nspr" ] ++
-    stdenv.lib.optionals (stdenv.hostPlatform.system == "armv5tel-linux") [
+    lib.optionals (stdenv.hostPlatform.system == "armv5tel-linux") [
         "--with-cpu-arch=armv5t"
         "--disable-tracejit" ];
 
@@ -67,7 +67,7 @@ stdenv.mkDerivation {
     rm jit-test/tests/sunspider/check-date-format-tofte.js    # https://bugzil.la/600522
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Mozilla's JavaScript engine written in C/C++";
     homepage = "https://developer.mozilla.org/en/SpiderMonkey";
     # TODO: MPL/GPL/LGPL tri-license.
diff --git a/pkgs/development/interpreters/spidermonkey/38.nix b/pkgs/development/interpreters/spidermonkey/38.nix
index 2a527eb8640..482561a901e 100644
--- a/pkgs/development/interpreters/spidermonkey/38.nix
+++ b/pkgs/development/interpreters/spidermonkey/38.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchurl, pkg-config, gnused_422, perl, python2, zip, libffi, readline, icu, zlib, buildPackages
+{ lib, stdenv, fetchurl, pkg-config, gnused_422, perl, python2, zip, libffi, readline, icu, zlib, buildPackages
 , libobjc }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   version = "38.8.0";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ libffi readline icu zlib ]
-               ++ stdenv.lib.optional stdenv.isDarwin libobjc;
+               ++ lib.optional stdenv.isDarwin libobjc;
   nativeBuildInputs = [ pkg-config perl python2 zip gnused_422 ];
 
   postUnpack = "sourceRoot=\${sourceRoot}/js/src";
@@ -60,7 +60,7 @@ stdenv.mkDerivation rec {
     done
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Mozilla's JavaScript engine written in C/C++";
     homepage = "https://developer.mozilla.org/en/SpiderMonkey";
     # TODO: MPL/GPL/LGPL tri-license.
diff --git a/pkgs/development/interpreters/spidermonkey/60.nix b/pkgs/development/interpreters/spidermonkey/60.nix
index 4bb6c815b2d..d75e5e8b285 100644
--- a/pkgs/development/interpreters/spidermonkey/60.nix
+++ b/pkgs/development/interpreters/spidermonkey/60.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchurl, fetchpatch, autoconf213, pkg-config, perl, python2, zip, buildPackages
+{ lib, stdenv, fetchurl, fetchpatch, autoconf213, pkg-config, perl, python2, zip, buildPackages
 , which, readline, zlib, icu }:
 
-with stdenv.lib;
+with lib;
 
 let
   version = "60.9.0";
@@ -73,7 +73,7 @@ in stdenv.mkDerivation {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Mozilla's JavaScript engine written in C/C++";
     homepage = "https://developer.mozilla.org/en/SpiderMonkey";
     license = licenses.gpl2; # TODO: MPL/GPL/LGPL tri-license.
diff --git a/pkgs/development/interpreters/spidermonkey/68.nix b/pkgs/development/interpreters/spidermonkey/68.nix
index bb577be4cd7..0ac005b07de 100644
--- a/pkgs/development/interpreters/spidermonkey/68.nix
+++ b/pkgs/development/interpreters/spidermonkey/68.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchurl, fetchpatch, autoconf213, pkg-config, perl, python2, python3, zip, buildPackages
+{ lib, stdenv, fetchurl, fetchpatch, autoconf213, pkg-config, perl, python2, python3, zip, buildPackages
 , which, readline, zlib, icu, cargo, rustc, llvmPackages }:
 
-with stdenv.lib;
+with lib;
 
 let
   python3Env = buildPackages.python3.withPackages (p: [p.six]);
@@ -85,7 +85,7 @@ in stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Mozilla's JavaScript engine written in C/C++";
     homepage = "https://developer.mozilla.org/en/SpiderMonkey";
     license = licenses.gpl2; # TODO: MPL/GPL/LGPL tri-license.
diff --git a/pkgs/development/interpreters/spidermonkey/78.nix b/pkgs/development/interpreters/spidermonkey/78.nix
index e7f63870181..81ebcedf7bc 100644
--- a/pkgs/development/interpreters/spidermonkey/78.nix
+++ b/pkgs/development/interpreters/spidermonkey/78.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , fetchpatch
 , autoconf213
@@ -76,7 +76,7 @@ stdenv.mkDerivation rec {
     # https://src.fedoraproject.org/rpms/mozjs38/c/761399aba092bcb1299bb4fccfd60f370ab4216e
     "--enable-optimize"
     "--enable-release"
-  ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+  ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     # Spidermonkey seems to use different host/build terminology for cross
     # compilation here.
     "--host=${stdenv.buildPlatform.config}"
@@ -96,7 +96,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Mozilla's JavaScript engine written in C/C++";
     homepage = "https://developer.mozilla.org/en/SpiderMonkey";
     license = licenses.gpl2; # TODO: MPL/GPL/LGPL tri-license.
diff --git a/pkgs/development/interpreters/supercollider/default.nix b/pkgs/development/interpreters/supercollider/default.nix
index df873937b4f..f80e18c7bb9 100644
--- a/pkgs/development/interpreters/supercollider/default.nix
+++ b/pkgs/development/interpreters/supercollider/default.nix
@@ -1,10 +1,10 @@
-{ stdenv, fetchurl, cmake, pkg-config, alsaLib
+{ lib, stdenv, fetchurl, cmake, pkg-config, alsaLib
 , libjack2, libsndfile, fftw, curl, gcc
 , libXt, qtbase, qttools, qtwebengine
 , readline, qtwebsockets, useSCEL ? false, emacs
 }:
 
-let optional = stdenv.lib.optional;
+let optional = lib.optional;
 in
 
 stdenv.mkDerivation rec {
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
       ++ optional (!stdenv.isDarwin) alsaLib
       ++ optional useSCEL emacs;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Programming language for real time audio synthesis";
     homepage = "https://supercollider.github.io";
     maintainers = with maintainers; [ mrmebelman ];
diff --git a/pkgs/development/interpreters/tcl/generic.nix b/pkgs/development/interpreters/tcl/generic.nix
index 9aaf8223837..e665e8cfb1e 100644
--- a/pkgs/development/interpreters/tcl/generic.nix
+++ b/pkgs/development/interpreters/tcl/generic.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 
 # Version specific stuff
 , release, version, src
@@ -27,7 +27,7 @@ stdenv.mkDerivation {
     # Don't install tzdata because NixOS already has a more up-to-date copy.
     "--with-tzdata=no"
     "tcl_cv_strtod_unbroken=ok"
-  ] ++ stdenv.lib.optional stdenv.is64bit "--enable-64bit";
+  ] ++ lib.optional stdenv.is64bit "--enable-64bit";
 
   enableParallelBuilding = true;
 
@@ -39,7 +39,7 @@ stdenv.mkDerivation {
     ln -s $out/lib/libtcl${release}${dllExtension} $out/lib/libtcl${dllExtension}
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "The Tcl scripting language";
     homepage = "https://www.tcl.tk/";
     license = licenses.tcltk;
diff --git a/pkgs/development/interpreters/tclreadline/default.nix b/pkgs/development/interpreters/tclreadline/default.nix
index bbd34f71d22..44d2745dac8 100644
--- a/pkgs/development/interpreters/tclreadline/default.nix
+++ b/pkgs/development/interpreters/tclreadline/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , automake
 , autoconf
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
 
   # The provided makefile leaves a wrong reference to /build/ in RPATH,
   # so we fix it after checking that everything is also present in $out
-  preFixup = stdenv.lib.optionalString stdenv.isLinux ''
+  preFixup = lib.optionalString stdenv.isLinux ''
     needed_libraries=$(ls .libs | grep '\.\(so\|la\)$')
     for lib in $needed_libraries; do
       if ! ls $out/lib | grep "$lib"; then
@@ -58,7 +58,7 @@ stdenv.mkDerivation rec {
     done
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "GNU readline for interactive tcl shells";
     homepage = "https://github.com/flightaware/tclreadline";
     license = licenses.bsd3;
diff --git a/pkgs/development/interpreters/tinyscheme/default.nix b/pkgs/development/interpreters/tinyscheme/default.nix
index b49a37a7285..8dd27b3f000 100644
--- a/pkgs/development/interpreters/tinyscheme/default.nix
+++ b/pkgs/development/interpreters/tinyscheme/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "tinyscheme";
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
     cp scheme $out/bin/tinyscheme
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Lightweight Scheme implementation";
     longDescription = ''
       TinyScheme is a lightweight Scheme interpreter that implements as large a
diff --git a/pkgs/development/interpreters/unicon-lang/default.nix b/pkgs/development/interpreters/unicon-lang/default.nix
index 4889a21ddfd..ac0a944f210 100644
--- a/pkgs/development/interpreters/unicon-lang/default.nix
+++ b/pkgs/development/interpreters/unicon-lang/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip, libX11, libXt, libnsl }:
+{ lib, stdenv, fetchurl, unzip, libX11, libXt, libnsl }:
 
 stdenv.mkDerivation {
   pname = "unicon-lang";
@@ -33,7 +33,7 @@ stdenv.mkDerivation {
     cp -r bin $out/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A very high level, goal-directed, object-oriented, general purpose applications language";
     maintainers = with maintainers; [ vrthra ];
     platforms = platforms.linux;
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 d442970ffcb..92bd85b1e8c 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/boost/generic.nix b/pkgs/development/libraries/boost/generic.nix
index 5a2b437d41d..abff1268bfa 100644
--- a/pkgs/development/libraries/boost/generic.nix
+++ b/pkgs/development/libraries/boost/generic.nix
@@ -14,7 +14,8 @@
 , enableNumpy ? false
 , taggedLayout ? ((enableRelease && enableDebug) || (enableSingleThreaded && enableMultiThreaded) || (enableShared && enableStatic))
 , patches ? []
-, mpi ? null
+, useMpi ? false
+, mpi
 , extraB2Args ? []
 
 # Attributes inherit from specific versions
@@ -94,7 +95,7 @@ let
     ++ optional (variant == "release") "debug-symbols=off"
     ++ optional (toolset != null) "toolset=${toolset}"
     ++ optional (!enablePython) "--without-python"
-    ++ optional (mpi != null || stdenv.hostPlatform != stdenv.buildPlatform) "--user-config=user-config.jam"
+    ++ optional (useMpi || stdenv.hostPlatform != stdenv.buildPlatform) "--user-config=user-config.jam"
     ++ optionals (stdenv.hostPlatform.libc == "msvcrt") [
     "threadapi=win32"
   ] ++ extraB2Args
@@ -140,7 +141,7 @@ stdenv.mkDerivation {
         substituteInPlace tools/build/src/tools/clang-darwin.jam \
           --replace '@rpath/$(<[1]:D=)' "$out/lib/\$(<[1]:D=)";
     fi;
-  '' + optionalString (mpi != null) ''
+  '' + optionalString useMpi ''
     cat << EOF >> user-config.jam
     using mpi : ${mpi}/bin/mpiCC ;
     EOF
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/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix
index 5063ec65723..54882ba6718 100644
--- a/pkgs/development/libraries/glibc/common.nix
+++ b/pkgs/development/libraries/glibc/common.nix
@@ -158,7 +158,7 @@ stdenv.mkDerivation ({
       "--enable-kernel=3.2.0" # can't get below with glibc >= 2.26
     ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
       (lib.flip lib.withFeature "fp"
-         (stdenv.hostPlatform.platform.gcc.float or (stdenv.hostPlatform.parsed.abi.float or "hard") == "soft"))
+         (stdenv.hostPlatform.gcc.float or (stdenv.hostPlatform.parsed.abi.float or "hard") == "soft"))
       "--with-__thread"
     ] ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform && stdenv.hostPlatform.isAarch32) [
       "--host=arm-linux-gnueabi"
diff --git a/pkgs/development/libraries/globalarrays/default.nix b/pkgs/development/libraries/globalarrays/default.nix
index 049e262bb17..1f70946cbce 100644
--- a/pkgs/development/libraries/globalarrays/default.nix
+++ b/pkgs/development/libraries/globalarrays/default.nix
@@ -1,5 +1,5 @@
 { lib, stdenv, fetchpatch, fetchFromGitHub, autoreconfHook
-, blas, gfortran, openssh, openmpi
+, blas, gfortran, openssh, mpi
 } :
 
 let
@@ -17,7 +17,7 @@ in stdenv.mkDerivation {
   };
 
   nativeBuildInputs = [ autoreconfHook ];
-  buildInputs = [ openmpi blas gfortran openssh ];
+  buildInputs = [ mpi blas gfortran openssh ];
 
   preConfigure = ''
     configureFlagsArray+=( "--enable-i8" \
diff --git a/pkgs/development/libraries/gtk/3.x.nix b/pkgs/development/libraries/gtk/3.x.nix
index 21a87de4a16..0e5c6edc964 100644
--- a/pkgs/development/libraries/gtk/3.x.nix
+++ b/pkgs/development/libraries/gtk/3.x.nix
@@ -3,7 +3,7 @@
 , fetchpatch
 , pkg-config
 , gettext
-, docbook_xsl
+, docbook-xsl-nons
 , docbook_xml_dtd_43
 , gtk-doc
 , meson
@@ -48,13 +48,11 @@
 
 assert cupsSupport -> cups != null;
 
-with lib;
-
 stdenv.mkDerivation rec {
   pname = "gtk+3";
   version = "3.24.24";
 
-  outputs = [ "out" "dev" ] ++ optional withGtkDoc "devdoc";
+  outputs = [ "out" "dev" ] ++ lib.optional withGtkDoc "devdoc";
   outputBin = "dev";
 
   setupHooks = [
@@ -69,12 +67,13 @@ stdenv.mkDerivation rec {
 
   patches = [
     ./patches/3.0-immodules.cache.patch
+
     (fetchpatch {
       name = "Xft-setting-fallback-compute-DPI-properly.patch";
       url = "https://bug757142.bugzilla-attachments.gnome.org/attachment.cgi?id=344123";
       sha256 = "0g6fhqcv8spfy3mfmxpyji93k8d4p4q4fz1v9a1c1cgcwkz41d7p";
     })
-  ] ++ optionals stdenv.isDarwin [
+  ] ++ lib.optionals stdenv.isDarwin [
     # X11 module requires <gio/gdesktopappinfo.h> which is not installed on Darwin
     # let’s drop that dependency in similar way to how other parts of the library do it
     # e.g. https://gitlab.gnome.org/GNOME/gtk/blob/3.24.4/gtk/gtk-launch.c#L31-33
@@ -82,35 +81,6 @@ stdenv.mkDerivation rec {
     ./patches/3.0-darwin-x11.patch
   ];
 
-  separateDebugInfo = stdenv.isLinux;
-
-  mesonFlags = [
-    "-Dgtk_doc=${boolToString withGtkDoc}"
-    "-Dtests=false"
-    "-Dtracker3=${boolToString trackerSupport}"
-    "-Dbroadway_backend=${boolToString broadwaySupport}"
-  ];
-
-  # These are the defines that'd you'd get with --enable-debug=minimum (default).
-  # See: https://developer.gnome.org/gtk3/stable/gtk-building.html#extra-configuration-options
-  NIX_CFLAGS_COMPILE = "-DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS";
-
-  postPatch = ''
-    files=(
-      build-aux/meson/post-install.py
-      demos/gtk-demo/geninclude.py
-      gdk/broadway/gen-c-array.py
-      gdk/gen-gdk-gresources-xml.py
-      gtk/cursor/dnd-copy.png
-      gtk/gen-gtk-gresources-xml.py
-      gtk/gen-rc.py
-      gtk/gentypefuncs.py
-    )
-
-    chmod +x ''${files[@]}
-    patchShebangs ''${files[@]}
-  '';
-
   nativeBuildInputs = [
     gettext
     gobject-introspection
@@ -120,9 +90,9 @@ stdenv.mkDerivation rec {
     pkg-config
     python3
     sassc
-  ] ++ setupHooks ++ optionals withGtkDoc [
+  ] ++ setupHooks ++ lib.optionals withGtkDoc [
     docbook_xml_dtd_43
-    docbook_xsl
+    docbook-xsl-nons
     gtk-doc
     # For xmllint
     libxml2
@@ -133,10 +103,12 @@ stdenv.mkDerivation rec {
     epoxy
     json-glib
     isocodes
-  ]
-  ++ optional stdenv.isDarwin AppKit
-  ++ optional trackerSupport tracker
-  ;
+  ] ++ lib.optionals stdenv.isDarwin [
+    AppKit
+  ] ++ lib.optionals trackerSupport [
+    tracker
+  ];
+  #TODO: colord?
 
   propagatedBuildInputs = with xorg; [
     at-spi2-atk
@@ -155,17 +127,51 @@ stdenv.mkDerivation rec {
     libXrandr
     libXrender
     pango
-  ]
-  ++ optional stdenv.isDarwin Cocoa  # explicitly propagated, always needed
-  ++ optionals waylandSupport [ mesa wayland wayland-protocols ]
-  ++ optional xineramaSupport libXinerama
-  ++ optional cupsSupport cups
-  ;
-  #TODO: colord?
+  ] ++ lib.optionals stdenv.isDarwin [
+    # explicitly propagated, always needed
+    Cocoa
+  ] ++ lib.optionals waylandSupport [
+    mesa
+    wayland
+    wayland-protocols
+  ] ++ lib.optionals xineramaSupport [
+    libXinerama
+  ] ++ lib.optionals cupsSupport [
+    cups
+  ];
+
+  mesonFlags = [
+    "-Dgtk_doc=${lib.boolToString withGtkDoc}"
+    "-Dtests=false"
+    "-Dtracker3=${lib.boolToString trackerSupport}"
+    "-Dbroadway_backend=${lib.boolToString broadwaySupport}"
+  ];
 
   doCheck = false; # needs X11
 
-  postInstall = optionalString (!stdenv.isDarwin) ''
+  separateDebugInfo = stdenv.isLinux;
+
+  # These are the defines that'd you'd get with --enable-debug=minimum (default).
+  # See: https://developer.gnome.org/gtk3/stable/gtk-building.html#extra-configuration-options
+  NIX_CFLAGS_COMPILE = "-DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS";
+
+  postPatch = ''
+    files=(
+      build-aux/meson/post-install.py
+      demos/gtk-demo/geninclude.py
+      gdk/broadway/gen-c-array.py
+      gdk/gen-gdk-gresources-xml.py
+      gtk/cursor/dnd-copy.png
+      gtk/gen-gtk-gresources-xml.py
+      gtk/gen-rc.py
+      gtk/gentypefuncs.py
+    )
+
+    chmod +x ''${files[@]}
+    patchShebangs ''${files[@]}
+  '';
+
+  postInstall = lib.optionalString (!stdenv.isDarwin) ''
     # The updater is needed for nixos env and it's tiny.
     moveToOutput bin/gtk-update-icon-cache "$out"
     # Launcher
@@ -178,7 +184,7 @@ stdenv.mkDerivation rec {
   '';
 
   # Wrap demos
-  postFixup =  optionalString (!stdenv.isDarwin) ''
+  postFixup =  lib.optionalString (!stdenv.isDarwin) ''
     demos=(gtk3-demo gtk3-demo-application gtk3-icon-browser gtk3-widget-factory)
 
     for program in ''${demos[@]}; do
@@ -194,7 +200,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = {
+  meta = with lib; {
     description = "A multi-platform toolkit for creating graphical user interfaces";
     longDescription = ''
       GTK is a highly usable, feature rich toolkit for creating
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/hdf5-blosc/default.nix b/pkgs/development/libraries/hdf5-blosc/default.nix
index 0879bb9ee9d..985660ff907 100644
--- a/pkgs/development/libraries/hdf5-blosc/default.nix
+++ b/pkgs/development/libraries/hdf5-blosc/default.nix
@@ -15,7 +15,8 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" "plugin" ];
 
-  buildInputs = [ c-blosc cmake hdf5 ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ c-blosc hdf5 ];
 
   preConfigure = ''
     substituteInPlace CMakeLists.txt --replace 'set(BLOSC_INSTALL_DIR "''${CMAKE_CURRENT_BINARY_DIR}/blosc")' 'set(BLOSC_INSTALL_DIR "${c-blosc}")'
diff --git a/pkgs/development/libraries/intel-gmmlib/default.nix b/pkgs/development/libraries/intel-gmmlib/default.nix
index f050a9c7b3b..28138f103b9 100644
--- a/pkgs/development/libraries/intel-gmmlib/default.nix
+++ b/pkgs/development/libraries/intel-gmmlib/default.nix
@@ -4,13 +4,13 @@
 
 stdenv.mkDerivation rec {
   pname = "intel-gmmlib";
-  version = "20.3.3";
+  version = "20.4.1";
 
   src = fetchFromGitHub {
     owner  = "intel";
     repo   = "gmmlib";
     rev    = "${pname}-${version}";
-    sha256 = "1diq1gqpfv5bawvag6bzwnd3ilhacwmwx3bl67abjvbb0m3jw4lk";
+    sha256 = "0qb0wpinfv8lg1pq1pxkl6v0kd8ax86m8zxzm6zjx91alsch1mi6";
   };
 
   nativeBuildInputs = [ cmake ];
@@ -19,6 +19,12 @@ stdenv.mkDerivation rec {
     homepage = "https://github.com/intel/gmmlib";
     license = licenses.mit;
     description = "Intel Graphics Memory Management Library";
+    longDescription = ''
+      The Intel(R) Graphics Memory Management Library provides device specific
+      and buffer management for the Intel(R) Graphics Compute Runtime for
+      OpenCL(TM) and the Intel(R) Media Driver for VAAPI.
+    '';
     platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ primeos ];
   };
 }
diff --git a/pkgs/development/libraries/intel-media-driver/default.nix b/pkgs/development/libraries/intel-media-driver/default.nix
index 75175bde4b3..6e62484ac68 100644
--- a/pkgs/development/libraries/intel-media-driver/default.nix
+++ b/pkgs/development/libraries/intel-media-driver/default.nix
@@ -6,13 +6,13 @@
 
 stdenv.mkDerivation rec {
   pname = "intel-media-driver";
-  version = "20.4.5";
+  version = "21.1.0";
 
   src = fetchFromGitHub {
     owner  = "intel";
     repo   = "media-driver";
     rev    = "intel-media-${version}";
-    sha256 = "149xkhhp8q06c1jzxjs24lnbfrlvf19m0hcwld593vv4arfpbpmf";
+    sha256 = "17cgs52f42jdvfb6q3wpkxaz2b41z59jdribpgb9qmcvizsnglxc";
   };
 
   cmakeFlags = [
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/libgadu/default.nix b/pkgs/development/libraries/libgadu/default.nix
index 10705a2c164..72bf067b2db 100644
--- a/pkgs/development/libraries/libgadu/default.nix
+++ b/pkgs/development/libraries/libgadu/default.nix
@@ -1,19 +1,23 @@
-{lib, stdenv, fetchurl, zlib}:
+{ lib, stdenv, fetchFromGitHub, zlib, protobufc, autoreconfHook }:
 
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
+  pname = "libgadu";
+  version = "1.12.2";
 
-  name = "libgadu-1.11.2";
-
-  src = fetchurl {
-    url = "http://toxygen.net/libgadu/files/libgadu-1.11.2.tar.gz";
-    sha256 = "0kifi9blhbimihqw4kaf6wyqhlx8fpp8nq4s6y280ar9p0il2n3z";
+  src = fetchFromGitHub {
+    owner = "wojtekka";
+    repo = pname;
+    rev = version;
+    sha256 = "1s16cripy5w9k12534qb012iwc5m9qcjyrywgsziyn3kl3i0aa8h";
   };
 
   propagatedBuildInputs = [ zlib ];
+  buildInputs = [ protobufc ];
+  nativeBuildInputs = [ autoreconfHook ];
 
   meta = {
     description = "A library to deal with gadu-gadu protocol (most popular polish IM protocol)";
-    homepage = "http://toxygen.net/libgadu/";
+    homepage = "https://libgadu.net/index.en.html";
     platforms = lib.platforms.linux;
     license = lib.licenses.lgpl21;
   };
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/libpgf/default.nix b/pkgs/development/libraries/libpgf/default.nix
index 280059fbab3..682ff485d65 100644
--- a/pkgs/development/libraries/libpgf/default.nix
+++ b/pkgs/development/libraries/libpgf/default.nix
@@ -1,24 +1,20 @@
-{ lib, stdenv, fetchurl, autoconf, automake, libtool, dos2unix }:
+{ lib, stdenv, fetchzip, autoreconfHook }:
 
-with lib;
-
-let
-  version = "6.14.12";
-in
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   pname = "libpgf";
-  inherit version;
+  version = "7.21.2";
 
-  src = fetchurl {
-    url = "mirror://sourceforge/libpgf/libpgf-src-${version}.tar.gz";
-    sha256 = "1ssqjbh6l5jc04f67n47m9bqcigl46c6lgyabyi6cabnh1frk9dx";
+  src = fetchzip {
+    url = "mirror://sourceforge/${pname}/${pname}/${version}/${pname}.zip";
+    sha256 = "0l1j5b1d02jn27miggihlppx656i0pc70cn6x89j1rpj33zn0g9r";
   };
 
-  buildInputs = [ autoconf automake libtool dos2unix ];
-
-  preConfigure = "dos2unix configure.ac; sh autogen.sh";
+  nativeBuildInputs = [ autoreconfHook ];
 
-# configureFlags = optional static "--enable-static --disable-shared";
+  autoreconfPhase = ''
+    mv README.txt README
+    sh autogen.sh
+  '';
 
   meta = {
     homepage = "https://www.libpgf.org/";
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/libredwg/default.nix b/pkgs/development/libraries/libredwg/default.nix
index 358a8490e69..5fca199acb0 100644
--- a/pkgs/development/libraries/libredwg/default.nix
+++ b/pkgs/development/libraries/libredwg/default.nix
@@ -6,13 +6,13 @@ let
 in
 stdenv.mkDerivation rec {
   pname = "libredwg";
-  version = "0.10.1.3707";
+  version = "0.12";
 
   src = fetchFromGitHub {
     owner = "LibreDWG";
     repo = pname;
     rev = version;
-    sha256 = "009n96lx4ahf05ryvm09z0l9956vz94r8pliyb88j0jficl0pxkf";
+    sha256 = "0ayhp3ym30hzp5f6dz7mmp9hpxf6a48nx3kq5crcmzycm5fllbn7";
     fetchSubmodules = true;
   };
 
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/mtxclient/default.nix b/pkgs/development/libraries/mtxclient/default.nix
index 38c95a5a19f..d1834de5558 100644
--- a/pkgs/development/libraries/mtxclient/default.nix
+++ b/pkgs/development/libraries/mtxclient/default.nix
@@ -5,8 +5,6 @@
 , pkg-config
 , boost17x
 , openssl
-, zlib
-, libsodium
 , olm
 , spdlog
 , nlohmann_json
@@ -42,8 +40,6 @@ stdenv.mkDerivation rec {
     spdlog
     boost17x
     openssl
-    zlib
-    libsodium
     olm
   ];
 
@@ -51,7 +47,7 @@ stdenv.mkDerivation rec {
     description = "Client API library for Matrix, built on top of Boost.Asio";
     homepage = "https://github.com/Nheko-Reborn/mtxclient";
     license = licenses.mit;
-    maintainers = with maintainers; [ fpletz ];
+    maintainers = with maintainers; [ fpletz pstn ];
     platforms = platforms.all;
     # Should be fixable if a higher clang version is used, see:
     # https://github.com/NixOS/nixpkgs/pull/85922#issuecomment-619287177
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/precice/default.nix b/pkgs/development/libraries/precice/default.nix
index e9e67737d32..10a80ebb91e 100644
--- a/pkgs/development/libraries/precice/default.nix
+++ b/pkgs/development/libraries/precice/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, cmake, gcc, boost, eigen, libxml2, openmpi, python3, petsc }:
+{ lib, stdenv, fetchFromGitHub, cmake, gcc, boost, eigen, libxml2, mpi, python3, petsc }:
 
 stdenv.mkDerivation rec {
   pname = "precice";
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin [ "-D_GNU_SOURCE" ];
 
   nativeBuildInputs = [ cmake gcc ];
-  buildInputs = [ boost eigen libxml2 openmpi python3 python3.pkgs.numpy ];
+  buildInputs = [ boost eigen libxml2 mpi python3 python3.pkgs.numpy ];
 
   meta = {
     description = "preCICE stands for Precise Code Interaction Coupling Environment";
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..b79479e5dba 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";
@@ -88,7 +88,7 @@ qtModule {
   NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [
     # with gcc8, -Wclass-memaccess became part of -Wall and this exceeds the logging limit
     "-Wno-class-memaccess"
-  ] ++ lib.optionals (stdenv.hostPlatform.platform.gcc.arch or "" == "sandybridge") [
+  ] ++ lib.optionals (stdenv.hostPlatform.gcc.arch or "" == "sandybridge") [
     # it fails when compiled with -march=sandybridge https://github.com/NixOS/nixpkgs/pull/59148#discussion_r276696940
     # TODO: investigate and fix properly
     "-march=westmere"
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/science/math/scalapack/default.nix b/pkgs/development/libraries/science/math/scalapack/default.nix
index 4ef10439cc5..3b84a9d99cb 100644
--- a/pkgs/development/libraries/science/math/scalapack/default.nix
+++ b/pkgs/development/libraries/science/math/scalapack/default.nix
@@ -36,6 +36,9 @@ stdenv.mkDerivation rec {
     # make sure the test starts even if we have less than 4 cores
     export OMPI_MCA_rmaps_base_oversubscribe=1
 
+    # Fix to make mpich run in a sandbox
+    export HYDRA_IFACE=lo
+
     # Run single threaded
     export OMP_NUM_THREADS=1
 
diff --git a/pkgs/development/libraries/simdjson/default.nix b/pkgs/development/libraries/simdjson/default.nix
index 3a7734b1d51..e41d08c7cd3 100644
--- a/pkgs/development/libraries/simdjson/default.nix
+++ b/pkgs/development/libraries/simdjson/default.nix
@@ -2,20 +2,20 @@
 
 stdenv.mkDerivation rec {
   pname = "simdjson";
-  version = "0.7.0";
+  version = "0.8.0";
 
   src = fetchFromGitHub {
     owner = "simdjson";
     repo = "simdjson";
     rev = "v${version}";
-    sha256 = "14gi2zq430nfjy424q6r57imc2gnz30nhx4r0wbajzp9qvna819w";
+    sha256 = "0lpb8la74xwd78d5mgwnzx4fy632jbmh0ip19v0dydwm0kagm0a3";
   };
 
   nativeBuildInputs = [ cmake ];
 
   cmakeFlags = [
     "-DSIMDJSON_JUST_LIBRARY=ON"
-  ];
+  ] ++ lib.optional stdenv.hostPlatform.isStatic "-DSIMDJSON_BUILD_STATIC=ON";
 
   meta = with lib; {
     homepage = "https://simdjson.org/";
diff --git a/pkgs/development/libraries/spdlog/default.nix b/pkgs/development/libraries/spdlog/default.nix
index 1bd73990443..ac74b74ccf1 100644
--- a/pkgs/development/libraries/spdlog/default.nix
+++ b/pkgs/development/libraries/spdlog/default.nix
@@ -17,7 +17,8 @@ let
       buildInputs = [ fmt ];
 
       cmakeFlags = [
-        "-DSPDLOG_BUILD_SHARED=ON"
+        "-DSPDLOG_BUILD_SHARED=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}"
+        "-DSPDLOG_BUILD_STATIC=${if stdenv.hostPlatform.isStatic then "ON" else "OFF"}"
         "-DSPDLOG_BUILD_EXAMPLE=OFF"
         "-DSPDLOG_BUILD_BENCH=OFF"
         "-DSPDLOG_BUILD_TESTS=ON"
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/python-modules/aioeafm/default.nix b/pkgs/development/python-modules/aioeafm/default.nix
new file mode 100644
index 00000000000..be91e0e9557
--- /dev/null
+++ b/pkgs/development/python-modules/aioeafm/default.nix
@@ -0,0 +1,44 @@
+{ lib
+, aiohttp
+, async-timeout
+, buildPythonPackage
+, fetchFromGitHub
+, poetry
+, pytest-aiohttp
+, pytest-asyncio
+, pytest-cov
+, pytestCheckHook
+}:
+
+buildPythonPackage rec {
+  pname = "aioeafm";
+  version = "1.0.0";
+  format = "pyproject";
+
+  src = fetchFromGitHub {
+    owner = "Jc2k";
+    repo = pname;
+    rev = version;
+    sha256 = "048cxn3fw2hynp27zlizq7k8ps67qq9sib1ddgirnxy5zc87vgkc";
+  };
+
+  nativeBuildInputs = [ poetry ];
+
+  propagatedBuildInputs = [ aiohttp ];
+
+  checkInputs = [
+    pytest-aiohttp
+    pytest-asyncio
+    pytest-cov
+    pytestCheckHook
+  ];
+
+  pythonImportsCheck = [ "aioeafm" ];
+
+  meta = with lib; {
+    description = "Python client for access the Real Time flood monitoring API";
+    homepage = "https://github.com/Jc2k/aioeafm";
+    license = with licenses; [ asl20 ];
+    maintainers = with maintainers; [ fab ];
+  };
+}
diff --git a/pkgs/development/python-modules/amcrest/default.nix b/pkgs/development/python-modules/amcrest/default.nix
new file mode 100644
index 00000000000..772b8fbaa04
--- /dev/null
+++ b/pkgs/development/python-modules/amcrest/default.nix
@@ -0,0 +1,43 @@
+{ lib
+, argcomplete
+, buildPythonPackage
+, fetchFromGitHub
+, mock
+, pytestCheckHook
+, requests
+, responses
+, urllib3
+}:
+
+buildPythonPackage rec {
+  pname = "amcrest";
+  version = "1.7.2";
+
+  src = fetchFromGitHub {
+    owner = "tchellomello";
+    repo = "python-amcrest";
+    rev = version;
+    sha256 = "06gbrshf6vqvq3k813d1w37k2kmps0g6msa4lp2f9xvzw3iczshy";
+  };
+
+  propagatedBuildInputs = [
+    argcomplete
+    requests
+    urllib3
+  ];
+
+  checkInputs = [
+    mock
+    pytestCheckHook
+    responses
+  ];
+
+  pythonImportsCheck = [ "amcrest" ];
+
+  meta = with lib; {
+    description = "Python module for Amcrest and Dahua Cameras";
+    homepage = "https://github.com/tchellomello/python-amcrest";
+    license = with licenses; [ gpl2Only ];
+    maintainers = with maintainers; [ fab ];
+  };
+}
diff --git a/pkgs/development/python-modules/cntk/default.nix b/pkgs/development/python-modules/cntk/default.nix
index ce388bb1d5d..b1bba8cf1e0 100644
--- a/pkgs/development/python-modules/cntk/default.nix
+++ b/pkgs/development/python-modules/cntk/default.nix
@@ -3,7 +3,7 @@
 , pkgs
 , numpy
 , scipy
-, openmpi
+, mpi
 , enum34
 , protobuf
 , pip
@@ -17,8 +17,8 @@ in
 buildPythonPackage {
   inherit (cntk) name version src;
 
-  nativeBuildInputs = [ swig openmpi ];
-  buildInputs = [ cntk openmpi ];
+  nativeBuildInputs = [ swig mpi ];
+  buildInputs = [ cntk mpi ];
   propagatedBuildInputs = [ numpy scipy enum34 protobuf pip ];
 
   CNTK_LIB_PATH = "${cntk}/lib";
@@ -28,7 +28,7 @@ buildPythonPackage {
 
   postPatch = ''
     cd bindings/python
-    sed -i 's,"libmpi.so.12","${openmpi}/lib/libmpi.so",g' cntk/train/distributed.py
+    sed -i 's,"libmpi.so.12","${mpi}/lib/libmpi.so",g' cntk/train/distributed.py
 
     # Remove distro and libs checks; they aren't compatible with NixOS and besides we guarantee
     # compatibility by providing a package.
diff --git a/pkgs/development/python-modules/pycfdns/default.nix b/pkgs/development/python-modules/pycfdns/default.nix
new file mode 100644
index 00000000000..ca0b0fe5ecf
--- /dev/null
+++ b/pkgs/development/python-modules/pycfdns/default.nix
@@ -0,0 +1,34 @@
+{ lib
+, aiohttp
+, async-timeout
+, buildPythonPackage
+, fetchFromGitHub
+}:
+
+buildPythonPackage rec {
+  pname = "pycfdns";
+  version = "1.2.1";
+
+  src = fetchFromGitHub {
+    owner = "ludeeus";
+    repo = pname;
+    rev = version;
+    sha256 = "0df4695cb0h6f2lnn6dx4h5al2ra93zp1hzfaz07nj2gvirswp83";
+  };
+
+  propagatedBuildInputs = [
+    aiohttp
+    async-timeout
+  ];
+
+  # Project has no tests
+  doCheck = false;
+  pythonImportsCheck = [ "pycfdns" ];
+
+  meta = with lib; {
+    description = "Python module for updating Cloudflare DNS A records";
+    homepage = "https://github.com/ludeeus/pycfdns";
+    license = with licenses; [ mit ];
+    maintainers = with maintainers; [ fab ];
+  };
+}
diff --git a/pkgs/development/python-modules/pytile/default.nix b/pkgs/development/python-modules/pytile/default.nix
index 52b3d828ded..771ae4d1328 100644
--- a/pkgs/development/python-modules/pytile/default.nix
+++ b/pkgs/development/python-modules/pytile/default.nix
@@ -4,28 +4,29 @@
 , aresponses
 , buildPythonPackage
 , fetchFromGitHub
-, poetry
+, poetry-core
 , pylint
 , pytest-aiohttp
 , pytest-asyncio
 , pytestCheckHook
 , pythonAtLeast
 }:
+
 buildPythonPackage rec {
   pname = "pytile";
-  version = "5.1.0";
+  version = "5.1.1";
   disabled = pythonAtLeast "3.9";
 
   src = fetchFromGitHub {
     owner = "bachya";
     repo = pname;
     rev = version;
-    sha256 = "0hdyb8ca4ihqf7yfkr3hbpkwz7g182ycra151y5dxn0319fillc3";
+    sha256 = "sha256-bVoFTaK/Alemtc5I+Z/M9y/FWczvJ+P86R0DMD89/BM=";
   };
 
   format = "pyproject";
 
-  nativeBuildInputs = [ poetry ];
+  nativeBuildInputs = [ poetry-core ];
 
   propagatedBuildInputs = [
     aiohttp
diff --git a/pkgs/development/python-modules/pytorch/default.nix b/pkgs/development/python-modules/pytorch/default.nix
index f072972937a..822586bf190 100644
--- a/pkgs/development/python-modules/pytorch/default.nix
+++ b/pkgs/development/python-modules/pytorch/default.nix
@@ -1,7 +1,7 @@
 { stdenv, lib, fetchFromGitHub, fetchpatch, buildPythonPackage, python,
   cudaSupport ? false, cudatoolkit ? null, cudnn ? null, nccl ? null, magma ? null,
   mklDnnSupport ? true, useSystemNccl ? true,
-  openMPISupport ? false, openmpi ? null,
+  MPISupport ? false, mpi,
   buildDocs ? false,
   cudaArchList ? null,
 
@@ -29,8 +29,6 @@
 
   isPy3k, pythonOlder }:
 
-assert !openMPISupport || openmpi != null;
-
 # assert that everything needed for cuda is present and that the correct cuda versions are used
 assert !cudaSupport || cudatoolkit != null;
 assert cudnn == null || cudatoolkit != null;
@@ -38,7 +36,7 @@ assert !cudaSupport || (let majorIs = lib.versions.major cudatoolkit.version;
                         in majorIs == "9" || majorIs == "10" || majorIs == "11");
 
 # confirm that cudatoolkits are sync'd across dependencies
-assert !(openMPISupport && cudaSupport) || openmpi.cudatoolkit == cudatoolkit;
+assert !(MPISupport && cudaSupport) || mpi.cudatoolkit == cudatoolkit;
 assert !cudaSupport || magma.cudatoolkit == cudatoolkit;
 
 let
@@ -224,7 +222,7 @@ in buildPythonPackage rec {
     typing-extensions
     # the following are required for tensorboard support
     pillow six future tensorflow-tensorboard protobuf
-  ] ++ lib.optionals openMPISupport [ openmpi ]
+  ] ++ lib.optionals MPISupport [ mpi ]
     ++ lib.optionals (pythonOlder "3.7") [ dataclasses ];
 
   checkInputs = [ hypothesis ninja psutil ];
diff --git a/pkgs/development/python-modules/tensorflow/default.nix b/pkgs/development/python-modules/tensorflow/default.nix
index 342a87a6e8d..9f64a689e2b 100644
--- a/pkgs/development/python-modules/tensorflow/default.nix
+++ b/pkgs/development/python-modules/tensorflow/default.nix
@@ -11,7 +11,7 @@
 # Common deps
 , git, pybind11, which, binutils, glibcLocales, cython, perl
 # Common libraries
-, jemalloc, openmpi, gast, grpc, sqlite, boringssl, jsoncpp
+, jemalloc, mpi, gast, grpc, sqlite, boringssl, jsoncpp
 , curl, snappy, flatbuffers-core, lmdb-core, icu, double-conversion, libpng, libjpeg_turbo, giflib
 # Upsteam by default includes cuda support since tensorflow 1.15. We could do
 # that in nix as well. It would make some things easier and less confusing, but
@@ -129,7 +129,7 @@ let
 
     buildInputs = [
       jemalloc
-      openmpi
+      mpi
       glibcLocales
       git
 
diff --git a/pkgs/development/python-modules/tokenizers/default.nix b/pkgs/development/python-modules/tokenizers/default.nix
index d5d92b19061..ec435a0ac35 100644
--- a/pkgs/development/python-modules/tokenizers/default.nix
+++ b/pkgs/development/python-modules/tokenizers/default.nix
@@ -7,6 +7,7 @@
 , wheel
 , numpy
 , python
+, datasets
 , pytestCheckHook
 , requests
 }:
@@ -50,16 +51,16 @@ let
   };
 in rustPlatform.buildRustPackage rec {
   pname = "tokenizers";
-  version = "0.9.4";
+  version = "0.10.0";
 
   src = fetchFromGitHub {
     owner = "huggingface";
     repo = pname;
     rev = "python-v${version}";
-    hash = "sha256-JXoH9yfhMIFg5qDY5zrF6iWb7XKugjMfk1NxSizfaWg=";
+    hash = "sha256-rQ2hRV52naEf6PvRsWVCTN7B1oXAQGmnpJw4iIdhamw=";
   };
 
-  cargoSha256 = "sha256-u9qitrOxJSABs0VjwHUZgmw7VTQXNbp6l8fKKE/RQ7M=";
+  cargoSha256 = "sha256-BoHIN/519Top1NUBjpB/oEMqi86Omt3zTQcXFWqrek0=";
 
   sourceRoot = "source/bindings/python";
 
@@ -75,6 +76,7 @@ in rustPlatform.buildRustPackage rec {
   ];
 
   installCheckInputs = [
+    datasets
     pytestCheckHook
     requests
   ];
@@ -105,6 +107,15 @@ in rustPlatform.buildRustPackage rec {
     pipInstallPhase
   '';
 
+  preCheck = ''
+    HOME=$TMPDIR
+  '';
+
+  disabledTests = [
+    # Downloads data using the datasets module.
+    "TestTrainFromIterators"
+  ];
+
   meta = with lib; {
     homepage = "https://github.com/huggingface/tokenizers";
     description = "Fast State-of-the-Art Tokenizers optimized for Research and Production";
diff --git a/pkgs/development/python-modules/transformers/default.nix b/pkgs/development/python-modules/transformers/default.nix
index 743cbebea75..ee288f7626b 100644
--- a/pkgs/development/python-modules/transformers/default.nix
+++ b/pkgs/development/python-modules/transformers/default.nix
@@ -1,32 +1,28 @@
 { buildPythonPackage
 , lib, stdenv
 , fetchFromGitHub
-, isPy39
+, pythonOlder
 , cookiecutter
 , filelock
+, importlib-metadata
 , regex
 , requests
 , numpy
-, pandas
-, parameterized
 , protobuf
 , sacremoses
-, timeout-decorator
 , tokenizers
 , tqdm
-, pytestCheckHook
 }:
 
 buildPythonPackage rec {
   pname = "transformers";
-  version = "4.1.1";
-  disabled = isPy39;
+  version = "4.2.2";
 
   src = fetchFromGitHub {
     owner = "huggingface";
     repo = pname;
     rev = "v${version}";
-    sha256 = "1l1gxdsakjmzsgggypq45pnwm87brhlccjfzafs43460pz0wbd6k";
+    hash = "sha256-sBMCzEgYX6HQbzoEIYnmMdpYecCCsQjTdl2mO1Veu9M=";
   };
 
   propagatedBuildInputs = [
@@ -39,63 +35,16 @@ buildPythonPackage rec {
     sacremoses
     tokenizers
     tqdm
-  ];
+  ] ++ stdenv.lib.optionals (pythonOlder "3.8") [ importlib-metadata ];
 
-  checkInputs = [
-    pandas
-    parameterized
-    pytestCheckHook
-    timeout-decorator
-  ];
+  # Many tests require internet access.
+  doCheck = false;
 
   postPatch = ''
-    substituteInPlace setup.py \
-      --replace "tokenizers == 0.9.4" "tokenizers"
+    sed -ri 's/tokenizers==[0-9.]+/tokenizers/g' setup.py
   '';
 
-  preCheck = ''
-    export HOME="$TMPDIR"
-
-    # This test requires the `datasets` module to download test
-    # data. However, since we cannot download in the Nix sandbox
-    # and `dataset` is an optional dependency for transformers
-    # itself, we will just remove the tests files that import
-    # `dataset`.
-    rm tests/test_retrieval_rag.py
-    rm tests/test_trainer.py
-  '';
-
-  # We have to run from the main directory for the tests. However,
-  # letting pytest discover tests leads to errors.
-  pytestFlagsArray = [ "tests" ];
-
-  # Disable tests that require network access.
-  disabledTests = [
-    "BlenderbotSmallTokenizerTest"
-    "Blenderbot3BTokenizerTests"
-    "GetFromCacheTests"
-    "TokenizationTest"
-    "TestTokenizationBart"
-    "test_all_tokenizers"
-    "test_batch_encoding_is_fast"
-    "test_batch_encoding_pickle"
-    "test_batch_encoding_word_to_tokens"
-    "test_config_from_model_shortcut"
-    "test_config_model_type_from_model_identifier"
-    "test_from_pretrained_use_fast_toggle"
-    "test_hf_api"
-    "test_outputs_can_be_shorter"
-    "test_outputs_not_longer_than_maxlen"
-    "test_padding_accepts_tensors"
-    "test_pretokenized_tokenizers"
-    "test_tokenizer_equivalence_en_de"
-    "test_tokenizer_from_model_type"
-    "test_tokenizer_from_model_type"
-    "test_tokenizer_from_pretrained"
-    "test_tokenizer_from_tokenizer_class"
-    "test_tokenizer_identifier_with_correct_config"
-    "test_tokenizer_identifier_non_existent"
-  ];
+  pythonImportsCheck = [ "transformers" ];
 
   meta = with lib; {
     homepage = "https://github.com/huggingface/transformers";
diff --git a/pkgs/development/r-modules/default.nix b/pkgs/development/r-modules/default.nix
index e79504bdaab..e827c9b807f 100644
--- a/pkgs/development/r-modules/default.nix
+++ b/pkgs/development/r-modules/default.nix
@@ -237,7 +237,7 @@ let
     BayesSAE = [ pkgs.gsl_1 ];
     BayesVarSel = [ pkgs.gsl_1 ];
     BayesXsrc = [ pkgs.readline.dev pkgs.ncurses ];
-    bigGP = [ pkgs.openmpi ];
+    bigGP = [ pkgs.mpi ];
     bio3d = [ pkgs.zlib ];
     BiocCheck = [ pkgs.which ];
     Biostrings = [ pkgs.zlib ];
@@ -284,8 +284,8 @@ let
     n1qn1 = [ pkgs.gfortran ];
     odbc = [ pkgs.unixODBC ];
     pander = [ pkgs.pandoc pkgs.which ];
-    pbdMPI = [ pkgs.openmpi ];
-    pbdPROF = [ pkgs.openmpi ];
+    pbdMPI = [ pkgs.mpi ];
+    pbdPROF = [ pkgs.mpi ];
     pbdZMQ = lib.optionals stdenv.isDarwin [ pkgs.which ];
     pdftools = [ pkgs.poppler.dev ];
     phytools = [ pkgs.which ];
@@ -309,14 +309,14 @@ let
     RGtk2 = [ pkgs.gtk2.dev ];
     rhdf5 = [ pkgs.zlib ];
     Rhdf5lib = [ pkgs.zlib ];
-    Rhpc = [ pkgs.zlib pkgs.bzip2.dev pkgs.icu pkgs.lzma.dev pkgs.openmpi pkgs.pcre.dev ];
+    Rhpc = [ pkgs.zlib pkgs.bzip2.dev pkgs.icu pkgs.lzma.dev pkgs.mpi pkgs.pcre.dev ];
     Rhtslib = [ pkgs.zlib.dev pkgs.automake pkgs.autoconf pkgs.bzip2.dev pkgs.lzma.dev pkgs.curl.dev ];
     rjags = [ pkgs.jags ];
     rJava = [ pkgs.zlib pkgs.bzip2.dev pkgs.icu pkgs.lzma.dev pkgs.pcre.dev pkgs.jdk pkgs.libzip ];
     Rlibeemd = [ pkgs.gsl_1 ];
     rmatio = [ pkgs.zlib.dev ];
     Rmpfr = [ pkgs.gmp pkgs.mpfr.dev ];
-    Rmpi = [ pkgs.openmpi ];
+    Rmpi = [ pkgs.mpi ];
     RMySQL = [ pkgs.zlib pkgs.libmysqlclient pkgs.openssl.dev ];
     RNetCDF = [ pkgs.netcdf pkgs.udunits ];
     RODBC = [ pkgs.libiodbc ];
diff --git a/pkgs/development/tools/alloy/default.nix b/pkgs/development/tools/alloy/default.nix
index 44a6d7329ba..1dade32ac64 100644
--- a/pkgs/development/tools/alloy/default.nix
+++ b/pkgs/development/tools/alloy/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, jre, makeWrapper, makeDesktopItem }:
+{ lib, stdenv, fetchurl, jre, makeWrapper, makeDesktopItem }:
 
 let generic = { major, version, src }:
 
@@ -30,7 +30,7 @@ let generic = { major, version, src }:
       cp -r ${desktopItem}/share/applications $out/share
     '';
 
-    meta = with stdenv.lib; {
+    meta = with lib; {
       description = "Language & tool for relational models";
       longDescription = ''
         Alloy is a language for describing structures and a tool for exploring
diff --git a/pkgs/development/tools/ammonite/default.nix b/pkgs/development/tools/ammonite/default.nix
index 20b26437e75..eb827882b75 100644
--- a/pkgs/development/tools/ammonite/default.nix
+++ b/pkgs/development/tools/ammonite/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchurl, jre, nixosTests, writeScript, common-updater-scripts, git
+{ lib, stdenv, fetchurl, jre, nixosTests, writeScript, common-updater-scripts, git
 , nixfmt, nix, coreutils, gnused, disableRemoteLogging ? true }:
 
-with stdenv.lib;
+with lib;
 
 let
   repo = "git@github.com:lihaoyi/Ammonite.git";
@@ -34,7 +34,7 @@ let
           #!${stdenv.shell}
           set -o errexit
           PATH=${
-            stdenv.lib.makeBinPath [
+            lib.makeBinPath [
               common-updater-scripts
               coreutils
               git
diff --git a/pkgs/development/tools/analysis/autoflake/default.nix b/pkgs/development/tools/analysis/autoflake/default.nix
index 396a5817c67..884b511b8af 100644
--- a/pkgs/development/tools/analysis/autoflake/default.nix
+++ b/pkgs/development/tools/analysis/autoflake/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, python3Packages }:
+{ lib, stdenv, python3Packages }:
 
 with python3Packages;
 buildPythonApplication rec {
@@ -14,7 +14,7 @@ buildPythonApplication rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/myint/autoflake";
     description = "A simple program which removes unused imports and unused variables as reported by pyflakes";
     license = licenses.mit;
diff --git a/pkgs/development/tools/analysis/bingrep/default.nix b/pkgs/development/tools/analysis/bingrep/default.nix
index d1b0c3a6656..ae54723dda3 100644
--- a/pkgs/development/tools/analysis/bingrep/default.nix
+++ b/pkgs/development/tools/analysis/bingrep/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, rustPlatform, fetchFromGitHub }:
+{ lib, stdenv, rustPlatform, fetchFromGitHub }:
 
 rustPlatform.buildRustPackage rec {
   pname = "bingrep";
@@ -13,7 +13,7 @@ rustPlatform.buildRustPackage rec {
 
   cargoSha256 = "sha256-3eGYU5O7HSpawIL/8OVmROCzXfdnoMAnIujjrIp00xg=";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Greps through binaries from various OSs and architectures, and colors them";
     homepage = "https://github.com/m4b/bingrep";
     license = licenses.mit;
diff --git a/pkgs/development/tools/analysis/cccc/default.nix b/pkgs/development/tools/analysis/cccc/default.nix
index 374331f3ac8..bcbda8ad7e6 100644
--- a/pkgs/development/tools/analysis/cccc/default.nix
+++ b/pkgs/development/tools/analysis/cccc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 let
   name = "cccc";
@@ -30,8 +30,8 @@ stdenv.mkDerivation {
       complexity and metrics proposed by Chidamber&Kemerer and Henry&Kafura.
     '';
     homepage = "http://cccc.sourceforge.net/";
-    license = stdenv.lib.licenses.gpl2;
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = [ stdenv.lib.maintainers.linquize ];
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.unix;
+    maintainers = [ lib.maintainers.linquize ];
   };
 }
diff --git a/pkgs/development/tools/analysis/checkstyle/default.nix b/pkgs/development/tools/analysis/checkstyle/default.nix
index e38645e84c5..e5325f7da8c 100644
--- a/pkgs/development/tools/analysis/checkstyle/default.nix
+++ b/pkgs/development/tools/analysis/checkstyle/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper, jre }:
+{ lib, stdenv, fetchurl, makeWrapper, jre }:
 
 stdenv.mkDerivation rec {
   version = "8.39";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     runHook postInstall
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Checks Java source against a coding standard";
     longDescription = ''
       checkstyle is a development tool to help programmers write Java code that
diff --git a/pkgs/development/tools/analysis/clang-analyzer/default.nix b/pkgs/development/tools/analysis/clang-analyzer/default.nix
index 43b32052bf3..4752b31649d 100644
--- a/pkgs/development/tools/analysis/clang-analyzer/default.nix
+++ b/pkgs/development/tools/analysis/clang-analyzer/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, clang, llvmPackages, perl, makeWrapper, python3 }:
+{ lib, stdenv, fetchurl, clang, llvmPackages, perl, makeWrapper, python3 }:
 
 stdenv.mkDerivation rec {
   pname = "clang-analyzer";
@@ -27,8 +27,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Clang Static Analyzer";
     homepage    = "http://clang-analyzer.llvm.org";
-    license     = stdenv.lib.licenses.bsd3;
-    platforms   = stdenv.lib.platforms.unix;
-    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
+    license     = lib.licenses.bsd3;
+    platforms   = lib.platforms.unix;
+    maintainers = [ lib.maintainers.thoughtpolice ];
   };
 }
diff --git a/pkgs/development/tools/analysis/coan/default.nix b/pkgs/development/tools/analysis/coan/default.nix
index 4c6e9f1a078..1e0b79e0daa 100644
--- a/pkgs/development/tools/analysis/coan/default.nix
+++ b/pkgs/development/tools/analysis/coan/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl }:
+{ lib, stdenv, fetchurl, perl }:
 
 stdenv.mkDerivation rec {
   version = "6.0.1";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     mv -v $out/share/man/man1/coan.1.{1,gz}
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "The C preprocessor chainsaw";
     longDescription = ''
       A software engineering tool for analysing preprocessor-based
diff --git a/pkgs/development/tools/analysis/codeql/default.nix b/pkgs/development/tools/analysis/codeql/default.nix
index f9bd749f014..f3ad1d81e57 100644
--- a/pkgs/development/tools/analysis/codeql/default.nix
+++ b/pkgs/development/tools/analysis/codeql/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchzip
 , zlib
 , xorg
@@ -52,7 +52,7 @@ stdenv.mkDerivation rec {
     ln -s $out/codeql/codeql $out/bin/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Semantic code analysis engine";
     homepage = "https://semmle.com/codeql";
     maintainers = [ maintainers.dump_stack ];
diff --git a/pkgs/development/tools/analysis/cov-build/default.nix b/pkgs/development/tools/analysis/cov-build/default.nix
index bd8c5c37c86..93a4ffab388 100644
--- a/pkgs/development/tools/analysis/cov-build/default.nix
+++ b/pkgs/development/tools/analysis/cov-build/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, requireFile }:
+{ lib, stdenv, requireFile }:
 
 let
   message = ''
@@ -41,8 +41,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Coverity Scan build tools";
     homepage    = "https://scan.coverity.com";
-    license     = stdenv.lib.licenses.unfreeRedistributable;
-    platforms   = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
+    license     = lib.licenses.unfreeRedistributable;
+    platforms   = lib.platforms.linux;
+    maintainers = [ lib.maintainers.thoughtpolice ];
   };
 }
diff --git a/pkgs/development/tools/analysis/coz/default.nix b/pkgs/development/tools/analysis/coz/default.nix
index 42b47a9a8fd..17968a466bf 100644
--- a/pkgs/development/tools/analysis/coz/default.nix
+++ b/pkgs/development/tools/analysis/coz/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , libelfin
 , ncurses
@@ -50,7 +50,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://github.com/plasma-umass/coz";
     description = "Profiler based on casual profiling";
-    license = stdenv.lib.licenses.bsd2;
-    maintainers = with stdenv.lib.maintainers; [ zimbatm ];
+    license = lib.licenses.bsd2;
+    maintainers = with lib.maintainers; [ zimbatm ];
   };
 }
diff --git a/pkgs/development/tools/analysis/cppcheck/default.nix b/pkgs/development/tools/analysis/cppcheck/default.nix
index 91bcecbb43d..30c0614446e 100644
--- a/pkgs/development/tools/analysis/cppcheck/default.nix
+++ b/pkgs/development/tools/analysis/cppcheck/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libxslt, docbook_xsl, docbook_xml_dtd_45, pcre, withZ3 ? true, z3 }:
+{ lib, stdenv, fetchurl, libxslt, docbook_xsl, docbook_xml_dtd_45, pcre, withZ3 ? true, z3 }:
 
 stdenv.mkDerivation rec {
   pname = "cppcheck";
@@ -9,11 +9,11 @@ stdenv.mkDerivation rec {
     sha256 = "0mlw0z20qf0g9qrmdmbykzf87wlcgmah8bacmp4mk6dwfzr9g9n3";
   };
 
-  buildInputs = [ pcre ] ++ stdenv.lib.optionals withZ3 [ z3 ];
+  buildInputs = [ pcre ] ++ lib.optionals withZ3 [ z3 ];
   nativeBuildInputs = [ libxslt docbook_xsl docbook_xml_dtd_45 ];
 
   makeFlags = [ "PREFIX=$(out)" "FILESDIR=$(out)/cfg" "HAVE_RULES=yes" ]
-   ++ stdenv.lib.optionals withZ3 [ "USE_Z3=yes" "CPPFLAGS=-DNEW_Z3=1" ];
+   ++ lib.optionals withZ3 [ "USE_Z3=yes" "CPPFLAGS=-DNEW_Z3=1" ];
 
   outputs = [ "out" "man" ];
 
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
     cp cppcheck.1 $man/share/man/man1/cppcheck.1
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A static analysis tool for C/C++ code";
     longDescription = ''
       Check C/C++ code for memory leaks, mismatching allocation-deallocation,
diff --git a/pkgs/development/tools/analysis/egypt/default.nix b/pkgs/development/tools/analysis/egypt/default.nix
index 080b19bf163..cfb974c86dd 100644
--- a/pkgs/development/tools/analysis/egypt/default.nix
+++ b/pkgs/development/tools/analysis/egypt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perlPackages }:
+{ lib, stdenv, fetchurl, perlPackages }:
 
 perlPackages.buildPerlPackage rec {
   pname = "egypt";
@@ -15,7 +15,7 @@ perlPackages.buildPerlPackage rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Tool for making call graphs of C programmes";
     longDescription = ''
       Egypt is a simple tool for creating call graphs of C programs. It neither
diff --git a/pkgs/development/tools/analysis/emma/default.nix b/pkgs/development/tools/analysis/emma/default.nix
index 56d3554bf75..97f93722a18 100644
--- a/pkgs/development/tools/analysis/emma/default.nix
+++ b/pkgs/development/tools/analysis/emma/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, unzip}:
+{lib, stdenv, fetchurl, unzip}:
 
 stdenv.mkDerivation {
   name = "emma-2.0.5312";
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = "http://emma.sourceforge.net/";
     description = "A code coverage tool for Java";
-    platforms = stdenv.lib.platforms.unix;
-    license = stdenv.lib.licenses.cpl10;
+    platforms = lib.platforms.unix;
+    license = lib.licenses.cpl10;
   };
 }
diff --git a/pkgs/development/tools/analysis/evmdis/default.nix b/pkgs/development/tools/analysis/evmdis/default.nix
index 64a1c317393..b8f3aa0ac1f 100644
--- a/pkgs/development/tools/analysis/evmdis/default.nix
+++ b/pkgs/development/tools/analysis/evmdis/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage {
   pname = "evmdis-unstable";
@@ -12,7 +12,7 @@ buildGoPackage {
     sha256 = "09y4j7ipgv8yd99g3xk3f079w8fqfj7kl1y7ry81ainysn0qlqrg";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/Arachnid/evmdis";
     description = "Ethereum EVM disassembler";
     license = [ licenses.asl20 ];
diff --git a/pkgs/development/tools/analysis/findbugs/default.nix b/pkgs/development/tools/analysis/findbugs/default.nix
index d522b2b9422..265f6290453 100644
--- a/pkgs/development/tools/analysis/findbugs/default.nix
+++ b/pkgs/development/tools/analysis/findbugs/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "findbugs-3.0.1";
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
     EOF
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A static analysis tool to find bugs in Java programs automatically";
     homepage = "http://findbugs.sourceforge.net/";
     maintainers = with maintainers; [ pSub ];
diff --git a/pkgs/development/tools/analysis/flow/default.nix b/pkgs/development/tools/analysis/flow/default.nix
index 948df14957a..fc39e86007d 100644
--- a/pkgs/development/tools/analysis/flow/default.nix
+++ b/pkgs/development/tools/analysis/flow/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, ocamlPackages, CoreServices }:
+{ lib, stdenv, fetchFromGitHub, ocamlPackages, CoreServices }:
 
 stdenv.mkDerivation rec {
   pname = "flow";
@@ -17,9 +17,9 @@ stdenv.mkDerivation rec {
   '';
 
   buildInputs = (with ocamlPackages; [ ocaml findlib ocamlbuild dtoa core_kernel sedlex_2 ocaml_lwt lwt_log lwt_ppx ppx_deriving ppx_gen_rec ppx_tools_versioned visitors wtf8 ocaml-migrate-parsetree ])
-    ++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices ];
+    ++ lib.optionals stdenv.isDarwin [ CoreServices ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A static type checker for JavaScript";
     homepage = "https://flow.org/";
     changelog = "https://github.com/facebook/flow/releases/tag/v${version}";
diff --git a/pkgs/development/tools/analysis/frama-c/default.nix b/pkgs/development/tools/analysis/frama-c/default.nix
index 94012ce7ff6..394bd6558fb 100644
--- a/pkgs/development/tools/analysis/frama-c/default.nix
+++ b/pkgs/development/tools/analysis/frama-c/default.nix
@@ -73,8 +73,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "An extensible and collaborative platform dedicated to source-code analysis of C software";
     homepage    = "http://frama-c.com/";
-    license     = stdenv.lib.licenses.lgpl21;
-    maintainers = with stdenv.lib.maintainers; [ thoughtpolice amiddelk ];
-    platforms   = stdenv.lib.platforms.unix;
+    license     = lib.licenses.lgpl21;
+    maintainers = with lib.maintainers; [ thoughtpolice amiddelk ];
+    platforms   = lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/analysis/garcosim/tracefilegen/default.nix b/pkgs/development/tools/analysis/garcosim/tracefilegen/default.nix
index d0221e80b9b..8984a395818 100644
--- a/pkgs/development/tools/analysis/garcosim/tracefilegen/default.nix
+++ b/pkgs/development/tools/analysis/garcosim/tracefilegen/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
 
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     cp -ar $src/Documentation/html $out/share/doc/${name}/.
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Automatically generate all types of basic memory management operations and write into trace files";
     homepage = "https://github.com/GarCoSim";
     maintainers = [ maintainers.cmcdragonkai ];
diff --git a/pkgs/development/tools/analysis/garcosim/tracefilesim/default.nix b/pkgs/development/tools/analysis/garcosim/tracefilesim/default.nix
index 10f0d74c0dc..3f97485cbfa 100644
--- a/pkgs/development/tools/analysis/garcosim/tracefilesim/default.nix
+++ b/pkgs/development/tools/analysis/garcosim/tracefilesim/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit }:
+{ lib, stdenv, fetchgit }:
 
 stdenv.mkDerivation {
 
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
     cp ./traceFileSim "$out/bin"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Ease the analysis of existing memory management techniques, as well as the prototyping of new memory management techniques";
     homepage = "https://github.com/GarCoSim";
     maintainers = [ maintainers.cmcdragonkai ];
diff --git a/pkgs/development/tools/analysis/hopper/default.nix b/pkgs/development/tools/analysis/hopper/default.nix
index 68f12dac70f..b169877f5c1 100644
--- a/pkgs/development/tools/analysis/hopper/default.nix
+++ b/pkgs/development/tools/analysis/hopper/default.nix
@@ -67,7 +67,7 @@ stdenv.mkDerivation rec {
       --replace "Exec=/opt/hopper-${rev}/bin/Hopper" "Exec=$out/bin/hopper"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.hopperapp.com/index.html";
     description = "A macOS and Linux Disassembler";
     license = licenses.unfree;
diff --git a/pkgs/development/tools/analysis/hotspot/default.nix b/pkgs/development/tools/analysis/hotspot/default.nix
index de29b29df31..6ea079e3ec1 100644
--- a/pkgs/development/tools/analysis/hotspot/default.nix
+++ b/pkgs/development/tools/analysis/hotspot/default.nix
@@ -1,4 +1,4 @@
-{ stdenv,
+{ lib, stdenv,
   mkDerivation,
   cmake,
   elfutils,
@@ -58,8 +58,8 @@ mkDerivation rec {
       then displays the result in a graphical way.
     '';
     homepage = "https://github.com/KDAB/hotspot";
-    license = with stdenv.lib.licenses; [ gpl2 gpl3 ];
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ nh2 ];
+    license = with lib.licenses; [ gpl2 gpl3 ];
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ nh2 ];
   };
 }
diff --git a/pkgs/development/tools/analysis/include-what-you-use/default.nix b/pkgs/development/tools/analysis/include-what-you-use/default.nix
index 67157218154..db1cf9c6ead 100644
--- a/pkgs/development/tools/analysis/include-what-you-use/default.nix
+++ b/pkgs/development/tools/analysis/include-what-you-use/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, llvmPackages, python2 }:
+{ lib, stdenv, fetchurl, cmake, llvmPackages, python2 }:
 
 stdenv.mkDerivation rec {
   pname = "include-what-you-use";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
       --replace "'include-what-you-use'" "'$out/bin/include-what-you-use'"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Analyze #includes in C/C++ source files with clang";
     longDescription = ''
       For every symbol (type, function variable, or macro) that you use in
diff --git a/pkgs/development/tools/analysis/jdepend/default.nix b/pkgs/development/tools/analysis/jdepend/default.nix
index c903833a731..faa68dadc3b 100644
--- a/pkgs/development/tools/analysis/jdepend/default.nix
+++ b/pkgs/development/tools/analysis/jdepend/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, ant, jdk, runtimeShell }:
+{ lib, stdenv, fetchFromGitHub, ant, jdk, runtimeShell }:
 
 stdenv.mkDerivation rec {
   pname = "jdepend";
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
     chmod a+x $out/bin/jdepend
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Traverses Java class file directories and generates design quality metrics for each Java package";
     homepage = "http://www.clarkware.com/software/JDepend.html";
     license = licenses.bsd3;
diff --git a/pkgs/development/tools/analysis/kcov/default.nix b/pkgs/development/tools/analysis/kcov/default.nix
index b8e456b1c1e..15891e74044 100644
--- a/pkgs/development/tools/analysis/kcov/default.nix
+++ b/pkgs/development/tools/analysis/kcov/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchFromGitHub, cmake, pkg-config, zlib, curl, elfutils, python, libiberty, libopcodes}:
+{lib, stdenv, fetchFromGitHub, cmake, pkg-config, zlib, curl, elfutils, python, libiberty, libopcodes}:
 
 stdenv.mkDerivation rec {
   pname = "kcov";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ zlib curl elfutils python libiberty libopcodes ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Code coverage tester for compiled programs, Python scripts and shell scripts";
 
     longDescription = ''
diff --git a/pkgs/development/tools/analysis/lcov/default.nix b/pkgs/development/tools/analysis/lcov/default.nix
index c6faeaa72f2..35c75d67da5 100644
--- a/pkgs/development/tools/analysis/lcov/default.nix
+++ b/pkgs/development/tools/analysis/lcov/default.nix
@@ -1,4 +1,4 @@
- {stdenv, fetchFromGitHub, perl, perlPackages, makeWrapper }:
+ {lib, stdenv, fetchFromGitHub, perl, perlPackages, makeWrapper }:
 
 stdenv.mkDerivation rec {
   pname = "lcov";
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     wrapProgram $out/bin/genpng --set PERL5LIB ${perlPackages.makeFullPerlPath [ perlPackages.GD ]}
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Code coverage tool that enhances GNU gcov";
 
     longDescription =
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
       '';
 
     homepage = "http://ltp.sourceforge.net/coverage/lcov.php";
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
 
     maintainers = with maintainers; [ dezgeg ];
     platforms = platforms.all;
diff --git a/pkgs/development/tools/analysis/makefile2graph/default.nix b/pkgs/development/tools/analysis/makefile2graph/default.nix
index 20fe74ecb74..66f767f4702 100644
--- a/pkgs/development/tools/analysis/makefile2graph/default.nix
+++ b/pkgs/development/tools/analysis/makefile2graph/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, makeWrapper, bash, gnumake }:
+{ lib, stdenv, fetchFromGitHub, makeWrapper, bash, gnumake }:
 
 stdenv.mkDerivation {
   name = "makefile2graph-2018-01-03";
@@ -19,10 +19,10 @@ stdenv.mkDerivation {
       --replace '/bin/sh' ${bash}/bin/bash \
       --replace 'make2graph' "$out/bin/make2graph"
     wrapProgram $out/bin/makefile2graph \
-      --set PATH ${stdenv.lib.makeBinPath [ gnumake ]}
+      --set PATH ${lib.makeBinPath [ gnumake ]}
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/lindenb/makefile2graph";
     description = "Creates a graph of dependencies from GNU-Make; Output is a graphiz-dot file or a Gexf-XML file";
     maintainers = with maintainers; [ cmcdragonkai ];
diff --git a/pkgs/development/tools/analysis/oclgrind/default.nix b/pkgs/development/tools/analysis/oclgrind/default.nix
index 8cc0477ca59..72154e909b6 100644
--- a/pkgs/development/tools/analysis/oclgrind/default.nix
+++ b/pkgs/development/tools/analysis/oclgrind/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, llvmPackages, readline, python }:
+{ lib, stdenv, fetchFromGitHub, cmake, llvmPackages, readline, python }:
 
 stdenv.mkDerivation rec {
   pname = "oclgrind";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     "-DCLANG_ROOT=${llvmPackages.clang-unwrapped}"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An OpenCL device simulator and debugger";
     homepage = "https://github.com/jrprice/oclgrind";
     license = licenses.bsd3;
diff --git a/pkgs/development/tools/analysis/panopticon/default.nix b/pkgs/development/tools/analysis/panopticon/default.nix
index 4cd16a80a94..ff5014bd46a 100644
--- a/pkgs/development/tools/analysis/panopticon/default.nix
+++ b/pkgs/development/tools/analysis/panopticon/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, rustPlatform, qt5, git, cmake
+{ lib, stdenv, fetchFromGitHub, rustPlatform, qt5, git, cmake
 , pkg-config, makeWrapper }:
 
 rustPlatform.buildRustPackage rec {
@@ -34,7 +34,7 @@ rustPlatform.buildRustPackage rec {
     makeWrapper $out/share/${pname}/${pname} $out/bin/${pname}
      '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A libre cross-platform disassembler";
     longDescription = ''
       Panopticon is a cross platform disassembler for reverse
diff --git a/pkgs/development/tools/analysis/pev/default.nix b/pkgs/development/tools/analysis/pev/default.nix
index 42e382c8bca..a46bc067f11 100644
--- a/pkgs/development/tools/analysis/pev/default.nix
+++ b/pkgs/development/tools/analysis/pev/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, openssl, fetchFromGitHub }:
+{ lib, stdenv, openssl, fetchFromGitHub }:
 
 stdenv.mkDerivation {
   pname = "pev";
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
 
   installFlags = [ "prefix=$(out)" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A full-featured, open source, multiplatform command line toolkit to work with PE (Portable Executables) binaries";
     homepage = "https://pev.sourceforge.net/";
     license = licenses.gpl2;
diff --git a/pkgs/development/tools/analysis/pmd/default.nix b/pkgs/development/tools/analysis/pmd/default.nix
index 497a244f68b..a75445c363b 100644
--- a/pkgs/development/tools/analysis/pmd/default.nix
+++ b/pkgs/development/tools/analysis/pmd/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip, makeWrapper, openjdk }:
+{ lib, stdenv, fetchurl, unzip, makeWrapper, openjdk }:
 
 stdenv.mkDerivation rec {
   pname = "pmd";
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
     runHook postInstall
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An extensible cross-language static code analyzer";
     homepage = "https://pmd.github.io/";
     changelog = "https://pmd.github.io/pmd-${version}/pmd_release_notes.html";
diff --git a/pkgs/development/tools/analysis/qcachegrind/default.nix b/pkgs/development/tools/analysis/qcachegrind/default.nix
index d9f39667cef..0145e51ee26 100644
--- a/pkgs/development/tools/analysis/qcachegrind/default.nix
+++ b/pkgs/development/tools/analysis/qcachegrind/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, qmake, qtbase, perl, python, php, kcachegrind }:
+{ lib, stdenv, qmake, qtbase, perl, python, php, kcachegrind }:
 
 let
-  name = stdenv.lib.replaceStrings ["kcachegrind"] ["qcachegrind"] kcachegrind.name;
+  name = lib.replaceStrings ["kcachegrind"] ["qcachegrind"] kcachegrind.name;
 
 in stdenv.mkDerivation {
   inherit name;
@@ -31,7 +31,7 @@ in stdenv.mkDerivation {
     install -Dm644 kcachegrind/48-apps-kcachegrind.png "$out/share/icons/hicolor/48x48/apps/kcachegrind.png"
   '');
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A Qt GUI to visualize profiling data";
     license = licenses.gpl2;
     platforms = platforms.unix;
diff --git a/pkgs/development/tools/analysis/radare2/default.nix b/pkgs/development/tools/analysis/radare2/default.nix
index c6cc555e050..3623893ea63 100644
--- a/pkgs/development/tools/analysis/radare2/default.nix
+++ b/pkgs/development/tools/analysis/radare2/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchFromGitHub
+{lib, stdenv, fetchFromGitHub
 , buildPackages
 , pkg-config
 , libusb-compat-0_1, readline, libewf, perl, zlib, openssl
@@ -19,7 +19,7 @@ assert pythonBindings -> python3 != null;
 
 
 let
-  inherit (stdenv.lib) optional;
+  inherit (lib) optional;
 
   generic = {
     version_commit, # unused
@@ -95,9 +95,9 @@ let
       meta = {
         description = "unix-like reverse engineering framework and commandline tools";
         homepage = "http://radare.org/";
-        license = stdenv.lib.licenses.gpl2Plus;
-        maintainers = with stdenv.lib.maintainers; [ raskin makefu mic92 ];
-        platforms = with stdenv.lib.platforms; linux;
+        license = lib.licenses.gpl2Plus;
+        maintainers = with lib.maintainers; [ raskin makefu mic92 ];
+        platforms = with lib.platforms; linux;
         inherit version;
       };
   };
diff --git a/pkgs/development/tools/analysis/randoop/default.nix b/pkgs/development/tools/analysis/randoop/default.nix
index b51b26eab17..0d10d6d6b27 100644
--- a/pkgs/development/tools/analysis/randoop/default.nix
+++ b/pkgs/development/tools/analysis/randoop/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip }:
+{ lib, stdenv, fetchurl, unzip }:
 
 stdenv.mkDerivation rec {
   version = "4.2.5";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     cp README.txt $out/doc
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Automatic test generation for Java";
     homepage = "https://randoop.github.io/randoop/";
     license = licenses.mit;
diff --git a/pkgs/development/tools/analysis/rr/default.nix b/pkgs/development/tools/analysis/rr/default.nix
index 92f2494dbe2..b63713f0007 100644
--- a/pkgs/development/tools/analysis/rr/default.nix
+++ b/pkgs/development/tools/analysis/rr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, libpfm, zlib, pkg-config, python3Packages, which, procps, gdb, capnproto }:
+{ lib, stdenv, fetchFromGitHub, cmake, libpfm, zlib, pkg-config, python3Packages, which, procps, gdb, capnproto }:
 
 stdenv.mkDerivation rec {
   version = "5.4.0";
@@ -52,8 +52,8 @@ stdenv.mkDerivation rec {
       time the same execution is replayed.
     '';
 
-    license = with stdenv.lib.licenses; [ mit bsd2 ];
-    maintainers = with stdenv.lib.maintainers; [ pierron thoughtpolice ];
-    platforms = stdenv.lib.platforms.x86;
+    license = with lib.licenses; [ mit bsd2 ];
+    maintainers = with lib.maintainers; [ pierron thoughtpolice ];
+    platforms = lib.platforms.x86;
   };
 }
diff --git a/pkgs/development/tools/analysis/smatch/default.nix b/pkgs/development/tools/analysis/smatch/default.nix
index e29f06fca8e..4330ec3d742 100644
--- a/pkgs/development/tools/analysis/smatch/default.nix
+++ b/pkgs/development/tools/analysis/smatch/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, sqlite, pkg-config, perl
+{ lib, stdenv, fetchgit, sqlite, pkg-config, perl
 , buildllvmsparse ? true
 , buildc2xml ? true
 , llvm ? null, libxml2 ? null
@@ -18,8 +18,8 @@ stdenv.mkDerivation {
 
   nativeBuildInputs = [ pkg-config ];
   buildInputs = [sqlite perl]
-   ++ stdenv.lib.optional buildllvmsparse llvm
-   ++ stdenv.lib.optional buildc2xml libxml2;
+   ++ lib.optional buildllvmsparse llvm
+   ++ lib.optional buildc2xml libxml2;
 
   preBuild =
     '' sed -i Makefile \
@@ -29,7 +29,7 @@ stdenv.mkDerivation {
   meta = {
     description = "A semantic analysis tool for C";
     homepage = "http://smatch.sourceforge.net/";
-    license = stdenv.lib.licenses.free; /* OSL, see http://www.opensource.org */
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.free; /* OSL, see http://www.opensource.org */
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/pkgs/development/tools/analysis/snowman/default.nix b/pkgs/development/tools/analysis/snowman/default.nix
index 82eb58879f1..261645c062d 100644
--- a/pkgs/development/tools/analysis/snowman/default.nix
+++ b/pkgs/development/tools/analysis/snowman/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, mkDerivation, fetchFromGitHub, cmake, boost, qtbase }:
+{ lib, stdenv, mkDerivation, fetchFromGitHub, cmake, boost, qtbase }:
 
 mkDerivation rec {
   pname = "snowman";
@@ -19,7 +19,7 @@ mkDerivation rec {
     export sourceRoot=$sourceRoot/src
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Native code to C/C++ decompiler";
     homepage = "http://derevenets.com/";
 
diff --git a/pkgs/development/tools/analysis/sparse/default.nix b/pkgs/development/tools/analysis/sparse/default.nix
index 29ee980b487..e0d9840472b 100644
--- a/pkgs/development/tools/analysis/sparse/default.nix
+++ b/pkgs/development/tools/analysis/sparse/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, pkg-config, libxml2, llvm }:
+{ fetchurl, lib, stdenv, pkg-config, libxml2, llvm }:
 
 stdenv.mkDerivation rec {
   name = "sparse-0.5.0";
@@ -19,8 +19,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Semantic parser for C";
     homepage    = "https://git.kernel.org/cgit/devel/sparse/sparse.git/";
-    license     = stdenv.lib.licenses.mit;
-    platforms   = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
+    license     = lib.licenses.mit;
+    platforms   = lib.platforms.linux;
+    maintainers = [ lib.maintainers.thoughtpolice ];
   };
 }
diff --git a/pkgs/development/tools/analysis/spin/default.nix b/pkgs/development/tools/analysis/spin/default.nix
index 73e88f9811c..49e31f53a84 100644
--- a/pkgs/development/tools/analysis/spin/default.nix
+++ b/pkgs/development/tools/analysis/spin/default.nix
@@ -2,13 +2,13 @@
 , withISpin ? true, tk, swarm, graphviz }:
 
 let
-  binPath = stdenv.lib.makeBinPath [ gcc ];
-  ibinPath = stdenv.lib.makeBinPath [ gcc tk swarm graphviz tk ];
+  binPath = lib.makeBinPath [ gcc ];
+  ibinPath = lib.makeBinPath [ gcc tk swarm graphviz tk ];
 
 in stdenv.mkDerivation rec {
   pname = "spin";
   version = "6.4.9";
-  url-version = stdenv.lib.replaceChars ["."] [""] version;
+  url-version = lib.replaceChars ["."] [""] version;
 
   src = fetchurl {
     # The homepage is behind CloudFlare anti-DDoS protection, which blocks cURL.
@@ -36,7 +36,7 @@ in stdenv.mkDerivation rec {
       --prefix PATH ':' "$out/bin:${ibinPath}"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Formal verification tool for distributed software systems";
     homepage = "http://spinroot.com/";
     license = licenses.free;
diff --git a/pkgs/development/tools/analysis/splint/default.nix b/pkgs/development/tools/analysis/splint/default.nix
index 4dc93897e86..581ff56bb61 100644
--- a/pkgs/development/tools/analysis/splint/default.nix
+++ b/pkgs/development/tools/analysis/splint/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, flex }:
+{ fetchurl, lib, stdenv, flex }:
 
 stdenv.mkDerivation rec {
   name = "splint-3.1.2";
@@ -8,13 +8,13 @@ stdenv.mkDerivation rec {
     sha256 = "02pv8kscsrkrzip9r08pfs9xs98q74c52mlxzbii6cv6vx1vd3f7";
   };
 
-  patches = [ ./tmpdir.patch ] ++ stdenv.lib.optional stdenv.isDarwin ./darwin.patch;
+  patches = [ ./tmpdir.patch ] ++ lib.optional stdenv.isDarwin ./darwin.patch;
 
   buildInputs = [ flex ];
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.splint.org/";
     description = "Annotation-assisted lightweight static analyzer for C";
 
diff --git a/pkgs/development/tools/analysis/swarm/default.nix b/pkgs/development/tools/analysis/swarm/default.nix
index 03f218546eb..894d9a2357e 100644
--- a/pkgs/development/tools/analysis/swarm/default.nix
+++ b/pkgs/development/tools/analysis/swarm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation {
   name = "swarm-2019-03-11";
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
     install -Dm644 Doc/swarm.1 $out/share/man/man1/swarm.1
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Verification script generator for Spin";
     homepage = "http://spinroot.com/";
     license = licenses.free;
diff --git a/pkgs/development/tools/analysis/uefi-firmware-parser/default.nix b/pkgs/development/tools/analysis/uefi-firmware-parser/default.nix
index 0ad042d74de..17f39071462 100644
--- a/pkgs/development/tools/analysis/uefi-firmware-parser/default.nix
+++ b/pkgs/development/tools/analysis/uefi-firmware-parser/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, python3, fetchFromGitHub }:
+{ lib, stdenv, python3, fetchFromGitHub }:
 
 with python3.pkgs;
 
@@ -14,7 +14,7 @@ buildPythonApplication rec {
     sha256 = "1yn9vi91j1yxkn0icdnjhgl0qrqqkzyhccj39af4f19q1gdw995l";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/theopolis/uefi-firmware-parser/";
     description = "Parse BIOS/Intel ME/UEFI firmware related structures: Volumes, FileSystems, Files, etc";
     # MIT + license headers in some files
diff --git a/pkgs/development/tools/analysis/valgrind/default.nix b/pkgs/development/tools/analysis/valgrind/default.nix
index 60d3a7c5ebc..d99bbe1cae4 100644
--- a/pkgs/development/tools/analysis/valgrind/default.nix
+++ b/pkgs/development/tools/analysis/valgrind/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, gdb, cctools, xnu, bootstrap_cmds }:
+{ lib, stdenv, fetchurl, perl, gdb, cctools, xnu, bootstrap_cmds }:
 
 stdenv.mkDerivation rec {
   name = "valgrind-3.16.1";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   # GDB is needed to provide a sane default for `--db-command'.
   # Perl is needed for `callgrind_{annotate,control}'.
-  buildInputs = [ gdb perl ]  ++ stdenv.lib.optionals (stdenv.isDarwin) [ bootstrap_cmds xnu ];
+  buildInputs = [ gdb perl ]  ++ lib.optionals (stdenv.isDarwin) [ bootstrap_cmds xnu ];
 
   # Perl is also a native build input.
   nativeBuildInputs = [ perl ];
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
   separateDebugInfo = stdenv.isLinux;
 
-  preConfigure = stdenv.lib.optionalString stdenv.isDarwin (
+  preConfigure = lib.optionalString stdenv.isDarwin (
     let OSRELEASE = ''
       $(awk -F '"' '/#define OSRELEASE/{ print $2 }' \
       <${xnu}/Library/Frameworks/Kernel.framework/Headers/libkern/version.h)'';
@@ -50,8 +50,8 @@ stdenv.mkDerivation rec {
   postPatch = "";
 
   configureFlags =
-    stdenv.lib.optional (stdenv.hostPlatform.system == "x86_64-linux" || stdenv.hostPlatform.system == "x86_64-darwin") "--enable-only64bit"
-    ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin "--with-xcodedir=${xnu}/include";
+    lib.optional (stdenv.hostPlatform.system == "x86_64-linux" || stdenv.hostPlatform.system == "x86_64-darwin") "--enable-only64bit"
+    ++ lib.optional stdenv.hostPlatform.isDarwin "--with-xcodedir=${xnu}/include";
 
   doCheck = false; # fails
 
@@ -76,10 +76,10 @@ stdenv.mkDerivation rec {
       Valgrind to build new tools.
     '';
 
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
 
-    maintainers = [ stdenv.lib.maintainers.eelco ];
-    platforms = stdenv.lib.platforms.unix;
+    maintainers = [ lib.maintainers.eelco ];
+    platforms = lib.platforms.unix;
     badPlatforms = [
       "armv5tel-linux" "armv6l-linux" "armv6m-linux"
       "sparc-linux" "sparc64-linux"
diff --git a/pkgs/development/tools/analysis/valkyrie/default.nix b/pkgs/development/tools/analysis/valkyrie/default.nix
index 1c571fe6be0..10b9f7291a2 100644
--- a/pkgs/development/tools/analysis/valkyrie/default.nix
+++ b/pkgs/development/tools/analysis/valkyrie/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, qt4, qmake4Hook }:
+{ lib, stdenv, fetchurl, qt4, qmake4Hook }:
 
 stdenv.mkDerivation rec {
   name = "valkyrie-2.0.0";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ qmake4Hook ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.valgrind.org/";
     description = "Qt4-based GUI for the Valgrind 3.6.x series";
     license = licenses.gpl2;
diff --git a/pkgs/development/tools/apktool/default.nix b/pkgs/development/tools/apktool/default.nix
index 2ff9c58fb33..33721e60b0e 100644
--- a/pkgs/development/tools/apktool/default.nix
+++ b/pkgs/development/tools/apktool/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper, jre, build-tools }:
+{ lib, stdenv, fetchurl, makeWrapper, jre, build-tools }:
 
 stdenv.mkDerivation rec {
   pname = "apktool";
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
         --prefix PATH : "${builtins.head build-tools}/libexec/android-sdk/build-tools/28.0.3"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A tool for reverse engineering Android apk files";
     homepage    = "https://ibotpeaches.github.io/Apktool/";
     license     = licenses.asl20;
diff --git a/pkgs/development/tools/asn2quickder/default.nix b/pkgs/development/tools/asn2quickder/default.nix
index 68a0c0f6073..b2432f7fefc 100644
--- a/pkgs/development/tools/asn2quickder/default.nix
+++ b/pkgs/development/tools/asn2quickder/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildPythonApplication, fetchFromGitHub, makeWrapper, cmake
+{ lib, stdenv, buildPythonApplication, fetchFromGitHub, makeWrapper, cmake
 , pytestrunner, pytest, six, pyparsing, asn1ate }:
 
 buildPythonApplication rec {
@@ -23,7 +23,7 @@ buildPythonApplication rec {
 
   propagatedBuildInputs = [ pyparsing asn1ate six ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An ASN.1 compiler with a backend for Quick DER";
     homepage = "https://github.com/vanrein/asn2quickder";
     license = licenses.bsd3;
diff --git a/pkgs/development/tools/avro-tools/default.nix b/pkgs/development/tools/avro-tools/default.nix
index 5327ab354e9..5dd058614c1 100644
--- a/pkgs/development/tools/avro-tools/default.nix
+++ b/pkgs/development/tools/avro-tools/default.nix
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
     --add-flags "-jar $out/libexec/avro-tools/${pname}.jar"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage    = "https://avro.apache.org/";
     description = "Avro command-line tools and utilities";
     license     = lib.licenses.asl20;
diff --git a/pkgs/development/tools/azcopy/default.nix b/pkgs/development/tools/azcopy/default.nix
index bae6dd73829..822480b1d3f 100644
--- a/pkgs/development/tools/azcopy/default.nix
+++ b/pkgs/development/tools/azcopy/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, buildGoModule }:
+{ lib, stdenv, fetchFromGitHub, buildGoModule }:
 
 buildGoModule rec {
   pname = "azure-storage-azcopy";
@@ -21,7 +21,7 @@ buildGoModule rec {
     ln -rs "$out/bin/azure-storage-azcopy" "$out/bin/azcopy"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     maintainers = with maintainers; [ colemickens ];
     license = licenses.mit;
     description = "The new Azure Storage data transfer utility - AzCopy v10";
diff --git a/pkgs/development/tools/bazel-watcher/default.nix b/pkgs/development/tools/bazel-watcher/default.nix
index e0a7febb875..94efcc9be06 100644
--- a/pkgs/development/tools/bazel-watcher/default.nix
+++ b/pkgs/development/tools/bazel-watcher/default.nix
@@ -3,7 +3,7 @@
 , git
 , go
 , python
-, stdenv
+, lib, stdenv
 }:
 
 let
@@ -73,7 +73,7 @@ buildBazelPackage rec {
     '';
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/bazelbuild/bazel-watcher";
     description = "Tools for building Bazel targets when source files change";
     license = licenses.asl20;
diff --git a/pkgs/development/tools/bazelisk/default.nix b/pkgs/development/tools/bazelisk/default.nix
index 2a20888426d..e4a6b3c2869 100644
--- a/pkgs/development/tools/bazelisk/default.nix
+++ b/pkgs/development/tools/bazelisk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoModule, fetchFromGitHub }:
+{ lib, stdenv, buildGoModule, fetchFromGitHub }:
 
 buildGoModule rec {
   pname = "bazelisk";
@@ -17,7 +17,7 @@ buildGoModule rec {
 
   buildFlagsArray = [ "-ldflags=-s -w -X main.BazeliskVersion=${version}" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A user-friendly launcher for Bazel";
     longDescription = ''
       BEWARE: This package does not work on NixOS.
diff --git a/pkgs/development/tools/bloaty/default.nix b/pkgs/development/tools/bloaty/default.nix
index fcab0fb198e..ff24e7b7c1c 100644
--- a/pkgs/development/tools/bloaty/default.nix
+++ b/pkgs/development/tools/bloaty/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, cmake, zlib, fetchFromGitHub }:
+{ lib, stdenv, cmake, zlib, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   version = "1.1";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     install -Dm755 {.,$out/bin}/bloaty
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "a size profiler for binaries";
     homepage = "https://github.com/google/bloaty";
     license = licenses.asl20;
diff --git a/pkgs/development/tools/boost-build/default.nix b/pkgs/development/tools/boost-build/default.nix
index 8ce475c893d..8566edd2315 100644
--- a/pkgs/development/tools/boost-build/default.nix
+++ b/pkgs/development/tools/boost-build/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "boost-build";
@@ -27,9 +27,9 @@ stdenv.mkDerivation rec {
     ./b2 install --prefix=$out
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.boost.org/boost-build2/";
-    license = stdenv.lib.licenses.boost;
+    license = lib.licenses.boost;
     platforms = platforms.unix;
     maintainers = with maintainers; [ ivan-tkatchev ];
   };
diff --git a/pkgs/development/tools/build-managers/apache-ant/1.9.nix b/pkgs/development/tools/build-managers/apache-ant/1.9.nix
index 49f8435b377..182b8633aa0 100644
--- a/pkgs/development/tools/build-managers/apache-ant/1.9.nix
+++ b/pkgs/development/tools/build-managers/apache-ant/1.9.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, coreutils, makeWrapper }:
+{ fetchurl, lib, stdenv, coreutils, makeWrapper }:
 
 let version = "1.9.15"; in
 
@@ -105,8 +105,8 @@ stdenv.mkDerivation {
       by an object that implements a particular Task interface.
     '';
 
-    license = stdenv.lib.licenses.asl20;
-    maintainers = [ stdenv.lib.maintainers.eelco ];
-    platforms = stdenv.lib.platforms.all;
+    license = lib.licenses.asl20;
+    maintainers = [ lib.maintainers.eelco ];
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/development/tools/build-managers/apache-ant/default.nix b/pkgs/development/tools/build-managers/apache-ant/default.nix
index caa9bc3b9eb..d88068c1c3e 100644
--- a/pkgs/development/tools/build-managers/apache-ant/default.nix
+++ b/pkgs/development/tools/build-managers/apache-ant/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, coreutils, makeWrapper }:
+{ fetchurl, lib, stdenv, coreutils, makeWrapper }:
 
 let version = "1.10.9"; in
 
@@ -105,8 +105,8 @@ stdenv.mkDerivation {
       by an object that implements a particular Task interface.
     '';
 
-    license = stdenv.lib.licenses.asl20;
-    maintainers = [ stdenv.lib.maintainers.eelco ];
-    platforms = stdenv.lib.platforms.all;
+    license = lib.licenses.asl20;
+    maintainers = [ lib.maintainers.eelco ];
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/development/tools/build-managers/apache-maven/default.nix b/pkgs/development/tools/build-managers/apache-maven/default.nix
index 83260cbc186..4658703f8b1 100644
--- a/pkgs/development/tools/build-managers/apache-maven/default.nix
+++ b/pkgs/development/tools/build-managers/apache-maven/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, jdk, makeWrapper }:
+{ lib, stdenv, fetchurl, jdk, makeWrapper }:
 
 assert jdk != null;
 
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
 
   inherit jdk;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Build automation tool (used primarily for Java projects)";
     homepage = "http://maven.apache.org/";
     license = licenses.asl20;
diff --git a/pkgs/development/tools/build-managers/arpa2cm/default.nix b/pkgs/development/tools/build-managers/arpa2cm/default.nix
index 9ed9da0d268..0af9e77acf5 100644
--- a/pkgs/development/tools/build-managers/arpa2cm/default.nix
+++ b/pkgs/development/tools/build-managers/arpa2cm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "arpa2cm";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "CMake Module library for the ARPA2 project";
     license = licenses.bsd2;
     maintainers = with maintainers; [ leenaars ];
diff --git a/pkgs/development/tools/build-managers/bam/default.nix b/pkgs/development/tools/build-managers/bam/default.nix
index 969cd987974..8eb197151a3 100644
--- a/pkgs/development/tools/build-managers/bam/default.nix
+++ b/pkgs/development/tools/build-managers/bam/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, lua5_3, python }:
+{ lib, stdenv, fetchFromGitHub, lua5_3, python }:
 
 stdenv.mkDerivation rec {
   pname = "bam";
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     cp bam "$out/bin"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Yet another build manager";
     maintainers = with maintainers;
     [
diff --git a/pkgs/development/tools/build-managers/bazel/bazel-remote/default.nix b/pkgs/development/tools/build-managers/bazel/bazel-remote/default.nix
index 0c9f4d7c50a..ac03288f148 100644
--- a/pkgs/development/tools/build-managers/bazel/bazel-remote/default.nix
+++ b/pkgs/development/tools/build-managers/bazel/bazel-remote/default.nix
@@ -3,7 +3,7 @@
 , fetchFromGitHub
 , git
 , go
-, stdenv
+, lib, stdenv
 }:
 
 buildBazelPackage rec {
@@ -80,7 +80,7 @@ buildBazelPackage rec {
     '';
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/buchgr/bazel-remote";
     description = "A remote HTTP/1.1 cache for Bazel";
     license = licenses.asl20;
diff --git a/pkgs/development/tools/build-managers/bazel/buildtools/default.nix b/pkgs/development/tools/build-managers/bazel/buildtools/default.nix
index 66560e768d2..436b681e005 100644
--- a/pkgs/development/tools/build-managers/bazel/buildtools/default.nix
+++ b/pkgs/development/tools/build-managers/bazel/buildtools/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "bazel-buildtools";
@@ -19,7 +19,7 @@ buildGoPackage rec {
 
   buildFlagsArray = [ "-ldflags=-s -w -X main.buildVersion=${version} -X main.buildScmRevision=${src.rev}" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Tools for working with Google's bazel buildtool. Includes buildifier, buildozer, and unused_deps";
     homepage = "https://github.com/bazelbuild/buildtools";
     license = licenses.asl20;
diff --git a/pkgs/development/tools/build-managers/bear/default.nix b/pkgs/development/tools/build-managers/bear/default.nix
index 756e68b5678..74b1f704020 100644
--- a/pkgs/development/tools/build-managers/bear/default.nix
+++ b/pkgs/development/tools/build-managers/bear/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 , pkg-config
@@ -45,7 +45,7 @@ stdenv.mkDerivation rec {
     ./no-double-relative.patch
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Tool that generates a compilation database for clang tooling";
     longDescription = ''
       Note: the bear command is very useful to generate compilation commands
diff --git a/pkgs/development/tools/build-managers/bloop/default.nix b/pkgs/development/tools/build-managers/bloop/default.nix
index c1b3a7aa156..12fd01e5e4e 100644
--- a/pkgs/development/tools/build-managers/bloop/default.nix
+++ b/pkgs/development/tools/build-managers/bloop/default.nix
@@ -82,7 +82,7 @@ stdenv.mkDerivation rec {
     installShellCompletion --name bloop.fish --fish ${bloop-fish}
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://scalacenter.github.io/bloop/";
     license = licenses.asl20;
     description = "A Scala build server and command-line tool to make the compile and test developer workflows fast and productive in a build-tool-agnostic way";
diff --git a/pkgs/development/tools/build-managers/bmake/default.nix b/pkgs/development/tools/build-managers/bmake/default.nix
index 9bda4cde044..e1e9b348503 100644
--- a/pkgs/development/tools/build-managers/bmake/default.nix
+++ b/pkgs/development/tools/build-managers/bmake/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl
+{ lib, stdenv, fetchurl
 , getopt
 }:
 
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     ./fix-unexport-env-test.patch
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Portable version of NetBSD 'make'";
     homepage    = "http://www.crufty.net/help/sjg/bmake.html";
     license     = licenses.bsd3;
diff --git a/pkgs/development/tools/build-managers/boot/default.nix b/pkgs/development/tools/build-managers/boot/default.nix
index 09c1eada54b..68a4d5f44ea 100644
--- a/pkgs/development/tools/build-managers/boot/default.nix
+++ b/pkgs/development/tools/build-managers/boot/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, jdk }:
+{ lib, stdenv, fetchurl, jdk }:
 
 stdenv.mkDerivation rec {
   version = "2.7.2";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ jdk ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Build tooling for Clojure";
     homepage = "https://boot-clj.com/";
     license = licenses.epl10;
diff --git a/pkgs/development/tools/build-managers/buck/default.nix b/pkgs/development/tools/build-managers/buck/default.nix
index 41fc0940b9d..0fbcb95704b 100644
--- a/pkgs/development/tools/build-managers/buck/default.nix
+++ b/pkgs/development/tools/build-managers/buck/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, jdk, ant, python2, python2Packages, watchman, bash, makeWrapper }:
+{ lib, stdenv, fetchFromGitHub, jdk, ant, python2, python2Packages, watchman, bash, makeWrapper }:
 
 stdenv.mkDerivation rec {
   pname = "buck";
@@ -30,10 +30,10 @@ stdenv.mkDerivation rec {
     install -D -m755 buck-out/gen/programs/buck.pex $out/bin/buck
     wrapProgram $out/bin/buck \
       --prefix PYTHONPATH : $PYTHONPATH \
-      --prefix PATH : "${stdenv.lib.makeBinPath [jdk watchman]}"
+      --prefix PATH : "${lib.makeBinPath [jdk watchman]}"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://buck.build/";
     description = "A high-performance build tool";
     maintainers = [ maintainers.jgertm maintainers.marsam ];
diff --git a/pkgs/development/tools/build-managers/cmake/2.8.nix b/pkgs/development/tools/build-managers/cmake/2.8.nix
index 804bdd76f67..9dabd7b3556 100644
--- a/pkgs/development/tools/build-managers/cmake/2.8.nix
+++ b/pkgs/development/tools/build-managers/cmake/2.8.nix
@@ -1,14 +1,14 @@
-{ stdenv, fetchurl, fetchpatch, curl, expat, zlib, bzip2
+{ lib, stdenv, fetchurl, fetchpatch, curl, expat, zlib, bzip2
 , useNcurses ? false, ncurses, useQt4 ? false, qt4, ps
 }:
 
-with stdenv.lib;
+with lib;
 
 assert stdenv ? cc;
 assert stdenv.cc ? libc;
 
 let
-  os = stdenv.lib.optionalString;
+  os = lib.optionalString;
   majorVersion = "2.8";
   minorVersion = "12.2";
   version = "${majorVersion}.${minorVersion}";
@@ -60,7 +60,7 @@ stdenv.mkDerivation rec {
     "--mandir=/share/man"
     "--system-libs"
     "--no-system-libarchive"
-   ] ++ stdenv.lib.optional useQt4 "--qt-gui";
+   ] ++ lib.optional useQt4 "--qt-gui";
 
   setupHook = ./setup-hook.sh;
 
@@ -80,8 +80,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://cmake.org";
     description = "Cross-Platform Makefile Generator";
-    platforms = if useQt4 then qt4.meta.platforms else stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ xfix ];
-    license = stdenv.lib.licenses.bsd3;
+    platforms = if useQt4 then qt4.meta.platforms else lib.platforms.unix;
+    maintainers = with lib.maintainers; [ xfix ];
+    license = lib.licenses.bsd3;
   };
 }
diff --git a/pkgs/development/tools/build-managers/colormake/default.nix b/pkgs/development/tools/build-managers/colormake/default.nix
index 7eed8806955..251268a449d 100644
--- a/pkgs/development/tools/build-managers/colormake/default.nix
+++ b/pkgs/development/tools/build-managers/colormake/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, perl }:
+{ lib, stdenv, fetchFromGitHub, perl }:
 
 stdenv.mkDerivation {
   pname = "colormake";
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
     cp -fa colormake.pl colormake colormake-short clmake clmake-short $out/bin
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Simple wrapper around make to colorize the output";
     homepage = "https://bre.klaki.net/programs/colormake/";
     license = licenses.gpl2;
diff --git a/pkgs/development/tools/build-managers/doit/default.nix b/pkgs/development/tools/build-managers/doit/default.nix
index b906d64f0af..d48f0d4d56b 100644
--- a/pkgs/development/tools/build-managers/doit/default.nix
+++ b/pkgs/development/tools/build-managers/doit/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, python3Packages }:
+{ lib, stdenv, fetchurl, python3Packages }:
 
 let
 
@@ -16,15 +16,15 @@ in python3Packages.buildPythonApplication {
   buildInputs = with python3Packages; [ mock pytest ];
 
   propagatedBuildInputs = with python3Packages; [ cloudpickle ]
-    ++ stdenv.lib.optional stdenv.isLinux pyinotify
-    ++ stdenv.lib.optional stdenv.isDarwin macfsevents;
+    ++ lib.optional stdenv.isLinux pyinotify
+    ++ lib.optional stdenv.isDarwin macfsevents;
 
   # Tests fail due to mysterious gdbm.open() resource temporarily
   # unavailable errors.
   doCheck = false;
   checkPhase = "py.test";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://pydoit.org/";
     description = "A task management & automation tool";
     license = licenses.mit;
diff --git a/pkgs/development/tools/build-managers/dub/default.nix b/pkgs/development/tools/build-managers/dub/default.nix
index 2668eca4569..2df829a0229 100644
--- a/pkgs/development/tools/build-managers/dub/default.nix
+++ b/pkgs/development/tools/build-managers/dub/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, curl, dmd, libevent, rsync }:
+{ lib, stdenv, fetchFromGitHub, curl, dmd, libevent, rsync }:
 
 stdenv.mkDerivation rec {
   pname = "dub";
@@ -72,7 +72,7 @@ stdenv.mkDerivation rec {
     cp bin/dub $out/bin
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Package and build manager for D applications and libraries";
     homepage = "https://code.dlang.org/";
     license = licenses.mit;
diff --git a/pkgs/development/tools/build-managers/fac/default.nix b/pkgs/development/tools/build-managers/fac/default.nix
index 8c41eb3ac51..25450ceb6d9 100644
--- a/pkgs/development/tools/build-managers/fac/default.nix
+++ b/pkgs/development/tools/build-managers/fac/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, git, fetchFromGitHub, rustPlatform }:
+{ lib, stdenv, git, fetchFromGitHub, rustPlatform }:
 
 rustPlatform.buildRustPackage rec {
   pname = "fac-build";
@@ -29,7 +29,7 @@ rustPlatform.buildRustPackage rec {
         'std::process::Command::new("${git}/bin/git")'
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = ''
       A build system that uses ptrace to handle dependencies automatically
     '';
diff --git a/pkgs/development/tools/build-managers/gnumake/4.2/default.nix b/pkgs/development/tools/build-managers/gnumake/4.2/default.nix
index c2ce00eee21..387650e85ab 100644
--- a/pkgs/development/tools/build-managers/gnumake/4.2/default.nix
+++ b/pkgs/development/tools/build-managers/gnumake/4.2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, guileSupport ? false, pkg-config ? null , guile ? null }:
+{ lib, stdenv, fetchurl, guileSupport ? false, pkg-config ? null , guile ? null }:
 
 assert guileSupport -> ( pkg-config != null && guile != null );
 
@@ -25,10 +25,10 @@ stdenv.mkDerivation {
     ./glibc-2.27-glob.patch
   ];
 
-  nativeBuildInputs = stdenv.lib.optionals guileSupport [ pkg-config ];
-  buildInputs = stdenv.lib.optionals guileSupport [ guile ];
+  nativeBuildInputs = lib.optionals guileSupport [ pkg-config ];
+  buildInputs = lib.optionals guileSupport [ guile ];
 
-  configureFlags = stdenv.lib.optional guileSupport "--with-guile"
+  configureFlags = lib.optional guileSupport "--with-guile"
 
     # Make uses this test to decide whether it should keep track of
     # subseconds. Apple made this possible with APFS and macOS 10.13.
@@ -37,11 +37,11 @@ stdenv.mkDerivation {
     # a second. So, tell Make to ignore nanoseconds in mtime here by
     # overriding the autoconf test for the struct.
     # See https://github.com/NixOS/nixpkgs/issues/51221 for discussion.
-    ++ stdenv.lib.optional stdenv.isDarwin "ac_cv_struct_st_mtim_nsec=no";
+    ++ lib.optional stdenv.isDarwin "ac_cv_struct_st_mtim_nsec=no";
 
   outputs = [ "out" "man" "info" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.gnu.org/software/make/";
     description = "A tool to control the generation of non-source files from sources";
     license = licenses.gpl3Plus;
diff --git a/pkgs/development/tools/build-managers/gnumake/default.nix b/pkgs/development/tools/build-managers/gnumake/default.nix
index 213d43c735c..fb9dab54049 100644
--- a/pkgs/development/tools/build-managers/gnumake/default.nix
+++ b/pkgs/development/tools/build-managers/gnumake/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, guileSupport ? false, pkg-config ? null , guile ? null }:
+{ lib, stdenv, fetchurl, guileSupport ? false, pkg-config ? null , guile ? null }:
 
 assert guileSupport -> ( pkg-config != null && guile != null );
 
@@ -21,10 +21,10 @@ stdenv.mkDerivation {
     ./impure-dirs.patch
   ];
 
-  nativeBuildInputs = stdenv.lib.optionals guileSupport [ pkg-config ];
-  buildInputs = stdenv.lib.optionals guileSupport [ guile ];
+  nativeBuildInputs = lib.optionals guileSupport [ pkg-config ];
+  buildInputs = lib.optionals guileSupport [ guile ];
 
-  configureFlags = stdenv.lib.optional guileSupport "--with-guile"
+  configureFlags = lib.optional guileSupport "--with-guile"
 
     # Make uses this test to decide whether it should keep track of
     # subseconds. Apple made this possible with APFS and macOS 10.13.
@@ -33,11 +33,11 @@ stdenv.mkDerivation {
     # a second. So, tell Make to ignore nanoseconds in mtime here by
     # overriding the autoconf test for the struct.
     # See https://github.com/NixOS/nixpkgs/issues/51221 for discussion.
-    ++ stdenv.lib.optional stdenv.isDarwin "ac_cv_struct_st_mtim_nsec=no";
+    ++ lib.optional stdenv.isDarwin "ac_cv_struct_st_mtim_nsec=no";
 
   outputs = [ "out" "man" "info" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.gnu.org/software/make/";
     description = "A tool to control the generation of non-source files from sources";
     license = licenses.gpl3Plus;
diff --git a/pkgs/development/tools/build-managers/gradle/default.nix b/pkgs/development/tools/build-managers/gradle/default.nix
index d06282739af..638be6b02d8 100644
--- a/pkgs/development/tools/build-managers/gradle/default.nix
+++ b/pkgs/development/tools/build-managers/gradle/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip, jdk, java ? jdk, makeWrapper }:
+{ lib, stdenv, fetchurl, unzip, jdk, java ? jdk, makeWrapper }:
 
 rec {
   gradleGen = {name, src, nativeVersion} : stdenv.mkDerivation {
@@ -46,8 +46,8 @@ rec {
         build-by-convention behavior.
       '';
       homepage = "http://www.gradle.org/";
-      license = stdenv.lib.licenses.asl20;
-      platforms = stdenv.lib.platforms.unix;
+      license = lib.licenses.asl20;
+      platforms = lib.platforms.unix;
     };
   };
 
diff --git a/pkgs/development/tools/build-managers/gup/default.nix b/pkgs/development/tools/build-managers/gup/default.nix
index 30c4d4ec4de..dcc0c3aef90 100644
--- a/pkgs/development/tools/build-managers/gup/default.nix
+++ b/pkgs/development/tools/build-managers/gup/default.nix
@@ -33,8 +33,8 @@ stdenv.mkDerivation rec {
   meta = {
     inherit (src.meta) homepage;
     description = "A better make, inspired by djb's redo";
-    license = stdenv.lib.licenses.lgpl2Plus;
-    maintainers = [ stdenv.lib.maintainers.timbertson ];
-    platforms = stdenv.lib.platforms.all;
+    license = lib.licenses.lgpl2Plus;
+    maintainers = [ lib.maintainers.timbertson ];
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/development/tools/build-managers/icmake/default.nix b/pkgs/development/tools/build-managers/icmake/default.nix
index 89e2b8d0cc6..6320646974a 100644
--- a/pkgs/development/tools/build-managers/icmake/default.nix
+++ b/pkgs/development/tools/build-managers/icmake/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitLab, makeWrapper, gcc, ncurses }:
+{ lib, stdenv, fetchFromGitLab, makeWrapper, gcc, ncurses }:
 
 stdenv.mkDerivation rec {
   pname = "icmake";
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
      --prefix PATH : ${ncurses}/bin
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A program maintenance (make) utility using a C-like grammar";
     homepage = "https://fbb-git.gitlab.io/icmake/";
     license = licenses.gpl3;
diff --git a/pkgs/development/tools/build-managers/jam/default.nix b/pkgs/development/tools/build-managers/jam/default.nix
index 7d7502fad4b..6f5ecde8f88 100644
--- a/pkgs/development/tools/build-managers/jam/default.nix
+++ b/pkgs/development/tools/build-managers/jam/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, yacc }:
+{ lib, stdenv, fetchurl, yacc }:
 
 stdenv.mkDerivation rec {
   name = "jam-2.6.1";
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.perforce.com/resources/documentation/jam";
     license = licenses.free;
     description = "Just Another Make";
diff --git a/pkgs/development/tools/build-managers/kati/default.nix b/pkgs/development/tools/build-managers/kati/default.nix
index a7fced4482b..ed5923e74d0 100644
--- a/pkgs/development/tools/build-managers/kati/default.nix
+++ b/pkgs/development/tools/build-managers/kati/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation {
   pname = "kati-unstable";
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
     install -D ckati $out/bin/ckati
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An experimental GNU make clone";
     homepage = "https://github.com/google/kati";
     platforms = platforms.all;
diff --git a/pkgs/development/tools/build-managers/leiningen/default.nix b/pkgs/development/tools/build-managers/leiningen/default.nix
index f1445970f6a..488697033d9 100644
--- a/pkgs/development/tools/build-managers/leiningen/default.nix
+++ b/pkgs/development/tools/build-managers/leiningen/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper
+{ lib, stdenv, fetchurl, makeWrapper
 , coreutils, jdk, rlwrap, gnupg }:
 
 stdenv.mkDerivation rec {
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
     substituteInPlace $out/bin/lein \
       --replace 'LEIN_JAR=/usr/share/java/leiningen-$LEIN_VERSION-standalone.jar' "LEIN_JAR=$out/share/$JARNAME"
     wrapProgram $out/bin/lein \
-      --prefix PATH ":" "${stdenv.lib.makeBinPath [ rlwrap coreutils ]}" \
+      --prefix PATH ":" "${lib.makeBinPath [ rlwrap coreutils ]}" \
       --set LEIN_GPG ${gnupg}/bin/gpg \
       --set JAVA_CMD ${jdk}/bin/java
   '';
@@ -46,8 +46,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://leiningen.org/";
     description = "Project automation for Clojure";
-    license = stdenv.lib.licenses.epl10;
-    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
-    maintainers = with stdenv.lib.maintainers; [ thiagokokada ];
+    license = lib.licenses.epl10;
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
+    maintainers = with lib.maintainers; [ thiagokokada ];
   };
 }
diff --git a/pkgs/development/tools/build-managers/mill/default.nix b/pkgs/development/tools/build-managers/mill/default.nix
index a3865e2c52c..5942e20ec92 100644
--- a/pkgs/development/tools/build-managers/mill/default.nix
+++ b/pkgs/development/tools/build-managers/mill/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, jre, makeWrapper }:
+{ lib, stdenv, fetchurl, jre, makeWrapper }:
 
 stdenv.mkDerivation rec {
   pname = "mill";
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
     runHook postInstall
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.lihaoyi.com/mill";
     license = licenses.mit;
     description = "A build tool for Scala, Java and more";
@@ -37,6 +37,6 @@ stdenv.mkDerivation rec {
       modules (written in Java or Scala) or through an external subprocesses.
     '';
     maintainers = with maintainers; [ scalavision ];
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/development/tools/build-managers/mk/default.nix b/pkgs/development/tools/build-managers/mk/default.nix
index 09028789daa..1eaa51a5de0 100644
--- a/pkgs/development/tools/build-managers/mk/default.nix
+++ b/pkgs/development/tools/build-managers/mk/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation {
   name = "mk-2006-01-31";
@@ -9,6 +9,6 @@ stdenv.mkDerivation {
   builder = ./builder.sh;
 
   meta = {
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/build-managers/msbuild/default.nix b/pkgs/development/tools/build-managers/msbuild/default.nix
index 1b805df95a0..ce08986b3e1 100644
--- a/pkgs/development/tools/build-managers/msbuild/default.nix
+++ b/pkgs/development/tools/build-managers/msbuild/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper, glibcLocales, mono, dotnetPackages, unzip, dotnet-sdk }:
+{ lib, stdenv, fetchurl, makeWrapper, glibcLocales, mono, dotnetPackages, unzip, dotnet-sdk }:
 
 let
 
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
 
   # https://github.com/NixOS/nixpkgs/issues/38991
   # bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
-  LOCALE_ARCHIVE = stdenv.lib.optionalString stdenv.isLinux
+  LOCALE_ARCHIVE = lib.optionalString stdenv.isLinux
       "${glibcLocales}/lib/locale/locale-archive";
 
   buildPhase = ''
@@ -122,7 +122,7 @@ EOF
     ${mono}/bin/mono Helloworld.exe | grep "Hello, world!"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Mono version of Microsoft Build Engine, the build platform for .NET, and Visual Studio";
     homepage = "https://github.com/mono/msbuild";
     license = licenses.mit;
diff --git a/pkgs/development/tools/build-managers/ninja/default.nix b/pkgs/development/tools/build-managers/ninja/default.nix
index 8fc81a1a979..ddc61ca86d9 100644
--- a/pkgs/development/tools/build-managers/ninja/default.nix
+++ b/pkgs/development/tools/build-managers/ninja/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchFromGitHub, fetchpatch, python3, buildDocs ? true, asciidoc, docbook_xml_dtd_45, docbook_xsl, libxslt, re2c }:
+{ lib, stdenv, fetchFromGitHub, fetchpatch, python3, buildDocs ? true, asciidoc, docbook_xml_dtd_45, docbook_xsl, libxslt, re2c }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "ninja";
diff --git a/pkgs/development/tools/build-managers/pants/default.nix b/pkgs/development/tools/build-managers/pants/default.nix
index 9757d8cda8d..03eac2db5e3 100644
--- a/pkgs/development/tools/build-managers/pants/default.nix
+++ b/pkgs/development/tools/build-managers/pants/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, pythonPackages }:
+{ lib, stdenv, pythonPackages }:
 
-with stdenv.lib;
+with lib;
 with pythonPackages;
 
 buildPythonApplication rec {
diff --git a/pkgs/development/tools/build-managers/qbs/default.nix b/pkgs/development/tools/build-managers/qbs/default.nix
index 359c942d189..3bf7623ed04 100644
--- a/pkgs/development/tools/build-managers/qbs/default.nix
+++ b/pkgs/development/tools/build-managers/qbs/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, qmake, qtbase, qtscript }:
+{ lib, stdenv, fetchFromGitHub, qmake, qtbase, qtscript }:
 
 stdenv.mkDerivation rec {
   pname = "qbs";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A tool that helps simplify the build process for developing projects across multiple platforms";
     homepage = "https://wiki.qt.io/Qbs";
     license = licenses.lgpl3;
diff --git a/pkgs/development/tools/build-managers/rebar/default.nix b/pkgs/development/tools/build-managers/rebar/default.nix
index 1c5996c6b1c..d3926beb321 100644
--- a/pkgs/development/tools/build-managers/rebar/default.nix
+++ b/pkgs/development/tools/build-managers/rebar/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, erlang }:
+{ lib, stdenv, fetchurl, erlang }:
 
 
 let
@@ -35,7 +35,7 @@ stdenv.mkDerivation {
       variety of locations (git, hg, etc).
       '';
 
-    platforms = stdenv.lib.platforms.unix;
-    license = stdenv.lib.licenses.asl20;
+    platforms = lib.platforms.unix;
+    license = lib.licenses.asl20;
   };
 }
diff --git a/pkgs/development/tools/build-managers/rebar3/default.nix b/pkgs/development/tools/build-managers/rebar3/default.nix
index bf28868d0e7..aa3af12c934 100644
--- a/pkgs/development/tools/build-managers/rebar3/default.nix
+++ b/pkgs/development/tools/build-managers/rebar3/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub,
+{ lib, stdenv, fetchFromGitHub,
   fetchHex, erlang,
   tree }:
 
@@ -135,8 +135,8 @@ stdenv.mkDerivation rec {
       variety of locations (hex.pm, git, hg, and so on).
       '';
 
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ gleber tazjin ];
-    license = stdenv.lib.licenses.asl20;
+    platforms = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ gleber tazjin ];
+    license = lib.licenses.asl20;
   };
 }
diff --git a/pkgs/development/tools/build-managers/redo-apenwarr/default.nix b/pkgs/development/tools/build-managers/redo-apenwarr/default.nix
index c62fb0f2515..638f10f0187 100644
--- a/pkgs/development/tools/build-managers/redo-apenwarr/default.nix
+++ b/pkgs/development/tools/build-managers/redo-apenwarr/default.nix
@@ -30,7 +30,7 @@
       --replace "/bin/ls" "ls"
 
     substituteInPlace t/110-compile/hello.o.do \
-      --replace "/usr/include" "${stdenv.lib.getDev stdenv.cc.libc}/include"
+      --replace "/usr/include" "${lib.getDev stdenv.cc.libc}/include"
 
     substituteInPlace t/200-shell/nonshelltest.do \
       --replace "/usr/bin/env perl" "${perl}/bin/perl"
diff --git a/pkgs/development/tools/build-managers/redo-c/default.nix b/pkgs/development/tools/build-managers/redo-c/default.nix
index 1480f32a50f..40708b7877a 100644
--- a/pkgs/development/tools/build-managers/redo-c/default.nix
+++ b/pkgs/development/tools/build-managers/redo-c/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 stdenv.mkDerivation rec {
   pname = "redo-c";
   version = "0.2";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
     cp '${./Makefile}' Makefile
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An implementation of the redo build system in portable C with zero dependencies";
     homepage = "https://github.com/leahneukirchen/redo-c";
     license = licenses.cc0;
diff --git a/pkgs/development/tools/build-managers/redo-sh/default.nix b/pkgs/development/tools/build-managers/redo-sh/default.nix
index 71e5a54320a..d22f4bc487f 100644
--- a/pkgs/development/tools/build-managers/redo-sh/default.nix
+++ b/pkgs/development/tools/build-managers/redo-sh/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper, coreutils }:
+{ lib, stdenv, fetchurl, makeWrapper, coreutils }:
 
 stdenv.mkDerivation {
   version = "4.0.4";
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
     done
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Redo implementation in Bourne Shell";
     homepage = "http://news.dieweltistgarnichtso.net/bin/redo-sh.html";
     license  = licenses.agpl3;
diff --git a/pkgs/development/tools/build-managers/redo/default.nix b/pkgs/development/tools/build-managers/redo/default.nix
index a735a05dc5b..48fbffc3940 100644
--- a/pkgs/development/tools/build-managers/redo/default.nix
+++ b/pkgs/development/tools/build-managers/redo/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, perl }:
+{lib, stdenv, fetchurl, perl }:
 
 stdenv.mkDerivation rec {
   name = "redo-1.4";
@@ -21,8 +21,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://jdebp.eu./Softwares/redo/";
     description = "A system for building target files from source files";
-    license = stdenv.lib.licenses.bsd2;
-    maintainers = [ stdenv.lib.maintainers.vrthra ];
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.bsd2;
+    maintainers = [ lib.maintainers.vrthra ];
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/build-managers/remake/default.nix b/pkgs/development/tools/build-managers/remake/default.nix
index 7d44bc74df8..f61a7e77458 100644
--- a/pkgs/development/tools/build-managers/remake/default.nix
+++ b/pkgs/development/tools/build-managers/remake/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, readline }:
+{ lib, stdenv, fetchurl, readline }:
 
 stdenv.mkDerivation rec {
   pname = "remake";
@@ -19,9 +19,9 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = "http://bashdb.sourceforge.net/remake/";
-    license = stdenv.lib.licenses.gpl3;
+    license = lib.licenses.gpl3;
     description = "GNU Make with comprehensible tracing and a debugger";
-    platforms = with stdenv.lib.platforms; linux ++ darwin;
-    maintainers = with stdenv.lib.maintainers; [ bjornfor ];
+    platforms = with lib.platforms; linux ++ darwin;
+    maintainers = with lib.maintainers; [ bjornfor ];
   };
 }
diff --git a/pkgs/development/tools/build-managers/rocm-cmake/default.nix b/pkgs/development/tools/build-managers/rocm-cmake/default.nix
index 1dd931981da..5b9a456ce75 100644
--- a/pkgs/development/tools/build-managers/rocm-cmake/default.nix
+++ b/pkgs/development/tools/build-managers/rocm-cmake/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "rocm-cmake";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "CMake modules for common build tasks for the ROCm stack";
     homepage = "https://github.com/RadeonOpenCompute/rocm-cmake";
     license = licenses.mit;
diff --git a/pkgs/development/tools/build-managers/samurai/default.nix b/pkgs/development/tools/build-managers/samurai/default.nix
index f8b649e0409..4360a3f3a30 100644
--- a/pkgs/development/tools/build-managers/samurai/default.nix
+++ b/pkgs/development/tools/build-managers/samurai/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "samurai";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   makeFlags = [ "DESTDIR=" "PREFIX=${placeholder "out"}" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "ninja-compatible build tool written in C";
     homepage = "https://github.com/michaelforney/samurai";
     license = with licenses; [ mit asl20 ]; # see LICENSE
diff --git a/pkgs/development/tools/build-managers/sbt-extras/default.nix b/pkgs/development/tools/build-managers/sbt-extras/default.nix
index 24c2bdd2af3..f80d278c86d 100644
--- a/pkgs/development/tools/build-managers/sbt-extras/default.nix
+++ b/pkgs/development/tools/build-managers/sbt-extras/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, which, curl, makeWrapper, jdk, writeScript
+{ lib, stdenv, fetchFromGitHub, which, curl, makeWrapper, jdk, writeScript
 , common-updater-scripts, cacert, git, nixfmt, nix, jq, coreutils, gnused
 , nixosTests }:
 
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
     install bin/sbt $out/bin
 
     wrapProgram $out/bin/sbt --prefix PATH : ${
-      stdenv.lib.makeBinPath [ which curl ]
+      lib.makeBinPath [ which curl ]
     }
   '';
 
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
       #!${stdenv.shell}
       set -xo errexit
       PATH=${
-        stdenv.lib.makeBinPath [
+        lib.makeBinPath [
           common-updater-scripts
           curl
           cacert
@@ -70,8 +70,8 @@ stdenv.mkDerivation rec {
     description =
       "A more featureful runner for sbt, the simple/scala/standard build tool";
     homepage = "https://github.com/paulp/sbt-extras";
-    license = stdenv.lib.licenses.bsd3;
-    maintainers = with stdenv.lib.maintainers; [ nequissimus puffnfresh ];
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ nequissimus puffnfresh ];
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/build-managers/sbt/default.nix b/pkgs/development/tools/build-managers/sbt/default.nix
index a9314cef0cc..6bd0b83cec1 100644
--- a/pkgs/development/tools/build-managers/sbt/default.nix
+++ b/pkgs/development/tools/build-managers/sbt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, jre, autoPatchelfHook, zlib, writeScript
+{ lib, stdenv, fetchurl, jre, autoPatchelfHook, zlib, writeScript
 , common-updater-scripts, git, nixfmt, nix, coreutils, gnused, nixosTests }:
 
 stdenv.mkDerivation rec {
@@ -15,9 +15,9 @@ stdenv.mkDerivation rec {
     echo -java-home ${jre.home} >>conf/sbtopts
   '';
 
-  nativeBuildInputs = stdenv.lib.optionals stdenv.isLinux [ autoPatchelfHook ];
+  nativeBuildInputs = lib.optionals stdenv.isLinux [ autoPatchelfHook ];
 
-  buildInputs = stdenv.lib.optionals stdenv.isLinux [ zlib ];
+  buildInputs = lib.optionals stdenv.isLinux [ zlib ];
 
   installPhase = ''
     mkdir -p $out/share/sbt $out/bin
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
     } $out/bin/sbtn
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.scala-sbt.org/";
     license = licenses.bsd3;
     description = "A build tool for Scala, Java and more";
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
       #!${stdenv.shell}
       set -o errexit
       PATH=${
-        stdenv.lib.makeBinPath [
+        lib.makeBinPath [
           common-updater-scripts
           git
           nixfmt
diff --git a/pkgs/development/tools/build-managers/scons/common.nix b/pkgs/development/tools/build-managers/scons/common.nix
index f38b909d5a0..2c8ea2f5523 100644
--- a/pkgs/development/tools/build-managers/scons/common.nix
+++ b/pkgs/development/tools/build-managers/scons/common.nix
@@ -29,7 +29,7 @@ python3Packages.buildPythonApplication rec {
     mv "$out/"*.1 "$out/share/man/man1/"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An improved, cross-platform substitute for Make";
     longDescription = ''
       SCons is an Open Source software construction tool. Think of
diff --git a/pkgs/development/tools/build-managers/shards/default.nix b/pkgs/development/tools/build-managers/shards/default.nix
index cf422fc2e07..868ea265f6f 100644
--- a/pkgs/development/tools/build-managers/shards/default.nix
+++ b/pkgs/development/tools/build-managers/shards/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , crystal_0_34
 , crystal_0_35
@@ -26,7 +26,7 @@ let
       # tries to execute git which fails spectacularly
       doCheck = false;
 
-      meta = with stdenv.lib; {
+      meta = with lib; {
         description = "Dependency manager for the Crystal language";
         license = licenses.asl20;
         maintainers = with maintainers; [ peterhoeg ];
diff --git a/pkgs/development/tools/build-managers/tup/default.nix b/pkgs/development/tools/build-managers/tup/default.nix
index ebdad7be8fa..f0e6efdca3e 100644
--- a/pkgs/development/tools/build-managers/tup/default.nix
+++ b/pkgs/development/tools/build-managers/tup/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fuse3, pkg-config, pcre }:
+{ lib, stdenv, fetchFromGitHub, fuse3, pkg-config, pcre }:
 
 stdenv.mkDerivation rec {
   pname = "tup";
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
 
   setupHook = ./setup-hook.sh;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A fast, file-based build system";
     longDescription = ''
       Tup is a file-based build system for Linux, OSX, and Windows. It inputs a list
diff --git a/pkgs/development/tools/build-managers/waf/default.nix b/pkgs/development/tools/build-managers/waf/default.nix
index 49aae7c3014..ae62ce539ba 100644
--- a/pkgs/development/tools/build-managers/waf/default.nix
+++ b/pkgs/development/tools/build-managers/waf/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchFromGitLab, python, ensureNewerSourcesForZipFilesHook
+{ lib, stdenv, fetchFromGitLab, python, ensureNewerSourcesForZipFilesHook
 # optional list of extra waf tools, e.g. `[ "doxygen" "pytest" ]`
 , withTools ? null
 }:
 let
-  wafToolsArg = with stdenv.lib.strings;
+  wafToolsArg = with lib.strings;
     optionalString (!isNull withTools) " --tools=\"${concatStringsSep "," withTools}\"";
 in
 stdenv.mkDerivation rec {
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     install -D waf $out/bin/waf
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Meta build system";
     homepage    = "https://waf.io";
     license     = licenses.bsd3;
diff --git a/pkgs/development/tools/buildkit/default.nix b/pkgs/development/tools/buildkit/default.nix
index 30a013dac11..55894058794 100644
--- a/pkgs/development/tools/buildkit/default.nix
+++ b/pkgs/development/tools/buildkit/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchFromGitHub, buildGoPackage }:
+{ lib, stdenv, fetchFromGitHub, buildGoPackage }:
 
 buildGoPackage rec {
   pname = "buildkit";
   version = "0.8.1";
 
   goPackagePath = "github.com/moby/buildkit";
-  subPackages = [ "cmd/buildctl" ] ++ stdenv.lib.optionals stdenv.isLinux [ "cmd/buildkitd" ];
+  subPackages = [ "cmd/buildctl" ] ++ lib.optionals stdenv.isLinux [ "cmd/buildkitd" ];
 
   src = fetchFromGitHub {
     owner = "moby";
@@ -16,7 +16,7 @@ buildGoPackage rec {
 
   buildFlagsArray = [ "-ldflags=-s -w -X ${goPackagePath}/version.Version=${version} -X ${goPackagePath}/version.Revision=${src.rev}" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Concurrent, cache-efficient, and Dockerfile-agnostic builder toolkit";
     homepage = "https://github.com/moby/buildkit";
     license = licenses.asl20;
diff --git a/pkgs/development/tools/cargo-web/default.nix b/pkgs/development/tools/cargo-web/default.nix
index cf2e565fe45..c85ef52564a 100644
--- a/pkgs/development/tools/cargo-web/default.nix
+++ b/pkgs/development/tools/cargo-web/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, openssl, perl, pkg-config, rustPlatform
+{ lib, stdenv, fetchFromGitHub, openssl, perl, pkg-config, rustPlatform
 , CoreServices, Security
 }:
 
@@ -16,9 +16,9 @@ rustPlatform.buildRustPackage rec {
   cargoSha256 = "0i9xp7vd1rp6xgkbbrspm3qq4hxwfwa00di3k73z1x64d3d8r5fm";
 
   nativeBuildInputs = [ openssl perl pkg-config ];
-  buildInputs = stdenv.lib.optionals stdenv.isDarwin [ CoreServices Security ];
+  buildInputs = lib.optionals stdenv.isDarwin [ CoreServices Security ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A Cargo subcommand for the client-side Web";
     homepage = "https://github.com/koute/cargo-web";
     license = with licenses; [ asl20 /* or */ mit ];
diff --git a/pkgs/development/tools/cask/default.nix b/pkgs/development/tools/cask/default.nix
index ab7a7c0fdff..886d435b811 100644
--- a/pkgs/development/tools/cask/default.nix
+++ b/pkgs/development/tools/cask/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, python, emacs }:
+{ lib, stdenv, fetchurl, python, emacs }:
 
 stdenv.mkDerivation rec {
   pname = "cask";
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
     ln -s $out/share/emacs/site-lisp/cask/bin/cask $out/bin/cask
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Project management for Emacs";
     longDescription = ''
       Cask is a project management tool for Emacs that helps automate the
diff --git a/pkgs/development/tools/castxml/default.nix b/pkgs/development/tools/castxml/default.nix
index 90be513bd50..ff47bd0e9f3 100644
--- a/pkgs/development/tools/castxml/default.nix
+++ b/pkgs/development/tools/castxml/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     sha256 = "0ypj67xrgj228myp7l1gsjw1ja97q68nmj98dsd33srmiayqraj4";
   };
 
-  nativeBuildInputs = [ cmake ] ++ stdenv.lib.optionals withMan [ python3Packages.sphinx ];
+  nativeBuildInputs = [ cmake ] ++ lib.optionals withMan [ python3Packages.sphinx ];
 
   clangVersion = lib.getVersion llvmPackages.clang;
 
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
     ctest -E 'cmd.cc-(gnu|msvc)-((c-src-c)|(src-cxx))-cmd'
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/CastXML/CastXML";
     license = licenses.asl20;
     description = "Abstract syntax tree XML output tool";
diff --git a/pkgs/development/tools/cdecl/default.nix b/pkgs/development/tools/cdecl/default.nix
index 7981681a641..7e0a07ad834 100644
--- a/pkgs/development/tools/cdecl/default.nix
+++ b/pkgs/development/tools/cdecl/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, yacc, flex, readline, ncurses, gnused}:
+{lib, stdenv, fetchurl, yacc, flex, readline, ncurses, gnused}:
 
 stdenv.mkDerivation {
   name = "cdecl-2.5";
@@ -18,8 +18,8 @@ stdenv.mkDerivation {
 
   meta = {
     description = "Translator English -- C/C++ declarations";
-    license = stdenv.lib.licenses.publicDomain;
-    maintainers = with stdenv.lib.maintainers; [joelteon];
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.publicDomain;
+    maintainers = with lib.maintainers; [joelteon];
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/chit/default.nix b/pkgs/development/tools/chit/default.nix
index f7c806c89a3..ac8f15a4158 100644
--- a/pkgs/development/tools/chit/default.nix
+++ b/pkgs/development/tools/chit/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, rustPlatform, pkg-config, openssl
+{ lib, stdenv, fetchFromGitHub, rustPlatform, pkg-config, openssl
 , darwin
 }:
 
@@ -17,13 +17,13 @@ buildRustPackage rec {
 
   cargoSha256 = "1w25k3bqmmcrhpkw510vbwph0rfmrzi2wby0z2rz1q4k1f9k486m";
 
-  nativeBuildInputs = stdenv.lib.optionals stdenv.isLinux [ pkg-config ];
+  nativeBuildInputs = lib.optionals stdenv.isLinux [ pkg-config ];
   buildInputs = []
-  ++ stdenv.lib.optionals stdenv.isLinux [ openssl ]
-  ++ stdenv.lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ CoreFoundation CoreServices Security ])
+  ++ lib.optionals stdenv.isLinux [ openssl ]
+  ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ CoreFoundation CoreServices Security ])
   ;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Crate help in terminal: A tool for looking up details about rust crates without going to crates.io";
     longDescription = ''
       Chit helps answer these questions:
diff --git a/pkgs/development/tools/clang-tools/default.nix b/pkgs/development/tools/clang-tools/default.nix
index 2e8f48901ab..498310d4324 100644
--- a/pkgs/development/tools/clang-tools/default.nix
+++ b/pkgs/development/tools/clang-tools/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, llvmPackages }:
+{ lib, stdenv, llvmPackages }:
 
 let
   clang = llvmPackages.clang-unwrapped;
 
 in stdenv.mkDerivation {
   pname = "clang-tools";
-  version = stdenv.lib.getVersion clang;
+  version = lib.getVersion clang;
 
   dontUnpack = true;
 
@@ -13,7 +13,7 @@ in stdenv.mkDerivation {
     runHook preInstall
 
     mkdir -p $out/bin
-    export libc_includes="${stdenv.lib.getDev stdenv.cc.libc}/include"
+    export libc_includes="${lib.getDev stdenv.cc.libc}/include"
     export libcpp_includes="${llvmPackages.libcxx}/include/c++/v1"
 
     export clang=${clang}
@@ -34,6 +34,6 @@ in stdenv.mkDerivation {
 
   meta = clang.meta // {
     description = "Standalone command line tools for C++ development";
-    maintainers = with stdenv.lib.maintainers; [ aherrmann ];
+    maintainers = with lib.maintainers; [ aherrmann ];
   };
 }
diff --git a/pkgs/development/tools/clog-cli/default.nix b/pkgs/development/tools/clog-cli/default.nix
index 6d843ead24e..182a7f98c4c 100644
--- a/pkgs/development/tools/clog-cli/default.nix
+++ b/pkgs/development/tools/clog-cli/default.nix
@@ -1,4 +1,4 @@
-{ fetchFromGitHub, rustPlatform, stdenv }:
+{ fetchFromGitHub, rustPlatform, lib, stdenv }:
 
 with rustPlatform;
 
@@ -18,8 +18,8 @@ buildRustPackage rec {
   meta = {
     description = "Generate changelogs from local git metadata";
     homepage = "https://github.com/clog-tool/clog-cli";
-    license = stdenv.lib.licenses.mit;
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = [stdenv.lib.maintainers.nthorne];
+    license = lib.licenses.mit;
+    platforms = lib.platforms.unix;
+    maintainers = [lib.maintainers.nthorne];
   };
 }
diff --git a/pkgs/development/tools/cloudfoundry-cli/default.nix b/pkgs/development/tools/cloudfoundry-cli/default.nix
index 642c42108aa..4d7e226463f 100644
--- a/pkgs/development/tools/cloudfoundry-cli/default.nix
+++ b/pkgs/development/tools/cloudfoundry-cli/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub, fetchurl, installShellFiles }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub, fetchurl, installShellFiles }:
 
 buildGoPackage rec {
   pname = "cloudfoundry-cli";
@@ -45,7 +45,7 @@ buildGoPackage rec {
     installShellCompletion --bash $bashCompletionScript
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "The official command line client for Cloud Foundry";
     homepage = "https://github.com/cloudfoundry/cli";
     maintainers = with maintainers; [ ris ];
diff --git a/pkgs/development/tools/clpm/default.nix b/pkgs/development/tools/clpm/default.nix
index e051dfef19b..03174d6c4fc 100644
--- a/pkgs/development/tools/clpm/default.nix
+++ b/pkgs/development/tools/clpm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchgit
 , wrapLisp
 , sbcl
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
   # fixupPhase results in fatal error in SBCL, `Can't find sbcl.core`
   dontFixup = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Common Lisp Package Manager";
     homepage = "https://www.clpm.dev/";
     license = licenses.bsd2;
diff --git a/pkgs/development/tools/cmake-language-server/default.nix b/pkgs/development/tools/cmake-language-server/default.nix
index c5398f695d2..2c85890e70b 100644
--- a/pkgs/development/tools/cmake-language-server/default.nix
+++ b/pkgs/development/tools/cmake-language-server/default.nix
@@ -17,7 +17,7 @@ buildPythonApplication rec {
   };
 
   # can be removed after v0.1.2
-  patches = stdenv.lib.optional stdenv.isDarwin (fetchpatch {
+  patches = lib.optional stdenv.isDarwin (fetchpatch {
     url = "https://github.com/regen100/cmake-language-server/commit/0ec120f39127f25898ab110b43819e3e9becb8a3.patch";
     sha256 = "1xbmarvsvzd61fnlap4qscnijli2rw2iqr7cyyvar2jd87z6sfp0";
   });
diff --git a/pkgs/development/tools/compile-daemon/default.nix b/pkgs/development/tools/compile-daemon/default.nix
index 24aca0dada7..ef08b2d5813 100644
--- a/pkgs/development/tools/compile-daemon/default.nix
+++ b/pkgs/development/tools/compile-daemon/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "compile-daemon-unstable";
@@ -16,7 +16,7 @@ buildGoPackage rec {
 
   goDeps = ./deps.nix;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Very simple compile daemon for Go";
     license = licenses.bsd2;
     maintainers = with maintainers; [ ];
diff --git a/pkgs/development/tools/continuous-integration/buildkite-agent/default.nix b/pkgs/development/tools/continuous-integration/buildkite-agent/default.nix
index 82ac1556574..bd8608a9119 100644
--- a/pkgs/development/tools/continuous-integration/buildkite-agent/default.nix
+++ b/pkgs/development/tools/continuous-integration/buildkite-agent/default.nix
@@ -1,4 +1,4 @@
-{ fetchFromGitHub, stdenv, buildGoModule,
+{ fetchFromGitHub, lib, stdenv, buildGoModule,
   makeWrapper, coreutils, git, openssh, bash, gnused, gnugrep }:
 buildGoModule rec {
   name = "buildkite-agent-${version}";
@@ -27,10 +27,10 @@ buildGoModule rec {
 
     # These are runtime dependencies
     wrapProgram $out/bin/buildkite-agent \
-      --prefix PATH : '${stdenv.lib.makeBinPath [ openssh git coreutils gnused gnugrep ]}'
+      --prefix PATH : '${lib.makeBinPath [ openssh git coreutils gnused gnugrep ]}'
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Build runner for buildkite.com";
     longDescription = ''
       The buildkite-agent is a small, reliable, and cross-platform build runner
diff --git a/pkgs/development/tools/continuous-integration/buildkite-agent/generic.nix b/pkgs/development/tools/continuous-integration/buildkite-agent/generic.nix
index 39178201456..232efe32a1a 100644
--- a/pkgs/development/tools/continuous-integration/buildkite-agent/generic.nix
+++ b/pkgs/development/tools/continuous-integration/buildkite-agent/generic.nix
@@ -13,7 +13,7 @@ buildGoPackage {
   nativeBuildInputs = [ makeWrapper ];
 
   postInstall = ''
-    ${stdenv.lib.optionalString hasBootstrapScript ''
+    ${lib.optionalString hasBootstrapScript ''
     # Install bootstrap.sh
     mkdir -p $out/libexec/buildkite-agent
     cp $NIX_BUILD_TOP/go/src/${goPackagePath}/templates/bootstrap.sh $out/libexec/buildkite-agent
@@ -25,11 +25,11 @@ buildGoPackage {
 
     # These are runtime dependencies
     wrapProgram $out/bin/buildkite-agent \
-      ${stdenv.lib.optionalString hasBootstrapScript "--set BUILDKITE_BOOTSTRAP_SCRIPT_PATH $out/libexec/buildkite-agent/bootstrap.sh"} \
-      --prefix PATH : '${stdenv.lib.makeBinPath [ openssh git coreutils gnused gnugrep ]}'
+      ${lib.optionalString hasBootstrapScript "--set BUILDKITE_BOOTSTRAP_SCRIPT_PATH $out/libexec/buildkite-agent/bootstrap.sh"} \
+      --prefix PATH : '${lib.makeBinPath [ openssh git coreutils gnused gnugrep ]}'
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Build runner for buildkite.com";
     longDescription = ''
       The buildkite-agent is a small, reliable, and cross-platform build runner
diff --git a/pkgs/development/tools/continuous-integration/drone-cli/default.nix b/pkgs/development/tools/continuous-integration/drone-cli/default.nix
index 2a8e10008c2..b1ee5349a5c 100644
--- a/pkgs/development/tools/continuous-integration/drone-cli/default.nix
+++ b/pkgs/development/tools/continuous-integration/drone-cli/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, buildGoModule }:
+{ lib, stdenv, fetchFromGitHub, buildGoModule }:
 
 let version = "1.2.4";
 in buildGoModule rec {
@@ -21,7 +21,7 @@ in buildGoModule rec {
     sha256 = "14sm5k2ifvr4g9369zqgb92vrr4rc0bxf5m52l3g8bd2s8fq8nx8";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     maintainers = with maintainers; [ bricewge ];
     license = licenses.asl20;
     description = "Command line client for the Drone continuous integration server";
diff --git a/pkgs/development/tools/continuous-integration/drone/default.nix b/pkgs/development/tools/continuous-integration/drone/default.nix
index 7a7f0d023d8..ffdf588895a 100644
--- a/pkgs/development/tools/continuous-integration/drone/default.nix
+++ b/pkgs/development/tools/continuous-integration/drone/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, buildGoModule }:
+{ lib, stdenv, fetchFromGitHub, buildGoModule }:
 
 buildGoModule rec {
   name = "drone.io-${version}";
@@ -15,7 +15,7 @@ buildGoModule rec {
     sha256 = "sha256-12Jac+mXWdUX8gWvmpdO9ROv7Bi0YzvyqnNDVNJOr34=";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     maintainers = with maintainers; [ elohmeier vdemeester ];
     license = licenses.asl20;
     description = "Continuous Integration platform built on container technology";
diff --git a/pkgs/development/tools/continuous-integration/gocd-agent/default.nix b/pkgs/development/tools/continuous-integration/gocd-agent/default.nix
index 7cefd896f48..6e58b74654d 100644
--- a/pkgs/development/tools/continuous-integration/gocd-agent/default.nix
+++ b/pkgs/development/tools/continuous-integration/gocd-agent/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip }:
+{ lib, stdenv, fetchurl, unzip }:
 
 stdenv.mkDerivation rec {
   name = "gocd-agent-${version}-${rev}";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     url = "https://download.go.cd/binaries/${version}-${rev}/generic/go-agent-${version}-${rev}.zip";
     sha256 = "1nirdv82i8x4s1dyb0rmxldh8avappd4g3mbbl6xp7r7s0drcprp";
   };
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A continuous delivery server specializing in advanced workflow modeling and visualization";
     homepage = "http://www.go.cd";
     license = licenses.asl20;
diff --git a/pkgs/development/tools/continuous-integration/gocd-server/default.nix b/pkgs/development/tools/continuous-integration/gocd-server/default.nix
index d23bc9d8d8e..90eb61dbff8 100644
--- a/pkgs/development/tools/continuous-integration/gocd-server/default.nix
+++ b/pkgs/development/tools/continuous-integration/gocd-server/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip }:
+{ lib, stdenv, fetchurl, unzip }:
 
 stdenv.mkDerivation rec {
   name = "gocd-server-${version}-${rev}";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "0c30qzd6awlw0zx91rk6na0mmgykqkgrw9ychx18ivjwma0hr0sc";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A continuous delivery server specializing in advanced workflow modeling and visualization";
     homepage = "http://www.go.cd";
     license = licenses.asl20;
diff --git a/pkgs/development/tools/continuous-integration/jenkins/default.nix b/pkgs/development/tools/continuous-integration/jenkins/default.nix
index f54ef1acbb0..adfc6a2580a 100644
--- a/pkgs/development/tools/continuous-integration/jenkins/default.nix
+++ b/pkgs/development/tools/continuous-integration/jenkins/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, common-updater-scripts, coreutils, git, gnused, nix, nixfmt
+{ lib, stdenv, fetchurl, common-updater-scripts, coreutils, git, gnused, nix, nixfmt
 , writeScript, nixosTests, jq, cacert, curl }:
 
 stdenv.mkDerivation rec {
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
       #!${stdenv.shell}
       set -o errexit
       PATH=${
-        stdenv.lib.makeBinPath [
+        lib.makeBinPath [
           cacert
           common-updater-scripts
           coreutils
@@ -54,7 +54,7 @@ stdenv.mkDerivation rec {
     '';
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An extendable open source continuous integration server";
     homepage = "https://jenkins-ci.org";
     license = licenses.mit;
diff --git a/pkgs/development/tools/continuous-integration/laminar/default.nix b/pkgs/development/tools/continuous-integration/laminar/default.nix
index 5a326e94a54..f64cbd5e85f 100644
--- a/pkgs/development/tools/continuous-integration/laminar/default.nix
+++ b/pkgs/development/tools/continuous-integration/laminar/default.nix
@@ -70,7 +70,7 @@ in stdenv.mkDerivation rec {
     rm -r $out/lib # it contains only systemd unit file
   '');
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Lightweight and modular continuous integration service";
     homepage = "https://laminar.ohwg.net";
     license = licenses.gpl3;
diff --git a/pkgs/development/tools/corgi/default.nix b/pkgs/development/tools/corgi/default.nix
index a1549de1843..a7698ef4fb8 100644
--- a/pkgs/development/tools/corgi/default.nix
+++ b/pkgs/development/tools/corgi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   name = "corgi-${rev}";
@@ -16,7 +16,7 @@ buildGoPackage rec {
 
   goDeps = ./deps.nix;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "CLI workflow manager";
     longDescription = ''
       Corgi is a command-line tool that helps with your repetitive command usages by organizing them into reusable snippet.
diff --git a/pkgs/development/tools/coursier/default.nix b/pkgs/development/tools/coursier/default.nix
index 54836216c54..e016f0ef7c9 100644
--- a/pkgs/development/tools/coursier/default.nix
+++ b/pkgs/development/tools/coursier/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper, jre, writeScript, common-updater-scripts
+{ lib, stdenv, fetchurl, makeWrapper, jre, writeScript, common-updater-scripts
 , coreutils, git, gnused, nix, nixfmt }:
 
 let
@@ -37,7 +37,7 @@ in stdenv.mkDerivation rec {
     #!${stdenv.shell}
     set -o errexit
     PATH=${
-      stdenv.lib.makeBinPath [
+      lib.makeBinPath [
         common-updater-scripts
         coreutils
         git
@@ -62,7 +62,7 @@ in stdenv.mkDerivation rec {
     fi
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://get-coursier.io/";
     description =
       "A Scala library to fetch dependencies from Maven / Ivy repositories";
diff --git a/pkgs/development/tools/cppclean/default.nix b/pkgs/development/tools/cppclean/default.nix
index 283d9845dfa..4e00eb903eb 100644
--- a/pkgs/development/tools/cppclean/default.nix
+++ b/pkgs/development/tools/cppclean/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, python3Packages }:
+{ lib, stdenv, fetchFromGitHub, python3Packages }:
 
 with python3Packages;
 
@@ -21,7 +21,7 @@ buildPythonApplication rec {
     ./test.bash
     '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Finds problems in C++ source that slow development of large code bases";
     homepage    = "https://github.com/myint/cppclean";
     license     = licenses.asl20;
diff --git a/pkgs/development/tools/cue/default.nix b/pkgs/development/tools/cue/default.nix
index cdd0f2ae105..243be958b07 100644
--- a/pkgs/development/tools/cue/default.nix
+++ b/pkgs/development/tools/cue/default.nix
@@ -1,4 +1,4 @@
-{ buildGoModule, fetchgit, stdenv }:
+{ buildGoModule, fetchgit, lib, stdenv }:
 
 buildGoModule rec {
   pname = "cue";
@@ -23,7 +23,7 @@ buildGoModule rec {
   meta = {
     description = "A data constraint language which aims to simplify tasks involving defining and using data";
     homepage = "https://cuelang.org/";
-    maintainers = with stdenv.lib.maintainers; [ solson ];
-    license = stdenv.lib.licenses.asl20;
+    maintainers = with lib.maintainers; [ solson ];
+    license = lib.licenses.asl20;
   };
 }
diff --git a/pkgs/development/tools/database/dbmate/default.nix b/pkgs/development/tools/database/dbmate/default.nix
index fe7721f5ed4..9c01c1e9d2d 100644
--- a/pkgs/development/tools/database/dbmate/default.nix
+++ b/pkgs/development/tools/database/dbmate/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoModule, fetchFromGitHub }:
+{ lib, stdenv, buildGoModule, fetchFromGitHub }:
 
 buildGoModule rec {
   pname = "dbmate";
@@ -15,7 +15,7 @@ buildGoModule rec {
 
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Database migration tool";
     homepage = "https://github.com/amacneil/dbmate";
     license = licenses.mit;
diff --git a/pkgs/development/tools/database/ephemeralpg/default.nix b/pkgs/development/tools/database/ephemeralpg/default.nix
index b2599cce430..ae10c402945 100644
--- a/pkgs/development/tools/database/ephemeralpg/default.nix
+++ b/pkgs/development/tools/database/ephemeralpg/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, postgresql, getopt, makeWrapper }:
+{ lib, stdenv, fetchurl, postgresql, getopt, makeWrapper }:
 stdenv.mkDerivation rec {
   pname = "ephemeralpg";
   version = "3.1";
@@ -10,9 +10,9 @@ stdenv.mkDerivation rec {
   installPhase = ''
     mkdir -p $out
     PREFIX=$out make install
-    wrapProgram $out/bin/pg_tmp --prefix PATH : ${stdenv.lib.makeBinPath [ postgresql getopt ]}
+    wrapProgram $out/bin/pg_tmp --prefix PATH : ${lib.makeBinPath [ postgresql getopt ]}
   '';
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Run tests on an isolated, temporary PostgreSQL database";
     license = licenses.isc;
     homepage = "http://ephemeralpg.org/";
diff --git a/pkgs/development/tools/database/pg_checksums/default.nix b/pkgs/development/tools/database/pg_checksums/default.nix
index f440e550a89..65e7c06b140 100644
--- a/pkgs/development/tools/database/pg_checksums/default.nix
+++ b/pkgs/development/tools/database/pg_checksums/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, libxslt, docbook_xsl, postgresql }:
+{ lib, stdenv, fetchFromGitHub, libxslt, docbook_xsl, postgresql }:
 
 stdenv.mkDerivation rec {
   pname = "pg_checksums";
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
     install -Dm644 -t $out/share/man/man1 doc/man1/pg_checksums.1
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Activate/deactivate/verify checksums in offline PostgreSQL clusters";
     homepage = "https://github.com/credativ/pg_checksums";
     maintainers = [ maintainers.marsam ];
diff --git a/pkgs/development/tools/database/pgcli/default.nix b/pkgs/development/tools/database/pgcli/default.nix
index b4c26d6fb5c..cc7524e3a43 100644
--- a/pkgs/development/tools/database/pgcli/default.nix
+++ b/pkgs/development/tools/database/pgcli/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , buildPythonApplication
 , fetchPypi
 , isPy3k
@@ -46,9 +46,9 @@ buildPythonApplication rec {
 
   checkInputs = [ pytestCheckHook mock ];
 
-  disabledTests = stdenv.lib.optionals stdenv.isDarwin [ "test_application_name_db_uri" ];
+  disabledTests = lib.optionals stdenv.isDarwin [ "test_application_name_db_uri" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Command-line interface for PostgreSQL";
     longDescription = ''
       Rich command-line interface for PostgreSQL with auto-completion and
diff --git a/pkgs/development/tools/database/pyrseas/default.nix b/pkgs/development/tools/database/pyrseas/default.nix
index c86a0f6df8b..119aa2eb8f8 100644
--- a/pkgs/development/tools/database/pyrseas/default.nix
+++ b/pkgs/development/tools/database/pyrseas/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, pythonPackages, fetchFromGitHub }:
+{ lib, stdenv, pythonPackages, fetchFromGitHub }:
 
 let
   pgdbconn = pythonPackages.buildPythonPackage {
@@ -39,7 +39,7 @@ pythonPackages.buildPythonApplication {
   meta = {
     description = "A declarative language to describe PostgreSQL databases";
     homepage = "https://perseas.github.io/";
-    license = stdenv.lib.licenses.bsd3;
-    maintainers = with stdenv.lib.maintainers; [ pmeunier ];
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ pmeunier ];
   };
 }
diff --git a/pkgs/development/tools/database/shmig/default.nix b/pkgs/development/tools/database/shmig/default.nix
index ca07a056940..447dbc23fdf 100644
--- a/pkgs/development/tools/database/shmig/default.nix
+++ b/pkgs/development/tools/database/shmig/default.nix
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
     mkdir -p $out/bin
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Minimalistic database migration tool with MySQL, PostgreSQL and SQLite support";
     homepage = "https://github.com/mbucc/shmig";
     license = licenses.bsd3;
diff --git a/pkgs/development/tools/database/sqlcheck/default.nix b/pkgs/development/tools/database/sqlcheck/default.nix
index 33b2abce277..2afd004f4d7 100644
--- a/pkgs/development/tools/database/sqlcheck/default.nix
+++ b/pkgs/development/tools/database/sqlcheck/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "sqlcheck";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit (src.meta) homepage;
     description = "Automatically identify anti-patterns in SQL queries";
     license = licenses.asl20;
diff --git a/pkgs/development/tools/database/sqldeveloper/default.nix b/pkgs/development/tools/database/sqldeveloper/default.nix
index 49cc7b42b3d..6017d704fc1 100644
--- a/pkgs/development/tools/database/sqldeveloper/default.nix
+++ b/pkgs/development/tools/database/sqldeveloper/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, makeDesktopItem, makeWrapper, requireFile, unzip, jdk }:
+{ lib, stdenv, makeDesktopItem, makeWrapper, requireFile, unzip, jdk }:
 
 let
   version = "20.2.0.175.1842";
@@ -65,7 +65,7 @@ in
       --run "cd $out/libexec/sqldeveloper/bin"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Oracle's Oracle DB GUI client";
     longDescription = ''
       Oracle SQL Developer is a free integrated development environment that
diff --git a/pkgs/development/tools/database/squirrel-sql/default.nix b/pkgs/development/tools/database/squirrel-sql/default.nix
index c773db7509f..5aca6d55bc8 100644
--- a/pkgs/development/tools/database/squirrel-sql/default.nix
+++ b/pkgs/development/tools/database/squirrel-sql/default.nix
@@ -1,6 +1,6 @@
 # To enable specific database drivers, override this derivation and pass the
 # driver packages in the drivers argument (e.g. mysql_jdbc, postgresql_jdbc).
-{ stdenv, fetchurl, makeDesktopItem, makeWrapper, unzip
+{ lib, stdenv, fetchurl, makeDesktopItem, makeWrapper, unzip
 , jre
 , drivers ? []
 }:
@@ -69,7 +69,7 @@ in stdenv.mkDerivation rec {
     icon = "squirrel-sql";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Universal SQL Client";
     homepage = "http://squirrel-sql.sourceforge.net/";
     license = licenses.lgpl21;
diff --git a/pkgs/development/tools/database/timescaledb-parallel-copy/default.nix b/pkgs/development/tools/database/timescaledb-parallel-copy/default.nix
index a0e05bf4ae5..2b8a6f7cca0 100644
--- a/pkgs/development/tools/database/timescaledb-parallel-copy/default.nix
+++ b/pkgs/development/tools/database/timescaledb-parallel-copy/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoModule, fetchFromGitHub }:
+{ lib, stdenv, buildGoModule, fetchFromGitHub }:
 
 buildGoModule rec {
   pname = "timescaledb-parallel-copy";
@@ -13,7 +13,7 @@ buildGoModule rec {
 
   vendorSha256 = "03siay3hv1sgmmp7w4f9b0xb8c6bnbx0v4wy5grjl5k04zhnj76b";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Bulk, parallel insert of CSV records into PostgreSQL";
     homepage = "https://github.com/timescale/timescaledb-parallel-copy";
     license = licenses.asl20;
diff --git a/pkgs/development/tools/database/timescaledb-tune/default.nix b/pkgs/development/tools/database/timescaledb-tune/default.nix
index 787c7c3131b..cec374ccb3a 100644
--- a/pkgs/development/tools/database/timescaledb-tune/default.nix
+++ b/pkgs/development/tools/database/timescaledb-tune/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoModule, fetchFromGitHub }:
+{ lib, stdenv, buildGoModule, fetchFromGitHub }:
 
 buildGoModule rec {
   pname = "timescaledb-tune";
@@ -13,7 +13,7 @@ buildGoModule rec {
 
   vendorSha256 = "0hbpprbxs19fcar7xcy42kn9yfzhal2zsv5pml9ghiv2s61yns4z";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A tool for tuning your TimescaleDB for better performance";
     homepage = "https://github.com/timescale/timescaledb-tune";
     license = licenses.asl20;
diff --git a/pkgs/development/tools/database/webdis/default.nix b/pkgs/development/tools/database/webdis/default.nix
index ec22252cbe0..5de8296299f 100644
--- a/pkgs/development/tools/database/webdis/default.nix
+++ b/pkgs/development/tools/database/webdis/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, hiredis, http-parser, jansson, libevent, fetchpatch }:
+{ lib, stdenv, fetchFromGitHub, hiredis, http-parser, jansson, libevent, fetchpatch }:
 
 stdenv.mkDerivation rec {
   pname = "webdis";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     "CONFDIR=${placeholder "out"}/share/webdis"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A Redis HTTP interface with JSON output";
     homepage = "https://webd.is/";
     license = licenses.bsd2;
diff --git a/pkgs/development/tools/dcadec/default.nix b/pkgs/development/tools/dcadec/default.nix
index 55f888056cf..9f5f4f0a3b5 100644
--- a/pkgs/development/tools/dcadec/default.nix
+++ b/pkgs/development/tools/dcadec/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "dcadec";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   doCheck = false; # fails with "ERROR: Run 'git submodule update --init test/samples' first."
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "DTS Coherent Acoustics decoder with support for HD extensions";
     maintainers = with maintainers; [ edwtjo ];
     homepage = "https://github.com/foo86/dcadec";
diff --git a/pkgs/development/tools/deis/default.nix b/pkgs/development/tools/deis/default.nix
index 4a07a05a636..c8e20d42063 100644
--- a/pkgs/development/tools/deis/default.nix
+++ b/pkgs/development/tools/deis/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "deis";
@@ -25,7 +25,7 @@ buildGoPackage rec {
     export GOPATH=$GOPATH:$NIX_BUILD_TOP/go/src/${goPackagePath}/Godeps/_workspace
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://deis.io";
     description = "A command line utility used to interact with the Deis open source PaaS";
     license = licenses.asl20;
diff --git a/pkgs/development/tools/deisctl/default.nix b/pkgs/development/tools/deisctl/default.nix
index a245a06afe1..0f5df40d92c 100644
--- a/pkgs/development/tools/deisctl/default.nix
+++ b/pkgs/development/tools/deisctl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "deis";
@@ -19,7 +19,7 @@ buildGoPackage rec {
     export GOPATH=$GOPATH:$NIX_BUILD_TOP/go/src/${goPackagePath}/Godeps/_workspace
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://deis.io";
     description = "A command-line utility used to provision and operate a Deis cluster";
     license = licenses.asl20;
diff --git a/pkgs/development/tools/delve/default.nix b/pkgs/development/tools/delve/default.nix
index e81a1273af8..62fb32c8516 100644
--- a/pkgs/development/tools/delve/default.nix
+++ b/pkgs/development/tools/delve/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "delve";
@@ -14,7 +14,7 @@ buildGoPackage rec {
     sha256 = "10zvla2jqxqibxdk3zbnsxg63i0zcwcn9npvw3bbicwd2z4vvskk";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "debugger for the Go programming language";
     homepage = "https://github.com/derekparker/delve";
     maintainers = with maintainers; [ vdemeester ];
diff --git a/pkgs/development/tools/dep/default.nix b/pkgs/development/tools/dep/default.nix
index 8b7c54832e2..ff7f370b0d4 100644
--- a/pkgs/development/tools/dep/default.nix
+++ b/pkgs/development/tools/dep/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "dep";
@@ -17,7 +17,7 @@ buildGoPackage rec {
 
   buildFlagsArray = ("-ldflags=-s -w -X main.commitHash=${rev} -X main.version=${version}");
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/golang/dep";
     description = "Go dependency management tool";
     license = licenses.bsd3;
diff --git a/pkgs/development/tools/devd/default.nix b/pkgs/development/tools/devd/default.nix
index 2d5a38458d3..32f29f7e128 100644
--- a/pkgs/development/tools/devd/default.nix
+++ b/pkgs/development/tools/devd/default.nix
@@ -1,4 +1,4 @@
-{ buildGoPackage, fetchFromGitHub, stdenv }:
+{ buildGoPackage, fetchFromGitHub, lib, stdenv }:
 
 buildGoPackage rec {
   pname = "devd";
@@ -11,7 +11,7 @@ buildGoPackage rec {
   };
   goPackagePath = "github.com/cortesi/devd";
   subPackages = [ "cmd/devd" ];
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A local webserver for developers";
     homepage = "https://github.com/cortesi/devd";
     license = licenses.mit;
diff --git a/pkgs/development/tools/devpi-client/default.nix b/pkgs/development/tools/devpi-client/default.nix
index f881f5c610d..766f3f2b729 100644
--- a/pkgs/development/tools/devpi-client/default.nix
+++ b/pkgs/development/tools/devpi-client/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , buildPythonApplication
 , fetchPypi
 # buildInputs
@@ -49,7 +49,7 @@ buildPythonApplication rec {
 
   LC_ALL = "en_US.UTF-8";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://doc.devpi.net";
     description = "Client for devpi, a pypi index server and packaging meta tool";
     license = licenses.mit;
diff --git a/pkgs/development/tools/devpi-server/default.nix b/pkgs/development/tools/devpi-server/default.nix
index 7ddff92402c..3d8cb16bb47 100644
--- a/pkgs/development/tools/devpi-server/default.nix
+++ b/pkgs/development/tools/devpi-server/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, python3Packages, nginx }:
+{ lib, stdenv, fetchFromGitHub, python3Packages, nginx }:
 
 python3Packages.buildPythonApplication rec {
   pname = "devpi-server";
@@ -33,7 +33,7 @@ python3Packages.buildPythonApplication rec {
     pytestCheckHook
     pytest-flake8
     webtest
-  ] ++ stdenv.lib.optionals isPy27 [ mock ];
+  ] ++ lib.optionals isPy27 [ mock ];
 
   # root_passwd_hash tries to write to store
   # TestMirrorIndexThings tries to write to /var through ngnix
@@ -55,7 +55,7 @@ python3Packages.buildPythonApplication rec {
     "TestMirrorIndexThings"
   ];
 
-  meta = with stdenv.lib;{
+  meta = with lib;{
     homepage = "http://doc.devpi.net";
     description = "Github-style pypi index server and packaging meta tool";
     license = licenses.mit;
diff --git a/pkgs/development/tools/devtodo/default.nix b/pkgs/development/tools/devtodo/default.nix
index f4a974da347..34fdd2c794e 100644
--- a/pkgs/development/tools/devtodo/default.nix
+++ b/pkgs/development/tools/devtodo/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, readline, ncurses }:
+{ lib, stdenv, fetchurl, readline, ncurses }:
 
 stdenv.mkDerivation rec {
   pname = "devtodo";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://swapoff.org/devtodo1.html";
     description = "A hierarchical command-line task manager";
     license = licenses.gpl2;
diff --git a/pkgs/development/tools/diesel-cli/default.nix b/pkgs/development/tools/diesel-cli/default.nix
index a1ae7cfc86e..bd8e71090c5 100644
--- a/pkgs/development/tools/diesel-cli/default.nix
+++ b/pkgs/development/tools/diesel-cli/default.nix
@@ -8,7 +8,7 @@ assert lib.assertMsg (sqliteSupport == true || postgresqlSupport == true || mysq
   "support for at least one database must be enabled";
 
 let
-  inherit (stdenv.lib) optional optionals optionalString;
+  inherit (lib) optional optionals optionalString;
   features = ''
     ${optionalString sqliteSupport "sqlite"} \
     ${optionalString postgresqlSupport "postgres"} \
diff --git a/pkgs/development/tools/dive/default.nix b/pkgs/development/tools/dive/default.nix
index 3cb050df036..07ca12cc9cc 100644
--- a/pkgs/development/tools/dive/default.nix
+++ b/pkgs/development/tools/dive/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoModule, fetchFromGitHub, pkg-config, btrfs-progs, gpgme, lvm2 }:
+{ lib, stdenv, buildGoModule, fetchFromGitHub, pkg-config, btrfs-progs, gpgme, lvm2 }:
 
 buildGoModule rec {
   pname = "dive";
@@ -17,11 +17,11 @@ buildGoModule rec {
 
   nativeBuildInputs = [ pkg-config ];
 
-  buildInputs = stdenv.lib.optionals stdenv.isLinux [ btrfs-progs gpgme lvm2 ];
+  buildInputs = lib.optionals stdenv.isLinux [ btrfs-progs gpgme lvm2 ];
 
   buildFlagsArray = [ "-ldflags=-s -w -X main.version=${version}" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A tool for exploring each layer in a docker image";
     homepage = "https://github.com/wagoodman/dive";
     license = licenses.mit;
diff --git a/pkgs/development/tools/documentation/antora/default.nix b/pkgs/development/tools/documentation/antora/default.nix
index 781fee2bb26..d553df59446 100644
--- a/pkgs/development/tools/documentation/antora/default.nix
+++ b/pkgs/development/tools/documentation/antora/default.nix
@@ -1,15 +1,15 @@
-{ stdenv, nodePackages }:
+{ lib, stdenv, nodePackages }:
 
 let
   linkNodeDeps = ({ pkg, deps, name ? "" }:
     let
-      targetModule = if name != "" then name else stdenv.lib.getName pkg;
+      targetModule = if name != "" then name else lib.getName pkg;
     in nodePackages.${pkg}.override (oldAttrs: {
       postInstall = ''
         mkdir -p $out/lib/node_modules/${targetModule}/node_modules
-        ${stdenv.lib.concatStringsSep "\n" (map (dep: ''
-          ln -s ${nodePackages.${dep}}/lib/node_modules/${stdenv.lib.getName dep} \
-            $out/lib/node_modules/${targetModule}/node_modules/${stdenv.lib.getName dep}
+        ${lib.concatStringsSep "\n" (map (dep: ''
+          ln -s ${nodePackages.${dep}}/lib/node_modules/${lib.getName dep} \
+            $out/lib/node_modules/${targetModule}/node_modules/${lib.getName dep}
         '') deps
         )}
       '';
diff --git a/pkgs/development/tools/documentation/doxygen/default.nix b/pkgs/development/tools/documentation/doxygen/default.nix
index 613dec86d7c..a4a70dabd69 100644
--- a/pkgs/development/tools/documentation/doxygen/default.nix
+++ b/pkgs/development/tools/documentation/doxygen/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, cmake, fetchFromGitHub, python3, flex, bison, qt5, CoreServices, libiconv }:
+{ lib, stdenv, cmake, fetchFromGitHub, python3, flex, bison, qt5, CoreServices, libiconv }:
 
 stdenv.mkDerivation rec {
   pname = "doxygen";
@@ -7,7 +7,7 @@ stdenv.mkDerivation rec {
   src = fetchFromGitHub {
     owner = "doxygen";
     repo = "doxygen";
-    rev = "Release_${stdenv.lib.replaceStrings [ "." ] [ "_" ] version}";
+    rev = "Release_${lib.replaceStrings [ "." ] [ "_" ] version}";
     sha256 = "17chvi3i80rj4750smpizf562xjzd2xcv5rfyh997pyvc1zbq5rh";
   };
 
@@ -19,21 +19,21 @@ stdenv.mkDerivation rec {
   ];
 
   buildInputs =
-       stdenv.lib.optionals (qt5 != null) (with qt5; [ qtbase wrapQtAppsHook ])
-    ++ stdenv.lib.optional stdenv.isSunOS libiconv
-    ++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices libiconv ];
+       lib.optionals (qt5 != null) (with qt5; [ qtbase wrapQtAppsHook ])
+    ++ lib.optional stdenv.isSunOS libiconv
+    ++ lib.optionals stdenv.isDarwin [ CoreServices libiconv ];
 
   cmakeFlags =
     [ "-DICONV_INCLUDE_DIR=${libiconv}/include" ] ++
-    stdenv.lib.optional (qt5 != null) "-Dbuild_wizard=YES";
+    lib.optional (qt5 != null) "-Dbuild_wizard=YES";
 
   NIX_CFLAGS_COMPILE =
-    stdenv.lib.optionalString stdenv.isDarwin "-mmacosx-version-min=10.9";
+    lib.optionalString stdenv.isDarwin "-mmacosx-version-min=10.9";
 
   enableParallelBuilding = false;
 
   meta = {
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
     homepage = "http://doxygen.nl/";
     description = "Source code documentation generator tool";
 
@@ -45,6 +45,6 @@ stdenv.mkDerivation rec {
       manual (in LaTeX) from a set of documented source files.
     '';
 
-    platforms = if qt5 != null then stdenv.lib.platforms.linux else stdenv.lib.platforms.unix;
+    platforms = if qt5 != null then lib.platforms.linux else lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/documentation/gnome-doc-utils/default.nix b/pkgs/development/tools/documentation/gnome-doc-utils/default.nix
index a5bbfbc9088..2e04d3dd365 100644
--- a/pkgs/development/tools/documentation/gnome-doc-utils/default.nix
+++ b/pkgs/development/tools/documentation/gnome-doc-utils/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, libxml2Python, libxslt, intltool, gnome3
+{ lib, stdenv, fetchurl, pkg-config, libxml2Python, libxslt, intltool, gnome3
 , python2Packages }:
 
 python2Packages.buildPythonApplication rec {
@@ -8,7 +8,7 @@ python2Packages.buildPythonApplication rec {
   format = "other";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "19n4x25ndzngaciiyd8dd6s2mf9gv6nv3wv27ggns2smm7zkj1nb";
   };
 
@@ -34,7 +34,7 @@ python2Packages.buildPythonApplication rec {
     rm $out/nix-support/propagated-build-inputs
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Collection of documentation utilities for the GNOME project";
     homepage = "https://gitlab.gnome.org/GNOME/gnome-doc-utils";
     license = with licenses; [ gpl2Plus lgpl2Plus ];
diff --git a/pkgs/development/tools/documentation/gtk-doc/default.nix b/pkgs/development/tools/documentation/gtk-doc/default.nix
index 10b48d51191..b1ea6a0634b 100644
--- a/pkgs/development/tools/documentation/gtk-doc/default.nix
+++ b/pkgs/development/tools/documentation/gtk-doc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitLab
 , meson
 , ninja
@@ -44,7 +44,7 @@ python3.pkgs.buildPythonApplication rec {
     docbook_xml_dtd_43
     docbook_xsl
     libxslt
-  ] ++ stdenv.lib.optionals withDblatex [
+  ] ++ lib.optionals withDblatex [
     dblatex
   ];
 
@@ -77,7 +77,7 @@ python3.pkgs.buildPythonApplication rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Tools to extract documentation embedded in GTK and GNOME source code";
     homepage = "https://www.gtk.org/gtk-doc";
     license = licenses.gpl2;
diff --git a/pkgs/development/tools/documentation/mdsh/default.nix b/pkgs/development/tools/documentation/mdsh/default.nix
index 5ab74a4b95f..d2e555a4550 100644
--- a/pkgs/development/tools/documentation/mdsh/default.nix
+++ b/pkgs/development/tools/documentation/mdsh/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, rustPlatform }:
+{ lib, stdenv, fetchFromGitHub, rustPlatform }:
 
 rustPlatform.buildRustPackage rec {
   pname = "mdsh";
@@ -13,7 +13,7 @@ rustPlatform.buildRustPackage rec {
 
   cargoSha256 = "118ykkqlf0x6gcgywx4pg3qawfhfr5q5f51gvrw9s302c1lmgk3g";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Markdown shell pre-processor";
     homepage = "https://github.com/zimbatm/mdsh";
     license = with licenses; [ mit ];
diff --git a/pkgs/development/tools/documentation/mkdocs/default.nix b/pkgs/development/tools/documentation/mkdocs/default.nix
index f3b66394207..bee22856eb1 100644
--- a/pkgs/development/tools/documentation/mkdocs/default.nix
+++ b/pkgs/development/tools/documentation/mkdocs/default.nix
@@ -35,7 +35,7 @@ buildPythonApplication rec {
     backports_tempfile
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Project documentation with Markdown / static website generator";
     longDescription = ''
       MkDocs is a fast, simple and downright gorgeous static site generator that's
diff --git a/pkgs/development/tools/dot-http/default.nix b/pkgs/development/tools/dot-http/default.nix
index 9ff3001882c..b156847870d 100644
--- a/pkgs/development/tools/dot-http/default.nix
+++ b/pkgs/development/tools/dot-http/default.nix
@@ -15,7 +15,7 @@ rustPlatform.buildRustPackage rec {
 
   nativeBuildInputs = [ pkg-config ];
 
-  buildInputs = [ openssl ] ++ stdenv.lib.optionals stdenv.isDarwin [
+  buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [
     libiconv Security
   ];
 
diff --git a/pkgs/development/tools/drip/default.nix b/pkgs/development/tools/drip/default.nix
index b4edf8ec081..2724e41e8e6 100644
--- a/pkgs/development/tools/drip/default.nix
+++ b/pkgs/development/tools/drip/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, jdk8, which, makeWrapper }:
+{ lib, stdenv, fetchFromGitHub, jdk8, which, makeWrapper }:
 
 stdenv.mkDerivation rec {
   pname = "drip";
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     runHook postInstall
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A launcher for the Java Virtual Machine intended to be a drop-in replacement for the java command, only faster";
     license = licenses.epl10;
     homepage = "https://github.com/ninjudd/drip";
diff --git a/pkgs/development/tools/drm_info/default.nix b/pkgs/development/tools/drm_info/default.nix
index c64ab8534da..86d55ab0780 100644
--- a/pkgs/development/tools/drm_info/default.nix
+++ b/pkgs/development/tools/drm_info/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub
+{ lib, stdenv, fetchFromGitHub
 , libdrm, json_c, pciutils
 , meson, ninja, pkg-config
 }:
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ meson ninja pkg-config ];
   buildInputs = [ libdrm json_c pciutils ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Small utility to dump info about DRM devices";
     homepage = "https://github.com/ascent12/drm_info";
     license = licenses.mit;
diff --git a/pkgs/development/tools/dtools/default.nix b/pkgs/development/tools/dtools/default.nix
index fabd2b2f775..1c1604db654 100644
--- a/pkgs/development/tools/dtools/default.nix
+++ b/pkgs/development/tools/dtools/default.nix
@@ -51,11 +51,11 @@ stdenv.mkDerivation rec {
       $makeCmd INSTALL_DIR=$out install
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Ancillary tools for the D programming language compiler";
     homepage = "https://github.com/dlang/tools";
     license = lib.licenses.boost;
     maintainers = with maintainers; [ ThomasMader ];
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/easyjson/default.nix b/pkgs/development/tools/easyjson/default.nix
index ef99bbd01c3..a458f0dbfce 100644
--- a/pkgs/development/tools/easyjson/default.nix
+++ b/pkgs/development/tools/easyjson/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage {
   pname = "easyjson";
@@ -12,7 +12,7 @@ buildGoPackage {
     sha256 = "0q85h383mhbkcjm2vqm72bi8n2252fv3c56q3lclzb8n2crnjcdk";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/mailru/easyjson";
     description = "Fast JSON serializer for golang";
     license = licenses.mit;
diff --git a/pkgs/development/tools/eclipse-mat/default.nix b/pkgs/development/tools/eclipse-mat/default.nix
index 025b7413ceb..633e13d25f7 100644
--- a/pkgs/development/tools/eclipse-mat/default.nix
+++ b/pkgs/development/tools/eclipse-mat/default.nix
@@ -62,13 +62,13 @@ stdenv.mkDerivation rec {
     libCairo=$out/eclipse/libcairo-swt.so
     patchelf --set-interpreter $interpreter $out/mat/MemoryAnalyzer
     [ -f $libCairo ] && patchelf --set-rpath ${
-      stdenv.lib.makeLibraryPath [ freetype fontconfig libX11 libXrender zlib ]
+      lib.makeLibraryPath [ freetype fontconfig libX11 libXrender zlib ]
     } $libCairo
 
     # Create wrapper script.  Pass -configuration to store settings in ~/.eclipse-mat/<version>
     makeWrapper $out/mat/MemoryAnalyzer $out/bin/eclipse-mat \
       --prefix PATH : ${jdk}/bin \
-      --prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath ([ glib gtk3 libXtst webkitgtk ])} \
+      --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath ([ glib gtk3 libXtst webkitgtk ])} \
       --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" \
       --add-flags "-configuration \$HOME/.eclipse-mat/''${version}/configuration"
 
diff --git a/pkgs/development/tools/electron/default.nix b/pkgs/development/tools/electron/default.nix
index 966f307e0da..2e60885111d 100644
--- a/pkgs/development/tools/electron/default.nix
+++ b/pkgs/development/tools/electron/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , libXScrnSaver
 , makeWrapper
 , fetchurl
@@ -94,12 +94,12 @@ rec {
     headers = "1k97pfzxqrgw4y76js2chq13avgp9czin9q9mlh1zdf13bih96hj";
   };
 
-  electron_11 = mkElectron "11.2.0" {
-    x86_64-linux = "a2ed11a5ec9ad10302053e5e2bdf2abf0f9bac521e4f80a377308bffe8c24c00";
-    x86_64-darwin = "c8485cc6cb754bccfb1a01db93f5f0f1ee1ed3017551f3d25a1191c7c7aea654";
-    i686-linux = "508b9276f97c66418e530cbfa584701d4b0a42825fb2519b21ff161db1dc121f";
-    armv7l-linux = "edf1ad6606eab5efc1c9a33ce16489dae1df21ce6e69166f4c8da27ca6fde2ca";
-    aarch64-linux = "ed8e318ce0ba92058efdc667790bcbfce1c7f888f9d94038c1c76ed8678158fc";
-    headers = "0mwv9vm2km6sawyds87fzy7m4pcmmwl9c2qihs1nc7cwmdz388lv";
+  electron_11 = mkElectron "11.2.1" {
+    x86_64-linux = "607d9d58c9a3b5c36461acc6bbe473bc604eee42a55c2c617ac46d095cf98abb";
+    x86_64-darwin = "39d95668a3ea04bdc652ff9e2889c7a88f638534420e8e256679cbf4b7658a65";
+    i686-linux = "59f226133d01fb6acf86fe98907964f79dcf2902054e5c4c9c4ff84a3ea88f4a";
+    armv7l-linux = "85051d8eacf04aeec3dd74e46e7888d01bd4e6caf7ec2001122a1f3e11db44ee";
+    aarch64-linux = "8aa9be5d6c139386390bad64f78b95756206a40fe4982fc9f199b67a7d06bec5";
+    headers = "12sy8zzb0z654b85c5l1j8762nhwmkim1pbz1y3qzgbzvpbd5arq";
   };
 }
diff --git a/pkgs/development/tools/electron/generic.nix b/pkgs/development/tools/electron/generic.nix
index 6d0dbc8cace..e29064e673a 100644
--- a/pkgs/development/tools/electron/generic.nix
+++ b/pkgs/development/tools/electron/generic.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , libXScrnSaver
 , makeWrapper
 , fetchurl
@@ -20,7 +20,7 @@ version: hashes:
 let
   name = "electron-${version}";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Cross platform desktop application shell";
     homepage = "https://github.com/electron/electron";
     license = licenses.mit;
@@ -56,7 +56,7 @@ let
     passthru.headers = headersFetcher version hashes.headers;
   };
 
-  electronLibPath = with stdenv.lib; makeLibraryPath (
+  electronLibPath = with lib; makeLibraryPath (
     [ libuuid at-spi2-atk at-spi2-core libappindicator-gtk3 ]
     ++ optionals (! versionOlder version "9.0.0") [ libdrm mesa ]
     ++ optionals (! versionOlder version "11.0.0") [ libxkbcommon ]
@@ -89,7 +89,7 @@ let
         $out/lib/electron/electron
 
       wrapProgram $out/lib/electron/electron \
-        --prefix LD_PRELOAD : ${stdenv.lib.makeLibraryPath [ libXScrnSaver ]}/libXss.so.1 \
+        --prefix LD_PRELOAD : ${lib.makeLibraryPath [ libXScrnSaver ]}/libXss.so.1 \
         "''${gappsWrapperArgs[@]}"
     '';
   };
diff --git a/pkgs/development/tools/erlang/cuter/default.nix b/pkgs/development/tools/erlang/cuter/default.nix
index f9d63cc86d8..44ed61ac1d5 100644
--- a/pkgs/development/tools/erlang/cuter/default.nix
+++ b/pkgs/development/tools/erlang/cuter/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, autoreconfHook, which, writeText, makeWrapper, fetchFromGitHub, erlang
+{ lib, stdenv, autoreconfHook, which, writeText, makeWrapper, fetchFromGitHub, erlang
 , z3, python }:
 
 stdenv.mkDerivation rec {
@@ -38,9 +38,9 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "A concolic testing tool for the Erlang functional programming language";
-    license = stdenv.lib.licenses.gpl3;
+    license = lib.licenses.gpl3;
     homepage = "https://github.com/aggelgian/cuter";
-    maintainers = with stdenv.lib.maintainers; [ ericbmerritt ];
-    platforms = with stdenv.lib.platforms; unix;
+    maintainers = with lib.maintainers; [ ericbmerritt ];
+    platforms = with lib.platforms; unix;
   };
 }
diff --git a/pkgs/development/tools/fac/default.nix b/pkgs/development/tools/fac/default.nix
index 6a23f84f236..ef3298c5478 100644
--- a/pkgs/development/tools/fac/default.nix
+++ b/pkgs/development/tools/fac/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub, makeWrapper, git }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub, makeWrapper, git }:
 
 buildGoPackage rec {
   pname = "fac";
@@ -25,7 +25,7 @@ buildGoPackage rec {
     install -D go/src/${goPackagePath}/assets/doc/fac.1 $out/share/man/man1/fac.1
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "CUI for fixing git conflicts";
     inherit (src.meta) homepage;
     license = licenses.mit;
diff --git a/pkgs/development/tools/fedpkg/default.nix b/pkgs/development/tools/fedpkg/default.nix
index 4fbecc2d58d..285e71707fd 100644
--- a/pkgs/development/tools/fedpkg/default.nix
+++ b/pkgs/development/tools/fedpkg/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildPythonApplication, buildPythonPackage, isPy3k, fetchurl, rpkg, offtrac, urlgrabber, pyopenssl, python_fedora }:
+{ lib, stdenv, buildPythonApplication, buildPythonPackage, isPy3k, fetchurl, rpkg, offtrac, urlgrabber, pyopenssl, python_fedora }:
 
 let
   fedora_cert = buildPythonPackage rec {
@@ -26,7 +26,7 @@ in buildPythonApplication rec {
   patches = [ ./fix-paths.patch ];
   propagatedBuildInputs = [ rpkg offtrac urlgrabber fedora_cert ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Subclass of the rpkg project for dealing with rpm packaging";
     homepage = "https://pagure.io/fedpkg";
     license = licenses.gpl2;
diff --git a/pkgs/development/tools/flamegraph/default.nix b/pkgs/development/tools/flamegraph/default.nix
index 23ada99eac0..3a64d741de5 100644
--- a/pkgs/development/tools/flamegraph/default.nix
+++ b/pkgs/development/tools/flamegraph/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, perl }:
+{ lib, stdenv, fetchFromGitHub, perl }:
 
 stdenv.mkDerivation rec {
   pname = "FlameGraph";
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     runHook postInstall
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     license = with licenses; [ asl20 cddl gpl2Plus ];
     homepage = "http://www.brendangregg.com/flamegraphs.html";
     description = "Visualization for profiled code";
diff --git a/pkgs/development/tools/flatpak-builder/default.nix b/pkgs/development/tools/flatpak-builder/default.nix
index beafe0654db..dd9282c6896 100644
--- a/pkgs/development/tools/flatpak-builder/default.nix
+++ b/pkgs/development/tools/flatpak-builder/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , substituteAll
 , nixosTests
@@ -145,7 +145,7 @@ in stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Tool to build flatpaks from source";
     homepage = "https://github.com/flatpak/flatpak-builder";
     license = licenses.lgpl21Plus;
diff --git a/pkgs/development/tools/flootty/default.nix b/pkgs/development/tools/flootty/default.nix
index 2b8f174f763..4867b9c2cb9 100644
--- a/pkgs/development/tools/flootty/default.nix
+++ b/pkgs/development/tools/flootty/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, python3Packages }:
+{ lib, stdenv, python3Packages }:
 
 python3Packages.buildPythonApplication rec {
   pname = "Flootty";
@@ -9,7 +9,7 @@ python3Packages.buildPythonApplication rec {
     sha256 = "0gfl143ly81pmmrcml91yr0ypvwrs5q4s1sfdc0l2qkqpy233ih7";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A collaborative terminal. In practice, it's similar to a shared screen or tmux session";
     homepage = "https://floobits.com/help/flootty";
     license = licenses.asl20;
diff --git a/pkgs/development/tools/flyway/default.nix b/pkgs/development/tools/flyway/default.nix
index af58da17510..bcad4ffb4e9 100644
--- a/pkgs/development/tools/flyway/default.nix
+++ b/pkgs/development/tools/flyway/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, jre_headless, makeWrapper }:
+{ lib, stdenv, fetchurl, jre_headless, makeWrapper }:
   let
     version = "7.3.1";
   in
@@ -22,7 +22,7 @@
           --add-flags "org.flywaydb.commandline.Main" \
           --add-flags "-jarDirs='$out/share/flyway/jars'"
       '';
-      meta = with stdenv.lib; {
+      meta = with lib; {
         description = "Evolve your Database Schema easily and reliably across all your instances";
         longDescription = ''
           The Flyway command-line tool is a standalone Flyway distribution.
diff --git a/pkgs/development/tools/fmbt/default.nix b/pkgs/development/tools/fmbt/default.nix
index 46a13238961..e6bb2032741 100644
--- a/pkgs/development/tools/fmbt/default.nix
+++ b/pkgs/development/tools/fmbt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, python, autoreconfHook, pkg-config, makeWrapper
+{ lib, stdenv, fetchFromGitHub, python, autoreconfHook, pkg-config, makeWrapper
 , flex
 , gettext, libedit, glib, imagemagick, libxml2, boost, gnuplot, graphviz
 , tesseract, gts, libXtst
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
   preBuild = ''
     export PYTHONPATH="$PYTHONPATH:$out/lib/python${python.pythonVersion}/site-packages"
     export PATH="$PATH:$out/bin"
-    export LD_LIBRARY_PATH="${stdenv.lib.makeLibraryPath [libXtst]}"
+    export LD_LIBRARY_PATH="${lib.makeLibraryPath [libXtst]}"
   '';
 
   postInstall = ''
@@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
     done
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Free Model-Based Testing tool";
     homepage = "https://github.com/intel/fMBT";
     license = licenses.lgpl21;
diff --git a/pkgs/development/tools/fusee-launcher/default.nix b/pkgs/development/tools/fusee-launcher/default.nix
index 077dc8b87f9..08cf6caae3e 100644
--- a/pkgs/development/tools/fusee-launcher/default.nix
+++ b/pkgs/development/tools/fusee-launcher/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , python3Packages
 , python3
 , fetchFromGitHub
@@ -32,7 +32,7 @@ stdenv.mkDerivation {
   buildInputs = [ python3 python3Packages.pyusb ];
   pythonPath = with python3Packages; [ pyusb ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/Cease-and-DeSwitch/fusee-launcher";
     description = "Work-in-progress launcher for one of the Tegra X1 bootROM exploits";
     license = licenses.gpl2;
diff --git a/pkgs/development/tools/galen/default.nix b/pkgs/development/tools/galen/default.nix
index 89d6b700018..00831c05691 100644
--- a/pkgs/development/tools/galen/default.nix
+++ b/pkgs/development/tools/galen/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, jre8, unzip }:
+{ lib, stdenv, fetchurl, jre8, unzip }:
 
 stdenv.mkDerivation rec {
   pname = "galen";
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   cp galen.jar $out/bin
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://galenframework.com";
     description = "Automated layout testing for websites";
     license = licenses.asl20;
diff --git a/pkgs/development/tools/gamecube-tools/default.nix b/pkgs/development/tools/gamecube-tools/default.nix
index 7c31f691b4e..2f7c088cd48 100644
--- a/pkgs/development/tools/gamecube-tools/default.nix
+++ b/pkgs/development/tools/gamecube-tools/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook
+{ lib, stdenv, fetchFromGitHub, autoreconfHook
 , freeimage, libGL }:
 
 stdenv.mkDerivation rec {
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     sha256 = "0zvpkzqvl8iv4ndzhkjkmrzpampyzgb91spv0h2x2arl8zy4z7ca";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Tools for gamecube/wii projects";
     homepage = "https://github.com/devkitPro/gamecube-tools/";
     license = licenses.gpl2;
diff --git a/pkgs/development/tools/gauge/default.nix b/pkgs/development/tools/gauge/default.nix
index dd48998c741..a0eb7370bee 100644
--- a/pkgs/development/tools/gauge/default.nix
+++ b/pkgs/development/tools/gauge/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "gauge";
@@ -14,7 +14,7 @@ buildGoPackage rec {
     sha256 = "02yrk4d5mm4j2grlhqkf4grxawx91kd2vhdn7k5wd2dl6wsnlgcl";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
    description = "Light weight cross-platform test automation";
    homepage    = "https://gauge.org";
    license     = licenses.gpl3;
diff --git a/pkgs/development/tools/gdm/default.nix b/pkgs/development/tools/gdm/default.nix
index 2f26a1c35f8..7c7f73af1e0 100644
--- a/pkgs/development/tools/gdm/default.nix
+++ b/pkgs/development/tools/gdm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "gdm";
@@ -15,7 +15,7 @@ buildGoPackage rec {
 
   goDeps = ./deps.nix;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Minimalist dependency manager for Go written in Go";
     homepage = "https://github.com/sparrc/gdm";
     license = licenses.unlicense;
diff --git a/pkgs/development/tools/git-ftp/default.nix b/pkgs/development/tools/git-ftp/default.nix
index 0c107ecc503..25295ad0062 100644
--- a/pkgs/development/tools/git-ftp/default.nix
+++ b/pkgs/development/tools/git-ftp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, pandoc, man }:
+{ lib, stdenv, fetchFromGitHub, pandoc, man }:
 stdenv.mkDerivation rec {
   pname = "git-ftp";
   version = "1.6.0";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [pandoc man];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Git powered FTP client written as shell script";
     homepage = "https://git-ftp.github.io/";
     license = licenses.gpl3;
diff --git a/pkgs/development/tools/git-quick-stats/default.nix b/pkgs/development/tools/git-quick-stats/default.nix
index 2b775de4e43..ed9205ee251 100644
--- a/pkgs/development/tools/git-quick-stats/default.nix
+++ b/pkgs/development/tools/git-quick-stats/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , makeWrapper
 , coreutils
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
 
   postInstall =
     let
-      path = stdenv.lib.makeBinPath [
+      path = lib.makeBinPath [
         coreutils
         gawk
         git
@@ -41,7 +41,7 @@ stdenv.mkDerivation rec {
       wrapProgram $out/bin/git-quick-stats --suffix PATH : ${path}
     '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/arzzen/git-quick-stats";
     description = "A simple and efficient way to access various statistics in git repository";
     platforms = platforms.all;
diff --git a/pkgs/development/tools/git-series/default.nix b/pkgs/development/tools/git-series/default.nix
index 004125adead..4f13c3de40b 100644
--- a/pkgs/development/tools/git-series/default.nix
+++ b/pkgs/development/tools/git-series/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fetchpatch, rustPlatform
+{ lib, stdenv, fetchFromGitHub, fetchpatch, rustPlatform
 , openssl, cmake, perl, pkg-config, zlib, curl, libgit2, libssh2
 }:
 
@@ -43,7 +43,7 @@ buildRustPackage rec {
     install -D "$src/git-series.1" "$out/man/man1/git-series.1"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A tool to help with formatting git patches for review on mailing lists";
     longDescription = ''
           git series tracks changes to a patch series over time. git
diff --git a/pkgs/development/tools/github/cligh/default.nix b/pkgs/development/tools/github/cligh/default.nix
index 5eb65dc4fbd..dfe66c789ca 100644
--- a/pkgs/development/tools/github/cligh/default.nix
+++ b/pkgs/development/tools/github/cligh/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, buildPythonApplication, pyxdg, PyGithub }:
+{ lib, stdenv, fetchFromGitHub, buildPythonApplication, pyxdg, PyGithub }:
 
 buildPythonApplication rec {
   pname = "cligh";
@@ -15,7 +15,7 @@ buildPythonApplication rec {
 
   propagatedBuildInputs = [ pyxdg PyGithub ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://the-brannons.com/software/cligh.html";
     description = "A simple command-line interface to the facilities of Github";
     longDescription = ''
diff --git a/pkgs/development/tools/github/github-release/default.nix b/pkgs/development/tools/github/github-release/default.nix
index 8b68426d4b5..81b125ac058 100644
--- a/pkgs/development/tools/github/github-release/default.nix
+++ b/pkgs/development/tools/github/github-release/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, system, fetchurl }:
+{ lib, stdenv, system, fetchurl }:
 
 let
   linuxPredicate = system == "x86_64-linux";
@@ -36,7 +36,7 @@ in stdenv.mkDerivation rec {
     cp "${metadata.archiveBinaryPath}/github-release" "$out/bin/"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Commandline app to create and edit releases on Github (and upload artifacts)";
     longDescription = ''
       A small commandline app written in Go that allows you to easily create and
diff --git a/pkgs/development/tools/glade/default.nix b/pkgs/development/tools/glade/default.nix
index 0e3cdf4bda1..d77772c32db 100644
--- a/pkgs/development/tools/glade/default.nix
+++ b/pkgs/development/tools/glade/default.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
   version = "3.38.2";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/glade/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/glade/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1dxsiz9ahqkxg2a1dw9sbd8jg59y5pdz4c1gvnbmql48gmj8gz4q";
   };
 
diff --git a/pkgs/development/tools/glide/default.nix b/pkgs/development/tools/glide/default.nix
index 4f511813ad0..f8abde7e00a 100644
--- a/pkgs/development/tools/glide/default.nix
+++ b/pkgs/development/tools/glide/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "glide";
@@ -18,7 +18,7 @@ buildGoPackage rec {
     sha256 = "1wskg1cxqy9sp0738qiiagdw09dbs3swxsk4z6w5hsfiq2h44a54";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://glide.sh";
     description = "Package management for Go";
     license = licenses.mit;
diff --git a/pkgs/development/tools/gllvm/default.nix b/pkgs/development/tools/gllvm/default.nix
index efa7ae21c3a..f2c552252fb 100644
--- a/pkgs/development/tools/gllvm/default.nix
+++ b/pkgs/development/tools/gllvm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "gllvm";
@@ -13,7 +13,7 @@ buildGoPackage rec {
     sha256 = "15cgngvd9mg057iz32fk5kcprcvvavahbvfvl5ds8x7shbm60g7s";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/SRI-CSL/gllvm";
     description = "Whole Program LLVM: wllvm ported to go";
     license = licenses.bsd3;
diff --git a/pkgs/development/tools/glock/default.nix b/pkgs/development/tools/glock/default.nix
index 0ffa521f38f..c00478c9fb6 100644
--- a/pkgs/development/tools/glock/default.nix
+++ b/pkgs/development/tools/glock/default.nix
@@ -1,8 +1,8 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "glock";
-  version = "20160816-${stdenv.lib.strings.substring 0 7 rev}";
+  version = "20160816-${lib.strings.substring 0 7 rev}";
   rev = "b8c84ff5ade15a6238ca61c20d3afc70d2e41276";
 
   goPackagePath = "github.com/robfig/glock";
@@ -16,7 +16,7 @@ buildGoPackage rec {
 
   goDeps = ./deps.nix;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/robfig/glock";
     description = "A command-line tool to lock Go dependencies to specific revisions";
     license = licenses.mit;
diff --git a/pkgs/development/tools/glslviewer/default.nix b/pkgs/development/tools/glslviewer/default.nix
index 76c75af2d5f..3f83e1fcb02 100644
--- a/pkgs/development/tools/glslviewer/default.nix
+++ b/pkgs/development/tools/glslviewer/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, glfw, pkg-config, libXrandr, libXdamage
+{ lib, stdenv, fetchFromGitHub, glfw, pkg-config, libXrandr, libXdamage
 , libXext, libXrender, libXinerama, libXcursor, libXxf86vm, libXi
 , libX11, libGLU, python3Packages, ensureNewerSourcesForZipFilesHook
 , Cocoa
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     libXext libXrender libXinerama libXcursor libXxf86vm
     libXi libX11
   ] ++ (with python3Packages; [ python setuptools wrapPython ])
-    ++ stdenv.lib.optional stdenv.isDarwin Cocoa;
+    ++ lib.optional stdenv.isDarwin Cocoa;
   pythonPath = with python3Packages; [ pyyaml requests ];
 
   # Makefile has /usr/local/bin hard-coded for 'make install'
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
     wrapPythonPrograms
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Live GLSL coding renderer";
     homepage = "http://patriciogonzalezvivo.com/2015/glslViewer/";
     license = licenses.bsd3;
diff --git a/pkgs/development/tools/gnome-desktop-testing/default.nix b/pkgs/development/tools/gnome-desktop-testing/default.nix
index f63a46793a3..5f01881958f 100644
--- a/pkgs/development/tools/gnome-desktop-testing/default.nix
+++ b/pkgs/development/tools/gnome-desktop-testing/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , glib
 , autoreconfHook
 , pkg-config
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "GNOME test runner for installed tests";
     homepage = "https://wiki.gnome.org/Initiatives/GnomeGoals/InstalledTests";
     license = licenses.lgpl2Plus;
diff --git a/pkgs/development/tools/gnulib/default.nix b/pkgs/development/tools/gnulib/default.nix
index 81e4d879375..2a2ce1b190f 100644
--- a/pkgs/development/tools/gnulib/default.nix
+++ b/pkgs/development/tools/gnulib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit }:
+{ lib, stdenv, fetchgit }:
 
 stdenv.mkDerivation {
   pname = "gnulib";
@@ -22,7 +22,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = "https://www.gnu.org/software/gnulib/";
     description = "Central location for code to be shared among GNU packages";
-    license = stdenv.lib.licenses.gpl3Plus;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.gpl3Plus;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/go-bindata-assetfs/default.nix b/pkgs/development/tools/go-bindata-assetfs/default.nix
index 30344a52e06..57d0e93a9b0 100644
--- a/pkgs/development/tools/go-bindata-assetfs/default.nix
+++ b/pkgs/development/tools/go-bindata-assetfs/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "go-bindata-assetfs";
@@ -13,7 +13,7 @@ buildGoPackage rec {
     sha256 = "0b6q8h9fwpgpkvml1j87wq9174g7px1dmskhm884drpvswda2djk";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Serve embedded files from jteeuwen/go-bindata";
     license = licenses.bsd2;
     maintainers = with maintainers; [ avnik ];
diff --git a/pkgs/development/tools/go-bindata/default.nix b/pkgs/development/tools/go-bindata/default.nix
index 9256fab43bf..5d257bbf998 100644
--- a/pkgs/development/tools/go-bindata/default.nix
+++ b/pkgs/development/tools/go-bindata/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage {
   pname = "go-bindata";
@@ -15,7 +15,7 @@ buildGoPackage {
 
   excludedPackages = "testdata";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/jteeuwen/go-bindata";
     description = "A small utility which generates Go code from any file, useful for embedding binary data in a Go program";
     maintainers = with maintainers; [ cstrahan ];
diff --git a/pkgs/development/tools/go-langserver/default.nix b/pkgs/development/tools/go-langserver/default.nix
index c6a0dcc0d9d..fdefd6b0178 100644
--- a/pkgs/development/tools/go-langserver/default.nix
+++ b/pkgs/development/tools/go-langserver/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "go-langserver";
@@ -14,7 +14,7 @@ buildGoPackage rec {
     sha256 = "1wv7xf81s3qi8xydxjkkp8vacdzrq8sbj04346fz73nsn85z0sgp";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A Go language server protocol server";
     homepage = "https://github.com/sourcegraph/go-langserver";
     license = licenses.mit;
diff --git a/pkgs/development/tools/go-outline/default.nix b/pkgs/development/tools/go-outline/default.nix
index f10ee426c08..d30d5c30f3a 100644
--- a/pkgs/development/tools/go-outline/default.nix
+++ b/pkgs/development/tools/go-outline/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "go-outline";
@@ -18,7 +18,7 @@ buildGoPackage rec {
   meta = {
     description = "Utility to extract JSON representation of declarations from a Go source file";
     homepage = "https://github.com/ramya-rao-a/go-outline";
-    maintainers = with stdenv.lib.maintainers; [ vdemeester ];
-    license = stdenv.lib.licenses.mit;
+    maintainers = with lib.maintainers; [ vdemeester ];
+    license = lib.licenses.mit;
   };
 }
diff --git a/pkgs/development/tools/go-protobuf/default.nix b/pkgs/development/tools/go-protobuf/default.nix
index c5e9af3e7bb..0187552d844 100644
--- a/pkgs/development/tools/go-protobuf/default.nix
+++ b/pkgs/development/tools/go-protobuf/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoModule, fetchFromGitHub }:
+{ lib, stdenv, buildGoModule, fetchFromGitHub }:
 
 buildGoModule rec {
   pname = "go-protobuf";
@@ -15,7 +15,7 @@ buildGoModule rec {
 
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage    = "https://github.com/golang/protobuf";
     description = " Go bindings for protocol buffer";
     maintainers = with maintainers; [ lewo ];
diff --git a/pkgs/development/tools/go-repo-root/default.nix b/pkgs/development/tools/go-repo-root/default.nix
index 3392a19b636..25fc87f8985 100644
--- a/pkgs/development/tools/go-repo-root/default.nix
+++ b/pkgs/development/tools/go-repo-root/default.nix
@@ -1,8 +1,8 @@
-{ stdenv, buildGoPackage, fetchgit }:
+{ lib, stdenv, buildGoPackage, fetchgit }:
 
 buildGoPackage rec {
   pname = "go-repo-root";
-  version = "20140911-${stdenv.lib.strings.substring 0 7 rev}";
+  version = "20140911-${lib.strings.substring 0 7 rev}";
   rev = "90041e5c7dc634651549f96814a452f4e0e680f9";
 
   goPackagePath = "github.com/cstrahan/go-repo-root";
diff --git a/pkgs/development/tools/go-symbols/default.nix b/pkgs/development/tools/go-symbols/default.nix
index 1e2b63ba154..3f41007716e 100644
--- a/pkgs/development/tools/go-symbols/default.nix
+++ b/pkgs/development/tools/go-symbols/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "go-symbols";
@@ -17,7 +17,7 @@ buildGoPackage rec {
   meta = {
     description = "A utility for extracting a JSON representation of the package symbols from a go source tree";
     homepage = "https://github.com/acroca/go-symbols";
-    maintainers = with stdenv.lib.maintainers; [ vdemeester ];
-    license = stdenv.lib.licenses.mit;
+    maintainers = with lib.maintainers; [ vdemeester ];
+    license = lib.licenses.mit;
   };
 }
diff --git a/pkgs/development/tools/go2nix/default.nix b/pkgs/development/tools/go2nix/default.nix
index 300f82ee548..618ddc7d450 100644
--- a/pkgs/development/tools/go2nix/default.nix
+++ b/pkgs/development/tools/go2nix/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, go-bindata, gotools, nix-prefetch-git, git, makeWrapper,
+{ lib, stdenv, buildGoPackage, go-bindata, gotools, nix-prefetch-git, git, makeWrapper,
   fetchFromGitHub }:
 
 buildGoPackage rec {
@@ -36,7 +36,7 @@ buildGoPackage rec {
 
   doCheck = false; # tries to access the net
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Go apps packaging for Nix";
     homepage = "https://github.com/kamilchm/go2nix";
     license = licenses.mit;
diff --git a/pkgs/development/tools/goa/default.nix b/pkgs/development/tools/goa/default.nix
index 6a373099a01..63322b6d363 100644
--- a/pkgs/development/tools/goa/default.nix
+++ b/pkgs/development/tools/goa/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "goa";
@@ -16,7 +16,7 @@ buildGoPackage rec {
 
   goDeps = ./deps.nix;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://goa.design";
     description = "A framework for building microservices in Go using a unique design-first approach";
     license = licenses.mit;
diff --git a/pkgs/development/tools/gocode-gomod/default.nix b/pkgs/development/tools/gocode-gomod/default.nix
index 01ee2931c99..59f17e8acfd 100644
--- a/pkgs/development/tools/gocode-gomod/default.nix
+++ b/pkgs/development/tools/gocode-gomod/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoModule, fetchFromGitHub }:
+{ lib, stdenv, buildGoModule, fetchFromGitHub }:
 
 buildGoModule rec {
   pname = "gocode-gomod";
@@ -24,7 +24,7 @@ buildGoModule rec {
     mv $out/bin/gocode $out/bin/gocode-gomod
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An autocompletion daemon for the Go programming language";
     longDescription = ''
       Gocode is a helper tool which is intended to be integrated with your
diff --git a/pkgs/development/tools/gocode/default.nix b/pkgs/development/tools/gocode/default.nix
index f38d06b34c6..a50c5969167 100644
--- a/pkgs/development/tools/gocode/default.nix
+++ b/pkgs/development/tools/gocode/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "gocode-unstable";
@@ -23,7 +23,7 @@ buildGoPackage rec {
 
   goDeps = ./deps.nix;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An autocompletion daemon for the Go programming language";
     longDescription = ''
       Gocode is a helper tool which is intended to be integrated with your
diff --git a/pkgs/development/tools/goconvey/default.nix b/pkgs/development/tools/goconvey/default.nix
index 173da3ff29d..dcec045e5eb 100644
--- a/pkgs/development/tools/goconvey/default.nix
+++ b/pkgs/development/tools/goconvey/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "goconvey";
@@ -19,7 +19,7 @@ buildGoPackage rec {
   meta = {
     description = "Go testing in the browser. Integrates with `go test`. Write behavioral tests in Go";
     homepage = "https://github.com/smartystreets/goconvey";
-    maintainers = with stdenv.lib.maintainers; [ vdemeester ];
-    license = stdenv.lib.licenses.mit;
+    maintainers = with lib.maintainers; [ vdemeester ];
+    license = lib.licenses.mit;
   };
 }
diff --git a/pkgs/development/tools/godef/default.nix b/pkgs/development/tools/godef/default.nix
index c8149ecc82d..6d4f40ba6bc 100644
--- a/pkgs/development/tools/godef/default.nix
+++ b/pkgs/development/tools/godef/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoModule, fetchFromGitHub }:
+{ lib, stdenv, buildGoModule, fetchFromGitHub }:
 
 buildGoModule rec {
   pname = "godef";
@@ -21,7 +21,7 @@ buildGoModule rec {
   meta = {
     description = "Print where symbols are defined in Go source code";
     homepage = "https://github.com/rogpeppe/godef/";
-    maintainers = with stdenv.lib.maintainers; [ vdemeester rvolosatovs ];
-    license = stdenv.lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ vdemeester rvolosatovs ];
+    license = lib.licenses.bsd3;
   };
 }
diff --git a/pkgs/development/tools/godot/default.nix b/pkgs/development/tools/godot/default.nix
index 303040768c7..217717d3e7d 100644
--- a/pkgs/development/tools/godot/default.nix
+++ b/pkgs/development/tools/godot/default.nix
@@ -61,8 +61,8 @@ in stdenv.mkDerivation rec {
   meta = {
     homepage    = "https://godotengine.org";
     description = "Free and Open Source 2D and 3D game engine";
-    license     = stdenv.lib.licenses.mit;
+    license     = lib.licenses.mit;
     platforms   = [ "i686-linux" "x86_64-linux" ];
-    maintainers = [ stdenv.lib.maintainers.twey ];
+    maintainers = [ lib.maintainers.twey ];
   };
 }
diff --git a/pkgs/development/tools/godot/headless.nix b/pkgs/development/tools/godot/headless.nix
index 0ae28b774fb..20d3b48f2fd 100644
--- a/pkgs/development/tools/godot/headless.nix
+++ b/pkgs/development/tools/godot/headless.nix
@@ -1,4 +1,4 @@
-{ godot, stdenv }:
+{ godot, lib, stdenv }:
 godot.overrideAttrs (oldAttrs: rec {
   pname = "godot-headless";
   sconsFlags = "target=release_debug platform=server tools=yes";
@@ -14,5 +14,5 @@ godot.overrideAttrs (oldAttrs: rec {
   '';
   meta.description =
     "Free and Open Source 2D and 3D game engine (headless build)";
-  meta.maintainers = with stdenv.lib.maintainers; [ twey yusdacra ];
+  meta.maintainers = with lib.maintainers; [ twey yusdacra ];
 })
diff --git a/pkgs/development/tools/godot/server.nix b/pkgs/development/tools/godot/server.nix
index 48f21b796c3..6ce347355e3 100644
--- a/pkgs/development/tools/godot/server.nix
+++ b/pkgs/development/tools/godot/server.nix
@@ -1,4 +1,4 @@
-{ godot, stdenv }:
+{ godot, lib, stdenv }:
 godot.overrideAttrs (oldAttrs: rec {
   pname = "godot-server";
   sconsFlags = "target=release platform=server tools=no";
@@ -14,5 +14,5 @@ godot.overrideAttrs (oldAttrs: rec {
   '';
   meta.description =
     "Free and Open Source 2D and 3D game engine (server build)";
-  meta.maintainers = with stdenv.lib.maintainers; [ twey yusdacra ];
+  meta.maintainers = with lib.maintainers; [ twey yusdacra ];
 })
diff --git a/pkgs/development/tools/golint/default.nix b/pkgs/development/tools/golint/default.nix
index 284bb32f89e..1f75384f338 100644
--- a/pkgs/development/tools/golint/default.nix
+++ b/pkgs/development/tools/golint/default.nix
@@ -1,8 +1,8 @@
-{ stdenv, buildGoPackage, fetchgit }:
+{ lib, stdenv, buildGoPackage, fetchgit }:
 
 buildGoPackage rec {
   pname = "lint";
-  version = "20181026-${stdenv.lib.strings.substring 0 7 rev}";
+  version = "20181026-${lib.strings.substring 0 7 rev}";
   rev = "c67002cb31c3a748b7688c27f20d8358b4193582";
 
   goPackagePath = "golang.org/x/lint";
@@ -20,7 +20,7 @@ buildGoPackage rec {
 
   goDeps = ./deps.nix;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://golang.org";
     description = "Linter for Go source code";
     license = licenses.bsd3;
diff --git a/pkgs/development/tools/gomodifytags/default.nix b/pkgs/development/tools/gomodifytags/default.nix
index 70bbc635cc1..650f1b89f30 100644
--- a/pkgs/development/tools/gomodifytags/default.nix
+++ b/pkgs/development/tools/gomodifytags/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoModule, fetchFromGitHub }:
+{ lib, stdenv, buildGoModule, fetchFromGitHub }:
 
 buildGoModule rec {
   pname = "gomodifytags";
@@ -18,7 +18,7 @@ buildGoModule rec {
   meta = {
     description = "Go tool to modify struct field tags";
     homepage = "https://github.com/fatih/gomodifytags";
-    maintainers = with stdenv.lib.maintainers; [ vdemeester ];
-    license = stdenv.lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ vdemeester ];
+    license = lib.licenses.bsd3;
   };
 }
diff --git a/pkgs/development/tools/google-app-engine-go-sdk/default.nix b/pkgs/development/tools/google-app-engine-go-sdk/default.nix
index 485b2c3625f..4d572e070e7 100644
--- a/pkgs/development/tools/google-app-engine-go-sdk/default.nix
+++ b/pkgs/development/tools/google-app-engine-go-sdk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchzip, python3Packages, makeWrapper }:
+{ lib, stdenv, fetchzip, python3Packages, makeWrapper }:
 
 with python3Packages;
 
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
     done
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Google App Engine SDK for Go";
     version = version;
     homepage = "https://cloud.google.com/appengine/docs/go/";
diff --git a/pkgs/development/tools/gopkgs/default.nix b/pkgs/development/tools/gopkgs/default.nix
index 8d26ca7eb44..e4a72cb27a1 100644
--- a/pkgs/development/tools/gopkgs/default.nix
+++ b/pkgs/development/tools/gopkgs/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoModule, fetchFromGitHub }:
+{ lib, stdenv, buildGoModule, fetchFromGitHub }:
 
 buildGoModule rec {
   pname = "gopkgs";
@@ -20,7 +20,7 @@ buildGoModule rec {
   meta = {
     description = "Tool to get list available Go packages";
     homepage = "https://github.com/uudashr/gopkgs";
-    maintainers = with stdenv.lib.maintainers; [ vdemeester ];
-    license = stdenv.lib.licenses.mit;
+    maintainers = with lib.maintainers; [ vdemeester ];
+    license = lib.licenses.mit;
   };
 }
diff --git a/pkgs/development/tools/gosec/default.nix b/pkgs/development/tools/gosec/default.nix
index 44862bb3311..69d74496e61 100644
--- a/pkgs/development/tools/gosec/default.nix
+++ b/pkgs/development/tools/gosec/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoModule, fetchFromGitHub }:
+{ lib, stdenv, buildGoModule, fetchFromGitHub }:
 
 buildGoModule rec {
   pname = "gosec";
@@ -19,7 +19,7 @@ buildGoModule rec {
 
   buildFlagsArray = [ "-ldflags=-s -w -X main.Version=${version} -X main.GitTag=${src.rev} -X main.BuildDate=unknown" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/securego/gosec";
     description = "Golang security checker";
     license = licenses.asl20;
diff --git a/pkgs/development/tools/gotags/default.nix b/pkgs/development/tools/gotags/default.nix
index 5499a22ec01..ea40bd0e6fe 100644
--- a/pkgs/development/tools/gotags/default.nix
+++ b/pkgs/development/tools/gotags/default.nix
@@ -1,8 +1,8 @@
-{ stdenv, buildGoPackage, fetchgit }:
+{ lib, stdenv, buildGoPackage, fetchgit }:
 
 buildGoPackage rec {
   pname = "gotags";
-  version = "20150803-${stdenv.lib.strings.substring 0 7 rev}";
+  version = "20150803-${lib.strings.substring 0 7 rev}";
   rev = "be986a34e20634775ac73e11a5b55916085c48e7";
 
   goPackagePath = "github.com/jstemmer/gotags";
diff --git a/pkgs/development/tools/gotests/default.nix b/pkgs/development/tools/gotests/default.nix
index 43f221bd324..87a93abee8e 100644
--- a/pkgs/development/tools/gotests/default.nix
+++ b/pkgs/development/tools/gotests/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "gotests";
@@ -19,7 +19,7 @@ buildGoPackage rec {
   meta = {
     description = "Generate Go tests from your source code";
     homepage = "https://github.com/cweill/gotests";
-    maintainers = with stdenv.lib.maintainers; [ vdemeester ];
-    license = stdenv.lib.licenses.asl20;
+    maintainers = with lib.maintainers; [ vdemeester ];
+    license = lib.licenses.asl20;
   };
 }
diff --git a/pkgs/development/tools/gotools/default.nix b/pkgs/development/tools/gotools/default.nix
index eabf41f8663..7ca3486a503 100644
--- a/pkgs/development/tools/gotools/default.nix
+++ b/pkgs/development/tools/gotools/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoModule, fetchgit }:
+{ lib, stdenv, buildGoModule, fetchgit }:
 
 buildGoModule rec {
   pname = "gotools-unstable";
@@ -40,7 +40,7 @@ buildGoModule rec {
   '';
 
   excludedPackages = "\\("
-    + stdenv.lib.concatStringsSep "\\|" ([ "testdata" "vet" "cover" ])
+    + lib.concatStringsSep "\\|" ([ "testdata" "vet" "cover" ])
     + "\\)";
 
   # Set GOTOOLDIR for derivations adding this to buildInputs
diff --git a/pkgs/development/tools/govendor/default.nix b/pkgs/development/tools/govendor/default.nix
index 804a9bf043e..edd9b577be4 100644
--- a/pkgs/development/tools/govendor/default.nix
+++ b/pkgs/development/tools/govendor/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "govendor";
@@ -13,7 +13,7 @@ buildGoPackage rec {
     sha256 = "0g02cd25chyijg0rzab4xr627pkvk5k33mscd6r0gf1v5xvadcfq";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/kardianos/govendor";
     description = "Go vendor tool that works with the standard vendor file";
     license = licenses.bsd3;
diff --git a/pkgs/development/tools/govers/default.nix b/pkgs/development/tools/govers/default.nix
index ebce368ea9f..cac76daa6fc 100644
--- a/pkgs/development/tools/govers/default.nix
+++ b/pkgs/development/tools/govers/default.nix
@@ -1,8 +1,8 @@
-{ stdenv, buildGoPackage, fetchgit }:
+{ lib, stdenv, buildGoPackage, fetchgit }:
 
 buildGoPackage rec {
   pname = "govers";
-  version = "20160623-${stdenv.lib.strings.substring 0 7 rev}";
+  version = "20160623-${lib.strings.substring 0 7 rev}";
   rev = "77fd787551fc5e7ae30696e009e334d52d2d3a43";
 
   goPackagePath = "github.com/rogpeppe/govers";
diff --git a/pkgs/development/tools/gox/default.nix b/pkgs/development/tools/gox/default.nix
index 34e7d338318..3deb73acb44 100644
--- a/pkgs/development/tools/gox/default.nix
+++ b/pkgs/development/tools/gox/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "gox";
@@ -13,7 +13,7 @@ buildGoPackage rec {
     sha256 = "0mkh81hd7kn45dz7b6yhzqsg2mvg1g6pwx89jjigxrnqhyg9vrl7";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/mitchellh/gox";
     description = "A dead simple, no frills Go cross compile tool";
     license = licenses.mpl20;
diff --git a/pkgs/development/tools/gpp/default.nix b/pkgs/development/tools/gpp/default.nix
index ee15df1a9f6..9e49b0c0284 100644
--- a/pkgs/development/tools/gpp/default.nix
+++ b/pkgs/development/tools/gpp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
 
 stdenv.mkDerivation {
   pname = "gpp";
@@ -16,7 +16,7 @@ stdenv.mkDerivation {
   installCheckPhase = "$out/bin/gpp --help";
   doInstallCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "General-purpose preprocessor with customizable syntax";
     homepage = "https://logological.org/gpp";
     license = licenses.lgpl3;
diff --git a/pkgs/development/tools/gron/default.nix b/pkgs/development/tools/gron/default.nix
index e0d2d3d1498..6d182b0b5f5 100644
--- a/pkgs/development/tools/gron/default.nix
+++ b/pkgs/development/tools/gron/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "gron";
@@ -16,7 +16,7 @@ buildGoPackage rec {
 
   goDeps = ./deps.nix;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Make JSON greppable!";
     longDescription = ''
       gron transforms JSON into discrete assignments to make it easier to grep
diff --git a/pkgs/development/tools/guile/g-wrap/default.nix b/pkgs/development/tools/guile/g-wrap/default.nix
index 33572c70b13..6bb80306e68 100644
--- a/pkgs/development/tools/guile/g-wrap/default.nix
+++ b/pkgs/development/tools/guile/g-wrap/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, guile, guile-lib, libffi, pkg-config, glib }:
+{ fetchurl, lib, stdenv, guile, guile-lib, libffi, pkg-config, glib }:
 
 stdenv.mkDerivation rec {
   pname = "g-wrap";
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A wrapper generator for Guile";
     longDescription = ''
       G-Wrap is a tool (and Guile library) for generating function wrappers for
diff --git a/pkgs/development/tools/guile/guile-lint/default.nix b/pkgs/development/tools/guile/guile-lint/default.nix
index b8efb30f5f1..6de9e48ae66 100644
--- a/pkgs/development/tools/guile/guile-lint/default.nix
+++ b/pkgs/development/tools/guile/guile-lint/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, guile }:
+{ lib, stdenv, fetchurl, guile }:
 
 stdenv.mkDerivation rec {
   pname = "guile-lint";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   doCheck = !stdenv.isDarwin;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Checks syntax and semantics in a Guile program or module";
     homepage = "https://user42.tuxfamily.org/guile-lint/index.html";
     license = licenses.gpl3Plus;
diff --git a/pkgs/development/tools/haskell/dconf2nix/dconf2nix.nix b/pkgs/development/tools/haskell/dconf2nix/dconf2nix.nix
index 4d7dca12f8f..02c4c96bd8e 100644
--- a/pkgs/development/tools/haskell/dconf2nix/dconf2nix.nix
+++ b/pkgs/development/tools/haskell/dconf2nix/dconf2nix.nix
@@ -1,5 +1,5 @@
 { mkDerivation, base, containers, fetchgit, hedgehog
-, optparse-applicative, parsec, stdenv, template-haskell, text
+, optparse-applicative, parsec, lib, stdenv, template-haskell, text
 }:
 mkDerivation {
   pname = "dconf2nix";
@@ -20,5 +20,5 @@ mkDerivation {
     base containers hedgehog parsec template-haskell text
   ];
   description = "Convert dconf files to Nix, as expected by Home Manager";
-  license = stdenv.lib.licenses.asl20;
+  license = lib.licenses.asl20;
 }
diff --git a/pkgs/development/tools/haskell/haskell-language-server/default.nix b/pkgs/development/tools/haskell/haskell-language-server/default.nix
index 44cd234da72..512aec84eea 100644
--- a/pkgs/development/tools/haskell/haskell-language-server/default.nix
+++ b/pkgs/development/tools/haskell/haskell-language-server/default.nix
@@ -7,7 +7,7 @@
 , hls-tactics-plugin, hslogger, hspec, hspec-core
 , hspec-expectations, lens, lsp-test, mtl, optparse-applicative
 , optparse-simple, ormolu, process, regex-tdfa, safe-exceptions
-, shake, stdenv, stm, stylish-haskell, tasty, tasty-ant-xml
+, shake, lib, stdenv, stm, stylish-haskell, tasty, tasty-ant-xml
 , tasty-expected-failure, tasty-golden, tasty-hunit, tasty-rerun
 , temporary, text, transformers, unordered-containers, with-utf8
 , yaml
@@ -49,5 +49,5 @@ mkDerivation {
   testToolDepends = [ ghcide ];
   homepage = "https://github.com/haskell/haskell-language-server#readme";
   description = "LSP server for GHC";
-  license = stdenv.lib.licenses.asl20;
+  license = lib.licenses.asl20;
 }
diff --git a/pkgs/development/tools/haskell/haskell-language-server/hls-class-plugin.nix b/pkgs/development/tools/haskell/haskell-language-server/hls-class-plugin.nix
index 86c29c7be39..c5168934390 100644
--- a/pkgs/development/tools/haskell/haskell-language-server/hls-class-plugin.nix
+++ b/pkgs/development/tools/haskell/haskell-language-server/hls-class-plugin.nix
@@ -1,6 +1,6 @@
 { mkDerivation, aeson, base, containers, fetchgit, ghc
 , ghc-exactprint, ghcide, haskell-lsp, hls-plugin-api, lens, shake
-, stdenv, text, transformers, unordered-containers
+, lib, stdenv, text, transformers, unordered-containers
 }:
 mkDerivation {
   pname = "hls-class-plugin";
@@ -17,5 +17,5 @@ mkDerivation {
     hls-plugin-api lens shake text transformers unordered-containers
   ];
   description = "Explicit imports plugin for Haskell Language Server";
-  license = stdenv.lib.licenses.asl20;
+  license = lib.licenses.asl20;
 }
diff --git a/pkgs/development/tools/haskell/haskell-language-server/hls-eval-plugin.nix b/pkgs/development/tools/haskell/haskell-language-server/hls-eval-plugin.nix
index 20ebc5f5e89..b5774ddcbfd 100644
--- a/pkgs/development/tools/haskell/haskell-language-server/hls-eval-plugin.nix
+++ b/pkgs/development/tools/haskell/haskell-language-server/hls-eval-plugin.nix
@@ -2,7 +2,7 @@
 , extra, fetchgit, filepath, ghc, ghc-boot-th, ghc-paths, ghcide
 , hashable, haskell-lsp, haskell-lsp-types, hls-plugin-api
 , parser-combinators, pretty-simple, QuickCheck, safe-exceptions
-, shake, stdenv, temporary, text, time, transformers
+, shake, lib, stdenv, temporary, text, time, transformers
 , unordered-containers
 }:
 mkDerivation {
@@ -23,5 +23,5 @@ mkDerivation {
     unordered-containers
   ];
   description = "Eval plugin for Haskell Language Server";
-  license = stdenv.lib.licenses.asl20;
+  license = lib.licenses.asl20;
 }
diff --git a/pkgs/development/tools/haskell/haskell-language-server/hls-explicit-imports-plugin.nix b/pkgs/development/tools/haskell/haskell-language-server/hls-explicit-imports-plugin.nix
index bad0e82194c..1c7d31004b6 100644
--- a/pkgs/development/tools/haskell/haskell-language-server/hls-explicit-imports-plugin.nix
+++ b/pkgs/development/tools/haskell/haskell-language-server/hls-explicit-imports-plugin.nix
@@ -1,5 +1,5 @@
 { mkDerivation, aeson, base, containers, deepseq, fetchgit, ghc
-, ghcide, haskell-lsp-types, hls-plugin-api, shake, stdenv, text
+, ghcide, haskell-lsp-types, hls-plugin-api, shake, lib, stdenv, text
 , unordered-containers
 }:
 mkDerivation {
@@ -17,5 +17,5 @@ mkDerivation {
     hls-plugin-api shake text unordered-containers
   ];
   description = "Explicit imports plugin for Haskell Language Server";
-  license = stdenv.lib.licenses.asl20;
+  license = lib.licenses.asl20;
 }
diff --git a/pkgs/development/tools/haskell/haskell-language-server/hls-hlint-plugin.nix b/pkgs/development/tools/haskell/haskell-language-server/hls-hlint-plugin.nix
index ecbe141fd72..4a90933d1e7 100644
--- a/pkgs/development/tools/haskell/haskell-language-server/hls-hlint-plugin.nix
+++ b/pkgs/development/tools/haskell/haskell-language-server/hls-hlint-plugin.nix
@@ -2,7 +2,7 @@
 , containers, data-default, deepseq, Diff, directory, extra
 , fetchgit, filepath, ghc, ghc-lib, ghc-lib-parser-ex, ghcide
 , hashable, haskell-lsp, hlint, hls-plugin-api, hslogger, lens
-, regex-tdfa, shake, stdenv, temporary, text, transformers
+, regex-tdfa, shake, lib, stdenv, temporary, text, transformers
 , unordered-containers
 }:
 mkDerivation {
@@ -22,5 +22,5 @@ mkDerivation {
     regex-tdfa shake temporary text transformers unordered-containers
   ];
   description = "Hlint integration plugin with Haskell Language Server";
-  license = stdenv.lib.licenses.asl20;
+  license = lib.licenses.asl20;
 }
diff --git a/pkgs/development/tools/haskell/haskell-language-server/hls-retrie-plugin.nix b/pkgs/development/tools/haskell/haskell-language-server/hls-retrie-plugin.nix
index 5a769e7a719..311a26633a5 100644
--- a/pkgs/development/tools/haskell/haskell-language-server/hls-retrie-plugin.nix
+++ b/pkgs/development/tools/haskell/haskell-language-server/hls-retrie-plugin.nix
@@ -1,6 +1,6 @@
 { mkDerivation, aeson, base, containers, deepseq, directory, extra
 , fetchgit, ghc, ghcide, hashable, haskell-lsp, haskell-lsp-types
-, hls-plugin-api, retrie, safe-exceptions, shake, stdenv, text
+, hls-plugin-api, retrie, safe-exceptions, shake, lib, stdenv, text
 , transformers, unordered-containers
 }:
 mkDerivation {
@@ -19,5 +19,5 @@ mkDerivation {
     shake text transformers unordered-containers
   ];
   description = "Retrie integration plugin for Haskell Language Server";
-  license = stdenv.lib.licenses.asl20;
+  license = lib.licenses.asl20;
 }
diff --git a/pkgs/development/tools/haskell/haskell-language-server/hls-tactics-plugin.nix b/pkgs/development/tools/haskell/haskell-language-server/hls-tactics-plugin.nix
index b5819b705b6..4f476431d9b 100644
--- a/pkgs/development/tools/haskell/haskell-language-server/hls-tactics-plugin.nix
+++ b/pkgs/development/tools/haskell/haskell-language-server/hls-tactics-plugin.nix
@@ -2,7 +2,7 @@
 , directory, extra, fetchgit, filepath, fingertree, generic-lens
 , ghc, ghc-boot-th, ghc-exactprint, ghc-source-gen, ghcide
 , haskell-lsp, hie-bios, hls-plugin-api, hspec, hspec-discover
-, lens, mtl, QuickCheck, refinery, retrie, shake, stdenv, syb, text
+, lens, mtl, QuickCheck, refinery, retrie, shake, lib, stdenv, syb, text
 , transformers
 }:
 mkDerivation {
@@ -28,5 +28,5 @@ mkDerivation {
   testToolDepends = [ hspec-discover ];
   description = "Tactics plugin for Haskell Language Server";
   license = "unknown";
-  hydraPlatforms = stdenv.lib.platforms.none;
+  hydraPlatforms = lib.platforms.none;
 }
diff --git a/pkgs/development/tools/haskell/hyper-haskell/default.nix b/pkgs/development/tools/haskell/hyper-haskell/default.nix
index df889d43d46..6b139904616 100644
--- a/pkgs/development/tools/haskell/hyper-haskell/default.nix
+++ b/pkgs/development/tools/haskell/hyper-haskell/default.nix
@@ -1,8 +1,8 @@
-{ stdenv, fetchFromGitHub, jshon, electron_3
+{ lib, stdenv, fetchFromGitHub, jshon, electron_3
 , runtimeShell, hyper-haskell-server, extra-packages ? [] }:
 
 let
-  binPath = stdenv.lib.makeBinPath ([ hyper-haskell-server ] ++ extra-packages);
+  binPath = lib.makeBinPath ([ hyper-haskell-server ] ++ extra-packages);
   electron = electron_3;
 in stdenv.mkDerivation rec {
   pname = "hyper-haskell";
@@ -42,7 +42,7 @@ in stdenv.mkDerivation rec {
     chmod 755 $out/bin/hyper-haskell
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "The strongly hyped graphical interpreter for the Haskell programming language";
     homepage = "https://github.com/HeinrichApfelmus/hyper-haskell";
     license = licenses.bsd3;
diff --git a/pkgs/development/tools/haskell/ihaskell/wrapper.nix b/pkgs/development/tools/haskell/ihaskell/wrapper.nix
index 60f8c2ecb25..875d5a8a4a8 100644
--- a/pkgs/development/tools/haskell/ihaskell/wrapper.nix
+++ b/pkgs/development/tools/haskell/ihaskell/wrapper.nix
@@ -1,4 +1,4 @@
-{ stdenv, writeScriptBin, makeWrapper, buildEnv, haskell, ghcWithPackages, jupyter, packages }:
+{ lib, stdenv, writeScriptBin, makeWrapper, buildEnv, haskell, ghcWithPackages, jupyter, packages }:
 let
   ihaskellEnv = ghcWithPackages (self: [
     self.ihaskell
@@ -9,7 +9,7 @@ let
   ihaskellSh = writeScriptBin "ihaskell-notebook" ''
     #! ${stdenv.shell}
     export GHC_PACKAGE_PATH="$(echo ${ihaskellEnv}/lib/*/package.conf.d| tr ' ' ':'):$GHC_PACKAGE_PATH"
-    export PATH="${stdenv.lib.makeBinPath ([ ihaskellEnv jupyter ])}''${PATH:+:}$PATH"
+    export PATH="${lib.makeBinPath ([ ihaskellEnv jupyter ])}''${PATH:+:}$PATH"
     ${ihaskellEnv}/bin/ihaskell install -l $(${ihaskellEnv}/bin/ghc --print-libdir) && ${jupyter}/bin/jupyter notebook
   '';
 in
diff --git a/pkgs/development/tools/haskell/vaultenv/default.nix b/pkgs/development/tools/haskell/vaultenv/default.nix
index 1d901cb723c..42cf3322420 100644
--- a/pkgs/development/tools/haskell/vaultenv/default.nix
+++ b/pkgs/development/tools/haskell/vaultenv/default.nix
@@ -1,7 +1,7 @@
 { mkDerivation, async, base, bytestring, connection, containers
 , directory, hpack, hspec, hspec-discover, hspec-expectations
 , http-client, http-conduit, lens, lens-aeson, megaparsec, mtl
-, optparse-applicative, parser-combinators, retry, stdenv, text
+, optparse-applicative, parser-combinators, retry, lib, stdenv, text
 , unix, unordered-containers, utf8-string, fetchzip, dotenv
 }:
 mkDerivation rec {
@@ -37,6 +37,6 @@ mkDerivation rec {
   preConfigure = "hpack";
   homepage = "https://github.com/channable/vaultenv#readme";
   description = "Runs processes with secrets from HashiCorp Vault";
-  license = stdenv.lib.licenses.bsd3;
-  maintainers = with stdenv.lib.maintainers; [ lnl7 manveru ];
+  license = lib.licenses.bsd3;
+  maintainers = with lib.maintainers; [ lnl7 manveru ];
 }
diff --git a/pkgs/development/tools/hcloud/default.nix b/pkgs/development/tools/hcloud/default.nix
index edaaa9c3a68..5c4fe48f60f 100644
--- a/pkgs/development/tools/hcloud/default.nix
+++ b/pkgs/development/tools/hcloud/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoModule, fetchFromGitHub, installShellFiles }:
+{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles }:
 
 buildGoModule rec {
   pname = "hcloud";
@@ -29,7 +29,7 @@ buildGoModule rec {
   meta = {
     description = "A command-line interface for Hetzner Cloud, a provider for cloud virtual private servers";
     homepage = "https://github.com/hetznercloud/cli";
-    license = stdenv.lib.licenses.mit;
-    maintainers = [ stdenv.lib.maintainers.zauberpony ];
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.zauberpony ];
   };
 }
diff --git a/pkgs/development/tools/hexio/default.nix b/pkgs/development/tools/hexio/default.nix
index 116e7c3a5ce..5b3fca815e6 100644
--- a/pkgs/development/tools/hexio/default.nix
+++ b/pkgs/development/tools/hexio/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, python, pcsclite, pth }:
+{ lib, stdenv, fetchFromGitHub, python, pcsclite, pth }:
 
 stdenv.mkDerivation rec {
   pname = "hexio";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   patchPhase = ''
     substituteInPlace Makefile \
-      --replace '-I/usr/local/include/PCSC/' '-I${stdenv.lib.getDev pcsclite}/include/PCSC/' \
+      --replace '-I/usr/local/include/PCSC/' '-I${lib.getDev pcsclite}/include/PCSC/' \
       --replace '-L/usr/local/lib/pth' '-I${pth}/lib/'
     '';
 
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
     make DESTDIR=$out PREFIX=/ install
     '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Low-level I/O helpers for hexadecimal, tty/serial devices and so on";
     homepage = "https://github.com/vanrein/hexio";
     license = licenses.bsd2;
diff --git a/pkgs/development/tools/iaca/2.1.nix b/pkgs/development/tools/iaca/2.1.nix
index f36e2e48fdf..0fc1dcfbae0 100644
--- a/pkgs/development/tools/iaca/2.1.nix
+++ b/pkgs/development/tools/iaca/2.1.nix
@@ -1,5 +1,5 @@
-{ stdenv, makeWrapper, requireFile, gcc, unzip }:
-with stdenv.lib;
+{ lib, stdenv, makeWrapper, requireFile, gcc, unzip }:
+with lib;
 
 # v2.1: last version with NHM/WSM arch support
 stdenv.mkDerivation {
diff --git a/pkgs/development/tools/iaca/3.0.nix b/pkgs/development/tools/iaca/3.0.nix
index f03f5354422..731b6431717 100644
--- a/pkgs/development/tools/iaca/3.0.nix
+++ b/pkgs/development/tools/iaca/3.0.nix
@@ -1,5 +1,5 @@
-{ stdenv, requireFile, unzip }:
-with stdenv.lib;
+{ lib, stdenv, requireFile, unzip }:
+with lib;
 
 stdenv.mkDerivation {
   name = "iaca-3.0";
diff --git a/pkgs/development/tools/icestorm/default.nix b/pkgs/development/tools/icestorm/default.nix
index 5b07f982aac..2644821529b 100644
--- a/pkgs/development/tools/icestorm/default.nix
+++ b/pkgs/development/tools/icestorm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub
+{ lib, stdenv, fetchFromGitHub
 , pkg-config, libftdi1
 , python3, pypy3
 
@@ -63,8 +63,8 @@ stdenv.mkDerivation rec {
       creating bitstream files.
     '';
     homepage    = "http://www.clifford.at/icestorm/";
-    license     = stdenv.lib.licenses.isc;
-    maintainers = with stdenv.lib.maintainers; [ shell thoughtpolice emily ];
-    platforms   = stdenv.lib.platforms.all;
+    license     = lib.licenses.isc;
+    maintainers = with lib.maintainers; [ shell thoughtpolice emily ];
+    platforms   = lib.platforms.all;
   };
 }
diff --git a/pkgs/development/tools/icr/default.nix b/pkgs/development/tools/icr/default.nix
index 8e549b54f1f..13c4cbe37db 100644
--- a/pkgs/development/tools/icr/default.nix
+++ b/pkgs/development/tools/icr/default.nix
@@ -26,7 +26,7 @@ crystal.buildCrystalPackage rec {
       --prefix PATH : ${lib.makeBinPath [ crystal shards makeWrapper which ]}
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Interactive console for the Crystal programming language";
     homepage = "https://github.com/crystal-community/icr";
     license = licenses.mit;
diff --git a/pkgs/development/tools/imatix_gsl/default.nix b/pkgs/development/tools/imatix_gsl/default.nix
index edba0d686db..ad729923d67 100644
--- a/pkgs/development/tools/imatix_gsl/default.nix
+++ b/pkgs/development/tools/imatix_gsl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, pcre } :
+{ lib, stdenv, fetchFromGitHub, pcre } :
 
 stdenv.mkDerivation {
   pname = "imatix_gsl";
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
   preBuild = "cd src";
   installFlags = [ "DESTDIR=$(out)" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     license = licenses.gpl3Plus;
     homepage = "https://github.com/imatix/gsl/";
     description = "A universal code generator";
diff --git a/pkgs/development/tools/irony-server/default.nix b/pkgs/development/tools/irony-server/default.nix
index cc56b27ca2d..2f8afb176e6 100644
--- a/pkgs/development/tools/irony-server/default.nix
+++ b/pkgs/development/tools/irony-server/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, cmake, llvmPackages, irony }:
+{ lib, stdenv, cmake, llvmPackages, irony }:
 
 stdenv.mkDerivation {
   pname = "irony-server";
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
     "-DCMAKE_PREFIX_PATH=${llvmPackages.clang-unwrapped}"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "The server part of irony";
     homepage = "https://melpa.org/#/irony";
     maintainers = [ maintainers.deepfire ];
diff --git a/pkgs/development/tools/java/cfr/default.nix b/pkgs/development/tools/java/cfr/default.nix
index ce1501fa4dd..35ac0dbc6a5 100644
--- a/pkgs/development/tools/java/cfr/default.nix
+++ b/pkgs/development/tools/java/cfr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, makeWrapper, fetchurl, jre }:
+{ lib, stdenv, makeWrapper, fetchurl, jre }:
 
 stdenv.mkDerivation rec {
   pname = "cfr";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     makeWrapper ${jre}/bin/java $out/bin/cfr --add-flags "-jar $jar"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Another java decompiler";
     longDescription = ''
       CFR will decompile modern Java features - Java 8 lambdas (pre and post
diff --git a/pkgs/development/tools/java/dex2jar/default.nix b/pkgs/development/tools/java/dex2jar/default.nix
index c1f7f132985..b20a80355a0 100644
--- a/pkgs/development/tools/java/dex2jar/default.nix
+++ b/pkgs/development/tools/java/dex2jar/default.nix
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
     done
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = https://sourceforge.net/projects/dex2jar/;
     description = "Tools to work with android .dex and java .class files";
     maintainers = with maintainers; [ makefu ];
diff --git a/pkgs/development/tools/java/fastjar/default.nix b/pkgs/development/tools/java/fastjar/default.nix
index 04fe7c2f46d..52211e302dd 100644
--- a/pkgs/development/tools/java/fastjar/default.nix
+++ b/pkgs/development/tools/java/fastjar/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, zlib }:
+{ fetchurl, lib, stdenv, zlib }:
 
 let version = "0.98"; in
   stdenv.mkDerivation {
@@ -25,8 +25,8 @@ let version = "0.98"; in
 
       homepage = "https://savannah.nongnu.org/projects/fastjar/";
 
-      license = stdenv.lib.licenses.gpl2Plus;
-      platforms = stdenv.lib.platforms.linux;
+      license = lib.licenses.gpl2Plus;
+      platforms = lib.platforms.linux;
       maintainers = [ ];
     };
   }
diff --git a/pkgs/development/tools/java/jhiccup/default.nix b/pkgs/development/tools/java/jhiccup/default.nix
index 1b235e35485..c2d1a33a49d 100644
--- a/pkgs/development/tools/java/jhiccup/default.nix
+++ b/pkgs/development/tools/java/jhiccup/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchzip }:
+{ lib, stdenv, fetchzip }:
 
 stdenv.mkDerivation rec {
   pname = "jhiccup";
@@ -29,8 +29,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Measure JVM application stalls and GC pauses";
     homepage    = "https://www.azul.com/jhiccup/";
-    license     = stdenv.lib.licenses.cc0;
-    platforms   = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ thoughtpolice ];
+    license     = lib.licenses.cc0;
+    platforms   = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ thoughtpolice ];
   };
 }
diff --git a/pkgs/development/tools/java/visualvm/default.nix b/pkgs/development/tools/java/visualvm/default.nix
index 4c0ec3bc29d..52ccc3d9150 100644
--- a/pkgs/development/tools/java/visualvm/default.nix
+++ b/pkgs/development/tools/java/visualvm/default.nix
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
     cp -r . $out
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A visual interface for viewing information about Java applications";
     longDescription = ''
       VisualVM is a visual tool integrating several commandline JDK
diff --git a/pkgs/development/tools/jbake/default.nix b/pkgs/development/tools/jbake/default.nix
index 44d537f9762..97d1c753682 100644
--- a/pkgs/development/tools/jbake/default.nix
+++ b/pkgs/development/tools/jbake/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchzip, makeWrapper, jre }:
+{ lib, stdenv, fetchzip, makeWrapper, jre }:
 
 stdenv.mkDerivation rec {
   version = "2.6.5";
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   '';
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Java based, open source, static site/blog generator for developers & designers";
     homepage = "https://jbake.org/";
     license = licenses.mit;
diff --git a/pkgs/development/tools/jbang/default.nix b/pkgs/development/tools/jbang/default.nix
index 11f22fbef3f..b161b1d137c 100644
--- a/pkgs/development/tools/jbang/default.nix
+++ b/pkgs/development/tools/jbang/default.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
     $out/bin/jbang --version 2>&1 | grep -q "${version}"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Run java as scripts anywhere";
     longDescription = ''
       jbang uses the java language to build scripts similar to groovy scripts. Dependencies are automatically
diff --git a/pkgs/development/tools/jd/default.nix b/pkgs/development/tools/jd/default.nix
index b03fd7a0028..772e2802ff5 100644
--- a/pkgs/development/tools/jd/default.nix
+++ b/pkgs/development/tools/jd/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchgit }:
+{ lib, stdenv, buildGoPackage, fetchgit }:
 
 buildGoPackage rec {
   pname = "jd";
@@ -13,7 +13,7 @@ buildGoPackage rec {
     sha256 = "0dj4k38pf80dl77jns29vx2dj265s4ksg2q2s9n240b7b8z8mn5h";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Interactive JSON Editor";
     license = licenses.mit;
     maintainers = [ maintainers.np ];
diff --git a/pkgs/development/tools/jid/default.nix b/pkgs/development/tools/jid/default.nix
index e6eef68ec6c..5e4e3df6942 100644
--- a/pkgs/development/tools/jid/default.nix
+++ b/pkgs/development/tools/jid/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "jid";
@@ -18,7 +18,7 @@ buildGoPackage rec {
   meta = {
     description = "A command-line tool to incrementally drill down JSON";
     homepage = "https://github.com/simeji/jid";
-    license = stdenv.lib.licenses.mit;
-    maintainers = with stdenv.lib.maintainers; [ stesie ];
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ stesie ];
   };
 }
diff --git a/pkgs/development/tools/jira_cli/default.nix b/pkgs/development/tools/jira_cli/default.nix
index 4040debf15e..7b7647da033 100644
--- a/pkgs/development/tools/jira_cli/default.nix
+++ b/pkgs/development/tools/jira_cli/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, libffi, openssl, python3Packages }:
+{ lib, stdenv, libffi, openssl, python3Packages }:
 let
   inherit (python3Packages) fetchPypi buildPythonApplication vcrpy mock hiro;
 in
@@ -23,7 +23,7 @@ in
       jira  keyrings-alt
     ];
 
-    meta = with stdenv.lib; {
+    meta = with lib; {
       description = "A command line interface to Jira";
       homepage = "https://github.com/alisaifee/jira-cli";
       maintainers = with maintainers; [ nyarly ];
diff --git a/pkgs/development/tools/jl/default.nix b/pkgs/development/tools/jl/default.nix
index 9a1314a6083..e0bf896c149 100644
--- a/pkgs/development/tools/jl/default.nix
+++ b/pkgs/development/tools/jl/default.nix
@@ -1,6 +1,6 @@
 { mkDerivation, fetchFromGitHub, fetchpatch
 , aeson, aeson-pretty, attoparsec, base, bytestring, conduit, conduit-extra
-, containers, exceptions, mtl, optparse-simple, parsec, scientific, stdenv
+, containers, exceptions, mtl, optparse-simple, parsec, scientific, lib, stdenv
 , text, unordered-containers, vector
 }:
 mkDerivation rec {
@@ -30,8 +30,8 @@ mkDerivation rec {
     aeson aeson-pretty base bytestring conduit conduit-extra containers
     mtl optparse-simple text vector
   ];
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
   description = "Functional sed for JSON";
-  maintainers = with stdenv.lib.maintainers; [ fgaz ];
+  maintainers = with lib.maintainers; [ fgaz ];
   homepage = "https://github.com/chrisdone/jl";
 }
diff --git a/pkgs/development/tools/jmespath/default.nix b/pkgs/development/tools/jmespath/default.nix
index 5414c51a00c..f5a7092e60f 100644
--- a/pkgs/development/tools/jmespath/default.nix
+++ b/pkgs/development/tools/jmespath/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "jmespath";
@@ -13,7 +13,7 @@ buildGoPackage rec {
     repo = "go-jmespath";
     sha256 = "0f4j0m44limnjd6q5fk152g6jq2a5cshcdms4p3a1br8pl9wp5fb";
   };
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A JMESPath implementation in Go";
     homepage = "https://github.com/jmespath/go-jmespath";
     maintainers = with maintainers; [ cransom ];
diff --git a/pkgs/development/tools/jo/default.nix b/pkgs/development/tools/jo/default.nix
index c3553a5b501..653867956ff 100644
--- a/pkgs/development/tools/jo/default.nix
+++ b/pkgs/development/tools/jo/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchFromGitHub, autoreconfHook, pandoc, pkg-config}:
+{lib, stdenv, fetchFromGitHub, autoreconfHook, pandoc, pkg-config}:
 
 stdenv.mkDerivation rec {
   pname = "jo";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoreconfHook pandoc pkg-config ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A small utility to create JSON objects";
     homepage = "https://github.com/jpmens/jo";
     license = licenses.gpl2Plus;
diff --git a/pkgs/development/tools/jp/default.nix b/pkgs/development/tools/jp/default.nix
index f05c788dabe..d8d703feed3 100644
--- a/pkgs/development/tools/jp/default.nix
+++ b/pkgs/development/tools/jp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "jp";
@@ -13,7 +13,7 @@ buildGoPackage rec {
     repo = "jp";
     sha256 = "0fdbnihbd0kq56am3bmh2zrfk4fqjslcbm48malbgmpqw3a5nvpi";
   };
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A command line interface to the JMESPath expression language for JSON";
     homepage = "https://github.com/jmespath/jp";
     maintainers = with maintainers; [ cransom ];
diff --git a/pkgs/development/tools/jq/default.nix b/pkgs/development/tools/jq/default.nix
index 63c7e01a4b8..e8fe27aae09 100644
--- a/pkgs/development/tools/jq/default.nix
+++ b/pkgs/development/tools/jq/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, nixosTests, fetchurl, oniguruma }:
+{ lib, stdenv, nixosTests, fetchurl, oniguruma }:
 
 stdenv.mkDerivation rec {
   pname = "jq";
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     "--mandir=\${man}/share/man"
   ]
   # jq is linked to libjq:
-    ++ stdenv.lib.optional (!stdenv.isDarwin) "LDFLAGS=-Wl,-rpath,\\\${libdir}";
+    ++ lib.optional (!stdenv.isDarwin) "LDFLAGS=-Wl,-rpath,\\\${libdir}";
 
   doInstallCheck = true;
   installCheckTarget = "check";
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
 
   passthru.tests = { inherit (nixosTests) jq; };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A lightweight and flexible command-line JSON processor";
     license = licenses.mit;
     maintainers = with maintainers; [ raskin globin ];
diff --git a/pkgs/development/tools/just/default.nix b/pkgs/development/tools/just/default.nix
index 05b2b50f26f..bbdd1bd016d 100644
--- a/pkgs/development/tools/just/default.nix
+++ b/pkgs/development/tools/just/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, rustPlatform, coreutils, bash, installShellFiles }:
+{ lib, stdenv, fetchFromGitHub, rustPlatform, coreutils, bash, installShellFiles }:
 
 rustPlatform.buildRustPackage rec {
   pname = "just";
@@ -42,7 +42,7 @@ rustPlatform.buildRustPackage rec {
   # Skip "choose" when running "cargo test", since this test case needs "fzf".
   checkFlags = [ "--skip=choose" "--skip=edit" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A handy way to save and run project-specific commands";
     homepage = "https://github.com/casey/just";
     license = licenses.cc0;
diff --git a/pkgs/development/tools/k6/default.nix b/pkgs/development/tools/k6/default.nix
index 35972f9cce5..6eb99291f8f 100644
--- a/pkgs/development/tools/k6/default.nix
+++ b/pkgs/development/tools/k6/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "k6";
@@ -15,7 +15,7 @@ buildGoPackage rec {
 
   subPackages = [ "./" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A modern load testing tool, using Go and JavaScript";
     homepage = "https://k6.io/";
     changelog = "https://github.com/loadimpact/k6/releases/tag/v${version}";
diff --git a/pkgs/development/tools/kafkacat/default.nix b/pkgs/development/tools/kafkacat/default.nix
index 01323281dfe..e297de7a0db 100644
--- a/pkgs/development/tools/kafkacat/default.nix
+++ b/pkgs/development/tools/kafkacat/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, pkg-config, zlib, rdkafka, yajl }:
+{ lib, stdenv, fetchFromGitHub, pkg-config, zlib, rdkafka, yajl }:
 
 stdenv.mkDerivation rec {
   pname = "kafkacat";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
     patchShebangs ./configure
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A generic non-JVM producer and consumer for Apache Kafka";
     homepage = "https://github.com/edenhill/kafkacat";
     license = licenses.bsd2;
diff --git a/pkgs/development/tools/kind/default.nix b/pkgs/development/tools/kind/default.nix
index 55f0a0e9f30..3fff2aae1f4 100644
--- a/pkgs/development/tools/kind/default.nix
+++ b/pkgs/development/tools/kind/default.nix
@@ -1,19 +1,19 @@
-{ stdenv, buildGoModule, fetchFromGitHub, installShellFiles }:
+{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles }:
 
-with stdenv.lib;
+with lib;
 
 buildGoModule rec {
   pname = "kind";
-  version = "0.9.0";
+  version = "0.10.0";
 
   src = fetchFromGitHub {
     rev    = "v${version}";
     owner  = "kubernetes-sigs";
     repo   = "kind";
-    sha256 = "1kyjmlp1kmr3lwylnya6w392j1qpqgbvcacwpnz3ifyh3pbv32qr";
+    sha256 = "1pp2x4bfqsd15siahyv9xkdyswsipmp9n86iwavrd0xhliqxlsa7";
   };
 
-  vendorSha256 = "04fmqh6lhvvzpvf1l2xk1r8687k5jx2lb5199rgmjbfnjgsa0q2d";
+  vendorSha256 = "0c0j4s8kfzk2b3hy0d2g5bp1zr60l6vnwnpynsg6ksv8spwnpl5m";
 
   doCheck = false;
 
@@ -31,7 +31,7 @@ buildGoModule rec {
     description = "Kubernetes IN Docker - local clusters for testing Kubernetes";
     homepage    = "https://github.com/kubernetes-sigs/kind";
     maintainers = with maintainers; [ offline rawkode ];
-    license     = stdenv.lib.licenses.asl20;
+    license     = lib.licenses.asl20;
     platforms   = platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/krew/default.nix b/pkgs/development/tools/krew/default.nix
index 8e5d9d76fc4..7449d6df38e 100644
--- a/pkgs/development/tools/krew/default.nix
+++ b/pkgs/development/tools/krew/default.nix
@@ -19,7 +19,7 @@ buildGoModule rec {
     description = "Package manager for kubectl plugins";
     homepage = "https://github.com/kubernetes-sigs/krew";
     maintainers = with maintainers; [ vdemeester ];
-    license = stdenv.lib.licenses.asl20;
+    license = lib.licenses.asl20;
     platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/ktlint/default.nix b/pkgs/development/tools/ktlint/default.nix
index 7e71c08ec4b..4abe6b6d17f 100644
--- a/pkgs/development/tools/ktlint/default.nix
+++ b/pkgs/development/tools/ktlint/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper, jre_headless }:
+{ lib, stdenv, fetchurl, makeWrapper, jre_headless }:
 
 stdenv.mkDerivation rec {
   pname = "ktlint";
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     wrapProgram $out/bin/ktlint --prefix PATH : "${jre_headless}/bin"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An anti-bikeshedding Kotlin linter with built-in formatter";
     homepage = "https://ktlint.github.io/";
     license = licenses.mit;
diff --git a/pkgs/development/tools/kubectx/default.nix b/pkgs/development/tools/kubectx/default.nix
index 59a7c8300e2..f2186709e83 100644
--- a/pkgs/development/tools/kubectx/default.nix
+++ b/pkgs/development/tools/kubectx/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoModule, fetchFromGitHub, installShellFiles }:
+{ lib, stdenv, buildGoModule, fetchFromGitHub, installShellFiles }:
 
 buildGoModule rec {
   pname = "kubectx";
@@ -21,7 +21,7 @@ buildGoModule rec {
     installShellCompletion completion/*
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Fast way to switch between clusters and namespaces in kubectl!";
     license = licenses.asl20;
     homepage = "https://github.com/ahmetb/kubectx";
diff --git a/pkgs/development/tools/kubicorn/default.nix b/pkgs/development/tools/kubicorn/default.nix
index 67e170f6e25..f0985277a25 100644
--- a/pkgs/development/tools/kubicorn/default.nix
+++ b/pkgs/development/tools/kubicorn/default.nix
@@ -1,10 +1,10 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
-with stdenv.lib;
+with lib;
 
 buildGoPackage rec {
   pname = "kubicorn";
-  version = "2018-10-13-${stdenv.lib.strings.substring 0 7 rev}";
+  version = "2018-10-13-${lib.strings.substring 0 7 rev}";
   rev = "4c7f3623e9188fba43778271afe161a4facfb657";
 
   src = fetchFromGitHub {
@@ -20,7 +20,7 @@ buildGoPackage rec {
   meta = {
     description = "Simple, cloud native infrastructure for Kubernetes";
     homepage = "http://kubicorn.io/";
-    maintainers = with stdenv.lib.maintainers; [ offline ];
-    license = stdenv.lib.licenses.asl20;
+    maintainers = with lib.maintainers; [ offline ];
+    license = lib.licenses.asl20;
   };
 }
diff --git a/pkgs/development/tools/kubie/default.nix b/pkgs/development/tools/kubie/default.nix
index 33d4ea0df1d..8a199f9191c 100644
--- a/pkgs/development/tools/kubie/default.nix
+++ b/pkgs/development/tools/kubie/default.nix
@@ -15,7 +15,7 @@ rustPlatform.buildRustPackage rec {
 
   nativeBuildInputs = [ installShellFiles ];
 
-  buildInputs = stdenv.lib.optionals stdenv.isDarwin [ Security ];
+  buildInputs = lib.optionals stdenv.isDarwin [ Security ];
 
   postInstall = ''
     installShellCompletion completion/kubie.bash
diff --git a/pkgs/development/tools/kythe/default.nix b/pkgs/development/tools/kythe/default.nix
index 601634b3184..f6a4c2e6c1e 100644
--- a/pkgs/development/tools/kythe/default.nix
+++ b/pkgs/development/tools/kythe/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, binutils , fetchurl, ncurses5 }:
+{ lib, stdenv, binutils , fetchurl, ncurses5 }:
 
 stdenv.mkDerivation rec {
   version = "0.0.30";
@@ -23,14 +23,14 @@ stdenv.mkDerivation rec {
                 write_entries write_tables entrystream; do
       echo "Patching:" $exe
       patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" $exe
-      patchelf --set-rpath "${stdenv.lib.makeLibraryPath [ stdenv.cc.cc ncurses5 ]}" $exe
+      patchelf --set-rpath "${lib.makeLibraryPath [ stdenv.cc.cc ncurses5 ]}" $exe
     done
     cd ../
     cp -R ./ $out
     ln -s $out/tools $out/bin
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A pluggable, (mostly) language-agnostic ecosystem for building tools that work with code";
     longDescription = ''
     The Kythe project was founded to provide and support tools and standards
diff --git a/pkgs/development/tools/lattice-diamond/default.nix b/pkgs/development/tools/lattice-diamond/default.nix
index 6720603b2e5..4c94ff1e6e2 100644
--- a/pkgs/development/tools/lattice-diamond/default.nix
+++ b/pkgs/development/tools/lattice-diamond/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, rpmextract, patchelf, makeWrapper, file, requireFile, glib, zlib, 
+{ lib, stdenv, rpmextract, patchelf, makeWrapper, file, requireFile, glib, zlib, 
     freetype, fontconfig, xorg, libusb-compat-0_1 }:
 
 stdenv.mkDerivation {
@@ -95,7 +95,7 @@ stdenv.mkDerivation {
     done
   '';
 
-  libPath = stdenv.lib.makeLibraryPath [
+  libPath = lib.makeLibraryPath [
     glib zlib freetype fontconfig
     xorg.libSM xorg.libICE xorg.libXrender xorg.libXext xorg.libX11 xorg.libXt
     libusb-compat-0_1
@@ -109,8 +109,8 @@ stdenv.mkDerivation {
       next-generation replacement for ispLEVER.
     '';
     homepage = "http://www.latticesemi.com/latticediamond";
-    license = stdenv.lib.licenses.unfree;
-    maintainers = with stdenv.lib.maintainers; [ q3k ];
+    license = lib.licenses.unfree;
+    maintainers = with lib.maintainers; [ q3k ];
     platforms = [ "x86_64-linux" ];
   };
 }
diff --git a/pkgs/development/tools/lazygit/default.nix b/pkgs/development/tools/lazygit/default.nix
index 1ede21609b4..1e8ebb0d087 100644
--- a/pkgs/development/tools/lazygit/default.nix
+++ b/pkgs/development/tools/lazygit/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoModule, fetchFromGitHub }:
+{ lib, stdenv, buildGoModule, fetchFromGitHub }:
 
 buildGoModule rec {
   pname = "lazygit";
@@ -16,7 +16,7 @@ buildGoModule rec {
 
   buildFlagsArray = [ "-ldflags=-X main.version=${version} -X main.buildSource=nix" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Simple terminal UI for git commands";
     homepage = "https://github.com/jesseduffield/lazygit";
     changelog = "https://github.com/jesseduffield/lazygit/releases/tag/v${version}";
diff --git a/pkgs/development/tools/leaps/default.nix b/pkgs/development/tools/leaps/default.nix
index bb8673d4d56..e68542e584f 100644
--- a/pkgs/development/tools/leaps/default.nix
+++ b/pkgs/development/tools/leaps/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "leaps";
@@ -19,7 +19,7 @@ buildGoPackage rec {
     description = "A pair programming tool and library written in Golang";
     homepage = "https://github.com/jeffail/leaps/";
     license = "MIT";
-    maintainers = with stdenv.lib.maintainers; [ qknight ];
-    platforms = stdenv.lib.platforms.unix;
+    maintainers = with lib.maintainers; [ qknight ];
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/libsigrok/default.nix b/pkgs/development/tools/libsigrok/default.nix
index 0846cc9d87a..7f32b0bd716 100644
--- a/pkgs/development/tools/libsigrok/default.nix
+++ b/pkgs/development/tools/libsigrok/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, libzip, glib, libusb1, libftdi1, check
+{ lib, stdenv, fetchurl, pkg-config, libzip, glib, libusb1, libftdi1, check
 , libserialport, librevisa, doxygen, glibmm, python
 , version ? "0.5.1", sha256 ? "171b553dir5gn6w4f7n37waqk62nq2kf1jykx4ifjacdz5xdw3z4"
 }:
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
     tar --strip-components=1 -xvf "${firmware}" -C "$out/share/sigrok-firmware/"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Core library of the sigrok signal analysis software suite";
     homepage = "https://sigrok.org/";
     license = licenses.gpl3Plus;
diff --git a/pkgs/development/tools/libsigrokdecode/default.nix b/pkgs/development/tools/libsigrokdecode/default.nix
index d97afa5604f..cb3b3040596 100644
--- a/pkgs/development/tools/libsigrokdecode/default.nix
+++ b/pkgs/development/tools/libsigrokdecode/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, glib, python3, libsigrok, check }:
+{ lib, stdenv, fetchurl, pkg-config, glib, python3, libsigrok, check }:
 
 stdenv.mkDerivation rec {
   name = "libsigrokdecode-0.5.3";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkg-config ];
   buildInputs = [ glib python3 libsigrok check ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Protocol decoding library for the sigrok signal analysis software suite";
     homepage = "https://sigrok.org/";
     license = licenses.gpl3Plus;
diff --git a/pkgs/development/tools/literate-programming/Literate/default.nix b/pkgs/development/tools/literate-programming/Literate/default.nix
index 428e6e444a2..87213b911a9 100644
--- a/pkgs/development/tools/literate-programming/Literate/default.nix
+++ b/pkgs/development/tools/literate-programming/Literate/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, dmd, dub }:
+{ lib, stdenv, fetchgit, dmd, dub }:
 
 stdenv.mkDerivation {
   pname = "Literate";
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
 
   installPhase = "install -D bin/lit $out/bin/lit";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A literate programming tool for any language";
     homepage    = "http://literate.zbyedidia.webfactional.com/";
     license = licenses.mit;
diff --git a/pkgs/development/tools/literate-programming/eweb/default.nix b/pkgs/development/tools/literate-programming/eweb/default.nix
index 82805af5804..caacc04903e 100644
--- a/pkgs/development/tools/literate-programming/eweb/default.nix
+++ b/pkgs/development/tools/literate-programming/eweb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, python3, asciidoc }:
+{ lib, stdenv, fetchurl, python3, asciidoc }:
 
 stdenv.mkDerivation rec {
   pname = "eweb";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     cp etangle.w etangle.html $out/share/doc/${pname}-${version}
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://eweb.sourceforge.net/";
     description = "An Asciidoc-based literate programming tool, written in Python";
     platforms = platforms.linux;
diff --git a/pkgs/development/tools/literate-programming/funnelweb/default.nix b/pkgs/development/tools/literate-programming/funnelweb/default.nix
index 9d27351f15d..53b7f208e81 100644
--- a/pkgs/development/tools/literate-programming/funnelweb/default.nix
+++ b/pkgs/development/tools/literate-programming/funnelweb/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
 
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     install fw $out/bin/fw
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     version = "3.20";
     description = "A simple, reliable literate-programming macro preprocessor";
     homepage = "http://www.ross.net/funnelweb/";
diff --git a/pkgs/development/tools/literate-programming/noweb/default.nix b/pkgs/development/tools/literate-programming/noweb/default.nix
index 52586939c1d..5d4441ecfbb 100644
--- a/pkgs/development/tools/literate-programming/noweb/default.nix
+++ b/pkgs/development/tools/literate-programming/noweb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, gawk, groff, icon-lang ? null }:
+{ lib, stdenv, fetchFromGitHub, gawk, groff, icon-lang ? null }:
 
 let noweb = stdenv.mkDerivation rec {
   pname = "noweb";
@@ -13,17 +13,17 @@ let noweb = stdenv.mkDerivation rec {
 
   patches = [ ./no-FAQ.patch ];
 
-  nativeBuildInputs = [ groff ] ++ stdenv.lib.optionals (!isNull icon-lang) [ icon-lang ];
+  nativeBuildInputs = [ groff ] ++ lib.optionals (!isNull icon-lang) [ icon-lang ];
 
   preBuild = ''
     mkdir -p "$out/lib/noweb"
     cd src
   '';
 
-  makeFlags = stdenv.lib.optionals (!isNull icon-lang) [
+  makeFlags = lib.optionals (!isNull icon-lang) [
     "LIBSRC=icon"
     "ICONC=icont"
-  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+  ] ++ lib.optionals stdenv.isDarwin [
     "CC=clang"
   ];
 
@@ -70,7 +70,7 @@ let noweb = stdenv.mkDerivation rec {
   tlType = "run";
   passthru.pkgs = [ noweb.tex ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A simple, extensible literate-programming tool";
     homepage = "https://www.cs.tufts.edu/~nr/noweb";
     license = licenses.bsd2;
diff --git a/pkgs/development/tools/literate-programming/nuweb/default.nix b/pkgs/development/tools/literate-programming/nuweb/default.nix
index 1f4fba681c3..37deaacb216 100644
--- a/pkgs/development/tools/literate-programming/nuweb/default.nix
+++ b/pkgs/development/tools/literate-programming/nuweb/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, tex}:
+{lib, stdenv, fetchurl, tex}:
 
 stdenv.mkDerivation rec {
 
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
     cp htdocs/index.html nuweb.w nuweb.pdf nuwebdoc.pdf README $out/share/doc/${pname}-${version}
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A simple literate programming tool";
     homepage = "http://nuweb.sourceforge.net";
     license = licenses.free;
diff --git a/pkgs/development/tools/makerpm/default.nix b/pkgs/development/tools/makerpm/default.nix
index 1577392c8bc..5b7fc83df40 100644
--- a/pkgs/development/tools/makerpm/default.nix
+++ b/pkgs/development/tools/makerpm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, zlib, libarchive, openssl }:
+{ lib, stdenv, fetchFromGitHub, zlib, libarchive, openssl }:
 
 stdenv.mkDerivation rec {
   version = "1.0";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     sha256 = "089dkbh5705ppyi920rd0ksjc0143xmvnhm8qrx93rsgwc1ggi1y";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/ivan-tkatchev/makerpm/";
     description = "A clean, simple RPM packager reimplemented completely from scratch";
     license = licenses.free;
diff --git a/pkgs/development/tools/manul/default.nix b/pkgs/development/tools/manul/default.nix
index 71010149a92..4265c2a7450 100644
--- a/pkgs/development/tools/manul/default.nix
+++ b/pkgs/development/tools/manul/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage {
   name = "manul-unstable-2016-09-30";
@@ -16,7 +16,7 @@ buildGoPackage {
   deleteVendor = true;
   goDeps = ./deps.nix;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "The madness vendoring utility for Golang programs";
     homepage = "https://github.com/kovetskiy/manul";
     license = licenses.mit;
diff --git a/pkgs/development/tools/mdk/default.nix b/pkgs/development/tools/mdk/default.nix
index d6f34a0a9d2..6db4395a14f 100644
--- a/pkgs/development/tools/mdk/default.nix
+++ b/pkgs/development/tools/mdk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, intltool, pkg-config, glib }:
+{ lib, stdenv, fetchurl, intltool, pkg-config, glib }:
 
 stdenv.mkDerivation {
   name = "gnu-mdk-1.3.0";
@@ -16,7 +16,7 @@ stdenv.mkDerivation {
   meta = {
     description = "GNU MIX Development Kit (MDK)";
     homepage = "https://www.gnu.org/software/mdk/";
-    license = stdenv.lib.licenses.gpl3;
-    platforms = stdenv.lib.platforms.all;
+    license = lib.licenses.gpl3;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/development/tools/minizinc/default.nix b/pkgs/development/tools/minizinc/default.nix
index bcaa3e56507..4e5f3947262 100644
--- a/pkgs/development/tools/minizinc/default.nix
+++ b/pkgs/development/tools/minizinc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fetchpatch, cmake, flex, bison }:
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, flex, bison }:
 let
   version = "2.4.3";
 in
@@ -34,7 +34,7 @@ stdenv.mkDerivation {
     })
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.minizinc.org/";
     description = "A medium-level constraint modelling language";
 
diff --git a/pkgs/development/tools/minizinc/ide.nix b/pkgs/development/tools/minizinc/ide.nix
index aedf2ab881d..7709423e676 100644
--- a/pkgs/development/tools/minizinc/ide.nix
+++ b/pkgs/development/tools/minizinc/ide.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, qtbase, qtwebengine, qtwebkit, qmake, makeWrapper, minizinc }:
+{ lib, stdenv, fetchFromGitHub, qtbase, qtwebengine, qtwebkit, qmake, makeWrapper, minizinc }:
 let
   version = "2.4.3";
 in
@@ -21,10 +21,10 @@ stdenv.mkDerivation {
   enableParallelBuilding = true;
 
   postInstall = ''
-    wrapProgram $out/bin/MiniZincIDE --prefix PATH ":" ${stdenv.lib.makeBinPath [ minizinc ]}
+    wrapProgram $out/bin/MiniZincIDE --prefix PATH ":" ${lib.makeBinPath [ minizinc ]}
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.minizinc.org/";
     description = "IDE for MiniZinc, a medium-level constraint modelling language";
 
diff --git a/pkgs/development/tools/misc/abi-compliance-checker/default.nix b/pkgs/development/tools/misc/abi-compliance-checker/default.nix
index c95a340181c..c4dda95a7f2 100644
--- a/pkgs/development/tools/misc/abi-compliance-checker/default.nix
+++ b/pkgs/development/tools/misc/abi-compliance-checker/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, ctags, perl, binutils, abi-dumper }:
+{ lib, stdenv, fetchFromGitHub, ctags, perl, binutils, abi-dumper }:
 
 stdenv.mkDerivation rec {
   pname = "abi-compliance-checker";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   makeFlags = [ "prefix=$(out)" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://lvc.github.io/abi-compliance-checker";
     description = "A tool for checking backward API/ABI compatibility of a C/C++ library";
     license = licenses.lgpl21;
diff --git a/pkgs/development/tools/misc/abi-dumper/default.nix b/pkgs/development/tools/misc/abi-dumper/default.nix
index dc2a6d00b5f..6dd2bf41ba6 100644
--- a/pkgs/development/tools/misc/abi-dumper/default.nix
+++ b/pkgs/development/tools/misc/abi-dumper/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, ctags, perl, elfutils, vtable-dumper }:
+{ lib, stdenv, fetchFromGitHub, ctags, perl, elfutils, vtable-dumper }:
 
 stdenv.mkDerivation rec {
   pname = "abi-dumper";
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   preBuild = "mkdir -p $out";
   makeFlags = [ "prefix=$(out)" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/lvc/abi-dumper";
     description = "Dump ABI of an ELF object containing DWARF debug info";
     license = licenses.lgpl21;
diff --git a/pkgs/development/tools/misc/arcanist/default.nix b/pkgs/development/tools/misc/arcanist/default.nix
index 14ef09ee7ed..a5a9d724a79 100644
--- a/pkgs/development/tools/misc/arcanist/default.nix
+++ b/pkgs/development/tools/misc/arcanist/default.nix
@@ -2,7 +2,7 @@
 , fetchFromGitHub
 , flex
 , php
-, stdenv
+, lib, stdenv
 }:
 
 # Make a custom wrapper. If `wrapProgram` is used, arcanist thinks .arc-wrapped is being
@@ -31,7 +31,7 @@ stdenv.mkDerivation {
   };
   buildInputs = [ bison flex php ];
 
-  postPatch = stdenv.lib.optionalString stdenv.isAarch64 ''
+  postPatch = lib.optionalString stdenv.isAarch64 ''
     substituteInPlace support/xhpast/Makefile \
       --replace "-minline-all-stringops" ""
   '';
@@ -60,8 +60,8 @@ stdenv.mkDerivation {
   meta = {
     description = "Command line interface to Phabricator";
     homepage = "http://phabricator.org";
-    license = stdenv.lib.licenses.asl20;
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
+    license = lib.licenses.asl20;
+    platforms = lib.platforms.unix;
+    maintainers = [ lib.maintainers.thoughtpolice ];
   };
 }
diff --git a/pkgs/development/tools/misc/argbash/default.nix b/pkgs/development/tools/misc/argbash/default.nix
index 3efff500943..57105050814 100644
--- a/pkgs/development/tools/misc/argbash/default.nix
+++ b/pkgs/development/tools/misc/argbash/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoconf, runtimeShell, python3Packages, makeWrapper }:
+{ lib, stdenv, fetchFromGitHub, autoconf, runtimeShell, python3Packages, makeWrapper }:
 
 stdenv.mkDerivation rec {
   pname = "argbash";
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
       --prefix PATH : '${autoconf}/bin'
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Bash argument parsing code generator";
     homepage = "https://argbash.io/";
     license = licenses.free; # custom license.  See LICENSE in source repo.
diff --git a/pkgs/development/tools/misc/asls/default.nix b/pkgs/development/tools/misc/asls/default.nix
index 0e08acdeb45..bccda018503 100644
--- a/pkgs/development/tools/misc/asls/default.nix
+++ b/pkgs/development/tools/misc/asls/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , erlangR22
 }:
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ erlangR22 ];
   installPhase = "install -Dm755 -t $out/bin asls";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "AssemblyScript Language Server";
     homepage = "https://github.com/saulecabrera/asls";
     license = licenses.mit;
diff --git a/pkgs/development/tools/misc/autobuild/default.nix b/pkgs/development/tools/misc/autobuild/default.nix
index 05afa379f99..da387105cef 100644
--- a/pkgs/development/tools/misc/autobuild/default.nix
+++ b/pkgs/development/tools/misc/autobuild/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, makeWrapper, perl, openssh, rsync }:
+{ fetchurl, lib, stdenv, makeWrapper, perl, openssh, rsync }:
 
 stdenv.mkDerivation rec {
   name = "autobuild-5.3";
@@ -29,6 +29,6 @@ stdenv.mkDerivation rec {
     '';
 
     homepage = "https://josefsson.org/autobuild/";
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
   };
 }
diff --git a/pkgs/development/tools/misc/autoconf-archive/default.nix b/pkgs/development/tools/misc/autoconf-archive/default.nix
index f002346c994..e0d558b1880 100644
--- a/pkgs/development/tools/misc/autoconf-archive/default.nix
+++ b/pkgs/development/tools/misc/autoconf-archive/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, xz }:
+{ lib, stdenv, fetchurl, xz }:
 
 stdenv.mkDerivation rec {
   pname = "autoconf-archive";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ xz ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Archive of autoconf m4 macros";
     homepage = "https://www.gnu.org/software/autoconf-archive/";
     license = licenses.gpl3;
diff --git a/pkgs/development/tools/misc/autoconf/2.13.nix b/pkgs/development/tools/misc/autoconf/2.13.nix
index 424dff8541b..e5280d46b59 100644
--- a/pkgs/development/tools/misc/autoconf/2.13.nix
+++ b/pkgs/development/tools/misc/autoconf/2.13.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, m4, perl, lzma}:
+{lib, stdenv, fetchurl, m4, perl, lzma}:
 
 stdenv.mkDerivation rec {
   name = "autoconf-2.13";
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
       can use, in the form of M4 macro calls.
     '';
 
-    license = stdenv.lib.licenses.gpl2Plus;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/misc/autoconf/2.64.nix b/pkgs/development/tools/misc/autoconf/2.64.nix
index 1fd18bcb12a..6976a291ae7 100644
--- a/pkgs/development/tools/misc/autoconf/2.64.nix
+++ b/pkgs/development/tools/misc/autoconf/2.64.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, m4, perl }:
+{ lib, stdenv, fetchurl, m4, perl }:
 
 stdenv.mkDerivation rec {
   name = "autoconf-2.64";
@@ -44,8 +44,8 @@ stdenv.mkDerivation rec {
       can use, in the form of M4 macro calls.
     '';
 
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
 
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/development/tools/misc/autoconf/2.69.nix b/pkgs/development/tools/misc/autoconf/2.69.nix
index 500d80d4bb8..f2f8ca0a858 100644
--- a/pkgs/development/tools/misc/autoconf/2.69.nix
+++ b/pkgs/development/tools/misc/autoconf/2.69.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, m4, perl }:
+{ lib, stdenv, fetchurl, m4, perl }:
 
 stdenv.mkDerivation rec {
   name = "autoconf-2.69";
@@ -45,8 +45,8 @@ stdenv.mkDerivation rec {
       can use, in the form of M4 macro calls.
     '';
 
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
 
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/development/tools/misc/autoconf/default.nix b/pkgs/development/tools/misc/autoconf/default.nix
index 57a92cee737..ae8fc2d9061 100644
--- a/pkgs/development/tools/misc/autoconf/default.nix
+++ b/pkgs/development/tools/misc/autoconf/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, m4, perl }:
+{ lib, stdenv, fetchurl, m4, perl }:
 
 # Note: this package is used for bootstrapping fetchurl, and thus
 # cannot use fetchpatch! All mutable patches (generated by GitHub or
@@ -47,8 +47,8 @@ stdenv.mkDerivation rec {
       can use, in the form of M4 macro calls.
     '';
 
-    license = stdenv.lib.licenses.gpl3Plus;
+    license = lib.licenses.gpl3Plus;
 
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/development/tools/misc/autogen/default.nix b/pkgs/development/tools/misc/autogen/default.nix
index 1bf3a0c2832..c6eb6916d1e 100644
--- a/pkgs/development/tools/misc/autogen/default.nix
+++ b/pkgs/development/tools/misc/autogen/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildPackages, fetchurl, autoreconfHook, which, pkg-config, perl, guile, libxml2 }:
+{ lib, stdenv, buildPackages, fetchurl, autoreconfHook, which, pkg-config, perl, guile, libxml2 }:
 
 stdenv.mkDerivation rec {
   pname = "autogen";
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     which pkg-config perl autoreconfHook/*patches applied*/
-  ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+  ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     # autogen needs a build autogen when cross-compiling
     buildPackages.buildPackages.autogen buildPackages.texinfo
   ];
@@ -56,7 +56,7 @@ stdenv.mkDerivation rec {
       # Debian: https://salsa.debian.org/debian/autogen/-/blob/master/debian/rules#L21
       "--enable-timeout=78"
     ]
-    ++ (stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+    ++ (lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
       "--with-libxml2=${libxml2.dev}"
       "--with-libxml2-cflags=-I${libxml2.dev}/include/libxml2"
       # the configure check for regcomp wants to run a host program
@@ -76,7 +76,7 @@ stdenv.mkDerivation rec {
       sed -e "s|$lib/lib|/no-such-autogen-lib-path|" -i $f
     done
 
-  '' + stdenv.lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
+  '' + lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
     # remove /build/** from RPATHs
     for f in "$bin"/bin/*; do
       local nrp="$(patchelf --print-rpath "$f" | sed -E 's@(:|^)/build/[^:]*:@\1@g')"
@@ -84,7 +84,7 @@ stdenv.mkDerivation rec {
     done
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Automated text and program generation tool";
     license = with licenses; [ gpl3Plus lgpl3Plus ];
     homepage = "https://www.gnu.org/software/autogen/";
diff --git a/pkgs/development/tools/misc/automake/automake-1.11.x.nix b/pkgs/development/tools/misc/automake/automake-1.11.x.nix
index b79f3047889..5e3167d182d 100644
--- a/pkgs/development/tools/misc/automake/automake-1.11.x.nix
+++ b/pkgs/development/tools/misc/automake/automake-1.11.x.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, autoconf }:
+{ lib, stdenv, fetchurl, perl, autoconf }:
 
 stdenv.mkDerivation rec {
   name = "automake-1.11.6";
@@ -42,8 +42,8 @@ stdenv.mkDerivation rec {
       Standards.  Automake requires the use of Autoconf.
     '';
 
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
 
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/development/tools/misc/automake/automake-1.15.x.nix b/pkgs/development/tools/misc/automake/automake-1.15.x.nix
index bf0967e9ddb..0088eb74cc4 100644
--- a/pkgs/development/tools/misc/automake/automake-1.15.x.nix
+++ b/pkgs/development/tools/misc/automake/automake-1.15.x.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, autoconf }:
+{ lib, stdenv, fetchurl, perl, autoconf }:
 
 stdenv.mkDerivation rec {
   name = "automake-1.15.1";
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
     branch = "1.15";
     homepage = "https://www.gnu.org/software/automake/";
     description = "GNU standard-compliant makefile generator";
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
 
     longDescription = ''
       GNU Automake is a tool for automatically generating
@@ -40,6 +40,6 @@ stdenv.mkDerivation rec {
       Standards.  Automake requires the use of Autoconf.
     '';
 
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/development/tools/misc/automake/automake-1.16.x.nix b/pkgs/development/tools/misc/automake/automake-1.16.x.nix
index 58c559fcc56..48f01f8d0f6 100644
--- a/pkgs/development/tools/misc/automake/automake-1.16.x.nix
+++ b/pkgs/development/tools/misc/automake/automake-1.16.x.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, autoconf }:
+{ lib, stdenv, fetchurl, perl, autoconf }:
 
 stdenv.mkDerivation rec {
   name = "automake-1.16.3";
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
     branch = "1.16";
     homepage = "https://www.gnu.org/software/automake/";
     description = "GNU standard-compliant makefile generator";
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
 
     longDescription = ''
       GNU Automake is a tool for automatically generating
@@ -38,6 +38,6 @@ stdenv.mkDerivation rec {
       Standards.  Automake requires the use of Autoconf.
     '';
 
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/development/tools/misc/automoc4/default.nix b/pkgs/development/tools/misc/automoc4/default.nix
index 22942e2a658..ac027ec4530 100644
--- a/pkgs/development/tools/misc/automoc4/default.nix
+++ b/pkgs/development/tools/misc/automoc4/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, qt4 }:
+{ lib, stdenv, fetchurl, cmake, qt4 }:
 
 stdenv.mkDerivation rec {
   pname = "automoc4";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake ];
   buildInputs = [ qt4 ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://techbase.kde.org/Development/Tools/Automoc4";
     description = "KDE Meta Object Compiler";
     license = licenses.bsd2;
diff --git a/pkgs/development/tools/misc/avrdude/default.nix b/pkgs/development/tools/misc/avrdude/default.nix
index bb0520cf28e..4d95310c342 100644
--- a/pkgs/development/tools/misc/avrdude/default.nix
+++ b/pkgs/development/tools/misc/avrdude/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, yacc, flex, libusb-compat-0_1, libelf, libftdi1, readline
+{ lib, stdenv, fetchurl, yacc, flex, libusb-compat-0_1, libelf, libftdi1, readline
 # docSupport is a big dependency, disabled by default
 , docSupport ? false, texLive ? null, texinfo ? null, texi2html ? null
 }:
@@ -13,12 +13,12 @@ stdenv.mkDerivation rec {
     sha256 = "15m1w1qad3dj7r8n5ng1qqcaiyx1gyd6hnc3p2apgjllccdp77qg";
   };
 
-  configureFlags = stdenv.lib.optionals docSupport "--enable-doc";
+  configureFlags = lib.optionals docSupport "--enable-doc";
 
   buildInputs = [ yacc flex libusb-compat-0_1 libelf libftdi1 readline ]
-    ++ stdenv.lib.optionals docSupport [ texLive texinfo texi2html ];
+    ++ lib.optionals docSupport [ texLive texinfo texi2html ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Command-line tool for programming Atmel AVR microcontrollers";
     longDescription = ''
       AVRDUDE (AVR Downloader/UploaDEr) is an utility to
diff --git a/pkgs/development/tools/misc/awf/default.nix b/pkgs/development/tools/misc/awf/default.nix
index 24a04550428..b73f1dc0450 100644
--- a/pkgs/development/tools/misc/awf/default.nix
+++ b/pkgs/development/tools/misc/awf/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, gtk2, gtk3, pkg-config
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, gtk2, gtk3, pkg-config
 , wrapGAppsHook }:
 
 stdenv.mkDerivation rec {
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     ./autogen.sh
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A Widget Factory";
     longDescription = ''
       A widget factory is a theme preview application for gtk2 and
diff --git a/pkgs/development/tools/misc/babeltrace/default.nix b/pkgs/development/tools/misc/babeltrace/default.nix
index e768bdde146..26c484017d2 100644
--- a/pkgs/development/tools/misc/babeltrace/default.nix
+++ b/pkgs/development/tools/misc/babeltrace/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, glib, libuuid, popt, elfutils }:
+{ lib, stdenv, fetchurl, pkg-config, glib, libuuid, popt, elfutils }:
 
 stdenv.mkDerivation rec {
   name = "babeltrace-1.5.8";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkg-config ];
   buildInputs = [ glib libuuid popt elfutils ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Command-line tool and library to read and convert LTTng tracefiles";
     homepage = "https://www.efficios.com/babeltrace";
     license = licenses.mit;
diff --git a/pkgs/development/tools/misc/bashdb/default.nix b/pkgs/development/tools/misc/bashdb/default.nix
index 0897960f6aa..72ec8c96be3 100644
--- a/pkgs/development/tools/misc/bashdb/default.nix
+++ b/pkgs/development/tools/misc/bashdb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper, python3Packages }:
+{ lib, stdenv, fetchurl, makeWrapper, python3Packages }:
 
 stdenv.mkDerivation rec {
   pname = "bashdb";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Bash script debugger";
     homepage = "http://bashdb.sourceforge.net/";
-    license = stdenv.lib.licenses.gpl2;
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/pkgs/development/tools/misc/bin_replace_string/default.nix b/pkgs/development/tools/misc/bin_replace_string/default.nix
index 8fc809f0f0c..a732d6e732c 100644
--- a/pkgs/development/tools/misc/bin_replace_string/default.nix
+++ b/pkgs/development/tools/misc/bin_replace_string/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libelf, txt2man }:
+{ lib, stdenv, fetchurl, libelf, txt2man }:
 
 stdenv.mkDerivation {
   pname = "bin_replace_string";
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Edit precompiled binaries";
     longDescription = ''
       bin_replace_string edits C-style strings in precompiled binaries. This is
diff --git a/pkgs/development/tools/misc/bossa/default.nix b/pkgs/development/tools/misc/bossa/default.nix
index 38cc2867650..bb14e26bfd9 100644
--- a/pkgs/development/tools/misc/bossa/default.nix
+++ b/pkgs/development/tools/misc/bossa/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, wxGTK, libX11, readline }:
+{ lib, stdenv, fetchgit, wxGTK, libX11, readline }:
 
 let
   # BOSSA needs a "bin2c" program to embed images.
@@ -36,7 +36,7 @@ stdenv.mkDerivation {
     cp bin/bossa{c,sh,} $out/bin/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A flash programming utility for Atmel's SAM family of flash-based ARM microcontrollers";
     longDescription = ''
       BOSSA is a flash programming utility for Atmel's SAM family of
diff --git a/pkgs/development/tools/misc/bsdbuild/default.nix b/pkgs/development/tools/misc/bsdbuild/default.nix
index 6491ff83ec7..e3bfc958437 100644
--- a/pkgs/development/tools/misc/bsdbuild/default.nix
+++ b/pkgs/development/tools/misc/bsdbuild/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, libtool, pkg-config, gettext, mandoc, ed }:
+{ lib, stdenv, fetchurl, perl, libtool, pkg-config, gettext, mandoc, ed }:
 
 stdenv.mkDerivation rec {
   pname = "bsdbuild";
@@ -62,7 +62,7 @@ EOF
       directory, BSDBuild will produce the required Makefiles in place).
     '';
 
-    license = stdenv.lib.licenses.bsd3;
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.bsd3;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/pkgs/development/tools/misc/cbrowser/default.nix b/pkgs/development/tools/misc/cbrowser/default.nix
index f3ba4b3a70d..0f7edeea812 100644
--- a/pkgs/development/tools/misc/cbrowser/default.nix
+++ b/pkgs/development/tools/misc/cbrowser/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, tk, makeWrapper }:
+{ fetchurl, lib, stdenv, tk, makeWrapper }:
 
 stdenv.mkDerivation rec {
   name = "cbrowser-0.8";
@@ -23,12 +23,12 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Tcl/Tk GUI front-end to cscope";
 
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
 
     homepage = "https://sourceforge.net/projects/cbrowser/";
 
-    maintainers = with stdenv.lib.maintainers; [viric];
+    maintainers = with lib.maintainers; [viric];
 
-    platforms = with stdenv.lib.platforms; linux;
+    platforms = with lib.platforms; linux;
   };
 }
diff --git a/pkgs/development/tools/misc/cc-tool/default.nix b/pkgs/development/tools/misc/cc-tool/default.nix
index 6be0ab2acb5..e2a511a0e32 100644
--- a/pkgs/development/tools/misc/cc-tool/default.nix
+++ b/pkgs/development/tools/misc/cc-tool/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , autoreconfHook
 , boost
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     install -D udev/90-cc-debugger.rules $out/lib/udev/rules.d/90-cc-debugger.rules
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Command line tool for the Texas Instruments CC Debugger";
     longDescription = ''
       cc-tool provides support for Texas Instruments CC Debugger
diff --git a/pkgs/development/tools/misc/ccache/default.nix b/pkgs/development/tools/misc/ccache/default.nix
index f9254b2cf15..655807d9506 100644
--- a/pkgs/development/tools/misc/ccache/default.nix
+++ b/pkgs/development/tools/misc/ccache/default.nix
@@ -60,7 +60,7 @@ let ccache = stdenv.mkDerivation rec {
           local cname="$1"
           if [ -x "${unwrappedCC}/bin/$cname" ]; then
             makeWrapper ${ccache}/bin/ccache $out/bin/$cname \
-              --run ${stdenv.lib.escapeShellArg extraConfig} \
+              --run ${lib.escapeShellArg extraConfig} \
               --add-flags ${unwrappedCC}/bin/$cname
           fi
         }
@@ -84,7 +84,7 @@ let ccache = stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Compiler cache for fast recompilation of C/C++ code";
     homepage = "https://ccache.dev";
     downloadPage = "https://ccache.dev/download.html";
diff --git a/pkgs/development/tools/misc/ccls/default.nix b/pkgs/development/tools/misc/ccls/default.nix
index 16365a462a9..40b53ca6934 100644
--- a/pkgs/development/tools/misc/ccls/default.nix
+++ b/pkgs/development/tools/misc/ccls/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub
+{ lib, stdenv, fetchFromGitHub
 , cmake, llvmPackages, rapidjson, runtimeShell }:
 
 stdenv.mkDerivation rec {
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   postFixup = ''
     # We need to tell ccls where to find the standard library headers.
 
-    standard_library_includes="\\\"-isystem\\\", \\\"${stdenv.lib.getDev stdenv.cc.libc}/include\\\""
+    standard_library_includes="\\\"-isystem\\\", \\\"${lib.getDev stdenv.cc.libc}/include\\\""
     standard_library_includes+=", \\\"-isystem\\\", \\\"${llvmPackages.libcxx}/include/c++/v1\\\""
     export standard_library_includes
 
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
     chmod --reference=$out/bin/$wrapped $out/bin/ccls
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A c/c++ language server powered by clang";
     homepage    = "https://github.com/MaskRay/ccls";
     license     = licenses.asl20;
diff --git a/pkgs/development/tools/misc/cflow/default.nix b/pkgs/development/tools/misc/cflow/default.nix
index 8c271bd7673..b9e75d7cb2a 100644
--- a/pkgs/development/tools/misc/cflow/default.nix
+++ b/pkgs/development/tools/misc/cflow/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gettext, emacs }:
+{ lib, stdenv, fetchurl, gettext, emacs }:
 
 stdenv.mkDerivation rec {
   name = "cflow-1.6";
@@ -16,14 +16,14 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ gettext ] ++
     # We don't have Emacs/GTK/etc. on {Dar,Cyg}win.
-    stdenv.lib.optional
-      (! (stdenv.lib.lists.any (x: stdenv.hostPlatform.system == x)
+    lib.optional
+      (! (lib.lists.any (x: stdenv.hostPlatform.system == x)
               [ "i686-cygwin" ]))
       emacs;
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Tool to analyze the control flow of C programs";
 
     longDescription = ''
diff --git a/pkgs/development/tools/misc/cgdb/default.nix b/pkgs/development/tools/misc/cgdb/default.nix
index a863cec1d4c..0e92d373c0b 100644
--- a/pkgs/development/tools/misc/cgdb/default.nix
+++ b/pkgs/development/tools/misc/cgdb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ncurses, readline, flex, texinfo }:
+{ lib, stdenv, fetchurl, ncurses, readline, flex, texinfo }:
 
 stdenv.mkDerivation rec {
   pname = "cgdb";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ ncurses readline flex texinfo ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A curses interface to gdb";
 
     homepage = "https://cgdb.github.io/";
diff --git a/pkgs/development/tools/misc/checkbashisms/default.nix b/pkgs/development/tools/misc/checkbashisms/default.nix
index 86ac37ee491..524abbfdc90 100644
--- a/pkgs/development/tools/misc/checkbashisms/default.nix
+++ b/pkgs/development/tools/misc/checkbashisms/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl }:
+{ lib, stdenv, fetchurl, perl }:
 stdenv.mkDerivation rec {
   version = "2.0.0.2";
   pname = "checkbashisms";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://sourceforge.net/projects/checkbaskisms/";
     description = "Check shell scripts for non-portable syntax";
-    license = stdenv.lib.licenses.gpl2;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/misc/chrpath/default.nix b/pkgs/development/tools/misc/chrpath/default.nix
index 7e08157d7bd..ff804f897d1 100644
--- a/pkgs/development/tools/misc/chrpath/default.nix
+++ b/pkgs/development/tools/misc/chrpath/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation {
   name = "chrpath-0.16";
@@ -8,7 +8,7 @@ stdenv.mkDerivation {
     sha256 = "0yvfq891mcdkf8g18gjjkn2m5rvs8z4z4cl1vwdhx6f2p9a4q3dv";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Command line tool to adjust the RPATH or RUNPATH of ELF binaries";
     longDescription = ''
       chrpath changes, lists or removes the rpath or runpath setting in a
diff --git a/pkgs/development/tools/misc/circleci-cli/default.nix b/pkgs/development/tools/misc/circleci-cli/default.nix
index 441aae58269..73ea64f1d62 100644
--- a/pkgs/development/tools/misc/circleci-cli/default.nix
+++ b/pkgs/development/tools/misc/circleci-cli/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, buildGoModule }:
+{ lib, stdenv, fetchFromGitHub, buildGoModule }:
 
 buildGoModule rec {
   pname = "circleci-cli";
@@ -26,7 +26,7 @@ buildGoModule rec {
     install -Dm644 -t $out/share/circleci-cli _data/data.yml
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     # Box blurb edited from the AUR package circleci-cli
     description = ''
       Command to enable you to reproduce the CircleCI environment locally and
diff --git a/pkgs/development/tools/misc/cl-launch/default.nix b/pkgs/development/tools/misc/cl-launch/default.nix
index c245a32a06d..1d3a36c5773 100644
--- a/pkgs/development/tools/misc/cl-launch/default.nix
+++ b/pkgs/development/tools/misc/cl-launch/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 let
   s = # Generated upstream information
   rec {
@@ -31,8 +31,8 @@ stdenv.mkDerivation {
   meta = {
     inherit (s) version;
     description = ''Common Lisp launcher script'';
-    license = stdenv.lib.licenses.llgpl21 ;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.llgpl21 ;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/misc/cli11/default.nix b/pkgs/development/tools/misc/cli11/default.nix
index de01ab93090..03c3e51cb89 100644
--- a/pkgs/development/tools/misc/cli11/default.nix
+++ b/pkgs/development/tools/misc/cli11/default.nix
@@ -1,5 +1,5 @@
 {
-  stdenv,
+  lib, stdenv,
   fetchFromGitHub,
   cmake,
   gtest,
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
     sed -i '/TrueFalseTest/d' tests/CMakeLists.txt
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Command line parser for C++11";
     homepage = "https://github.com/CLIUtils/CLI11";
     platforms = platforms.unix;
diff --git a/pkgs/development/tools/misc/clojure-lsp/default.nix b/pkgs/development/tools/misc/clojure-lsp/default.nix
index 16f5c4063be..af435d417ce 100644
--- a/pkgs/development/tools/misc/clojure-lsp/default.nix
+++ b/pkgs/development/tools/misc/clojure-lsp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, jre, makeWrapper }:
+{ lib, stdenv, fetchurl, jre, makeWrapper }:
 
 stdenv.mkDerivation rec {
   pname = "clojure-lsp";
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
       --add-flags "-jar $out/share/java/${pname}.jar"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Language Server Protocol (LSP) for Clojure";
     homepage = "https://github.com/snoe/clojure-lsp";
     license = licenses.mit;
diff --git a/pkgs/development/tools/misc/coccinelle/default.nix b/pkgs/development/tools/misc/coccinelle/default.nix
index 43392b2a89c..40a22f18203 100644
--- a/pkgs/development/tools/misc/coccinelle/default.nix
+++ b/pkgs/development/tools/misc/coccinelle/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, python, ncurses, ocamlPackages, pkg-config }:
+{ fetchurl, lib, stdenv, python, ncurses, ocamlPackages, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "coccinelle";
@@ -50,8 +50,8 @@ stdenv.mkDerivation rec {
     '';
 
     homepage = "http://coccinelle.lip6.fr/";
-    license = stdenv.lib.licenses.gpl2;
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.unix;
+    maintainers = [ lib.maintainers.thoughtpolice ];
   };
 }
diff --git a/pkgs/development/tools/misc/complexity/default.nix b/pkgs/development/tools/misc/complexity/default.nix
index 71ed762df04..6e70fbcfcde 100644
--- a/pkgs/development/tools/misc/complexity/default.nix
+++ b/pkgs/development/tools/misc/complexity/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, autogen }:
+{ fetchurl, lib, stdenv, autogen }:
 
 stdenv.mkDerivation rec {
   pname = "complexity";
@@ -22,11 +22,11 @@ stdenv.mkDerivation rec {
          addresses several issues not considered in that scoring scheme.
       '';
 
-    license = stdenv.lib.licenses.gpl3Plus;
+    license = lib.licenses.gpl3Plus;
 
     homepage = "https://www.gnu.org/software/complexity/";
 
-    platforms = stdenv.lib.platforms.gnu ++ stdenv.lib.platforms.linux;
+    platforms = lib.platforms.gnu ++ lib.platforms.linux;
     maintainers = [ ];
   };
 }
diff --git a/pkgs/development/tools/misc/cppi/default.nix b/pkgs/development/tools/misc/cppi/default.nix
index 8de7391b9ec..9fe5ed96672 100644
--- a/pkgs/development/tools/misc/cppi/default.nix
+++ b/pkgs/development/tools/misc/cppi/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv }:
+{ fetchurl, lib, stdenv }:
 
 stdenv.mkDerivation rec {
   name = "cppi-1.18";
@@ -23,9 +23,9 @@ stdenv.mkDerivation rec {
          to the level of nesting of that directive.
       '';
 
-    license = stdenv.lib.licenses.gpl3Plus;
+    license = lib.licenses.gpl3Plus;
 
     maintainers = [ ];
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/development/tools/misc/cproto/default.nix b/pkgs/development/tools/misc/cproto/default.nix
index e18196fe595..5ee1a64f2c2 100644
--- a/pkgs/development/tools/misc/cproto/default.nix
+++ b/pkgs/development/tools/misc/cproto/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, flex, bison }:
+{ lib, stdenv, fetchurl, flex, bison }:
 
 stdenv.mkDerivation rec {
   pname = "cproto";
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
     [ "$("$out/bin/cproto" -V 2>&1)" = '${version}' ]
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Tool to generate C function prototypes from C source code";
     homepage = "https://invisible-island.net/cproto/";
     license = licenses.publicDomain;
diff --git a/pkgs/development/tools/misc/creduce/default.nix b/pkgs/development/tools/misc/creduce/default.nix
index 7bc4aca3d9d..75234fde6ca 100644
--- a/pkgs/development/tools/misc/creduce/default.nix
+++ b/pkgs/development/tools/misc/creduce/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, makeWrapper
+{ lib, stdenv, fetchurl, cmake, makeWrapper
 , llvm, clang-unwrapped
 , flex
 , zlib
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
   # On Linux, c-reduce's preferred way to reason about
   # the cpu architecture/topology is to use 'lscpu',
   # so let's make sure it knows where to find it:
-  postPatch = stdenv.lib.optionalString stdenv.isLinux ''
+  postPatch = lib.optionalString stdenv.isLinux ''
     substituteInPlace creduce/creduce_utils.pm --replace \
       lscpu ${util-linux}/bin/lscpu
   '';
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
     wrapProgram $out/bin/creduce --prefix PERL5LIB : "$PERL5LIB"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A C program reducer";
     homepage = "https://embed.cs.utah.edu/creduce";
     # Officially, the license is: https://github.com/csmith-project/creduce/blob/master/COPYING
diff --git a/pkgs/development/tools/misc/cscope/default.nix b/pkgs/development/tools/misc/cscope/default.nix
index 31d4e83663b..7eb38e385e8 100644
--- a/pkgs/development/tools/misc/cscope/default.nix
+++ b/pkgs/development/tools/misc/cscope/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, ncurses
+{ fetchurl, lib, stdenv, ncurses
 , emacsSupport ? true, emacs
 }:
 
@@ -13,9 +13,9 @@ stdenv.mkDerivation rec {
   configureFlags = [ "--with-ncurses=${ncurses.dev}" ];
 
   buildInputs = [ ncurses ];
-  nativeBuildInputs = stdenv.lib.optional emacsSupport emacs;
+  nativeBuildInputs = lib.optional emacsSupport emacs;
 
-  postInstall = stdenv.lib.optionalString emacsSupport ''
+  postInstall = lib.optionalString emacsSupport ''
     cd "contrib/xcscope"
 
     sed -i "cscope-indexer" \
@@ -46,8 +46,8 @@ stdenv.mkDerivation rec {
 
     homepage = "http://cscope.sourceforge.net/";
 
-    maintainers = with stdenv.lib.maintainers; [viric];
+    maintainers = with lib.maintainers; [viric];
 
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/misc/csmith/default.nix b/pkgs/development/tools/misc/csmith/default.nix
index 253dd4065e4..0643e81edf9 100644
--- a/pkgs/development/tools/misc/csmith/default.nix
+++ b/pkgs/development/tools/misc/csmith/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, m4, makeWrapper, libbsd, perlPackages }:
+{ lib, stdenv, fetchurl, m4, makeWrapper, libbsd, perlPackages }:
 
 stdenv.mkDerivation rec {
   pname = "csmith";
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A random generator of C programs";
     homepage = "https://embed.cs.utah.edu/csmith";
     # Officially, the license is this: https://github.com/csmith-project/csmith/blob/master/COPYING
diff --git a/pkgs/development/tools/misc/ctags/default.nix b/pkgs/development/tools/misc/ctags/default.nix
index 3adca34a5bb..90825db2a54 100644
--- a/pkgs/development/tools/misc/ctags/default.nix
+++ b/pkgs/development/tools/misc/ctags/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchsvn, autoreconfHook }:
+{ lib, stdenv, fetchsvn, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   name = "ctags-${revision}";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   # don't use $T(E)MP which is set to the build directory
   configureFlags= [ "--enable-tmpdir=/tmp" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A tool for fast source code browsing (exuberant ctags)";
     longDescription = ''
       Ctags generates an index (or tag) file of language objects found
diff --git a/pkgs/development/tools/misc/cwebbin/default.nix b/pkgs/development/tools/misc/cwebbin/default.nix
index 0b89156d71a..3ab8800f3c4 100644
--- a/pkgs/development/tools/misc/cwebbin/default.nix
+++ b/pkgs/development/tools/misc/cwebbin/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fetchurl, tie }:
+{ lib, stdenv, fetchFromGitHub, fetchurl, tie }:
 
 stdenv.mkDerivation rec {
   pname = "cwebbin";
@@ -41,7 +41,7 @@ stdenv.mkDerivation rec {
     make -f Makefile.unix install $makeFlags
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit (src.meta) homepage;
     description = "Literate Programming in C/C++";
     platforms = with platforms; unix;
diff --git a/pkgs/development/tools/misc/d-feet/default.nix b/pkgs/development/tools/misc/d-feet/default.nix
index 6ee366ae2c6..60d3c5c4539 100644
--- a/pkgs/development/tools/misc/d-feet/default.nix
+++ b/pkgs/development/tools/misc/d-feet/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , pkg-config
 , fetchurl
 , meson
@@ -21,7 +21,7 @@ python3.pkgs.buildPythonApplication rec {
   format = "other";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/d-feet/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/d-feet/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1cgxgpj546jgpyns6z9nkm5k48lid8s36mvzj8ydkjqws2d19zqz";
   };
 
@@ -68,7 +68,7 @@ python3.pkgs.buildPythonApplication rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "D-Feet is an easy to use D-Bus debugger";
     longDescription = ''
       D-Feet can be used to inspect D-Bus interfaces of running programs
diff --git a/pkgs/development/tools/misc/dbench/default.nix b/pkgs/development/tools/misc/dbench/default.nix
index 49fb1efbd4a..9565eaa3626 100644
--- a/pkgs/development/tools/misc/dbench/default.nix
+++ b/pkgs/development/tools/misc/dbench/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, autoconf, popt, zlib, rpcsvc-proto, libtirpc }:
+{ lib, stdenv, fetchgit, autoconf, popt, zlib, rpcsvc-proto, libtirpc }:
 
 stdenv.mkDerivation {
   name = "dbench-2013-01-01";
@@ -35,7 +35,7 @@ stdenv.mkDerivation {
     ln -s dbench/doc/dbench/loadfiles $out/share/loadfiles
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Filesystem benchmark tool based on load patterns";
     homepage = "https://dbench.samba.org/";
     license = licenses.gpl3;
diff --git a/pkgs/development/tools/misc/ddd/default.nix b/pkgs/development/tools/misc/ddd/default.nix
index 174168b7db7..74eb9fcb293 100644
--- a/pkgs/development/tools/misc/ddd/default.nix
+++ b/pkgs/development/tools/misc/ddd/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, motif, ncurses, libX11, libXt}:
+{lib, stdenv, fetchurl, motif, ncurses, libX11, libXt}:
 
 stdenv.mkDerivation rec {
   name = "ddd-3.3.12";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://www.gnu.org/software/ddd";
     description = "Graphical front-end for command-line debuggers";
-    license = stdenv.lib.licenses.gpl2;
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/pkgs/development/tools/misc/dejagnu/default.nix b/pkgs/development/tools/misc/dejagnu/default.nix
index 73e2ab8ef92..285805ccb02 100644
--- a/pkgs/development/tools/misc/dejagnu/default.nix
+++ b/pkgs/development/tools/misc/dejagnu/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, expect, makeWrapper }:
+{ fetchurl, lib, stdenv, expect, makeWrapper }:
 
 stdenv.mkDerivation rec {
   name = "dejagnu-1.6.2";
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
       --prefix PATH ":" "${expect}/bin"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Framework for testing other programs";
 
     longDescription = ''
diff --git a/pkgs/development/tools/misc/dfu-programmer/default.nix b/pkgs/development/tools/misc/dfu-programmer/default.nix
index 1aaf113d0b9..f0a3a9b7600 100644
--- a/pkgs/development/tools/misc/dfu-programmer/default.nix
+++ b/pkgs/development/tools/misc/dfu-programmer/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libusb-compat-0_1 }:
+{ lib, stdenv, fetchurl, libusb-compat-0_1 }:
 let
   version = "0.7.2";
 in
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   configureFlags = [ "--disable-libusb_1_0" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     license = licenses.gpl2;
     description = "A Device Firmware Update based USB programmer for Atmel chips with a USB bootloader";
     homepage = "http://dfu-programmer.sourceforge.net/";
diff --git a/pkgs/development/tools/misc/dfu-util/default.nix b/pkgs/development/tools/misc/dfu-util/default.nix
index c570b1a7997..85917a114c0 100644
--- a/pkgs/development/tools/misc/dfu-util/default.nix
+++ b/pkgs/development/tools/misc/dfu-util/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, libusb1 }:
+{ lib, stdenv, fetchurl, pkg-config, libusb1 }:
 
 stdenv.mkDerivation rec {
   pname = "dfu-util";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "0hlvc47ccf5hry13saqhc1j5cdq5jyjv4i05kj0mdh3rzj6wagd0";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Device firmware update (DFU) USB programmer";
     longDescription = ''
       dfu-util is a program that implements the host (PC) side of the USB
diff --git a/pkgs/development/tools/misc/dialog/default.nix b/pkgs/development/tools/misc/dialog/default.nix
index c56620e3105..97db1b5b7e8 100644
--- a/pkgs/development/tools/misc/dialog/default.nix
+++ b/pkgs/development/tools/misc/dialog/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl
+{ lib, stdenv, fetchurl
 , ncurses
 , withLibrary ? false, libtool
 , unicodeSupport ? true
@@ -24,14 +24,14 @@ stdenv.mkDerivation rec {
 
   configureFlags = [
     "--disable-rpath-hacks"
-    (stdenv.lib.withFeature withLibrary "libtool")
-    "--with-ncurses${stdenv.lib.optionalString unicodeSupport "w"}"
-    "--with-libtool-opts=${stdenv.lib.optionalString enableShared "-shared"}"
+    (lib.withFeature withLibrary "libtool")
+    "--with-ncurses${lib.optionalString unicodeSupport "w"}"
+    "--with-libtool-opts=${lib.optionalString enableShared "-shared"}"
   ];
 
-  installTargets = [ "install${stdenv.lib.optionalString withLibrary "-full"}" ];
+  installTargets = [ "install${lib.optionalString withLibrary "-full"}" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://invisible-island.net/dialog/dialog.html";
     description = "Display dialog boxes from shell";
     license = licenses.lgpl21Plus;
diff --git a/pkgs/development/tools/misc/direvent/default.nix b/pkgs/development/tools/misc/direvent/default.nix
index 0ae1884646d..3477d60b784 100644
--- a/pkgs/development/tools/misc/direvent/default.nix
+++ b/pkgs/development/tools/misc/direvent/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 }:
 
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "0m9vi01b1km0cpknflyzsjnknbava0s1n6393b2bpjwyvb6j5613";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Directory event monitoring daemon";
     homepage = "https://www.gnu.org.ua/software/direvent/";
     license = licenses.gpl3Plus;
diff --git a/pkgs/development/tools/misc/distcc/default.nix b/pkgs/development/tools/misc/distcc/default.nix
index 8a315a61e98..cad9fe0960b 100644
--- a/pkgs/development/tools/misc/distcc/default.nix
+++ b/pkgs/development/tools/misc/distcc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, popt, avahi, pkg-config, python, gtk2, runCommand
+{ lib, stdenv, fetchFromGitHub, popt, avahi, pkg-config, python, gtk2, runCommand
 , gcc, autoconf, automake, which, procps, libiberty_static
 , runtimeShell
 , sysconfDir ? ""   # set this parameter to override the default value $out/etc
@@ -76,8 +76,8 @@ let
       homepage = "http://distcc.org";
       license = "GPL";
 
-      platforms = stdenv.lib.platforms.linux;
-      maintainers = with stdenv.lib.maintainers; [ anderspapitto ];
+      platforms = lib.platforms.linux;
+      maintainers = with lib.maintainers; [ anderspapitto ];
     };
   };
 in
diff --git a/pkgs/development/tools/misc/distcc/masq.nix b/pkgs/development/tools/misc/distcc/masq.nix
index f3bccde8160..2387ab1bd41 100644
--- a/pkgs/development/tools/misc/distcc/masq.nix
+++ b/pkgs/development/tools/misc/distcc/masq.nix
@@ -1,4 +1,4 @@
-{ stdenv, gccRaw, binutils }:
+{ lib, stdenv, gccRaw, binutils }:
 
 stdenv.mkDerivation {
   name = "distcc-masq-${gccRaw.name}";
@@ -39,6 +39,6 @@ stdenv.mkDerivation {
   '';
 
   meta = {
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/pkgs/development/tools/misc/doclifter/default.nix b/pkgs/development/tools/misc/doclifter/default.nix
index a1528cfca3e..8b771788111 100644
--- a/pkgs/development/tools/misc/doclifter/default.nix
+++ b/pkgs/development/tools/misc/doclifter/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, python}:
+{lib, stdenv, fetchurl, python}:
 
 stdenv.mkDerivation {
   name = "doclifter-2.19";
@@ -21,6 +21,6 @@ stdenv.mkDerivation {
     description = "Lift documents in nroff markups to XML-DocBook";
     homepage = "http://www.catb.org/esr/doclifter";
     license = "BSD";
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/misc/docopts/default.nix b/pkgs/development/tools/misc/docopts/default.nix
index 98a24ca5ebe..3614270574e 100644
--- a/pkgs/development/tools/misc/docopts/default.nix
+++ b/pkgs/development/tools/misc/docopts/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "docopts";
@@ -21,7 +21,7 @@ buildGoPackage rec {
     install -D -m 755 ./go/src/$goPackagePath/docopts.sh $out/bin/docopts.sh
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/docopt/${pname}";
     description = "docopt CLI tool for shell scripting";
     license = licenses.mit;
diff --git a/pkgs/development/tools/misc/drush/default.nix b/pkgs/development/tools/misc/drush/default.nix
index d5c345d9d22..32d9975e332 100644
--- a/pkgs/development/tools/misc/drush/default.nix
+++ b/pkgs/development/tools/misc/drush/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchurl, php73, which, makeWrapper, bash, coreutils, ncurses }:
+{ lib, stdenv, fetchurl, php73, which, makeWrapper, bash, coreutils, ncurses }:
 
 stdenv.mkDerivation rec {
   name = "drush-6.1.0";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Command-line shell and Unix scripting interface for Drupal";
     homepage    = "https://github.com/drush-ops/drush";
     license     = licenses.gpl2;
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
     mkdir -p "$out"
     cp -r . "$out/src"
     mkdir "$out/bin"
-    wrapProgram "$out/src/drush" --prefix PATH : "${stdenv.lib.makeBinPath [ which php73 bash coreutils ncurses ]}"
+    wrapProgram "$out/src/drush" --prefix PATH : "${lib.makeBinPath [ which php73 bash coreutils ncurses ]}"
     ln -s "$out/src/drush" "$out/bin/drush"
   '';
 }
diff --git a/pkgs/development/tools/misc/editorconfig-core-c/default.nix b/pkgs/development/tools/misc/editorconfig-core-c/default.nix
index e563ff203a2..de5c1e070fd 100644
--- a/pkgs/development/tools/misc/editorconfig-core-c/default.nix
+++ b/pkgs/development/tools/misc/editorconfig-core-c/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, cmake, pcre, doxygen }:
+{ lib, stdenv, fetchgit, cmake, pcre, doxygen }:
 
 stdenv.mkDerivation rec {
   name = "editorconfig-core-c-${meta.version}";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   # parallel: https://bugzilla.gnome.org/show_bug.cgi?id=791153
   enableParallelBuilding = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://editorconfig.org/";
     description = "EditorConfig core library written in C";
     longDescription = ''
diff --git a/pkgs/development/tools/misc/eggdbus/default.nix b/pkgs/development/tools/misc/eggdbus/default.nix
index 198bbabb19f..5a5267510d7 100644
--- a/pkgs/development/tools/misc/eggdbus/default.nix
+++ b/pkgs/development/tools/misc/eggdbus/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, glib, dbus, dbus-glib }:
+{ lib, stdenv, fetchurl, pkg-config, glib, dbus, dbus-glib }:
 
 stdenv.mkDerivation rec {
   name = "eggdbus-0.6";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkg-config ];
   buildInputs = [ glib dbus dbus-glib ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://hal.freedesktop.org/releases/";
     description = "D-Bus bindings for GObject";
     platforms = platforms.linux;
diff --git a/pkgs/development/tools/misc/elfinfo/default.nix b/pkgs/development/tools/misc/elfinfo/default.nix
index 3778793b71c..cd19e263f0a 100644
--- a/pkgs/development/tools/misc/elfinfo/default.nix
+++ b/pkgs/development/tools/misc/elfinfo/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "elfinfo";
@@ -12,7 +12,7 @@ buildGoPackage rec {
     sha256 = "1n8bg0rcq9fqa6rdnk6x9ngvm59hcayblkpjv9j5myn2vmm6fv8m";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Small utility for showing information about ELF files";
     homepage = "https://elfinfo.roboticoverlords.org/";
     license = licenses.mit;
diff --git a/pkgs/development/tools/misc/elfkickers/default.nix b/pkgs/development/tools/misc/elfkickers/default.nix
index e8992b62665..e60b40c7fd4 100644
--- a/pkgs/development/tools/misc/elfkickers/default.nix
+++ b/pkgs/development/tools/misc/elfkickers/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "elfkickers";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.muppetlabs.com/~breadbox/software/elfkickers.html";
     description = "A collection of programs that access and manipulate ELF files";
     platforms = platforms.linux;
diff --git a/pkgs/development/tools/misc/epm/default.nix b/pkgs/development/tools/misc/epm/default.nix
index 8caa33c20d1..8f5921783e2 100644
--- a/pkgs/development/tools/misc/epm/default.nix
+++ b/pkgs/development/tools/misc/epm/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchFromGitHub, rpm}:
+{lib, stdenv, fetchFromGitHub, rpm}:
 
 stdenv.mkDerivation rec {
   pname = "epm";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     sed -i 's/README/README.md/' Makefile
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "The ESP Package Manager generates distribution archives for a variety of platforms";
     homepage = "https://www.msweet.org/projects.php?Z2";
     license = licenses.gpl2;
diff --git a/pkgs/development/tools/misc/findnewest/default.nix b/pkgs/development/tools/misc/findnewest/default.nix
index b289c16b7a6..6773e9bc0bd 100644
--- a/pkgs/development/tools/misc/findnewest/default.nix
+++ b/pkgs/development/tools/misc/findnewest/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "findnewest";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoreconfHook ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/0-wiz-0/findnewest";
     description = "Recursively find newest file in a hierarchy and print its timestamp";
     license = licenses.bsd2;
diff --git a/pkgs/development/tools/misc/fsatrace/default.nix b/pkgs/development/tools/misc/fsatrace/default.nix
index 69d7c6b3919..132ddf2eacf 100644
--- a/pkgs/development/tools/misc/fsatrace/default.nix
+++ b/pkgs/development/tools/misc/fsatrace/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "fsatrace";
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     ln -s $out/$installDir/fsatrace $out/bin/fsatrace
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/jacereda/fsatrace";
     description = "filesystem access tracer";
     license = licenses.isc;
diff --git a/pkgs/development/tools/misc/fswatch/default.nix b/pkgs/development/tools/misc/fswatch/default.nix
index e32da3e67b7..6f9f5e113c0 100644
--- a/pkgs/development/tools/misc/fswatch/default.nix
+++ b/pkgs/development/tools/misc/fswatch/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , autoreconfHook
                      # for xargs
@@ -20,12 +20,12 @@ stdenv.mkDerivation rec {
     sha256 = "11479ac436g8bwk0lfnmdms0cirv9k11pdvfrrg9jwkki1j1abkk";
   };
 
-  nativeBuildInputs = [ autoreconfHook ] ++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices ];
+  nativeBuildInputs = [ autoreconfHook ] ++ lib.optionals stdenv.isDarwin [ CoreServices ];
   buildInputs = [ gettext libtool makeWrapper texinfo ];
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A cross-platform file change monitor with multiple backends";
     homepage = "https://github.com/emcrisostomo/fswatch";
     license = licenses.gpl3Plus;
diff --git a/pkgs/development/tools/misc/fujprog/default.nix b/pkgs/development/tools/misc/fujprog/default.nix
index 3ec4d0f8efb..db1f42e3a26 100644
--- a/pkgs/development/tools/misc/fujprog/default.nix
+++ b/pkgs/development/tools/misc/fujprog/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 , pkg-config
@@ -26,9 +26,9 @@ stdenv.mkDerivation rec {
   buildInputs = [
     libftdi1
     libusb-compat-0_1
-  ] ++ stdenv.lib.optionals stdenv.isDarwin [ IOKit ];
+  ] ++ lib.optionals stdenv.isDarwin [ IOKit ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "JTAG programmer for the ULX3S and ULX2S open hardware FPGA development boards";
     homepage = "https://github.com/kost/fujprog";
     license = licenses.bsd2;
diff --git a/pkgs/development/tools/misc/gdb/default.nix b/pkgs/development/tools/misc/gdb/default.nix
index f77ab03b810..2ce779be568 100644
--- a/pkgs/development/tools/misc/gdb/default.nix
+++ b/pkgs/development/tools/misc/gdb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, targetPackages
+{ lib, stdenv, targetPackages
 
 # Build time
 , fetchurl, pkg-config, perl, texinfo, setupDebugInfoDirs, buildPackages
@@ -18,7 +18,7 @@
 
 let
   basename = "gdb";
-  targetPrefix = stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
+  targetPrefix = lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
                  "${stdenv.targetPlatform.config}-";
 in
 
@@ -40,15 +40,15 @@ stdenv.mkDerivation rec {
 
   patches = [
     ./debug-info-from-env.patch
-  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+  ] ++ lib.optionals stdenv.isDarwin [
     ./darwin-target-match.patch
   ];
 
   nativeBuildInputs = [ pkg-config texinfo perl setupDebugInfoDirs ];
 
   buildInputs = [ ncurses readline gmp mpfr expat libipt zlib guile ]
-    ++ stdenv.lib.optional pythonSupport python3
-    ++ stdenv.lib.optional doCheck dejagnu;
+    ++ lib.optional pythonSupport python3
+    ++ lib.optional doCheck dejagnu;
 
   propagatedNativeBuildInputs = [ setupDebugInfoDirs ];
 
@@ -57,12 +57,12 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   # darwin build fails with format hardening since v7.12
-  hardeningDisable = stdenv.lib.optionals stdenv.isDarwin [ "format" ];
+  hardeningDisable = lib.optionals stdenv.isDarwin [ "format" ];
 
   NIX_CFLAGS_COMPILE = "-Wno-format-nonliteral";
 
   # TODO(@Ericson2314): Always pass "--target" and always prefix.
-  configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (stdenv.targetPlatform != stdenv.hostPlatform) "target";
+  configurePlatforms = [ "build" "host" ] ++ lib.optional (stdenv.targetPlatform != stdenv.hostPlatform) "target";
 
   # GDB have to be built out of tree.
   preConfigure = ''
@@ -71,7 +71,7 @@ stdenv.mkDerivation rec {
   '';
   configureScript = "../configure";
 
-  configureFlags = with stdenv.lib; [
+  configureFlags = with lib; [
     "--enable-targets=all" "--enable-64-bit-bfd"
     "--disable-install-libbfd"
     "--disable-shared" "--enable-static"
@@ -82,7 +82,7 @@ stdenv.mkDerivation rec {
     "--with-mpfr=${mpfr.dev}"
     "--with-expat" "--with-libexpat-prefix=${expat.dev}"
     "--with-auto-load-safe-path=${builtins.concatStringsSep ":" safePaths}"
-  ] ++ stdenv.lib.optional (!pythonSupport) "--without-python";
+  ] ++ lib.optional (!pythonSupport) "--without-python";
 
   postInstall =
     '' # Remove Info files already provided by Binutils and other packages.
@@ -92,7 +92,7 @@ stdenv.mkDerivation rec {
   # TODO: Investigate & fix the test failures.
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "The GNU Project debugger";
 
     longDescription = ''
@@ -103,7 +103,7 @@ stdenv.mkDerivation rec {
 
     homepage = "https://www.gnu.org/software/gdb/";
 
-    license = stdenv.lib.licenses.gpl3Plus;
+    license = lib.licenses.gpl3Plus;
 
     platforms = with platforms; linux ++ cygwin ++ darwin;
     maintainers = with maintainers; [ pierron globin lsix ];
diff --git a/pkgs/development/tools/misc/gdbgui/default.nix b/pkgs/development/tools/misc/gdbgui/default.nix
index ecbfc2ae756..c01bb61f4f6 100644
--- a/pkgs/development/tools/misc/gdbgui/default.nix
+++ b/pkgs/development/tools/misc/gdbgui/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , buildPythonApplication
 , fetchPypi
 , gdb
@@ -41,13 +41,13 @@ buildPythonApplication rec {
 
   postInstall = ''
     wrapProgram $out/bin/gdbgui \
-      --prefix PATH : ${stdenv.lib.makeBinPath [ gdb ]}
+      --prefix PATH : ${lib.makeBinPath [ gdb ]}
   '';
 
   # tests do not work without stdout/stdin
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A browser-based frontend for GDB";
     homepage = "https://www.gdbgui.com/";
     license = licenses.gpl3;
diff --git a/pkgs/development/tools/misc/gengetopt/default.nix b/pkgs/development/tools/misc/gengetopt/default.nix
index 0a3b0b1c750..2c09f925d3d 100644
--- a/pkgs/development/tools/misc/gengetopt/default.nix
+++ b/pkgs/development/tools/misc/gengetopt/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, texinfo, help2man }:
+{ fetchurl, lib, stdenv, texinfo, help2man }:
 
 stdenv.mkDerivation rec {
   pname = "gengetopt";
@@ -37,9 +37,9 @@ stdenv.mkDerivation rec {
 
     homepage = "https://www.gnu.org/software/gengetopt/";
 
-    license = stdenv.lib.licenses.gpl3Plus;
+    license = lib.licenses.gpl3Plus;
 
     maintainers = [ ];
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/development/tools/misc/global/default.nix b/pkgs/development/tools/misc/global/default.nix
index 36798fe4fc1..fb3ddfcb29b 100644
--- a/pkgs/development/tools/misc/global/default.nix
+++ b/pkgs/development/tools/misc/global/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, libtool, makeWrapper
+{ fetchurl, lib, stdenv, libtool, makeWrapper
 , coreutils, ctags, ncurses, pythonPackages, sqlite, universal-ctags
 }:
 
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
       --prefix PYTHONPATH : "$(toPythonPath ${pythonPackages.pygments})"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Source code tag system";
     longDescription = ''
       GNU GLOBAL is a source code tagging system that works the same way
diff --git a/pkgs/development/tools/misc/gnum4/default.nix b/pkgs/development/tools/misc/gnum4/default.nix
index 2e3e4acfdc1..512989a1446 100644
--- a/pkgs/development/tools/misc/gnum4/default.nix
+++ b/pkgs/development/tools/misc/gnum4/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 # Note: this package is used for bootstrapping fetchurl, and thus
 # cannot use fetchpatch! All mutable patches (generated by GitHub or
@@ -26,7 +26,7 @@ stdenv.mkDerivation {
         sha256 = "12lmdnbml9lfvy0khpjc42riicddaz7li8wmbnsam7zsw6al11qk";
       })
     ]
-    ++ stdenv.lib.optional stdenv.isDarwin ./darwin-secure-format.patch;
+    ++ lib.optional stdenv.isDarwin ./darwin-secure-format.patch;
 
   meta = {
     homepage = "https://www.gnu.org/software/m4/";
@@ -49,8 +49,8 @@ stdenv.mkDerivation {
       compiler or as a macro processor in its own right.
     '';
 
-    license = stdenv.lib.licenses.gpl3Plus;
-    platforms = stdenv.lib.platforms.unix ++ stdenv.lib.platforms.windows;
+    license = lib.licenses.gpl3Plus;
+    platforms = lib.platforms.unix ++ lib.platforms.windows;
   };
 
 }
diff --git a/pkgs/development/tools/misc/gob2/default.nix b/pkgs/development/tools/misc/gob2/default.nix
index e34b5733b22..b78c111ccbf 100644
--- a/pkgs/development/tools/misc/gob2/default.nix
+++ b/pkgs/development/tools/misc/gob2/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchurl, pkg-config, glib, bison, flex, gnome3 }:
+{ lib, stdenv, fetchurl, pkg-config, glib, bison, flex, gnome3 }:
 
 stdenv.mkDerivation rec {
   pname = "gob2";
   version = "2.0.20";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "5fe5d7990fd65b0d4b617ba894408ebaa6df453f2781c15a1cfdf2956c0c5428";
   };
 
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Preprocessor for making GObjects with inline C code";
     homepage = "https://www.jirka.org/gob.html";
-    license = stdenv.lib.licenses.gpl2Plus;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/misc/gperf/3.0.x.nix b/pkgs/development/tools/misc/gperf/3.0.x.nix
index e013428a6f7..339511f2cc0 100644
--- a/pkgs/development/tools/misc/gperf/3.0.x.nix
+++ b/pkgs/development/tools/misc/gperf/3.0.x.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, autoreconfHook }:
+{lib, stdenv, fetchurl, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   name = "gperf-3.0.4";
@@ -27,9 +27,9 @@ stdenv.mkDerivation rec {
       employed by gperf.
     '';
 
-    license = stdenv.lib.licenses.gpl3Plus;
+    license = lib.licenses.gpl3Plus;
 
     homepage = "https://www.gnu.org/software/gperf/";
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/misc/gperf/default.nix b/pkgs/development/tools/misc/gperf/default.nix
index bf85cd91380..e998f09683a 100644
--- a/pkgs/development/tools/misc/gperf/default.nix
+++ b/pkgs/development/tools/misc/gperf/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
   name = "gperf-3.1";
@@ -25,9 +25,9 @@ stdenv.mkDerivation rec {
       employed by gperf.
     '';
 
-    license = stdenv.lib.licenses.gpl3Plus;
+    license = lib.licenses.gpl3Plus;
 
     homepage = "https://www.gnu.org/software/gperf/";
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/misc/gpshell/default.nix b/pkgs/development/tools/misc/gpshell/default.nix
index 5a3cdad8040..13437b71953 100644
--- a/pkgs/development/tools/misc/gpshell/default.nix
+++ b/pkgs/development/tools/misc/gpshell/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, globalplatform, pcsclite, gppcscconnectionplugin
+{ lib, stdenv, fetchurl, pkg-config, globalplatform, pcsclite, gppcscconnectionplugin
 , makeWrapper
 }:
 
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     wrapProgram "$out/bin/gpshell" --prefix LD_LIBRARY_PATH : "${gppcscconnectionplugin}/lib"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://sourceforge.net/p/globalplatform/wiki/Home/";
     description = "Smartcard management application";
     license = licenses.gpl3;
diff --git a/pkgs/development/tools/misc/gputils/default.nix b/pkgs/development/tools/misc/gputils/default.nix
index 2ad496bfb88..c07949e8096 100644
--- a/pkgs/development/tools/misc/gputils/default.nix
+++ b/pkgs/development/tools/misc/gputils/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "gputils";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "055v83fdgqljprapf7rmh8x66mr13fj0qypj49xba5spx0ca123g";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://gputils.sourceforge.io";
     description = "A collection of tools for the Microchip (TM) PIC microcontrollers. It includes gpasm, gplink, and gplib";
     license = licenses.gpl2;
diff --git a/pkgs/development/tools/misc/gtkdialog/default.nix b/pkgs/development/tools/misc/gtkdialog/default.nix
index 2b2a8318947..6651bbb0384 100644
--- a/pkgs/development/tools/misc/gtkdialog/default.nix
+++ b/pkgs/development/tools/misc/gtkdialog/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, gtk2, pkg-config }:
+{lib, stdenv, fetchurl, gtk2, pkg-config }:
 
 stdenv.mkDerivation {
   name = "gtkdialog-0.8.3";
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
     homepage = "https://code.google.com/archive/p/gtkdialog/";
     # community links: http://murga-linux.com/puppy/viewtopic.php?t=111923 -> https://github.com/01micko/gtkdialog
     description = "Small utility for fast and easy GUI building from many scripted and compiled languages";
-    license = stdenv.lib.licenses.gpl2Plus;
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/pkgs/development/tools/misc/gtkperf/default.nix b/pkgs/development/tools/misc/gtkperf/default.nix
index feda9faf59a..4b7f7985a67 100644
--- a/pkgs/development/tools/misc/gtkperf/default.nix
+++ b/pkgs/development/tools/misc/gtkperf/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gtk2, pkg-config, libintl }:
+{ lib, stdenv, fetchurl, gtk2, pkg-config, libintl }:
 
 stdenv.mkDerivation {
   name = "gtkperf-0.40.0";
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
   # https://openbenchmarking.org/innhold/7e9780c11550d09aa67bdba71248facbe2d781db
   patches = [ ./bench.patch ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Application designed to test GTK performance";
     homepage = "http://gtkperf.sourceforge.net/";
     license = with licenses; [ gpl2 ];
diff --git a/pkgs/development/tools/misc/help2man/default.nix b/pkgs/development/tools/misc/help2man/default.nix
index f23b5a9c8fd..6afc4415e11 100644
--- a/pkgs/development/tools/misc/help2man/default.nix
+++ b/pkgs/development/tools/misc/help2man/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perlPackages, gettext }:
+{ lib, stdenv, fetchurl, perlPackages, gettext }:
 
 # Note: this package is used for bootstrapping fetchurl, and thus
 # cannot use fetchpatch! All mutable patches (generated by GitHub or
@@ -27,14 +27,14 @@ stdenv.mkDerivation rec {
     cat > $out/bin/help2man <<EOF
     #! $SHELL -e
     export PERL5LIB=\''${PERL5LIB:+:}${perlPackages.LocaleGettext}/${perlPackages.perl.libPrefix}
-    ${stdenv.lib.optionalString stdenv.hostPlatform.isCygwin
+    ${lib.optionalString stdenv.hostPlatform.isCygwin
         ''export PATH=\''${PATH:+:}${gettext}/bin''}
     exec -a \$0 $out/bin/.help2man-wrapped "\$@"
     EOF
     chmod +x $out/bin/help2man
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Generate man pages from `--help' output";
 
     longDescription =
diff --git a/pkgs/development/tools/misc/hound/default.nix b/pkgs/development/tools/misc/hound/default.nix
index 4e817251bff..476179ac8e7 100644
--- a/pkgs/development/tools/misc/hound/default.nix
+++ b/pkgs/development/tools/misc/hound/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , buildGoPackage
 , fetchFromGitHub
 , makeWrapper
@@ -32,8 +32,8 @@ buildGoPackage rec {
     inherit (src.meta) homepage;
 
     description = "Lightning fast code searching made easy";
-    license = stdenv.lib.licenses.mit;
-    maintainers = with stdenv.lib.maintainers; [ grahamc ];
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ grahamc ];
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/misc/hydra-cli/default.nix b/pkgs/development/tools/misc/hydra-cli/default.nix
index 837128e2977..9160a336681 100644
--- a/pkgs/development/tools/misc/hydra-cli/default.nix
+++ b/pkgs/development/tools/misc/hydra-cli/default.nix
@@ -19,7 +19,7 @@ rustPlatform.buildRustPackage rec {
     pkg-config
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A client for the Hydra CI";
     homepage = "https://github.com/nlewo/hydra-cli";
     license = with licenses; [ mit ];
diff --git a/pkgs/development/tools/misc/hydra/common.nix b/pkgs/development/tools/misc/hydra/common.nix
index 7aaee31b504..cf56e6c1a9c 100644
--- a/pkgs/development/tools/misc/hydra/common.nix
+++ b/pkgs/development/tools/misc/hydra/common.nix
@@ -128,7 +128,7 @@ in stdenv.mkDerivation rec {
 
   passthru = { inherit perlDeps migration tests; };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Nix-based continuous build system";
     license = licenses.gpl3;
     platforms = platforms.linux;
diff --git a/pkgs/development/tools/misc/icon-naming-utils/default.nix b/pkgs/development/tools/misc/icon-naming-utils/default.nix
index 0905ce48463..8fdc448ee91 100644
--- a/pkgs/development/tools/misc/icon-naming-utils/default.nix
+++ b/pkgs/development/tools/misc/icon-naming-utils/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, perlPackages, librsvg}:
+{lib, stdenv, fetchurl, perlPackages, librsvg}:
 
 stdenv.mkDerivation rec {
   name = "icon-naming-utils-0.8.90";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
           --replace '/bin/perl' '/bin/perl -I${perlPackages.XMLSimple}/${perlPackages.perl.libPrefix}'
     '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://tango.freedesktop.org/Standard_Icon_Naming_Specification";
     platforms = with platforms; linux ++ darwin;
     license = licenses.gpl2;
diff --git a/pkgs/development/tools/misc/igprof/default.nix b/pkgs/development/tools/misc/igprof/default.nix
index 0780672cc02..47f41f130be 100644
--- a/pkgs/development/tools/misc/igprof/default.nix
+++ b/pkgs/development/tools/misc/igprof/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchFromGitHub, libunwind, cmake, pcre, gdb}:
+{lib, stdenv, fetchFromGitHub, libunwind, cmake, pcre, gdb}:
 
 stdenv.mkDerivation rec {
   version = "5.9.16";
@@ -34,10 +34,10 @@ stdenv.mkDerivation rec {
       details and see the big picture from combined workloads.
     '';
 
-    license = stdenv.lib.licenses.gpl2;
+    license = lib.licenses.gpl2;
 
     homepage = "https://igprof.org/";
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ ktf ];
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ ktf ];
   };
 }
diff --git a/pkgs/development/tools/misc/indent/default.nix b/pkgs/development/tools/misc/indent/default.nix
index c4b5fecca74..8c5ec6af1c7 100644
--- a/pkgs/development/tools/misc/indent/default.nix
+++ b/pkgs/development/tools/misc/indent/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, texinfo }:
+{ lib, stdenv, fetchurl, texinfo }:
 
 stdenv.mkDerivation rec {
   name = "indent-2.2.12";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ texinfo ];
 
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang
     "-Wno-implicit-function-declaration";
 
   hardeningDisable = [ "format" ];
@@ -20,8 +20,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://www.gnu.org/software/indent/";
     description = "A source code reformatter";
-    license = stdenv.lib.licenses.gpl3Plus;
-    maintainers = [ stdenv.lib.maintainers.mmahut ];
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.gpl3Plus;
+    maintainers = [ lib.maintainers.mmahut ];
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/misc/inotify-tools/default.nix b/pkgs/development/tools/misc/inotify-tools/default.nix
index a9d642f48f0..e085d3dd259 100644
--- a/pkgs/development/tools/misc/inotify-tools/default.nix
+++ b/pkgs/development/tools/misc/inotify-tools/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, autoreconfHook, fetchFromGitHub, fetchpatch }:
+{ lib, stdenv, autoreconfHook, fetchFromGitHub, fetchpatch }:
 
 stdenv.mkDerivation rec {
   pname = "inotify-tools";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoreconfHook ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/rvoicilas/inotify-tools/wiki";
     license = licenses.gpl2;
     maintainers = with maintainers; [ marcweber pSub ];
diff --git a/pkgs/development/tools/misc/intel-gpu-tools/default.nix b/pkgs/development/tools/misc/intel-gpu-tools/default.nix
index 9f442cfee14..62d350593b1 100644
--- a/pkgs/development/tools/misc/intel-gpu-tools/default.nix
+++ b/pkgs/development/tools/misc/intel-gpu-tools/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, libdrm, libpciaccess, cairo, xorgproto, udev
+{ lib, stdenv, fetchurl, pkg-config, libdrm, libpciaccess, cairo, xorgproto, udev
 , libX11, libXext, libXv, libXrandr, glib, bison, libunwind, python3, kmod
 , procps, utilmacros, gtk-doc, openssl, peg, elfutils
 }:
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://01.org/linuxgraphics/";
     description = "Tools for development and testing of the Intel DRM driver";
     license = licenses.mit;
diff --git a/pkgs/development/tools/misc/intltool/default.nix b/pkgs/development/tools/misc/intltool/default.nix
index 20f880938c6..7a3379d5921 100644
--- a/pkgs/development/tools/misc/intltool/default.nix
+++ b/pkgs/development/tools/misc/intltool/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, gettext, perlPackages, buildPackages }:
+{ lib, stdenv, fetchurl, fetchpatch, gettext, perlPackages, buildPackages }:
 
 stdenv.mkDerivation rec {
   pname = "intltool";
@@ -22,12 +22,12 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = with perlPackages; [ perl XMLParser ];
   propagatedBuildInputs = [ gettext ] ++ (with perlPackages; [ perl XMLParser ]);
 
-  postInstall = stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
+  postInstall = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
     for f in $out/bin/*; do
       substituteInPlace $f --replace "${buildPackages.perl}" "${perlPackages.perl}"
     done
   '';
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Translation helper tool";
     homepage = "https://launchpad.net/intltool/";
     license = licenses.gpl2Plus;
diff --git a/pkgs/development/tools/misc/iozone/default.nix b/pkgs/development/tools/misc/iozone/default.nix
index 93e2673be63..ad62d104873 100644
--- a/pkgs/development/tools/misc/iozone/default.nix
+++ b/pkgs/development/tools/misc/iozone/default.nix
@@ -55,8 +55,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "IOzone Filesystem Benchmark";
     homepage    = "http://www.iozone.org/";
-    license     = stdenv.lib.licenses.unfreeRedistributable;
+    license     = lib.licenses.unfreeRedistributable;
     platforms   = ["i686-linux" "x86_64-linux" "x86_64-darwin" "aarch64-linux" ];
-    maintainers = with stdenv.lib.maintainers; [ Baughn makefu ];
+    maintainers = with lib.maintainers; [ Baughn makefu ];
   };
 }
diff --git a/pkgs/development/tools/misc/itm-tools/default.nix b/pkgs/development/tools/misc/itm-tools/default.nix
index a121cc67099..992b76bd62d 100644
--- a/pkgs/development/tools/misc/itm-tools/default.nix
+++ b/pkgs/development/tools/misc/itm-tools/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, rustPlatform, pkg-config }:
+{ lib, stdenv, fetchFromGitHub, rustPlatform, pkg-config }:
 
 rustPlatform.buildRustPackage rec {
   pname = "itm-tools";
@@ -19,7 +19,7 @@ rustPlatform.buildRustPackage rec {
 
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Tools for analyzing ITM traces";
     homepage = "https://github.com/japaric/itm-tools";
     license = with licenses; [ asl20 mit ];
diff --git a/pkgs/development/tools/misc/itstool/default.nix b/pkgs/development/tools/misc/itstool/default.nix
index d46256f039a..55e62a2dcae 100644
--- a/pkgs/development/tools/misc/itstool/default.nix
+++ b/pkgs/development/tools/misc/itstool/default.nix
@@ -19,8 +19,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://itstool.org/";
     description = "XML to PO and back again";
-    license = stdenv.lib.licenses.gpl3Plus;
-    platforms = stdenv.lib.platforms.all;
+    license = lib.licenses.gpl3Plus;
+    platforms = lib.platforms.all;
     maintainers = [ ];
   };
 }
diff --git a/pkgs/development/tools/misc/jscoverage/default.nix b/pkgs/development/tools/misc/jscoverage/default.nix
index 6ed66c8d3cc..a978c31c34d 100644
--- a/pkgs/development/tools/misc/jscoverage/default.nix
+++ b/pkgs/development/tools/misc/jscoverage/default.nix
@@ -1,4 +1,4 @@
-{ autoconf, fetchurl, makedepend, perl, python, stdenv, unzip, zip }:
+{ autoconf, fetchurl, makedepend, perl, python, lib, stdenv, unzip, zip }:
 
 stdenv.mkDerivation rec {
   name = "jscoverage-0.5.1";
@@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
     '';
 
     homepage = "http://siliconforks.com/jscoverage/";
-    license = stdenv.lib.licenses.gpl2;
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/pkgs/development/tools/misc/kconfig-frontends/default.nix b/pkgs/development/tools/misc/kconfig-frontends/default.nix
index ea82b0a4e6e..3b355b6218a 100644
--- a/pkgs/development/tools/misc/kconfig-frontends/default.nix
+++ b/pkgs/development/tools/misc/kconfig-frontends/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, bison, flex, gperf, ncurses, pythonPackages }:
+{ lib, stdenv, fetchurl, pkg-config, bison, flex, gperf, ncurses, pythonPackages }:
 
 stdenv.mkDerivation rec {
   basename = "kconfig-frontends";
@@ -21,9 +21,9 @@ stdenv.mkDerivation rec {
     wrapPythonPrograms
   '';
 
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=format-security";
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=format-security";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Out of Linux tree packaging of the kconfig infrastructure";
     longDescription = ''
       Configuration language and system for the Linux kernel and other
diff --git a/pkgs/development/tools/misc/kdbg/default.nix b/pkgs/development/tools/misc/kdbg/default.nix
index 78acf8e17a7..dad7d41c1f6 100644
--- a/pkgs/development/tools/misc/kdbg/default.nix
+++ b/pkgs/development/tools/misc/kdbg/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, extra-cmake-modules, qt5,
+{ lib, stdenv, fetchurl, cmake, extra-cmake-modules, qt5,
   ki18n, kconfig, kiconthemes, kxmlgui, kwindowsystem,
   qtbase, makeWrapper,
 }:
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     wrapProgram $out/bin/kdbg --prefix QT_PLUGIN_PATH : ${qtbase}/${qtbase.qtPluginPrefix}
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.kdbg.org/";
     description = ''
       A graphical user interface to gdb, the GNU debugger. It provides an
diff --git a/pkgs/development/tools/misc/kibana/6.x.nix b/pkgs/development/tools/misc/kibana/6.x.nix
index 354f77d0fb9..3fa2d219fe3 100644
--- a/pkgs/development/tools/misc/kibana/6.x.nix
+++ b/pkgs/development/tools/misc/kibana/6.x.nix
@@ -1,6 +1,6 @@
 { elk6Version
 , enableUnfree ? true
-, stdenv
+, lib, stdenv
 , makeWrapper
 , fetchurl
 , nodejs-10_x
@@ -8,7 +8,7 @@
 , which
 }:
 
-with stdenv.lib;
+with lib;
 let
   nodejs = nodejs-10_x;
   inherit (builtins) elemAt;
@@ -49,7 +49,7 @@ in stdenv.mkDerivation rec {
     mv * $out/libexec/kibana/
     rm -r $out/libexec/kibana/node
     makeWrapper $out/libexec/kibana/bin/kibana $out/bin/kibana \
-      --prefix PATH : "${stdenv.lib.makeBinPath [ nodejs coreutils which ]}"
+      --prefix PATH : "${lib.makeBinPath [ nodejs coreutils which ]}"
     sed -i 's@NODE=.*@NODE=${nodejs}/bin/node@' $out/libexec/kibana/bin/kibana
   '';
 
diff --git a/pkgs/development/tools/misc/kibana/7.x.nix b/pkgs/development/tools/misc/kibana/7.x.nix
index dc3beb9866c..7f46d6f6512 100644
--- a/pkgs/development/tools/misc/kibana/7.x.nix
+++ b/pkgs/development/tools/misc/kibana/7.x.nix
@@ -1,6 +1,6 @@
 { elk7Version
 , enableUnfree ? true
-, stdenv
+, lib, stdenv
 , makeWrapper
 , fetchurl
 , nodejs-10_x
@@ -8,7 +8,7 @@
 , which
 }:
 
-with stdenv.lib;
+with lib;
 let
   nodejs = nodejs-10_x;
   inherit (builtins) elemAt;
@@ -49,7 +49,7 @@ in stdenv.mkDerivation rec {
     mv * $out/libexec/kibana/
     rm -r $out/libexec/kibana/node
     makeWrapper $out/libexec/kibana/bin/kibana $out/bin/kibana \
-      --prefix PATH : "${stdenv.lib.makeBinPath [ nodejs coreutils which ]}"
+      --prefix PATH : "${lib.makeBinPath [ nodejs coreutils which ]}"
     sed -i 's@NODE=.*@NODE=${nodejs}/bin/node@' $out/libexec/kibana/bin/kibana
   '';
 
diff --git a/pkgs/development/tools/misc/libtool/default.nix b/pkgs/development/tools/misc/libtool/default.nix
index 199c6504f39..2b0089e89f6 100644
--- a/pkgs/development/tools/misc/libtool/default.nix
+++ b/pkgs/development/tools/misc/libtool/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, m4, perl}:
+{lib, stdenv, fetchurl, m4, perl}:
 
 # Note: this package is used for bootstrapping fetchurl, and thus
 # cannot use fetchpatch! All mutable patches (generated by GitHub or
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
 
     homepage = "https://www.gnu.org/software/libtool/";
 
-    license = stdenv.lib.licenses.gpl2Plus;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/misc/libtool/libtool2.nix b/pkgs/development/tools/misc/libtool/libtool2.nix
index fbe49dc68b2..6d7c4a9087f 100644
--- a/pkgs/development/tools/misc/libtool/libtool2.nix
+++ b/pkgs/development/tools/misc/libtool/libtool2.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, m4, perl, help2man
+{ lib, stdenv, fetchurl, m4, perl, help2man
 }:
 
 stdenv.mkDerivation rec {
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "GNU Libtool, a generic library support script";
     longDescription = ''
       GNU libtool is a generic library support script.  Libtool hides
diff --git a/pkgs/development/tools/misc/libwhich/default.nix b/pkgs/development/tools/misc/libwhich/default.nix
index 59bbb99bd46..aeda5271142 100644
--- a/pkgs/development/tools/misc/libwhich/default.nix
+++ b/pkgs/development/tools/misc/libwhich/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "libwhich";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     install -Dm755 -t $out/bin libwhich
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Like `which`, for dynamic libraries";
     homepage = "https://github.com/vtjnash/libwhich";
     license = licenses.mit;
diff --git a/pkgs/development/tools/misc/loccount/default.nix b/pkgs/development/tools/misc/loccount/default.nix
index ace34f35059..59bab3742a2 100644
--- a/pkgs/development/tools/misc/loccount/default.nix
+++ b/pkgs/development/tools/misc/loccount/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitLab }:
+{ lib, stdenv, buildGoPackage, fetchFromGitLab }:
 buildGoPackage rec {
   pname = "loccount";
   version = "1.2";
@@ -13,7 +13,7 @@ buildGoPackage rec {
     sha256 = "18z7ai7wy2k9yd3w65d37apfqs3h9bc2c15y7v1bydppi44zfsdk";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Re-implementation of sloccount in Go";
     longDescription = ''
       loccount is a re-implementation of David A. Wheeler's sloccount tool
diff --git a/pkgs/development/tools/misc/lsof/default.nix b/pkgs/development/tools/misc/lsof/default.nix
index e5988b1d5a9..94e3722598b 100644
--- a/pkgs/development/tools/misc/lsof/default.nix
+++ b/pkgs/development/tools/misc/lsof/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchFromGitHub, buildPackages, ncurses }:
+{ lib, stdenv, fetchFromGitHub, buildPackages, ncurses }:
 
-let dialect = with stdenv.lib; last (splitString "-" stdenv.hostPlatform.system); in
+let dialect = with lib; last (splitString "-" stdenv.hostPlatform.system); in
 
 stdenv.mkDerivation rec {
   pname = "lsof";
@@ -18,14 +18,14 @@ stdenv.mkDerivation rec {
 
   patches = [ ./no-build-info.patch ];
 
-  postPatch = stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+  postPatch = lib.optionalString stdenv.hostPlatform.isMusl ''
     substituteInPlace dialects/linux/dlsof.h --replace "defined(__UCLIBC__)" 1
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     sed -i 's|lcurses|lncurses|g' Configure
   '';
 
   # Stop build scripts from searching global include paths
-  LSOF_INCLUDE = "${stdenv.lib.getDev stdenv.cc.libc}/include";
+  LSOF_INCLUDE = "${lib.getDev stdenv.cc.libc}/include";
   configurePhase = "LINUX_CONF_CC=$CC_FOR_BUILD LSOF_CC=$CC LSOF_AR=\"$AR cr\" LSOF_RANLIB=$RANLIB ./Configure -n ${dialect}";
   preBuild = ''
     for filepath in $(find dialects/${dialect} -type f); do
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
     cp lsof $out/bin
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/lsof-org/lsof";
     description = "A tool to list open files";
     longDescription = ''
diff --git a/pkgs/development/tools/misc/ltrace/default.nix b/pkgs/development/tools/misc/ltrace/default.nix
index d88d9d7a7be..e1d9ae6b551 100644
--- a/pkgs/development/tools/misc/ltrace/default.nix
+++ b/pkgs/development/tools/misc/ltrace/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, elfutils, libunwind }:
+{ lib, stdenv, fetchurl, elfutils, libunwind }:
 
 stdenv.mkDerivation {
   name = "ltrace-0.7.3";
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
       patches="$patches $(cat debian/patches/series | sed 's|^|debian/patches/|')"
     '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library call tracer";
     homepage = "https://www.ltrace.org/";
     platforms = [ "i686-linux" "x86_64-linux" ];
diff --git a/pkgs/development/tools/misc/lttng-tools/default.nix b/pkgs/development/tools/misc/lttng-tools/default.nix
index 87cf20c0cb8..223e10d04ab 100644
--- a/pkgs/development/tools/misc/lttng-tools/default.nix
+++ b/pkgs/development/tools/misc/lttng-tools/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, popt, libuuid, liburcu, lttng-ust, kmod, libxml2 }:
+{ lib, stdenv, fetchurl, pkg-config, popt, libuuid, liburcu, lttng-ust, kmod, libxml2 }:
 
 stdenv.mkDerivation rec {
   pname = "lttng-tools";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkg-config ];
   buildInputs = [ popt libuuid liburcu lttng-ust libxml2 kmod ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Tracing tools (kernel + user space) for Linux";
     homepage = "https://lttng.org/";
     license = licenses.lgpl21;
diff --git a/pkgs/development/tools/misc/lttng-ust/default.nix b/pkgs/development/tools/misc/lttng-ust/default.nix
index ba3930642b1..94d2e4a33f2 100644
--- a/pkgs/development/tools/misc/lttng-ust/default.nix
+++ b/pkgs/development/tools/misc/lttng-ust/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, liburcu, python3 }:
+{ lib, stdenv, fetchurl, liburcu, python3 }:
 
 # NOTE:
 #   ./configure ...
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ liburcu ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "LTTng Userspace Tracer libraries";
     homepage = "https://lttng.org/";
     license = licenses.lgpl21Plus;
diff --git a/pkgs/development/tools/misc/lttv/default.nix b/pkgs/development/tools/misc/lttv/default.nix
index ab5fa418dc7..a196c5f4528 100644
--- a/pkgs/development/tools/misc/lttv/default.nix
+++ b/pkgs/development/tools/misc/lttv/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, glib, gtk2, popt, babeltrace }:
+{ lib, stdenv, fetchurl, pkg-config, glib, gtk2, popt, babeltrace }:
 
 stdenv.mkDerivation rec {
   name = "lttv-1.5";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkg-config ];
   buildInputs = [ glib gtk2 popt babeltrace ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Graphical trace viewer for LTTng trace files";
     homepage = "https://lttng.org/";
     # liblttvtraceread (ltt/ directory) is distributed under the GNU LGPL v2.1.
diff --git a/pkgs/development/tools/misc/luarocks/default.nix b/pkgs/development/tools/misc/luarocks/default.nix
index fa19b249407..9f83ca5565f 100644
--- a/pkgs/development/tools/misc/luarocks/default.nix
+++ b/pkgs/development/tools/misc/luarocks/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchFromGitHub
+{lib, stdenv, fetchFromGitHub
 , curl, makeWrapper, which, unzip
 , lua
 # for 'luarocks pack'
@@ -62,7 +62,7 @@ stdenv.mkDerivation rec {
     export LUA_PATH="src/?.lua;''${LUA_PATH:-}"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit version;
     description = ''A package manager for Lua'';
     license = licenses.mit ;
diff --git a/pkgs/development/tools/misc/macdylibbundler/default.nix b/pkgs/development/tools/misc/macdylibbundler/default.nix
index 5008175363c..c92d7b07798 100644
--- a/pkgs/development/tools/misc/macdylibbundler/default.nix
+++ b/pkgs/development/tools/misc/macdylibbundler/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, makeWrapper, fetchFromGitHub, cctools }:
+{ lib, stdenv, makeWrapper, fetchFromGitHub, cctools }:
 
 stdenv.mkDerivation {
   pname = "macdylibbundler";
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
       --prefix PATH ":" "${cctools}/bin"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Utility to ease bundling libraries into executables for OSX";
     longDescription = ''
       dylibbundler is a small command-line programs that aims to make bundling
diff --git a/pkgs/development/tools/misc/micronucleus/default.nix b/pkgs/development/tools/misc/micronucleus/default.nix
index 890439adc6e..2999b741888 100644
--- a/pkgs/development/tools/misc/micronucleus/default.nix
+++ b/pkgs/development/tools/misc/micronucleus/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
    };
 
    buildInputs = [ libusb-compat-0_1 ];
-   makeFlags = stdenv.lib.optionals stdenv.isDarwin [ "CC=cc" ];
+   makeFlags = lib.optionals stdenv.isDarwin [ "CC=cc" ];
 
    installPhase = ''
      mkdir -p $out/bin
diff --git a/pkgs/development/tools/misc/msitools/default.nix b/pkgs/development/tools/misc/msitools/default.nix
index 0990b8d9733..f444f86dbfb 100644
--- a/pkgs/development/tools/misc/msitools/default.nix
+++ b/pkgs/development/tools/misc/msitools/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchurl, intltool, glib, pkg-config, libgsf, libuuid, gcab, bzip2, gnome3 }:
+{ lib, stdenv, fetchurl, intltool, glib, pkg-config, libgsf, libuuid, gcab, bzip2, gnome3 }:
 
 stdenv.mkDerivation rec {
   pname = "msitools";
   version = "0.98";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "19wb3n3nwkpc6bjr0q3f1znaxsfaqgjbdxxnbx8ic8bb5b49hwac";
   };
 
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Set of programs to inspect and build Windows Installer (.MSI) files";
     homepage = "https://wiki.gnome.org/msitools";
     license = [ licenses.gpl2 licenses.lgpl21 ];
diff --git a/pkgs/development/tools/misc/nimlsp/default.nix b/pkgs/development/tools/misc/nimlsp/default.nix
index 5795fca457d..1919e26ddec 100644
--- a/pkgs/development/tools/misc/nimlsp/default.nix
+++ b/pkgs/development/tools/misc/nimlsp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, srcOnly, nim }:
+{ lib, stdenv, fetchFromGitHub, srcOnly, nim }:
 let
   astpatternmatching = fetchFromGitHub {
     owner = "krux02";
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
     install -Dt $out/bin src/nimlsp
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Language Server Protocol implementation for Nim";
     homepage = "https://github.com/PMunch/nimlsp";
     license = licenses.mit;
diff --git a/pkgs/development/tools/misc/ninka/default.nix b/pkgs/development/tools/misc/ninka/default.nix
index e683bef7b06..8e8fb6bb597 100644
--- a/pkgs/development/tools/misc/ninka/default.nix
+++ b/pkgs/development/tools/misc/ninka/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, perl, perlPackages }:
+{ lib, stdenv, fetchFromGitHub, perl, perlPackages }:
 
 assert stdenv ? glibc;
 
@@ -26,7 +26,7 @@ perlPackages.buildPerlPackage {
     perl Makefile.PL
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A sentence based license detector";
     homepage = "http://ninka.turingmachine.org/";
     license = licenses.gpl2;
diff --git a/pkgs/development/tools/misc/nrfutil/default.nix b/pkgs/development/tools/misc/nrfutil/default.nix
index eeb9100a4c8..a8a18b254b9 100644
--- a/pkgs/development/tools/misc/nrfutil/default.nix
+++ b/pkgs/development/tools/misc/nrfutil/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, python37Packages, fetchFromGitHub }:
+{ lib, stdenv, python37Packages, fetchFromGitHub }:
 
 with python37Packages; buildPythonApplication rec {
   pname = "nrfutil";
@@ -20,7 +20,7 @@ with python37Packages; buildPythonApplication rec {
     mkdir test-reports
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Device Firmware Update tool for nRF chips";
     homepage = "https://github.com/NordicSemiconductor/pc-nrfutil";
     license = licenses.unfreeRedistributable;
diff --git a/pkgs/development/tools/misc/nxpmicro-mfgtools/default.nix b/pkgs/development/tools/misc/nxpmicro-mfgtools/default.nix
index e9259b7156b..74309a33f22 100644
--- a/pkgs/development/tools/misc/nxpmicro-mfgtools/default.nix
+++ b/pkgs/development/tools/misc/nxpmicro-mfgtools/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 , pkg-config
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
 
   preConfigure = "echo ${version} > .tarball-version";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Freescale/NXP I.MX chip image deploy tools";
     longDescription = ''
       UUU (Universal Update Utility) is a command line tool, evolved out of
diff --git a/pkgs/development/tools/misc/objconv/default.nix b/pkgs/development/tools/misc/objconv/default.nix
index 52cc1b2d5c5..55147e9a16d 100644
--- a/pkgs/development/tools/misc/objconv/default.nix
+++ b/pkgs/development/tools/misc/objconv/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip }:
+{ lib, stdenv, fetchurl, unzip }:
 
 stdenv.mkDerivation rec {
   pname = "objconv";
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     mv objconv-instructions.pdf $out/doc/objconv
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Object and executable file converter, modifier and disassembler";
     homepage = "https://www.agner.org/optimize/";
     license = licenses.gpl2;
diff --git a/pkgs/development/tools/misc/opengrok/default.nix b/pkgs/development/tools/misc/opengrok/default.nix
index 79fa383300e..01f2ced1f4b 100644
--- a/pkgs/development/tools/misc/opengrok/default.nix
+++ b/pkgs/development/tools/misc/opengrok/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, jre, ctags, makeWrapper, coreutils, git, runtimeShell }:
+{ lib, stdenv, fetchurl, jre, ctags, makeWrapper, coreutils, git, runtimeShell }:
 
 stdenv.mkDerivation rec {
   pname = "opengrok";
@@ -18,12 +18,12 @@ stdenv.mkDerivation rec {
     substituteInPlace $out/bin/OpenGrok --replace "/bin/uname" "${coreutils}/bin/uname"
     substituteInPlace $out/bin/Messages --replace "#!/bin/ksh" "#!${runtimeShell}"
     wrapProgram $out/bin/OpenGrok \
-      --prefix PATH : "${stdenv.lib.makeBinPath [ ctags git ]}" \
+      --prefix PATH : "${lib.makeBinPath [ ctags git ]}" \
       --set JAVA_HOME "${jre}" \
       --set OPENGROK_TOMCAT_BASE "/var/tomcat"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Source code search and cross reference engine";
     homepage = "https://opengrok.github.io/OpenGrok/";
     license = licenses.cddl;
diff --git a/pkgs/development/tools/misc/pahole/default.nix b/pkgs/development/tools/misc/pahole/default.nix
index bb88862a8e8..c39ef5e0051 100644
--- a/pkgs/development/tools/misc/pahole/default.nix
+++ b/pkgs/development/tools/misc/pahole/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, cmake, elfutils, zlib }:
+{ lib, stdenv, fetchgit, cmake, elfutils, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "pahole";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   # Put libraries in "lib" subdirectory, not top level of $out
   cmakeFlags = [ "-D__LIB=lib" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://git.kernel.org/cgit/devel/pahole/pahole.git/";
     description = "Pahole and other DWARF utils";
     license = licenses.gpl2;
diff --git a/pkgs/development/tools/misc/patchelf/default.nix b/pkgs/development/tools/misc/patchelf/default.nix
index 1d31709ccf0..a0c002d8a8c 100644
--- a/pkgs/development/tools/misc/patchelf/default.nix
+++ b/pkgs/development/tools/misc/patchelf/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 # Note: this package is used for bootstrapping fetchurl, and thus
 # cannot use fetchpatch! All mutable patches (generated by GitHub or
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
   # fails 8 out of 24 tests, problems when loading libc.so.6
   doCheck = stdenv.name == "stdenv-linux";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/NixOS/patchelf/blob/master/README";
     license = licenses.gpl3;
     description = "A small utility to modify the dynamic linker and RPATH of ELF executables";
diff --git a/pkgs/development/tools/misc/patchelf/unstable.nix b/pkgs/development/tools/misc/patchelf/unstable.nix
index 0d9eeb84bfb..1d790740e69 100644
--- a/pkgs/development/tools/misc/patchelf/unstable.nix
+++ b/pkgs/development/tools/misc/patchelf/unstable.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook, fetchFromGitHub }:
+{ lib, stdenv, fetchurl, autoreconfHook, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   name = "patchelf-${version}";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   };
 
   # Drop test that fails on musl (?)
-  postPatch = stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+  postPatch = lib.optionalString stdenv.hostPlatform.isMusl ''
     substituteInPlace tests/Makefile.am \
       --replace "set-rpath-library.sh" ""
   '';
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
 
   doCheck = !stdenv.isDarwin;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/NixOS/patchelf/blob/master/README";
     license = licenses.gpl3;
     description = "A small utility to modify the dynamic linker and RPATH of ELF executables";
diff --git a/pkgs/development/tools/misc/perfect-hash/default.nix b/pkgs/development/tools/misc/perfect-hash/default.nix
index 4e405413e3a..7447bf66022 100644
--- a/pkgs/development/tools/misc/perfect-hash/default.nix
+++ b/pkgs/development/tools/misc/perfect-hash/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, python3, fetchFromGitHub }:
+{ lib, stdenv, python3, fetchFromGitHub }:
 python3.pkgs.buildPythonApplication rec {
   pname = "perfect-hash";
   version = "0.4.1";
@@ -18,7 +18,7 @@ python3.pkgs.buildPythonApplication rec {
     cp -r examples $out/share/doc/perfect-hash
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Minimal perfect hash function generator";
     longDescription = ''
       Generate a minimal perfect hash function for a given set of keys.
diff --git a/pkgs/development/tools/misc/pkg-config/default.nix b/pkgs/development/tools/misc/pkg-config/default.nix
index 9b8f01b24e7..b0b3115700f 100644
--- a/pkgs/development/tools/misc/pkg-config/default.nix
+++ b/pkgs/development/tools/misc/pkg-config/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, libiconv, vanilla ? false }:
+{ lib, stdenv, fetchurl, libiconv, vanilla ? false }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "pkg-config";
diff --git a/pkgs/development/tools/misc/pkgconf/default.nix b/pkgs/development/tools/misc/pkgconf/default.nix
index 6fca02ad788..c6c984f9699 100644
--- a/pkgs/development/tools/misc/pkgconf/default.nix
+++ b/pkgs/development/tools/misc/pkgconf/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, removeReferencesTo }:
+{ lib, stdenv, fetchurl, removeReferencesTo }:
 
 stdenv.mkDerivation rec {
   pname = "pkgconf";
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
     mv ${placeholder "dev"}/share ${placeholder "out"}
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Package compiler and linker metadata toolkit";
     homepage = "https://git.dereferenced.org/pkgconf/pkgconf";
     platforms = platforms.all;
diff --git a/pkgs/development/tools/misc/pmccabe/default.nix b/pkgs/development/tools/misc/pmccabe/default.nix
index 81a88f20ad2..1fd58fd14a2 100644
--- a/pkgs/development/tools/misc/pmccabe/default.nix
+++ b/pkgs/development/tools/misc/pmccabe/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "pmccabe";
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "McCabe-style function complexity and line counting for C and C++";
     homepage = "https://people.debian.org/~bame/pmccabe/";
     license = licenses.gpl2Plus;
diff --git a/pkgs/development/tools/misc/prelink/default.nix b/pkgs/development/tools/misc/prelink/default.nix
index 5d7ca75de32..63fc7c8e64a 100644
--- a/pkgs/development/tools/misc/prelink/default.nix
+++ b/pkgs/development/tools/misc/prelink/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libelf }:
+{ lib, stdenv, fetchurl, libelf }:
 
 let
   version = "20130503";
@@ -8,7 +8,7 @@ stdenv.mkDerivation {
   inherit version;
 
   buildInputs = [
-    libelf stdenv.cc.libc (stdenv.lib.getOutput "static" stdenv.cc.libc)
+    libelf stdenv.cc.libc (lib.getOutput "static" stdenv.cc.libc)
   ];
 
   src = fetchurl {
@@ -20,6 +20,6 @@ stdenv.mkDerivation {
     homepage = "https://people.redhat.com/jakub/prelink/";
     license = "GPL";
     description = "ELF prelinking utility to speed up dynamic linking";
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/pkgs/development/tools/misc/premake/3.nix b/pkgs/development/tools/misc/premake/3.nix
index a630c0ced9e..9176842d75d 100644
--- a/pkgs/development/tools/misc/premake/3.nix
+++ b/pkgs/development/tools/misc/premake/3.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, unzip}:
+{lib, stdenv, fetchurl, unzip}:
 
 let baseName = "premake";
   version  = "3.7";
@@ -24,7 +24,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = "http://industriousone.com/premake";
     description = "A simple build configuration and project generation tool using lua";
-    license = stdenv.lib.licenses.bsd3;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.bsd3;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/misc/premake/5.nix b/pkgs/development/tools/misc/premake/5.nix
index 5e8606833d3..bb0269d0cc3 100644
--- a/pkgs/development/tools/misc/premake/5.nix
+++ b/pkgs/development/tools/misc/premake/5.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchFromGitHub, Foundation, readline }:
+{ lib, stdenv, fetchFromGitHub, Foundation, readline }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "premake5";
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://premake.github.io";
     description = "A simple build configuration and project generation tool using lua";
-    license = stdenv.lib.licenses.bsd3;
+    license = lib.licenses.bsd3;
     platforms = platforms.darwin ++ platforms.linux;
   };
 }
diff --git a/pkgs/development/tools/misc/premake/default.nix b/pkgs/development/tools/misc/premake/default.nix
index 92445abbba9..ccd8a4574a1 100644
--- a/pkgs/development/tools/misc/premake/default.nix
+++ b/pkgs/development/tools/misc/premake/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip }:
+{ lib, stdenv, fetchurl, unzip }:
 
 let baseName = "premake";
   version  = "4.3";
@@ -25,10 +25,10 @@ stdenv.mkDerivation {
   premake_cmd = "premake4";
   setupHook = ./setup-hook.sh;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://industriousone.com/premake";
     description = "A simple build configuration and project generation tool using lua";
-    license = stdenv.lib.licenses.bsd3;
+    license = lib.licenses.bsd3;
     platforms = platforms.unix;
     maintainers = [ maintainers.bjornfor ];
   };
diff --git a/pkgs/development/tools/misc/ptags/default.nix b/pkgs/development/tools/misc/ptags/default.nix
index 93014af3f62..0ef7a2aa73a 100644
--- a/pkgs/development/tools/misc/ptags/default.nix
+++ b/pkgs/development/tools/misc/ptags/default.nix
@@ -23,7 +23,7 @@ rustPlatform.buildRustPackage rec {
     $releaseDir/ptags --help > /dev/null
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A parallel universal-ctags wrapper for git repository";
     homepage = "https://github.com/dalance/ptags";
     maintainers = with maintainers; [ pamplemousse ];
diff --git a/pkgs/development/tools/misc/pwndbg/default.nix b/pkgs/development/tools/misc/pwndbg/default.nix
index f9d792d185f..69ed17ab4b9 100644
--- a/pkgs/development/tools/misc/pwndbg/default.nix
+++ b/pkgs/development/tools/misc/pwndbg/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , python3
 , fetchFromGitHub
 , makeWrapper
@@ -42,7 +42,7 @@ in stdenv.mkDerivation rec {
       --set NIX_PYTHONPATH ${pythonPath}
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Exploit Development and Reverse Engineering with GDB Made Easy";
     homepage = "https://github.com/pwndbg/pwndbg";
     license = licenses.mit;
diff --git a/pkgs/development/tools/misc/remarkable/remarkable-toolchain/default.nix b/pkgs/development/tools/misc/remarkable/remarkable-toolchain/default.nix
index d259721353b..643e28e82b2 100644
--- a/pkgs/development/tools/misc/remarkable/remarkable-toolchain/default.nix
+++ b/pkgs/development/tools/misc/remarkable/remarkable-toolchain/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libarchive, python, file, which }:
+{ lib, stdenv, fetchurl, libarchive, python, file, which }:
 
 stdenv.mkDerivation rec {
   pname = "remarkable-toolchain";
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
     ENVCLEANED=1 $src -y -d $out
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A toolchain for cross-compiling to reMarkable tablets";
     homepage = "https://remarkable.engineering/";
     license = licenses.gpl2;
diff --git a/pkgs/development/tools/misc/remarkable/remarkable2-toolchain/default.nix b/pkgs/development/tools/misc/remarkable/remarkable2-toolchain/default.nix
index f4f83f21840..7b4df5df164 100644
--- a/pkgs/development/tools/misc/remarkable/remarkable2-toolchain/default.nix
+++ b/pkgs/development/tools/misc/remarkable/remarkable2-toolchain/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libarchive, python3, file }:
+{ lib, stdenv, fetchurl, libarchive, python3, file }:
 
 stdenv.mkDerivation rec {
   pname = "remarkable2-toolchain";
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     ./install-toolchain.sh -D -y -d $out
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A toolchain for cross-compiling to reMarkable 2 tablets";
     homepage = "https://remarkable.engineering/";
     license = licenses.gpl2Plus;
diff --git a/pkgs/development/tools/misc/rman/default.nix b/pkgs/development/tools/misc/rman/default.nix
index 09769d5c591..1f7de915c97 100644
--- a/pkgs/development/tools/misc/rman/default.nix
+++ b/pkgs/development/tools/misc/rman/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation {
   name = "rman-3.2";
@@ -27,6 +27,6 @@ stdenv.mkDerivation {
   meta = {
     description = "Parse formatted man pages and man page source from most flavors of UNIX and converts them to HTML, ASCII, TkMan, DocBook, and other formats";
     license = "artistic";
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/pkgs/development/tools/misc/rolespec/default.nix b/pkgs/development/tools/misc/rolespec/default.nix
index 6eb13bb242d..d86277993ca 100644
--- a/pkgs/development/tools/misc/rolespec/default.nix
+++ b/pkgs/development/tools/misc/rolespec/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, makeWrapper }:
+{ lib, stdenv, fetchFromGitHub, makeWrapper }:
 
 stdenv.mkDerivation rec {
 
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
   dontPatchELF = true;
   dontStrip = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/nickjj/rolespec";
     description = "A test library for testing Ansible roles";
     longDescription = ''
diff --git a/pkgs/development/tools/misc/saleae-logic/default.nix b/pkgs/development/tools/misc/saleae-logic/default.nix
index b9f84edc964..c26e834ee0f 100644
--- a/pkgs/development/tools/misc/saleae-logic/default.nix
+++ b/pkgs/development/tools/misc/saleae-logic/default.nix
@@ -6,7 +6,7 @@
 #
 # In NixOS, simply add this package to services.udev.packages.
 
-{ stdenv, fetchurl, unzip, glib, libSM, libICE, gtk2, libXext, libXft
+{ lib, stdenv, fetchurl, unzip, glib, libSM, libICE, gtk2, libXext, libXft
 , fontconfig, libXrender, libXfixes, libX11, libXi, libXrandr, libXcursor
 , freetype, libXinerama, libxcb, zlib, pciutils
 , makeDesktopItem, xkeyboardconfig, dbus, runtimeShell, libGL
@@ -14,7 +14,7 @@
 
 let
 
-  libPath = stdenv.lib.makeLibraryPath [
+  libPath = lib.makeLibraryPath [
     glib libSM libICE gtk2 libXext libXft fontconfig libXrender libXfixes libX11
     libXi libXrandr libXcursor freetype libXinerama libxcb zlib stdenv.cc.cc.lib
     dbus libGL
@@ -87,7 +87,7 @@ stdenv.mkDerivation rec {
     cp Drivers/99-SaleaeLogic.rules "$out/etc/udev/rules.d/"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Software for Saleae logic analyzers";
     homepage = "https://www.saleae.com/";
     license = licenses.unfree;
diff --git a/pkgs/development/tools/misc/scc/default.nix b/pkgs/development/tools/misc/scc/default.nix
index 5fc23547615..49052c141a1 100644
--- a/pkgs/development/tools/misc/scc/default.nix
+++ b/pkgs/development/tools/misc/scc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoModule, fetchFromGitHub }:
+{ lib, stdenv, buildGoModule, fetchFromGitHub }:
 
 buildGoModule rec {
   pname = "scc";
@@ -16,7 +16,7 @@ buildGoModule rec {
   # scc has a scripts/ sub-package that's for testing.
   excludedPackages = [ "scripts" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/boyter/scc";
     description = "A very fast accurate code counter with complexity calculations and COCOMO estimates written in pure Go";
     maintainers = with maintainers; [ sigma Br1ght0ne ];
diff --git a/pkgs/development/tools/misc/sipp/default.nix b/pkgs/development/tools/misc/sipp/default.nix
index 610e66a2b9c..22bf244662b 100644
--- a/pkgs/development/tools/misc/sipp/default.nix
+++ b/pkgs/development/tools/misc/sipp/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, ncurses, libpcap }:
+{lib, stdenv, fetchurl, ncurses, libpcap }:
 
 stdenv.mkDerivation rec {
   version = "3.6.0";
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ncurses libpcap];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://sipp.sf.net";
     description = "The SIPp testing tool";
     license = licenses.gpl3;
diff --git a/pkgs/development/tools/misc/sloccount/default.nix b/pkgs/development/tools/misc/sloccount/default.nix
index b2b83aa79b1..fc041f2ee8d 100644
--- a/pkgs/development/tools/misc/sloccount/default.nix
+++ b/pkgs/development/tools/misc/sloccount/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, perl, makeWrapper }:
+{ fetchurl, lib, stdenv, perl, makeWrapper }:
 
 stdenv.mkDerivation rec {
   name = "sloccount-2.26";
@@ -62,11 +62,11 @@ stdenv.mkDerivation rec {
       the Perl CPAN library using this tool suite.
     '';
 
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
 
     homepage = "https://www.dwheeler.com/sloccount/";
 
     maintainers = [ ];
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/development/tools/misc/srecord/default.nix b/pkgs/development/tools/misc/srecord/default.nix
index f978d4d4e12..a18dcd85255 100644
--- a/pkgs/development/tools/misc/srecord/default.nix
+++ b/pkgs/development/tools/misc/srecord/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, boost, libtool, groff, ghostscript, libgcrypt ? null }:
+{ lib, stdenv, fetchurl, boost, libtool, groff, ghostscript, libgcrypt ? null }:
 
 stdenv.mkDerivation rec {
   name = "srecord-1.64";
@@ -10,13 +10,13 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ boost libtool groff ghostscript libgcrypt ];
 
-  configureFlags = stdenv.lib.optional (libgcrypt == null) "--without-gcrypt";
+  configureFlags = lib.optional (libgcrypt == null) "--without-gcrypt";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Collection of powerful tools for manipulating EPROM load files";
     homepage = "http://srecord.sourceforge.net/";
     license = licenses.gpl3Plus;
     maintainers = [ maintainers.bjornfor ];
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/misc/stlink/default.nix b/pkgs/development/tools/misc/stlink/default.nix
index 7595b84721c..e67fd9ca7a8 100644
--- a/pkgs/development/tools/misc/stlink/default.nix
+++ b/pkgs/development/tools/misc/stlink/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, libusb1 }:
+{ lib, stdenv, fetchFromGitHub, cmake, libusb1 }:
 
 let
   # The Darwin build of stlink explicitly refers to static libusb.
@@ -29,7 +29,7 @@ in stdenv.mkDerivation rec {
     mkdir -p $out/etc/modprobe.d
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "In-circuit debug and programming for ST-Link devices";
     license = licenses.bsd3;
     platforms = platforms.unix;
diff --git a/pkgs/development/tools/misc/stm32cubemx/default.nix b/pkgs/development/tools/misc/stm32cubemx/default.nix
index 9fe34aecade..3b754e4c91b 100644
--- a/pkgs/development/tools/misc/stm32cubemx/default.nix
+++ b/pkgs/development/tools/misc/stm32cubemx/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, requireFile, makeDesktopItem, libicns, imagemagick, jre, fetchzip }:
+{ lib, stdenv, requireFile, makeDesktopItem, libicns, imagemagick, jre, fetchzip }:
 
 let
   version = "6.0.1";
@@ -49,7 +49,7 @@ stdenv.mkDerivation rec {
     ln -s ${desktopItem}/share/applications/* $out/share/applications
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A graphical tool for configuring STM32 microcontrollers and microprocessors";
     longDescription = ''
       A graphical tool that allows a very easy configuration of STM32
diff --git a/pkgs/development/tools/misc/stm32flash/default.nix b/pkgs/development/tools/misc/stm32flash/default.nix
index 0c2cb96a9d6..bc7d4b1b3dc 100644
--- a/pkgs/development/tools/misc/stm32flash/default.nix
+++ b/pkgs/development/tools/misc/stm32flash/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "stm32flash-0.5";
@@ -16,10 +16,10 @@ stdenv.mkDerivation rec {
     cp stm32flash $out/bin/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Open source flash program for the STM32 ARM processors using the ST bootloader";
     homepage = "https://sourceforge.net/projects/stm32flash/";
-    license = stdenv.lib.licenses.gpl2;
+    license = lib.licenses.gpl2;
     platforms = platforms.all; # Should work on all platforms
     maintainers = with maintainers; [ elitak ];
   };
diff --git a/pkgs/development/tools/misc/strace/default.nix b/pkgs/development/tools/misc/strace/default.nix
index 877aedc4e49..004e1527d35 100644
--- a/pkgs/development/tools/misc/strace/default.nix
+++ b/pkgs/development/tools/misc/strace/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, libunwind, buildPackages }:
+{ lib, stdenv, fetchurl, perl, libunwind, buildPackages }:
 
 stdenv.mkDerivation rec {
   pname = "strace";
@@ -12,13 +12,13 @@ stdenv.mkDerivation rec {
   depsBuildBuild = [ buildPackages.stdenv.cc ];
   nativeBuildInputs = [ perl ];
 
-  buildInputs = [ perl.out ] ++ stdenv.lib.optional libunwind.supportsHost libunwind; # support -k
+  buildInputs = [ perl.out ] ++ lib.optional libunwind.supportsHost libunwind; # support -k
 
   postPatch = "patchShebangs --host strace-graph";
 
   configureFlags = [ "--enable-mpers=check" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://strace.io/";
     description = "A system call tracer for Linux";
     license =  with licenses; [ lgpl21Plus gpl2Plus ]; # gpl2Plus is for the test suite
diff --git a/pkgs/development/tools/misc/swig/2.x.nix b/pkgs/development/tools/misc/swig/2.x.nix
index 745cc9a2e78..1068b3e2ad9 100644
--- a/pkgs/development/tools/misc/swig/2.x.nix
+++ b/pkgs/development/tools/misc/swig/2.x.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoconf, automake, libtool, bison, pcre }:
+{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, bison, pcre }:
 
 stdenv.mkDerivation rec {
   pname = "swig";
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
     ./autogen.sh
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "SWIG, an interface compiler that connects C/C++ code to higher-level languages";
     homepage = "http://swig.org/";
     # Different types of licenses available: http://www.swig.org/Release/LICENSE .
diff --git a/pkgs/development/tools/misc/swig/3.x.nix b/pkgs/development/tools/misc/swig/3.x.nix
index 853a240ffc3..109243b54ba 100644
--- a/pkgs/development/tools/misc/swig/3.x.nix
+++ b/pkgs/development/tools/misc/swig/3.x.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoconf, automake, libtool, bison, pcre }:
+{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, bison, pcre }:
 
 stdenv.mkDerivation rec {
   pname = "swig";
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
     ./autogen.sh
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An interface compiler that connects C/C++ code to higher-level languages";
     homepage = "http://swig.org/";
     # Different types of licenses available: http://www.swig.org/Release/LICENSE .
diff --git a/pkgs/development/tools/misc/swig/4.nix b/pkgs/development/tools/misc/swig/4.nix
index 4096b7353fa..56106143027 100644
--- a/pkgs/development/tools/misc/swig/4.nix
+++ b/pkgs/development/tools/misc/swig/4.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoconf, automake, libtool, bison, pcre }:
+{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, bison, pcre }:
 
 stdenv.mkDerivation rec {
   pname = "swig";
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
     ./autogen.sh
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "SWIG, an interface compiler that connects C/C++ code to higher-level languages";
     homepage = "http://swig.org/";
     # Different types of licenses available: http://www.swig.org/Release/LICENSE .
diff --git a/pkgs/development/tools/misc/swig/default.nix b/pkgs/development/tools/misc/swig/default.nix
index cf0880855db..3c1a5b82dc2 100644
--- a/pkgs/development/tools/misc/swig/default.nix
+++ b/pkgs/development/tools/misc/swig/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, boost, tcl }:
+{ lib, stdenv, fetchurl, boost, tcl }:
 
 stdenv.mkDerivation rec {
   pname = "swig";
@@ -11,12 +11,12 @@ stdenv.mkDerivation rec {
 
   doCheck = !stdenv.isCygwin;
   # 'make check' uses boost and tcl
-  buildInputs = stdenv.lib.optionals doCheck [ boost tcl ];
+  buildInputs = lib.optionals doCheck [ boost tcl ];
 
   configureFlags = [ "--disable-ccache" ];
 
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "SWIG, an interface compiler that connects C/C++ code to higher-level languages";
     homepage = "http://swig.org/";
     # Different types of licenses available: http://www.swig.org/Release/LICENSE .
diff --git a/pkgs/development/tools/misc/sysbench/default.nix b/pkgs/development/tools/misc/sysbench/default.nix
index fb9b1966015..2cf8c91d3bf 100644
--- a/pkgs/development/tools/misc/sysbench/default.nix
+++ b/pkgs/development/tools/misc/sysbench/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkg-config
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config
 , libmysqlclient, libaio
 }:
 
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Modular, cross-platform and multi-threaded benchmark tool";
     homepage = "https://github.com/akopytov/sysbench";
-    license = stdenv.lib.licenses.gpl2;
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/pkgs/development/tools/misc/tcptrack/default.nix b/pkgs/development/tools/misc/tcptrack/default.nix
index 9872c91ac4b..5b1fd72a7f5 100644
--- a/pkgs/development/tools/misc/tcptrack/default.nix
+++ b/pkgs/development/tools/misc/tcptrack/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, ncurses, libpcap }:
+{ lib, stdenv, fetchFromGitHub, ncurses, libpcap }:
 
 stdenv.mkDerivation rec {
   pname = "tcptrack";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   NIX_CFLAGS_COMPILE = "-Wno-error=cpp";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit (src.meta) homepage;
     description = "libpcap based program for live TCP connection monitoring";
     license = licenses.lgpl21;
diff --git a/pkgs/development/tools/misc/teensy-loader-cli/default.nix b/pkgs/development/tools/misc/teensy-loader-cli/default.nix
index 40f3921ec70..156e3f7f895 100644
--- a/pkgs/development/tools/misc/teensy-loader-cli/default.nix
+++ b/pkgs/development/tools/misc/teensy-loader-cli/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, go-md2man, installShellFiles, libusb-compat-0_1 }:
+{ lib, stdenv, fetchFromGitHub, go-md2man, installShellFiles, libusb-compat-0_1 }:
 
 stdenv.mkDerivation rec {
   pname = "teensy-loader-cli";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     installManPage *.1
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Firmware uploader for the Teensy microcontroller boards";
     homepage = "https://www.pjrc.com/teensy/";
     license = licenses.gpl3;
diff --git a/pkgs/development/tools/misc/tet/default.nix b/pkgs/development/tools/misc/tet/default.nix
index acc42d61423..5e66b974337 100644
--- a/pkgs/development/tools/misc/tet/default.nix
+++ b/pkgs/development/tools/misc/tet/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv }:
+{ fetchurl, lib, stdenv }:
 
 stdenv.mkDerivation ({
   version = "3.8";
@@ -22,8 +22,8 @@ stdenv.mkDerivation ({
   meta = {
     description = "The Test Environment Toolkit is used in test applications like The Open Group's UNIX Certification program and the Free Standards Group's LSB Certification program";
     homepage = "http://tetworks.opengroup.org/Products/tet.htm";
-    license = stdenv.lib.licenses.artistic1;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.artistic1;
+    platforms = lib.platforms.unix;
     maintainers = [ ];
   };
 })
diff --git a/pkgs/development/tools/misc/texi2html/default.nix b/pkgs/development/tools/misc/texi2html/default.nix
index 0c3736ff2f3..98f846b7c2f 100644
--- a/pkgs/development/tools/misc/texi2html/default.nix
+++ b/pkgs/development/tools/misc/texi2html/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, gettext, buildPackages }:
+{ lib, stdenv, fetchurl, perl, gettext, buildPackages }:
 
 stdenv.mkDerivation rec {
   pname = "texi2html";
@@ -18,13 +18,13 @@ stdenv.mkDerivation rec {
     patchShebangs separated_to_hash.pl
   '';
 
-  postInstall = stdenv.lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
+  postInstall = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
     for f in $out/bin/*; do
       substituteInPlace $f --replace "${buildPackages.perl}" "${perl}"
     done
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Perl script which converts Texinfo source files to HTML output";
     homepage = "https://www.nongnu.org/texi2html/";
     license = licenses.gpl2;
diff --git a/pkgs/development/tools/misc/texinfo/common.nix b/pkgs/development/tools/misc/texinfo/common.nix
index 057e52615ac..1c5de083bc0 100644
--- a/pkgs/development/tools/misc/texinfo/common.nix
+++ b/pkgs/development/tools/misc/texinfo/common.nix
@@ -1,6 +1,6 @@
 { version, sha256 }:
 
-{ stdenv, buildPackages, fetchurl, perl, xz, gettext
+{ lib, stdenv, buildPackages, fetchurl, perl, xz, gettext
 
 # we are a dependency of gcc, this simplifies bootstraping
 , interactive ? false, ncurses, procps
@@ -15,7 +15,7 @@ let
   crossBuildTools = stdenv.hostPlatform != stdenv.buildPlatform;
 in
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation {
   name = "texinfo-${optionalString interactive "interactive-"}${version}";
@@ -43,7 +43,7 @@ stdenv.mkDerivation {
     ++ optional interactive ncurses;
 
   configureFlags = [ "PERL=${buildPackages.perl}/bin/perl" ]
-    ++ stdenv.lib.optional stdenv.isSunOS "AWK=${gawk}/bin/awk";
+    ++ lib.optional stdenv.isSunOS "AWK=${gawk}/bin/awk";
 
   installFlags = [ "TEXMF=$(out)/texmf-dist" ];
   installTargets = [ "install" "install-tex" ];
diff --git a/pkgs/development/tools/misc/tie/default.nix b/pkgs/development/tools/misc/tie/default.nix
index 074523309b6..e75248aa867 100644
--- a/pkgs/development/tools/misc/tie/default.nix
+++ b/pkgs/development/tools/misc/tie/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "tie";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     cp tie $out/bin
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.ctan.org/tex-archive/web/tie";
     description = "Allow multiple web change files";
     platforms = with platforms; unix;
diff --git a/pkgs/development/tools/misc/tokei/default.nix b/pkgs/development/tools/misc/tokei/default.nix
index 32094d9303b..47966dcc133 100644
--- a/pkgs/development/tools/misc/tokei/default.nix
+++ b/pkgs/development/tools/misc/tokei/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, rustPlatform, libiconv, darwin }:
+{ lib, stdenv, fetchFromGitHub, rustPlatform, libiconv, darwin }:
 
 rustPlatform.buildRustPackage rec {
   pname = "tokei";
@@ -13,14 +13,14 @@ rustPlatform.buildRustPackage rec {
 
   cargoSha256 = "sha256-iUDc54E8AiLMJw9h99kg/3VmaSi8GqfQyrPwa9nJ994=";
 
-  buildInputs = stdenv.lib.optionals stdenv.isDarwin [
+  buildInputs = lib.optionals stdenv.isDarwin [
     libiconv darwin.apple_sdk.frameworks.Security
   ];
 
   # enable all output formats
   cargoBuildFlags = [ "--features" "all" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A program that allows you to count your code, quickly";
     longDescription = ''
       Tokei is a program that displays statistics about your code. Tokei will show number of files, total lines within those files and code, comments, and blanks grouped by language.
diff --git a/pkgs/development/tools/misc/uisp/default.nix b/pkgs/development/tools/misc/uisp/default.nix
index ca51e089733..1fb255073ed 100644
--- a/pkgs/development/tools/misc/uisp/default.nix
+++ b/pkgs/development/tools/misc/uisp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation {
   name = "uisp-20050207";
@@ -12,8 +12,8 @@ stdenv.mkDerivation {
 
   meta = {
     description = "Tool for AVR microcontrollers which can interface to many hardware in-system programmers";
-    license = stdenv.lib.licenses.gpl2;
+    license = lib.licenses.gpl2;
     homepage = "https://savannah.nongnu.org/projects/uisp";
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/pkgs/development/tools/misc/uncrustify/default.nix b/pkgs/development/tools/misc/uncrustify/default.nix
index 526e71515ae..f6b51a969b2 100644
--- a/pkgs/development/tools/misc/uncrustify/default.nix
+++ b/pkgs/development/tools/misc/uncrustify/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, python }:
+{ lib, stdenv, fetchFromGitHub, cmake, python }:
 
 stdenv.mkDerivation rec {
   name = "${product}-${version}";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake python ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Source code beautifier for C, C++, C#, ObjectiveC, D, Java, Pawn and VALA";
     homepage = "http://uncrustify.sourceforge.net/";
     license = licenses.gpl2Plus;
diff --git a/pkgs/development/tools/misc/unifdef/default.nix b/pkgs/development/tools/misc/unifdef/default.nix
index 19dd907b73b..53e2b2762d3 100644
--- a/pkgs/development/tools/misc/unifdef/default.nix
+++ b/pkgs/development/tools/misc/unifdef/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv }:
+{ fetchurl, lib, stdenv }:
 
 stdenv.mkDerivation rec {
   name = "unifdef-2.6";
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     export DESTDIR=$out
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://dotat.at/prog/unifdef/";
     description = "Selectively remove C preprocessor conditionals";
     license = licenses.bsd2;
diff --git a/pkgs/development/tools/misc/universal-ctags/default.nix b/pkgs/development/tools/misc/universal-ctags/default.nix
index b086b3cdc48..bd362e8d1a4 100644
--- a/pkgs/development/tools/misc/universal-ctags/default.nix
+++ b/pkgs/development/tools/misc/universal-ctags/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkg-config, perl, pythonPackages, libiconv, jansson }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, perl, pythonPackages, libiconv, jansson }:
 
 stdenv.mkDerivation {
   pname = "universal-ctags";
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
   };
 
   nativeBuildInputs = [ autoreconfHook pkg-config pythonPackages.docutils ];
-  buildInputs = [ jansson ] ++ stdenv.lib.optional stdenv.isDarwin libiconv;
+  buildInputs = [ jansson ] ++ lib.optional stdenv.isDarwin libiconv;
 
   # to generate makefile.in
   autoreconfPhase = ''
@@ -35,7 +35,7 @@ stdenv.mkDerivation {
 
   checkFlags = [ "units" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A maintained ctags implementation";
     homepage = "https://ctags.io/";
     license = licenses.gpl2Plus;
diff --git a/pkgs/development/tools/misc/unused/default.nix b/pkgs/development/tools/misc/unused/default.nix
index 3e5f9c319ef..6487c3fc2c0 100644
--- a/pkgs/development/tools/misc/unused/default.nix
+++ b/pkgs/development/tools/misc/unused/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, rustPlatform, cmake }:
+{ lib, stdenv, fetchFromGitHub, rustPlatform, cmake }:
 rustPlatform.buildRustPackage rec {
   pname = "unused";
   version = "0.2.1";
@@ -14,7 +14,7 @@ rustPlatform.buildRustPackage rec {
 
   cargoSha256 = "1c0gj2wp0nydv0binxj3ikm5sm6y5z3pklp5b06dgvq02licz57a";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A tool to identify potentially unused code";
     homepage = "https://unused.codes";
     license = licenses.mit;
diff --git a/pkgs/development/tools/misc/usb-modeswitch/data.nix b/pkgs/development/tools/misc/usb-modeswitch/data.nix
index 6280b103ab6..7bb9fc69c58 100644
--- a/pkgs/development/tools/misc/usb-modeswitch/data.nix
+++ b/pkgs/development/tools/misc/usb-modeswitch/data.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, tcl, usb-modeswitch }:
+{ lib, stdenv, fetchurl, tcl, usb-modeswitch }:
 
 stdenv.mkDerivation rec {
   pname = "usb-modeswitch-data";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
   # the usb_modeswitch.d directory
   nativeBuildInputs = [ tcl ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Device database and the rules file for 'multi-mode' USB devices";
     inherit (usb-modeswitch.meta) license maintainers platforms;
   };
diff --git a/pkgs/development/tools/misc/usb-modeswitch/default.nix b/pkgs/development/tools/misc/usb-modeswitch/default.nix
index 5cbe627b553..4f9dbe92d2b 100644
--- a/pkgs/development/tools/misc/usb-modeswitch/default.nix
+++ b/pkgs/development/tools/misc/usb-modeswitch/default.nix
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ libusb1 tcl ];
   nativeBuildInputs = [ pkg-config makeWrapper ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A mode switching tool for controlling 'multi-mode' USB devices";
     license = licenses.gpl2;
     maintainers = with maintainers; [ marcweber peterhoeg ];
diff --git a/pkgs/development/tools/misc/vtable-dumper/default.nix b/pkgs/development/tools/misc/vtable-dumper/default.nix
index a44140c1445..1bd59aa9944 100644
--- a/pkgs/development/tools/misc/vtable-dumper/default.nix
+++ b/pkgs/development/tools/misc/vtable-dumper/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, libelf }:
+{ lib, stdenv, fetchFromGitHub, libelf }:
 
 stdenv.mkDerivation rec {
   pname = "vtable-dumper";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ libelf ];
   makeFlags = [ "prefix=$(out)" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/lvc/vtable-dumper";
     description = "A tool to list content of virtual tables in a C++ shared library";
     license = licenses.lgpl21;
diff --git a/pkgs/development/tools/misc/watson-ruby/default.nix b/pkgs/development/tools/misc/watson-ruby/default.nix
index 81f5430371a..23ec0643d77 100644
--- a/pkgs/development/tools/misc/watson-ruby/default.nix
+++ b/pkgs/development/tools/misc/watson-ruby/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, bundlerEnv, ruby, bundlerUpdateScript }:
+{ lib, stdenv, bundlerEnv, ruby, bundlerUpdateScript }:
 
 stdenv.mkDerivation rec {
   pname = "watson-ruby";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   passthru.updateScript = bundlerUpdateScript "watson-ruby";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An inline issue manager";
     homepage    = "https://goosecode.com/watson/";
     license     = with licenses; mit;
diff --git a/pkgs/development/tools/misc/whatstyle/default.nix b/pkgs/development/tools/misc/whatstyle/default.nix
index c882d6243fa..6afcfe871a4 100644
--- a/pkgs/development/tools/misc/whatstyle/default.nix
+++ b/pkgs/development/tools/misc/whatstyle/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, python3, fetchFromGitHub, clang-unwrapped }:
+{ lib, stdenv, python3, fetchFromGitHub, clang-unwrapped }:
 
 python3.pkgs.buildPythonApplication rec {
   pname = "whatstyle";
@@ -20,7 +20,7 @@ python3.pkgs.buildPythonApplication rec {
 
   doCheck = false; # 3 or 4 failures depending on version, haven't investigated.
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Find a code format style that fits given source files";
     homepage = "https://github.com/mikr/whatstyle";
     license = licenses.mit;
diff --git a/pkgs/development/tools/misc/xc3sprog/default.nix b/pkgs/development/tools/misc/xc3sprog/default.nix
index e54dc7844e7..b9785bac7c5 100644
--- a/pkgs/development/tools/misc/xc3sprog/default.nix
+++ b/pkgs/development/tools/misc/xc3sprog/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchsvn, cmake, libusb-compat-0_1, libftdi }:
+{ lib, stdenv, fetchsvn, cmake, libusb-compat-0_1, libftdi }:
 
 # The xc3sprog project doesn't seem to make proper releases, they only put out
 # prebuilt binary subversion snapshots on sourceforge.
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake ];
   buildInputs = [ libusb-compat-0_1 libftdi ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Command-line tools for programming FPGAs, microcontrollers and PROMs via JTAG";
     homepage = "http://xc3sprog.sourceforge.net/";
     license = licenses.gpl2Plus;
diff --git a/pkgs/development/tools/misc/ycmd/default.nix b/pkgs/development/tools/misc/ycmd/default.nix
index 4bbff3ca33f..cf4fe39754f 100644
--- a/pkgs/development/tools/misc/ycmd/default.nix
+++ b/pkgs/development/tools/misc/ycmd/default.nix
@@ -19,9 +19,9 @@ stdenv.mkDerivation {
   };
 
   nativeBuildInputs = [ cmake ]
-    ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+    ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
   buildInputs = [ boost llvmPackages.libclang ]
-    ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin Cocoa;
+    ++ lib.optional stdenv.hostPlatform.isDarwin Cocoa;
 
   buildPhase = ''
     export EXTRA_CMAKE_ARGS=-DPATH_TO_LLVM_ROOT=${llvmPackages.clang-unwrapped}
@@ -90,7 +90,7 @@ stdenv.mkDerivation {
                 "'$out/lib/ycmd/ycmd/__main__.py'"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A code-completion and comprehension server";
     homepage = "https://github.com/Valloric/ycmd";
     license = licenses.gpl3;
diff --git a/pkgs/development/tools/misc/yodl/default.nix b/pkgs/development/tools/misc/yodl/default.nix
index 6bb7e1377af..a8b48e9fa53 100644
--- a/pkgs/development/tools/misc/yodl/default.nix
+++ b/pkgs/development/tools/misc/yodl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitLab, perl, icmake, util-linux }:
+{ lib, stdenv, fetchFromGitLab, perl, icmake, util-linux }:
 
 stdenv.mkDerivation rec {
   pname = "yodl";
@@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
     ./build install man
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A package that implements a pre-document language and tools to process it";
     homepage = "https://fbb-git.gitlab.io/yodl/";
     license = licenses.gpl3;
diff --git a/pkgs/development/tools/modd/default.nix b/pkgs/development/tools/modd/default.nix
index 5c63447fdc5..efe4c960566 100644
--- a/pkgs/development/tools/modd/default.nix
+++ b/pkgs/development/tools/modd/default.nix
@@ -1,4 +1,4 @@
-{ buildGoPackage, fetchFromGitHub, stdenv }:
+{ buildGoPackage, fetchFromGitHub, lib, stdenv }:
 
 buildGoPackage rec {
   pname = "modd";
@@ -11,7 +11,7 @@ buildGoPackage rec {
   };
   goPackagePath = "github.com/cortesi/modd";
   subPackages = [ "cmd/modd" ];
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A flexible developer tool that runs processes and responds to filesystem changes";
     homepage = "https://github.com/cortesi/modd";
     license = licenses.mit;
diff --git a/pkgs/development/tools/mustache-go/default.nix b/pkgs/development/tools/mustache-go/default.nix
index 7bcf72df55c..99e4eb62156 100644
--- a/pkgs/development/tools/mustache-go/default.nix
+++ b/pkgs/development/tools/mustache-go/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "mustache-go";
@@ -13,7 +13,7 @@ buildGoPackage rec {
     sha256 = "0mnh5zbpfwymddm1dppg9i9d1r8jqyg03z2gl6c5a8fgbrnxpjvc";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/cbroglie/mustache";
     description = "The mustache template language in Go";
     license = [ licenses.mit ];
diff --git a/pkgs/development/tools/nemiver/default.nix b/pkgs/development/tools/nemiver/default.nix
index 2f51f0d9338..58c0f2ed28b 100644
--- a/pkgs/development/tools/nemiver/default.nix
+++ b/pkgs/development/tools/nemiver/default.nix
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   version = "0.9.6";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/nemiver/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/nemiver/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "85ab8cf6c4f83262f441cb0952a6147d075c3c53d0687389a3555e946b694ef2";
   };
 
diff --git a/pkgs/development/tools/neoload/default.nix b/pkgs/development/tools/neoload/default.nix
index be772f60492..fb85aa80dc3 100644
--- a/pkgs/development/tools/neoload/default.nix
+++ b/pkgs/development/tools/neoload/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, writeTextFile, jre, makeWrapper, fontsConf, licenseAccepted ? false }:
+{ lib, stdenv, fetchurl, writeTextFile, jre, makeWrapper, fontsConf, licenseAccepted ? false }:
 
 # If you happen to use this software on the XMonad window manager, you will have issues with
 # grey windows, no resizing, menus not showing and other glitches.
@@ -87,9 +87,9 @@ in stdenv.mkDerivation {
     homepage = "https://www.neotys.com/product/overview-neoload.html";
 
     # https://www.neotys.com/documents/legal/eula/neoload/eula_en.html
-    license = stdenv.lib.licenses.unfree;
+    license = lib.licenses.unfree;
 
-    maintainers = [ stdenv.lib.maintainers.bluescreen303 ];
+    maintainers = [ lib.maintainers.bluescreen303 ];
     platforms = [ "i686-linux" "x86_64-linux" ];
   };
 }
diff --git a/pkgs/development/tools/node-webkit/nw12.nix b/pkgs/development/tools/node-webkit/nw12.nix
index ffd2a78f509..31358129821 100644
--- a/pkgs/development/tools/node-webkit/nw12.nix
+++ b/pkgs/development/tools/node-webkit/nw12.nix
@@ -41,7 +41,7 @@ in stdenv.mkDerivation rec {
 
     ln -s ${lib.getLib systemd}/lib/libudev.so $out/share/nwjs/libudev.so.0
 
-    patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:${stdenv.lib.makeLibraryPath [ stdenv.cc.cc ]}:$out/share/nwjs" $out/share/nwjs/nw
+    patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:${lib.makeLibraryPath [ stdenv.cc.cc ]}:$out/share/nwjs" $out/share/nwjs/nw
     patchelf --set-rpath "${nwEnv}/lib:${nwEnv}/lib64:$out/share/nwjs" $out/share/nwjs/nwjc
 
     mkdir -p $out/bin
@@ -51,7 +51,7 @@ in stdenv.mkDerivation rec {
 
   buildInputs = [ makeWrapper ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An app runtime based on Chromium and node.js";
     homepage = "https://nwjs.io/";
     platforms = ["i686-linux" "x86_64-linux"];
diff --git a/pkgs/development/tools/nrpl/default.nix b/pkgs/development/tools/nrpl/default.nix
index a1c9bfd53e3..72177582919 100644
--- a/pkgs/development/tools/nrpl/default.nix
+++ b/pkgs/development/tools/nrpl/default.nix
@@ -35,7 +35,7 @@ stdenv.mkDerivation {
       --prefix PATH : ${lib.makeBinPath [ nim tinycc ]}
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "REPL for the Nim programming language";
     homepage = "https://github.com/wheineman/nrpl";
     license = licenses.mit;
diff --git a/pkgs/development/tools/nwjs/default.nix b/pkgs/development/tools/nwjs/default.nix
index 4eedc003272..d3490b2b9c9 100644
--- a/pkgs/development/tools/nwjs/default.nix
+++ b/pkgs/development/tools/nwjs/default.nix
@@ -53,7 +53,7 @@ in stdenv.mkDerivation rec {
   dontPatchELF = true;
 
   installPhase =
-    let ccPath = stdenv.lib.makeLibraryPath [ stdenv.cc.cc ];
+    let ccPath = lib.makeLibraryPath [ stdenv.cc.cc ];
     in ''
       mkdir -p $out/share/nwjs
       cp -R * $out/share/nwjs
@@ -85,7 +85,7 @@ in stdenv.mkDerivation rec {
 
   buildInputs = [ makeWrapper ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An app runtime based on Chromium and node.js";
     homepage = "https://nwjs.io/";
     platforms = ["i686-linux" "x86_64-linux"];
diff --git a/pkgs/development/tools/ocaml/camlidl/default.nix b/pkgs/development/tools/ocaml/camlidl/default.nix
index 309c44d6d46..a464996ff38 100644
--- a/pkgs/development/tools/ocaml/camlidl/default.nix
+++ b/pkgs/development/tools/ocaml/camlidl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ocaml, writeText }:
+{ lib, stdenv, fetchurl, ocaml, writeText }:
 
 let
   pname = "camlidl";
@@ -46,6 +46,6 @@ stdenv.mkDerivation rec {
     description = "A stub code generator and COM binding for Objective Caml";
     homepage = webpage;
     license = "LGPL";
-    maintainers = [ stdenv.lib.maintainers.roconnor ];
+    maintainers = [ lib.maintainers.roconnor ];
   };
 }
diff --git a/pkgs/development/tools/ocaml/camlp4/default.nix b/pkgs/development/tools/ocaml/camlp4/default.nix
index 73228655cca..fffa426ba4c 100644
--- a/pkgs/development/tools/ocaml/camlp4/default.nix
+++ b/pkgs/development/tools/ocaml/camlp4/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchzip, which, ocaml, ocamlbuild }:
+{ lib, stdenv, fetchzip, which, ocaml, ocamlbuild }:
 
-if stdenv.lib.versionAtLeast ocaml.version "4.09"
+if lib.versionAtLeast ocaml.version "4.09"
 then throw "camlp4 is not available for OCaml ${ocaml.version}"
 else
 
@@ -66,7 +66,7 @@ stdenv.mkDerivation rec {
 
   dontStrip = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A software system for writing extensible parsers for programming languages";
     homepage = "https://github.com/ocaml/camlp4";
     platforms = ocaml.meta.platforms or [];
diff --git a/pkgs/development/tools/ocaml/camlp5/default.nix b/pkgs/development/tools/ocaml/camlp5/default.nix
index 6d68a320a91..fc79cafdc42 100644
--- a/pkgs/development/tools/ocaml/camlp5/default.nix
+++ b/pkgs/development/tools/ocaml/camlp5/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchzip, ocaml, perl }:
+{ lib, stdenv, fetchzip, ocaml, perl }:
 
-if stdenv.lib.versionOlder ocaml.version "4.02"
+if lib.versionOlder ocaml.version "4.02"
 then throw "camlp5 is not available for OCaml ${ocaml.version}"
 else
 
@@ -26,7 +26,7 @@ stdenv.mkDerivation {
 
   dontStrip = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Preprocessor-pretty-printer for OCaml";
     longDescription = ''
       Camlp5 is a preprocessor and pretty-printer for OCaml programs.
diff --git a/pkgs/development/tools/ocaml/cppo/default.nix b/pkgs/development/tools/ocaml/cppo/default.nix
index a0215fa8147..032f346bf9c 100644
--- a/pkgs/development/tools/ocaml/cppo/default.nix
+++ b/pkgs/development/tools/ocaml/cppo/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchurl, fetchFromGitHub, ocaml, findlib, ocamlbuild
+{ lib, stdenv, fetchurl, fetchFromGitHub, ocaml, findlib, ocamlbuild
 , buildDunePackage
 }:
 
 let
   pname = "cppo";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "The C preprocessor for OCaml";
     longDescription = ''
       Cppo is an equivalent of the C preprocessor targeted at the OCaml language and its variants.
@@ -17,7 +17,7 @@ let
 
 in
 
-if stdenv.lib.versionAtLeast ocaml.version "4.02" then
+if lib.versionAtLeast ocaml.version "4.02" then
 
 buildDunePackage rec {
   inherit pname;
diff --git a/pkgs/development/tools/ocaml/dune/2.nix b/pkgs/development/tools/ocaml/dune/2.nix
index 8183e106aa7..f2fe3693ed7 100644
--- a/pkgs/development/tools/ocaml/dune/2.nix
+++ b/pkgs/development/tools/ocaml/dune/2.nix
@@ -1,16 +1,16 @@
-{ stdenv, fetchurl, ocaml, findlib }:
+{ lib, stdenv, fetchurl, ocaml, findlib }:
 
-if stdenv.lib.versionOlder ocaml.version "4.08"
+if lib.versionOlder ocaml.version "4.08"
 then throw "dune is not available for OCaml ${ocaml.version}"
 else
 
 stdenv.mkDerivation rec {
   pname = "dune";
-  version = "2.8.0";
+  version = "2.8.2";
 
   src = fetchurl {
     url = "https://github.com/ocaml/dune/releases/download/${version}/dune-${version}.tbz";
-    sha256 = "12yly2lp93ijhy7b72p6y2q3cr3yy3hk7rlmrh072py8a6d4s407";
+    sha256 = "07mf6pnmv1a6wh4la45zf6cn6qy2vcmz4xgx0djj75kw1wiyii72";
   };
 
   buildInputs = [ ocaml findlib ];
@@ -24,9 +24,9 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://dune.build/";
     description = "A composable build system";
-    changelog = "https://github.com/ocaml/dune/releases/tag/${version}";
-    maintainers = [ stdenv.lib.maintainers.vbgl stdenv.lib.maintainers.marsam ];
-    license = stdenv.lib.licenses.mit;
+    changelog = "https://github.com/ocaml/dune/blob/${version}/CHANGES.md";
+    maintainers = [ lib.maintainers.vbgl lib.maintainers.marsam ];
+    license = lib.licenses.mit;
     inherit (ocaml.meta) platforms;
   };
 }
diff --git a/pkgs/development/tools/ocaml/findlib/default.nix b/pkgs/development/tools/ocaml/findlib/default.nix
index 1354e158a8e..8752b2edb66 100644
--- a/pkgs/development/tools/ocaml/findlib/default.nix
+++ b/pkgs/development/tools/ocaml/findlib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, m4, ncurses, ocaml, writeText }:
+{ lib, stdenv, fetchurl, fetchpatch, m4, ncurses, ocaml, writeText }:
 
 stdenv.mkDerivation rec {
   pname = "ocaml-findlib";
@@ -49,11 +49,11 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://projects.camlcity.org/projects/findlib.html";
     description = "O'Caml library manager";
-    license = stdenv.lib.licenses.mit;
+    license = lib.licenses.mit;
     platforms = ocaml.meta.platforms or [];
     maintainers = [
-      stdenv.lib.maintainers.maggesi
-      stdenv.lib.maintainers.vbmithr
+      lib.maintainers.maggesi
+      lib.maintainers.vbmithr
     ];
   };
 }
diff --git a/pkgs/development/tools/ocaml/oasis/default.nix b/pkgs/development/tools/ocaml/oasis/default.nix
index a0932d919c0..6854c7c20ca 100644
--- a/pkgs/development/tools/ocaml/oasis/default.nix
+++ b/pkgs/development/tools/ocaml/oasis/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, ocamlmod, ocamlify }:
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, ocamlmod, ocamlify }:
 
 stdenv.mkDerivation {
   version = "0.4.10";
@@ -22,7 +22,7 @@ stdenv.mkDerivation {
   buildPhase     = "ocaml setup.ml -build";
   installPhase   = "ocaml setup.ml -install";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://oasis.forge.ocamlcore.org/";
     description = "Configure, build and install system for OCaml projects";
     license = licenses.lgpl21;
diff --git a/pkgs/development/tools/ocaml/obuild/default.nix b/pkgs/development/tools/ocaml/obuild/default.nix
index 5e851a93205..e31334000da 100644
--- a/pkgs/development/tools/ocaml/obuild/default.nix
+++ b/pkgs/development/tools/ocaml/obuild/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchzip, ocaml }:
+{ lib, stdenv, fetchzip, ocaml }:
 
 let version = "0.1.10"; in
 
@@ -27,7 +27,7 @@ stdenv.mkDerivation {
     homepage = "https://github.com/ocaml-obuild/obuild";
     platforms = ocaml.meta.platforms or [];
     description = "Simple package build system for OCaml";
-    license = stdenv.lib.licenses.lgpl21;
-    maintainers = with stdenv.lib.maintainers; [ volth ];
+    license = lib.licenses.lgpl21;
+    maintainers = with lib.maintainers; [ volth ];
   };
 }
diff --git a/pkgs/development/tools/ocaml/ocamlbuild/default.nix b/pkgs/development/tools/ocaml/ocamlbuild/default.nix
index 7270386972d..c74794b35c9 100644
--- a/pkgs/development/tools/ocaml/ocamlbuild/default.nix
+++ b/pkgs/development/tools/ocaml/ocamlbuild/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, ocaml, findlib }:
+{ lib, stdenv, fetchFromGitHub, ocaml, findlib }:
 let
   version = "0.14.0";
 in
@@ -25,7 +25,7 @@ stdenv.mkDerivation {
     "OCAMLBUILD_LIBDIR=$OCAMLFIND_DESTDIR"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/ocaml/ocamlbuild/";
     description = "A build system with builtin rules to easily build most OCaml projects";
     license = licenses.lgpl2;
diff --git a/pkgs/development/tools/ocaml/ocamlify/default.nix b/pkgs/development/tools/ocaml/ocamlify/default.nix
index 9b06a55f07d..a43903c34d3 100644
--- a/pkgs/development/tools/ocaml/ocamlify/default.nix
+++ b/pkgs/development/tools/ocaml/ocamlify/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ocaml, findlib, ocamlbuild }:
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild }:
 
 stdenv.mkDerivation {
   name = "ocamlify-0.0.2";
@@ -27,8 +27,8 @@ stdenv.mkDerivation {
     homepage = "https://forge.ocamlcore.org/projects/ocamlmod/ocamlmod";
     description = "Generate OCaml modules from source files";
     platforms = ocaml.meta.platforms or [];
-    license = stdenv.lib.licenses.lgpl21;
-    maintainers = with stdenv.lib.maintainers; [
+    license = lib.licenses.lgpl21;
+    maintainers = with lib.maintainers; [
       maggesi
     ];
   };
diff --git a/pkgs/development/tools/ocaml/ocamlmod/default.nix b/pkgs/development/tools/ocaml/ocamlmod/default.nix
index 49342d7b848..77d39029551 100644
--- a/pkgs/development/tools/ocaml/ocamlmod/default.nix
+++ b/pkgs/development/tools/ocaml/ocamlmod/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ocaml, findlib, ocamlbuild, ounit }:
+{ lib, stdenv, fetchurl, ocaml, findlib, ocamlbuild, ounit }:
 
 stdenv.mkDerivation {
   pname = "ocamlmod";
@@ -25,7 +25,7 @@ stdenv.mkDerivation {
     homepage = "https://forge.ocamlcore.org/projects/ocamlmod/ocamlmod";
     description = "Generate OCaml modules from source files";
     platforms = ocaml.meta.platforms or [];
-    maintainers = with stdenv.lib.maintainers; [
+    maintainers = with lib.maintainers; [
       maggesi
     ];
   };
diff --git a/pkgs/development/tools/ocaml/ocp-build/default.nix b/pkgs/development/tools/ocaml/ocp-build/default.nix
index 57db5161224..655f7b4d4c2 100644
--- a/pkgs/development/tools/ocaml/ocp-build/default.nix
+++ b/pkgs/development/tools/ocaml/ocp-build/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, ocaml, findlib, ncurses, cmdliner, re }:
+{ lib, stdenv, fetchFromGitHub, ocaml, findlib, ncurses, cmdliner, re }:
 let
   version = "1.99.21";
 in
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
   export configureFlags="$configureFlags --with-metadir=$OCAMLFIND_DESTDIR"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.typerex.org/ocp-build.html";
     description = "A build tool for OCaml";
     longDescription = ''
diff --git a/pkgs/development/tools/ocaml/ocsigen-i18n/default.nix b/pkgs/development/tools/ocaml/ocsigen-i18n/default.nix
index 476c98ce5bc..b12aa2e6d6d 100644
--- a/pkgs/development/tools/ocaml/ocsigen-i18n/default.nix
+++ b/pkgs/development/tools/ocaml/ocsigen-i18n/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchzip, ocamlPackages }:
+{ lib, stdenv, fetchzip, ocamlPackages }:
 
 stdenv.mkDerivation rec
 {
@@ -22,8 +22,8 @@ stdenv.mkDerivation rec
   meta = {
     homepage = "https://github.com/besport/ocsigen-i18n";
     description = "I18n made easy for web sites written with eliom";
-    license = stdenv.lib.licenses.lgpl21;
-    maintainers = [ stdenv.lib.maintainers.gal_bolle ];
+    license = lib.licenses.lgpl21;
+    maintainers = [ lib.maintainers.gal_bolle ];
   };
 
 }
diff --git a/pkgs/development/tools/ocaml/omake/0.9.8.6-rc1.nix b/pkgs/development/tools/ocaml/omake/0.9.8.6-rc1.nix
index b840cb7736b..047246cd0a0 100644
--- a/pkgs/development/tools/ocaml/omake/0.9.8.6-rc1.nix
+++ b/pkgs/development/tools/ocaml/omake/0.9.8.6-rc1.nix
@@ -1,11 +1,11 @@
-{stdenv, fetchurl, makeWrapper, ocaml, ncurses}:
+{lib, stdenv, fetchurl, makeWrapper, ocaml, ncurses}:
 let
   pname = "omake";
   version = "0.9.8.6-0.rc1";
   webpage = "http://omake.metaprl.org";
 in
 
-if stdenv.lib.versionAtLeast ocaml.version "4.06"
+if lib.versionAtLeast ocaml.version "4.06"
 then throw "${pname}-${version} is not available for OCaml ${ocaml.version}"
 else
 
diff --git a/pkgs/development/tools/ocaml/omake/default.nix b/pkgs/development/tools/ocaml/omake/default.nix
index 2afe0d1e9f5..bcfd86a2d4d 100644
--- a/pkgs/development/tools/ocaml/omake/default.nix
+++ b/pkgs/development/tools/ocaml/omake/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ocaml, ncurses }:
+{ lib, stdenv, fetchurl, ocaml, ncurses }:
 
 stdenv.mkDerivation rec {
 
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A build system designed for scalability and portability";
     homepage = "http://projects.camlcity.org/projects/omake.html";
-    license = with stdenv.lib.licenses; [
+    license = with lib.licenses; [
       mit /* scripts */
       gpl2 /* program */
     ];
diff --git a/pkgs/development/tools/ocaml/opaline/default.nix b/pkgs/development/tools/ocaml/opaline/default.nix
index a49749ad716..9cdacd289d4 100644
--- a/pkgs/development/tools/ocaml/opaline/default.nix
+++ b/pkgs/development/tools/ocaml/opaline/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, ocamlPackages }:
+{ lib, stdenv, fetchFromGitHub, ocamlPackages }:
 
 stdenv.mkDerivation rec {
   version = "0.3.2";
@@ -19,8 +19,8 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "OPAm Light INstaller Engine";
-    license = stdenv.lib.licenses.mit;
-    maintainers = [ stdenv.lib.maintainers.vbgl ];
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.vbgl ];
     inherit (src.meta) homepage;
     inherit (ocamlPackages.ocaml.meta) platforms;
   };
diff --git a/pkgs/development/tools/ocaml/opam/1.2.2.nix b/pkgs/development/tools/ocaml/opam/1.2.2.nix
index e6c08b97aca..a128f2144e9 100644
--- a/pkgs/development/tools/ocaml/opam/1.2.2.nix
+++ b/pkgs/development/tools/ocaml/opam/1.2.2.nix
@@ -82,7 +82,7 @@ in stdenv.mkDerivation {
 
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A package manager for OCaml";
     homepage = "http://opam.ocamlpro.com/";
     maintainers = [ maintainers.henrytill ];
diff --git a/pkgs/development/tools/ocaml/opam/default.nix b/pkgs/development/tools/ocaml/opam/default.nix
index 9e95db79dd0..4fe408fb77f 100644
--- a/pkgs/development/tools/ocaml/opam/default.nix
+++ b/pkgs/development/tools/ocaml/opam/default.nix
@@ -110,7 +110,7 @@ in stdenv.mkDerivation {
 
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A package manager for OCaml";
     homepage = "https://opam.ocaml.org/";
     maintainers = [ maintainers.henrytill maintainers.marsam ];
diff --git a/pkgs/development/tools/ocaml/utop/default.nix b/pkgs/development/tools/ocaml/utop/default.nix
index 2c4c330b286..622ac80306f 100644
--- a/pkgs/development/tools/ocaml/utop/default.nix
+++ b/pkgs/development/tools/ocaml/utop/default.nix
@@ -1,8 +1,8 @@
-{ stdenv, fetchurl, ocaml, findlib
+{ lib, stdenv, fetchurl, ocaml, findlib
 , lambdaTerm, cppo, makeWrapper, buildDunePackage
 }:
 
-if !stdenv.lib.versionAtLeast ocaml.version "4.03"
+if !lib.versionAtLeast ocaml.version "4.03"
 then throw "utop is not available for OCaml ${ocaml.version}"
 else
 
@@ -58,7 +58,7 @@ buildDunePackage rec {
       --prefix CAML_LD_LIBRARY_PATH ":" "${get "CAML_LD_LIBRARY_PATH"}" \
       --prefix OCAMLPATH ":" "${get "OCAMLPATH"}" \
       --prefix OCAMLPATH ":" $(unset OCAMLPATH; addOCamlPath "$out"; printf %s "$OCAMLPATH") \
-      --add-flags "-I ${findlib}/lib/ocaml/${stdenv.lib.getVersion ocaml}/site-lib"
+      --add-flags "-I ${findlib}/lib/ocaml/${lib.getVersion ocaml}/site-lib"
    done
    '';
 
@@ -70,10 +70,10 @@ buildDunePackage rec {
     It integrates with the tuareg mode in Emacs.
     '';
     homepage = "https://github.com/diml/utop";
-    license = stdenv.lib.licenses.bsd3;
+    license = lib.licenses.bsd3;
     platforms = ocaml.meta.platforms or [];
     maintainers = [
-      stdenv.lib.maintainers.gal_bolle
+      lib.maintainers.gal_bolle
     ];
   };
 }
diff --git a/pkgs/development/tools/omniorb/default.nix b/pkgs/development/tools/omniorb/default.nix
index 2ab8fa23dde..74341c0a7b4 100644
--- a/pkgs/development/tools/omniorb/default.nix
+++ b/pkgs/development/tools/omniorb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, python2 }:
+{ lib, stdenv, fetchurl, python2 }:
 stdenv.mkDerivation rec {
 
   pname = "omniorb";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   hardeningDisable = [ "format" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A robust high performance CORBA ORB for C++ and Python. It is freely available under the terms of the GNU Lesser General Public License (for the libraries), and GNU General Public License (for the tools). omniORB is largely CORBA 2.6 compliant";
     homepage    = "http://omniorb.sourceforge.net/";
     license     = licenses.gpl2Plus;
diff --git a/pkgs/development/tools/omnisharp-roslyn/default.nix b/pkgs/development/tools/omnisharp-roslyn/default.nix
index 9dd085b421f..ac5ab022ef1 100644
--- a/pkgs/development/tools/omnisharp-roslyn/default.nix
+++ b/pkgs/development/tools/omnisharp-roslyn/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , mono5
 , makeWrapper
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
     --add-flags "$out/src/OmniSharp.exe"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "OmniSharp based on roslyn workspaces";
     homepage = "https://github.com/OmniSharp/omnisharp-roslyn";
     platforms = platforms.linux;
diff --git a/pkgs/development/tools/out-of-tree/default.nix b/pkgs/development/tools/out-of-tree/default.nix
index 75737764219..9ab69d1d5d8 100644
--- a/pkgs/development/tools/out-of-tree/default.nix
+++ b/pkgs/development/tools/out-of-tree/default.nix
@@ -18,7 +18,7 @@ buildGoModule rec {
 
   postFixup = ''
     wrapProgram $out/bin/out-of-tree \
-      --prefix PATH : "${stdenv.lib.makeBinPath [ qemu docker which ]}"
+      --prefix PATH : "${lib.makeBinPath [ qemu docker which ]}"
   '';
 
   meta = with lib; {
diff --git a/pkgs/development/tools/packet/default.nix b/pkgs/development/tools/packet/default.nix
index 9bca1ec75b6..31ccf19bb05 100644
--- a/pkgs/development/tools/packet/default.nix
+++ b/pkgs/development/tools/packet/default.nix
@@ -1,5 +1,5 @@
 # This file was generated by https://github.com/kamilchm/go2nix v1.2.1
-{ stdenv, buildGoPackage, fetchgit }:
+{ lib, stdenv, buildGoPackage, fetchgit }:
 
 buildGoPackage rec {
   pname = "packet";
@@ -18,8 +18,8 @@ buildGoPackage rec {
   meta = {
     description = "a CLI tool to manage packet.net services";
     homepage = "https://github.com/ebsarr/packet";
-    license = stdenv.lib.licenses.mit;
-    maintainers = [ stdenv.lib.maintainers.grahamc ];
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.grahamc ];
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/parsing/antlr/3.5.nix b/pkgs/development/tools/parsing/antlr/3.5.nix
index 39c022604d8..2efe752c363 100644
--- a/pkgs/development/tools/parsing/antlr/3.5.nix
+++ b/pkgs/development/tools/parsing/antlr/3.5.nix
@@ -40,6 +40,6 @@ stdenv.mkDerivation rec {
     homepage = "https://www.antlr.org/";
     license = licenses.bsd3;
     platforms = platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.farlion ];
+    maintainers = [ lib.maintainers.farlion ];
   };
 }
diff --git a/pkgs/development/tools/parsing/antlr/4.8.nix b/pkgs/development/tools/parsing/antlr/4.8.nix
index acf46a4401f..0708ba754b2 100644
--- a/pkgs/development/tools/parsing/antlr/4.8.nix
+++ b/pkgs/development/tools/parsing/antlr/4.8.nix
@@ -19,8 +19,8 @@ let
       outputs = [ "out" "dev" "doc" ];
 
       nativeBuildInputs = [ cmake ninja pkg-config ];
-      buildInputs = stdenv.lib.optional stdenv.isLinux libuuid
-        ++ stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.CoreFoundation;
+      buildInputs = lib.optional stdenv.isLinux libuuid
+        ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.CoreFoundation;
 
       postUnpack = ''
         export sourceRoot=$sourceRoot/runtime/Cpp
diff --git a/pkgs/development/tools/parsing/bison/default.nix b/pkgs/development/tools/parsing/bison/default.nix
index aa8d8df2c1d..662961ae46a 100644
--- a/pkgs/development/tools/parsing/bison/default.nix
+++ b/pkgs/development/tools/parsing/bison/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, m4, perl, help2man }:
+{ lib, stdenv, fetchurl, m4, perl, help2man }:
 
 # Note: this package is used for bootstrapping fetchurl, and thus
 # cannot use fetchpatch! All mutable patches (generated by GitHub or
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
     sha256 = "1qkp2rfi5njyp5c5avajab00aj74pkmkgzkvshv4p2ydkhswgazv";
   };
 
-  nativeBuildInputs = [ m4 perl ] ++ stdenv.lib.optional stdenv.isSunOS help2man;
+  nativeBuildInputs = [ m4 perl ] ++ lib.optional stdenv.isSunOS help2man;
   propagatedBuildInputs = [ m4 ];
 
   doCheck = false; # fails
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://www.gnu.org/software/bison/";
     description = "Yacc-compatible parser generator";
-    license = stdenv.lib.licenses.gpl3Plus;
+    license = lib.licenses.gpl3Plus;
 
     longDescription = ''
       Bison is a general-purpose parser generator that converts an
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
       to use Bison.
     '';
 
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 
   passthru = { glrSupport = true; };
diff --git a/pkgs/development/tools/parsing/flex/2.5.35.nix b/pkgs/development/tools/parsing/flex/2.5.35.nix
index c352b5a3837..b2245ff9c9b 100644
--- a/pkgs/development/tools/parsing/flex/2.5.35.nix
+++ b/pkgs/development/tools/parsing/flex/2.5.35.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation {
 
   propagatedBuildInputs = [ m4 ];
 
-  preConfigure = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+  preConfigure = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     "ac_cv_func_malloc_0_nonnull=yes"
     "ac_cv_func_realloc_0_nonnull=yes"
   ];
diff --git a/pkgs/development/tools/parsing/flex/2.6.1.nix b/pkgs/development/tools/parsing/flex/2.6.1.nix
index 3a032e60c32..cc0ecb148c4 100644
--- a/pkgs/development/tools/parsing/flex/2.6.1.nix
+++ b/pkgs/development/tools/parsing/flex/2.6.1.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
 
   postPatch = ''
     patchShebangs tests
-  '' + stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
+  '' + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
     substituteInPlace Makefile.in --replace "tests" " ";
   '';
 
@@ -18,12 +18,12 @@ stdenv.mkDerivation {
 
   propagatedBuildInputs = [ m4 ];
 
-  preConfigure = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+  preConfigure = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     "ac_cv_func_malloc_0_nonnull=yes"
     "ac_cv_func_realloc_0_nonnull=yes"
   ];
 
-  postConfigure = stdenv.lib.optionalString (stdenv.isDarwin || stdenv.isCygwin) ''
+  postConfigure = lib.optionalString (stdenv.isDarwin || stdenv.isCygwin) ''
     sed -i Makefile -e 's/-no-undefined//;'
   '';
 
diff --git a/pkgs/development/tools/parsing/flex/default.nix b/pkgs/development/tools/parsing/flex/default.nix
index c77c1f73c69..42b007300a9 100644
--- a/pkgs/development/tools/parsing/flex/default.nix
+++ b/pkgs/development/tools/parsing/flex/default.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
 
   postPatch = ''
     patchShebangs tests
-  '' + stdenv.lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
+  '' + lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
     substituteInPlace Makefile.in --replace "tests" " "
 
     substituteInPlace doc/Makefile.am --replace 'flex.1: $(top_srcdir)/configure.ac' 'flex.1: '
@@ -33,12 +33,12 @@ stdenv.mkDerivation rec {
   buildInputs = [ bison ];
   propagatedBuildInputs = [ m4 ];
 
-  preConfigure = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+  preConfigure = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     "ac_cv_func_malloc_0_nonnull=yes"
     "ac_cv_func_realloc_0_nonnull=yes"
   ];
 
-  postConfigure = stdenv.lib.optionalString (stdenv.isDarwin || stdenv.isCygwin) ''
+  postConfigure = lib.optionalString (stdenv.isDarwin || stdenv.isCygwin) ''
     sed -i Makefile -e 's/-no-undefined//;'
   '';
 
diff --git a/pkgs/development/tools/parsing/ragel/default.nix b/pkgs/development/tools/parsing/ragel/default.nix
index fd730809711..6bbcf36cd2c 100644
--- a/pkgs/development/tools/parsing/ragel/default.nix
+++ b/pkgs/development/tools/parsing/ragel/default.nix
@@ -13,15 +13,15 @@ let
         inherit sha256;
       };
 
-      buildInputs = stdenv.lib.optional build-manual [ transfig ghostscript tex ];
+      buildInputs = lib.optional build-manual [ transfig ghostscript tex ];
 
-      preConfigure = stdenv.lib.optional build-manual ''
+      preConfigure = lib.optional build-manual ''
         sed -i "s/build_manual=no/build_manual=yes/g" DIST
       '';
 
       configureFlags = [ "--with-colm=${colm}" ];
 
-      NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-std=gnu++98";
+      NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-std=gnu++98";
 
       doCheck = true;
 
@@ -40,12 +40,12 @@ in
   ragelStable = generic {
     version = "6.10";
     sha256 = "0gvcsl62gh6sg73nwaxav4a5ja23zcnyxncdcdnqa2yjcpdnw5az";
-    license = stdenv.lib.licenses.gpl2;
+    license = lib.licenses.gpl2;
   };
 
   ragelDev = generic {
     version = "7.0.0.12";
     sha256 = "0x3si355lv6q051lgpg8bpclpiq5brpri5lv3p8kk2qhzfbyz69r";
-    license = stdenv.lib.licenses.mit;
+    license = lib.licenses.mit;
   };
 }
diff --git a/pkgs/development/tools/pgformatter/default.nix b/pkgs/development/tools/pgformatter/default.nix
index 0e3e1b7e9ca..d5c6872cd7d 100644
--- a/pkgs/development/tools/pgformatter/default.nix
+++ b/pkgs/development/tools/pgformatter/default.nix
@@ -24,8 +24,8 @@ perlPackages.buildPerlPackage rec {
       --replace "'INSTALLDIRS'  => \$INSTALLDIRS," "'INSTALLDIRS'  => \$INSTALLDIRS, 'INSTALLVENDORLIB' => 'bin/lib', 'INSTALLVENDORBIN' => 'bin', 'INSTALLVENDORSCRIPT' => 'bin', 'INSTALLVENDORMAN1DIR' => 'share/man/man1', 'INSTALLVENDORMAN3DIR' => 'share/man/man3',"
   '';
 
-  nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin shortenPerlShebang;
-  postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
+  nativeBuildInputs = lib.optional stdenv.isDarwin shortenPerlShebang;
+  postInstall = lib.optionalString stdenv.isDarwin ''
     shortenPerlShebang $out/bin/pg_format
   '';
 
diff --git a/pkgs/development/tools/pgloader/default.nix b/pkgs/development/tools/pgloader/default.nix
index 0e16726bb80..94217a765e2 100644
--- a/pkgs/development/tools/pgloader/default.nix
+++ b/pkgs/development/tools/pgloader/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ git makeWrapper ];
   buildInputs = [ sbcl cacert sqlite freetds libzip curl openssl ];
 
-  LD_LIBRARY_PATH = stdenv.lib.makeLibraryPath [ sqlite libzip curl git openssl freetds ];
+  LD_LIBRARY_PATH = lib.makeLibraryPath [ sqlite libzip curl git openssl freetds ];
 
   buildPhase = ''
     export PATH=$PATH:$out/bin
diff --git a/pkgs/development/tools/phantomjs/default.nix b/pkgs/development/tools/phantomjs/default.nix
index f042aa35b6f..66cdb09cf15 100644
--- a/pkgs/development/tools/phantomjs/default.nix
+++ b/pkgs/development/tools/phantomjs/default.nix
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
   buildPhase = lib.optionalString (!stdenv.isDarwin) ''
     patchelf \
       --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
-      --set-rpath "${stdenv.lib.makeLibraryPath [ freetype fontconfig stdenv.cc.cc stdenv.cc.cc openssl ]}" \
+      --set-rpath "${lib.makeLibraryPath [ freetype fontconfig stdenv.cc.cc stdenv.cc.cc openssl ]}" \
       bin/phantomjs
   '';
 
diff --git a/pkgs/development/tools/phantomjs2/default.nix b/pkgs/development/tools/phantomjs2/default.nix
index 9fc2f416b76..594deeb1c73 100644
--- a/pkgs/development/tools/phantomjs2/default.nix
+++ b/pkgs/development/tools/phantomjs2/default.nix
@@ -30,7 +30,7 @@ in stdenv.mkDerivation rec {
     bison flex fontconfig freetype gperf icu openssl
     libjpeg libpng perl python ruby sqlite qtwebkit qtbase
     makeWrapper
-  ] ++ stdenv.lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
+  ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
     AGL ApplicationServices AppKit Cocoa OpenGL
     darwin.libobjc fakeClang cups
   ]);
@@ -73,7 +73,7 @@ in stdenv.mkDerivation rec {
   # invalid suffix on literal; C++11 requires a space between litend identifier
   NIX_CFLAGS_COMPILE = "-Wno-reserved-user-defined-literal";
 
-  __impureHostDeps = stdenv.lib.optional stdenv.isDarwin "/usr/lib/libicucore.dylib";
+  __impureHostDeps = lib.optional stdenv.isDarwin "/usr/lib/libicucore.dylib";
 
   enableParallelBuilding = true;
 
@@ -81,7 +81,7 @@ in stdenv.mkDerivation rec {
     mkdir -p $out/share/doc/phantomjs
     cp -a bin $out
     cp -a ChangeLog examples LICENSE.BSD README.md third-party.txt $out/share/doc/phantomjs
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     install_name_tool -change \
         ${darwin.CF}/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation \
         /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation \
@@ -92,7 +92,7 @@ in stdenv.mkDerivation rec {
   '' + ''
     wrapProgram $out/bin/phantomjs \
     --set QT_QPA_PLATFORM offscreen \
-    --prefix PATH : ${stdenv.lib.makeBinPath [ qtbase ]}
+    --prefix PATH : ${lib.makeBinPath [ qtbase ]}
   '';
 
   meta = with lib; {
diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix b/pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix
index 31065758914..5810d6d2a74 100644
--- a/pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix
+++ b/pkgs/development/tools/poetry2nix/poetry2nix/overrides.nix
@@ -127,7 +127,7 @@ self: super:
   cryptography = super.cryptography.overridePythonAttrs (
     old: {
       nativeBuildInputs = old.nativeBuildInputs or [ ]
-        ++ stdenv.lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) self.python.pythonForBuild.pkgs.cffi;
+        ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) self.python.pythonForBuild.pkgs.cffi;
       buildInputs = old.buildInputs ++ [ pkgs.openssl ];
     }
   );
@@ -245,7 +245,7 @@ self: super:
 
   horovod = super.horovod.overridePythonAttrs (
     old: {
-      propagatedBuildInputs = old.propagatedBuildInputs ++ [ pkgs.openmpi ];
+      propagatedBuildInputs = old.propagatedBuildInputs ++ [ pkgs.mpi ];
     }
   );
 
@@ -443,7 +443,7 @@ self: super:
       inherit (pkgs.darwin.apple_sdk.frameworks) Cocoa;
     in
     {
-      NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-I${pkgs.libcxx}/include/c++/v1";
+      NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-I${pkgs.libcxx}/include/c++/v1";
 
       XDG_RUNTIME_DIR = "/tmp";
 
@@ -466,9 +466,9 @@ self: super:
         pkgs.libpng
         pkgs.freetype
       ]
-        ++ stdenv.lib.optionals enableGtk3 [ pkgs.cairo self.pycairo pkgs.gtk3 pkgs.gobject-introspection self.pygobject3 ]
-        ++ stdenv.lib.optionals enableTk [ pkgs.tcl pkgs.tk self.tkinter pkgs.libX11 ]
-        ++ stdenv.lib.optionals enableQt [ self.pyqt5 ]
+        ++ lib.optionals enableGtk3 [ pkgs.cairo self.pycairo pkgs.gtk3 pkgs.gobject-introspection self.pygobject3 ]
+        ++ lib.optionals enableTk [ pkgs.tcl pkgs.tk self.tkinter pkgs.libX11 ]
+        ++ lib.optionals enableQt [ self.pyqt5 ]
       ;
 
       inherit (super.matplotlib) patches;
@@ -528,14 +528,14 @@ self: super:
             { }
             {
               mpi = {
-                mpicc = "${pkgs.openmpi.outPath}/bin/mpicc";
+                mpicc = "${pkgs.mpi.outPath}/bin/mpicc";
               };
             }
         );
       };
     in
     {
-      propagatedBuildInputs = old.propagatedBuildInputs ++ [ pkgs.openmpi ];
+      propagatedBuildInputs = old.propagatedBuildInputs ++ [ pkgs.mpi ];
       enableParallelBuilding = true;
       preBuild = ''
         ln -sf ${cfg} mpi.cfg
diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/pep425.nix b/pkgs/development/tools/poetry2nix/poetry2nix/pep425.nix
index e333bd49718..edf556377b3 100644
--- a/pkgs/development/tools/poetry2nix/poetry2nix/pep425.nix
+++ b/pkgs/development/tools/poetry2nix/poetry2nix/pep425.nix
@@ -73,9 +73,9 @@ let
         if isLinux
         then
           (
-            x: x.platform == "manylinux1_${stdenv.platform.kernelArch}"
-              || x.platform == "manylinux2010_${stdenv.platform.kernelArch}"
-              || x.platform == "manylinux2014_${stdenv.platform.kernelArch}"
+            x: x.platform == "manylinux1_${stdenv.hostPlatform.linuxArch}"
+              || x.platform == "manylinux2010_${stdenv.hostPlatform.linuxArch}"
+              || x.platform == "manylinux2014_${stdenv.hostPlatform.linuxArch}"
               || x.platform == "any"
           )
         else (x: hasInfix "macosx" x.platform || x.platform == "any");
diff --git a/pkgs/development/tools/poetry2nix/poetry2nix/pep508.nix b/pkgs/development/tools/poetry2nix/poetry2nix/pep508.nix
index ba8145398f5..ea2f27b0e22 100644
--- a/pkgs/development/tools/poetry2nix/poetry2nix/pep508.nix
+++ b/pkgs/development/tools/poetry2nix/poetry2nix/pep508.nix
@@ -95,7 +95,7 @@ let
           else if stdenv.isDarwin then "darwin"
           else throw "Unsupported platform"
         );
-        platform_machine = stdenv.platform.kernelArch;
+        platform_machine = stdenv.hostPlatform.linuxArch;
         platform_python_implementation =
           let
             impl = python.passthru.implementation;
diff --git a/pkgs/development/tools/profiling/EZTrace/default.nix b/pkgs/development/tools/profiling/EZTrace/default.nix
index e856c1f718a..e057fc8ebe1 100644
--- a/pkgs/development/tools/profiling/EZTrace/default.nix
+++ b/pkgs/development/tools/profiling/EZTrace/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl, autoconf, gfortran
 , libelf, libiberty, zlib, libbfd, libopcodes
 , buildPackages
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "Tool that aims at generating automatically execution trace from HPC programs";
-    license = stdenv.lib.licenses.cecill-b;
-    maintainers = with stdenv.lib.maintainers; [ ];
+    license = lib.licenses.cecill-b;
+    maintainers = with lib.maintainers; [ ];
   };
 }
diff --git a/pkgs/development/tools/profiling/oprofile/default.nix b/pkgs/development/tools/profiling/oprofile/default.nix
index 335b9bef4cd..6cd3ea80027 100644
--- a/pkgs/development/tools/profiling/oprofile/default.nix
+++ b/pkgs/development/tools/profiling/oprofile/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildPackages
+{ lib, stdenv, buildPackages
 , fetchurl, pkg-config
 , libbfd, popt, zlib, linuxHeaders, libiberty_static
 , withGUI ? false, qt4 ? null
@@ -23,13 +23,13 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libbfd zlib popt linuxHeaders libiberty_static ]
-    ++ stdenv.lib.optionals withGUI [ qt4 ];
+    ++ lib.optionals withGUI [ qt4 ];
 
   configureFlags = [
       "--with-kernel=${linuxHeaders}"
       "--disable-shared"   # needed because only the static libbfd is available
     ]
-    ++ stdenv.lib.optional withGUI "--with-qt-dir=${qt4} --enable-gui=qt4";
+    ++ lib.optional withGUI "--with-qt-dir=${qt4} --enable-gui=qt4";
 
   meta = {
     description = "System-wide profiler for Linux";
@@ -45,10 +45,10 @@ stdenv.mkDerivation rec {
       is profiled: hardware and software interrupt handlers, kernel
       modules, the kernel, shared libraries, and applications.
     '';
-    license = stdenv.lib.licenses.gpl2;
+    license = lib.licenses.gpl2;
     homepage = "http://oprofile.sourceforge.net/";
 
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
     maintainers = [ ];
   };
 }
diff --git a/pkgs/development/tools/profiling/sysprof/capture.nix b/pkgs/development/tools/profiling/sysprof/capture.nix
index a1f5d00332c..a9443eeadf6 100644
--- a/pkgs/development/tools/profiling/sysprof/capture.nix
+++ b/pkgs/development/tools/profiling/sysprof/capture.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , meson
 , ninja
 , sysprof
@@ -25,6 +25,6 @@ stdenv.mkDerivation rec {
 
   meta = sysprof.meta // {
     description = "Static library for Sysprof capture data generation";
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/development/tools/profiling/sysprof/default.nix b/pkgs/development/tools/profiling/sysprof/default.nix
index 8144bae48c8..9e749adea20 100644
--- a/pkgs/development/tools/profiling/sysprof/default.nix
+++ b/pkgs/development/tools/profiling/sysprof/default.nix
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "lib" "dev" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1z2i9187f2jx456l7h07wy8m9a0p7pj3xiv1aji3snq7rjb1lkj0";
   };
 
diff --git a/pkgs/development/tools/purescript/spago/spago.nix b/pkgs/development/tools/purescript/spago/spago.nix
index ed0ce05843b..3f54a4f9c0e 100644
--- a/pkgs/development/tools/purescript/spago/spago.nix
+++ b/pkgs/development/tools/purescript/spago/spago.nix
@@ -6,7 +6,7 @@
 , http-conduit, http-types, lens-family-core, megaparsec, mtl
 , network-uri, open-browser, optparse-applicative, prettyprinter
 , process, QuickCheck, retry, rio, rio-orphans, safe, semver-range
-, stdenv, stm, stringsearch, tar, template-haskell, temporary, text
+, lib, stdenv, stm, stringsearch, tar, template-haskell, temporary, text
 , time, transformers, turtle, unliftio, unordered-containers
 , utf8-string, vector, versions, with-utf8, zlib
 }:
@@ -41,5 +41,5 @@ mkDerivation {
   testToolDepends = [ hspec-discover ];
   prePatch = "hpack";
   homepage = "https://github.com/purescript/spago#readme";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/pkgs/development/tools/py-spy/default.nix b/pkgs/development/tools/py-spy/default.nix
index a8973cd5084..a9634ec53c7 100644
--- a/pkgs/development/tools/py-spy/default.nix
+++ b/pkgs/development/tools/py-spy/default.nix
@@ -14,7 +14,7 @@ rustPlatform.buildRustPackage rec {
   NIX_CFLAGS_COMPILE = "-L${libunwind}/lib";
 
   # error: linker `arm-linux-gnueabihf-gcc` not found
-  preConfigure = stdenv.lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
+  preConfigure = lib.optionalString (stdenv.buildPlatform != stdenv.hostPlatform) ''
     export RUSTFLAGS="-Clinker=$CC"
   '';
 
diff --git a/pkgs/development/tools/pydb/default.nix b/pkgs/development/tools/pydb/default.nix
index 67e7a879d88..eaaa057dc0a 100644
--- a/pkgs/development/tools/pydb/default.nix
+++ b/pkgs/development/tools/pydb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, python2, emacs }:
+{ lib, stdenv, fetchurl, python2, emacs }:
 
 stdenv.mkDerivation {
   name = "pydb-1.26";
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
   meta = {
     description = "Python debugger with GDB-like commands and Emacs bindings";
     homepage = "http://bashdb.sourceforge.net/pydb/";
-    license = stdenv.lib.licenses.gpl3;
-    platforms = stdenv.lib.platforms.all;
+    license = lib.licenses.gpl3;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/development/tools/quilt/default.nix b/pkgs/development/tools/quilt/default.nix
index dece0a7b44b..71cf10e63b9 100644
--- a/pkgs/development/tools/quilt/default.nix
+++ b/pkgs/development/tools/quilt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper, bash, perl, diffstat, diffutils, patch, findutils }:
+{ lib, stdenv, fetchurl, makeWrapper, bash, perl, diffstat, diffutils, patch, findutils }:
 
 stdenv.mkDerivation rec {
 
@@ -27,8 +27,8 @@ stdenv.mkDerivation rec {
       and more.
     '';
 
-    license = stdenv.lib.licenses.gpl2Plus;
-    platforms = stdenv.lib.platforms.all;
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.all;
   };
 
 }
diff --git a/pkgs/development/tools/rdocker/default.nix b/pkgs/development/tools/rdocker/default.nix
index 16e832a99b8..098d7a59314 100644
--- a/pkgs/development/tools/rdocker/default.nix
+++ b/pkgs/development/tools/rdocker/default.nix
@@ -19,13 +19,13 @@ stdenv.mkDerivation {
 
   postInstall = ''
     wrapProgram $out/bin/rdocker \
-      --prefix PATH : ${stdenv.lib.makeBinPath [ openssh ]}
+      --prefix PATH : ${lib.makeBinPath [ openssh ]}
   '';
 
   meta = with lib; {
     description = "Securely control a remote docker daemon CLI using ssh forwarding, no SSL setup needed";
     homepage = "https://github.com/dvddarias/rdocker";
-    maintainers = [ stdenv.lib.maintainers.pneumaticat ];
+    maintainers = [ lib.maintainers.pneumaticat ];
     license = licenses.mit;
     platforms = platforms.unix;
   };
diff --git a/pkgs/development/tools/react-native-debugger/default.nix b/pkgs/development/tools/react-native-debugger/default.nix
index f5174da13a1..06b5dd79401 100644
--- a/pkgs/development/tools/react-native-debugger/default.nix
+++ b/pkgs/development/tools/react-native-debugger/default.nix
@@ -3,7 +3,7 @@
 }:
 
 let
-  rpath = stdenv.lib.makeLibraryPath [
+  rpath = lib.makeLibraryPath [
     cairo
     stdenv.cc.cc
     gdk-pixbuf
diff --git a/pkgs/development/tools/repository-managers/nexus/default.nix b/pkgs/development/tools/repository-managers/nexus/default.nix
index 62b9df74127..828b8e5b1cd 100644
--- a/pkgs/development/tools/repository-managers/nexus/default.nix
+++ b/pkgs/development/tools/repository-managers/nexus/default.nix
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
     wrapProgram $out/bin/nexus \
       --set JAVA_HOME ${jre_headless} \
       --set ALTERNATIVE_NAME "nexus" \
-      --prefix PATH "${stdenv.lib.makeBinPath [ gawk ]}"
+      --prefix PATH "${lib.makeBinPath [ gawk ]}"
 
     runHook postInstall
   '';
diff --git a/pkgs/development/tools/rtags/default.nix b/pkgs/development/tools/rtags/default.nix
index ec3fcf9cd39..e5da0ddf59a 100644
--- a/pkgs/development/tools/rtags/default.nix
+++ b/pkgs/development/tools/rtags/default.nix
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "C/C++ client-server indexer based on clang";
     homepage = "https://github.com/andersbakken/rtags";
-    license = stdenv.lib.licenses.gpl3;
-    platforms = with stdenv.lib.platforms; x86_64 ++ aarch64;
+    license = lib.licenses.gpl3;
+    platforms = with lib.platforms; x86_64 ++ aarch64;
   };
 }
diff --git a/pkgs/development/tools/rund/default.nix b/pkgs/development/tools/rund/default.nix
index 0752f803c3c..186e044318e 100644
--- a/pkgs/development/tools/rund/default.nix
+++ b/pkgs/development/tools/rund/default.nix
@@ -44,6 +44,6 @@ stdenv.mkDerivation rec {
     homepage = "https://github.com/dragon-lang/rund";
     license = lib.licenses.boost;
     maintainers = with maintainers; [ jonathanmarler ];
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/tools/rust/cargo-asm/default.nix b/pkgs/development/tools/rust/cargo-asm/default.nix
index 490fa9e09c3..f453955a5c7 100644
--- a/pkgs/development/tools/rust/cargo-asm/default.nix
+++ b/pkgs/development/tools/rust/cargo-asm/default.nix
@@ -13,7 +13,7 @@ rustPlatform.buildRustPackage rec {
 
   cargoSha256 = "0d797cisiydblh64vqpfdjf37wmxrvs77phdrqh582lbrvnfhx2j";
 
-  buildInputs = stdenv.lib.optional stdenv.isDarwin Security;
+  buildInputs = lib.optional stdenv.isDarwin Security;
 
   # Test checks against machine code output, which fails with some
   # LLVM/compiler versions.
diff --git a/pkgs/development/tools/rust/cargo-c/default.nix b/pkgs/development/tools/rust/cargo-c/default.nix
index e28f9165ebb..7b9aa5cf610 100644
--- a/pkgs/development/tools/rust/cargo-c/default.nix
+++ b/pkgs/development/tools/rust/cargo-c/default.nix
@@ -32,7 +32,7 @@ rustPlatform.buildRustPackage rec {
 
   nativeBuildInputs = [ pkg-config ];
   buildInputs = [ openssl ]
-  ++ stdenv.lib.optionals stdenv.isDarwin [ CoreFoundation libiconv Security ];
+  ++ lib.optionals stdenv.isDarwin [ CoreFoundation libiconv Security ];
 
   meta = with lib; {
     description = "A cargo subcommand to build and install C-ABI compatibile dynamic and static libraries";
diff --git a/pkgs/development/tools/rust/cargo-cache/default.nix b/pkgs/development/tools/rust/cargo-cache/default.nix
index 882f0408cec..021e19b9cd9 100644
--- a/pkgs/development/tools/rust/cargo-cache/default.nix
+++ b/pkgs/development/tools/rust/cargo-cache/default.nix
@@ -13,7 +13,7 @@ rustPlatform.buildRustPackage rec {
 
   cargoSha256 = "sha256-sZxkEQBZ2PJXSvwcA+IL7uW/gcnzuzRcDklNW5vpzWg=";
 
-  buildInputs = stdenv.lib.optionals stdenv.isDarwin [ libiconv Security ];
+  buildInputs = lib.optionals stdenv.isDarwin [ libiconv Security ];
 
   checkFlagsArray = [ "offline_tests" ];
 
diff --git a/pkgs/development/tools/rust/cargo-crev/default.nix b/pkgs/development/tools/rust/cargo-crev/default.nix
index f2c8d72ec18..e3c16b09ef3 100644
--- a/pkgs/development/tools/rust/cargo-crev/default.nix
+++ b/pkgs/development/tools/rust/cargo-crev/default.nix
@@ -24,7 +24,7 @@ rustPlatform.buildRustPackage rec {
 
   nativeBuildInputs = [ perl pkg-config ];
 
-  buildInputs = [ openssl ] ++ stdenv.lib.optionals stdenv.isDarwin [ Security libiconv curl ];
+  buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security libiconv curl ];
 
   meta = with lib; {
     description = "A cryptographically verifiable code review system for the cargo (Rust) package manager";
diff --git a/pkgs/development/tools/rust/cargo-deny/default.nix b/pkgs/development/tools/rust/cargo-deny/default.nix
index 4c2ee35bdf7..ba126e57a14 100644
--- a/pkgs/development/tools/rust/cargo-deny/default.nix
+++ b/pkgs/development/tools/rust/cargo-deny/default.nix
@@ -23,7 +23,7 @@ rustPlatform.buildRustPackage rec {
   nativeBuildInputs = [ perl pkg-config ];
 
   buildInputs = [ openssl  ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ Security libiconv curl ];
+    ++ lib.optionals stdenv.isDarwin [ Security libiconv curl ];
 
   meta = with lib; {
     description = "Cargo plugin to generate list of all licenses for a crate";
diff --git a/pkgs/development/tools/rust/cargo-fund/default.nix b/pkgs/development/tools/rust/cargo-fund/default.nix
index 4e30ea48272..70a2e6feca6 100644
--- a/pkgs/development/tools/rust/cargo-fund/default.nix
+++ b/pkgs/development/tools/rust/cargo-fund/default.nix
@@ -18,7 +18,7 @@ rustPlatform.buildRustPackage rec {
 
   nativeBuildInputs = [ pkg-config ];
 
-  buildInputs = [ openssl ] ++ stdenv.lib.optionals stdenv.isDarwin [ Security libiconv curl ];
+  buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security libiconv curl ];
 
   meta = with lib; {
     description = "Discover funding links for your project's dependencies";
diff --git a/pkgs/development/tools/rust/cargo-geiger/default.nix b/pkgs/development/tools/rust/cargo-geiger/default.nix
index 9daa3b251e8..3b2702c66f6 100644
--- a/pkgs/development/tools/rust/cargo-geiger/default.nix
+++ b/pkgs/development/tools/rust/cargo-geiger/default.nix
@@ -29,7 +29,7 @@ rustPlatform.buildRustPackage rec {
   # FIXME: Use impure version of CoreFoundation because of missing symbols.
   # CFURLSetResourcePropertyForKey is defined in the headers but there's no
   # corresponding implementation in the sources from opensource.apple.com.
-  preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
+  preConfigure = lib.optionalString stdenv.isDarwin ''
     export NIX_CFLAGS_COMPILE="-F${CoreFoundation}/Library/Frameworks $NIX_CFLAGS_COMPILE"
   '';
 
diff --git a/pkgs/development/tools/rust/cargo-generate/default.nix b/pkgs/development/tools/rust/cargo-generate/default.nix
index 3a4c4c44ae7..635f36ee834 100644
--- a/pkgs/development/tools/rust/cargo-generate/default.nix
+++ b/pkgs/development/tools/rust/cargo-generate/default.nix
@@ -16,7 +16,7 @@ rustPlatform.buildRustPackage rec {
   nativeBuildInputs = [ pkg-config ];
 
   buildInputs = [ openssl  ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ Security libiconv curl ];
+    ++ lib.optionals stdenv.isDarwin [ Security libiconv curl ];
 
   preCheck = ''
     export HOME=$(mktemp -d) USER=nixbld
diff --git a/pkgs/development/tools/rust/cargo-inspect/default.nix b/pkgs/development/tools/rust/cargo-inspect/default.nix
index 5a8c9150279..9339660388b 100644
--- a/pkgs/development/tools/rust/cargo-inspect/default.nix
+++ b/pkgs/development/tools/rust/cargo-inspect/default.nix
@@ -11,7 +11,7 @@ rustPlatform.buildRustPackage rec {
     sha256 = "026vc8d0jkc1d7dlp3ldmwks7svpvqzl0k5niri8a12cl5w5b9hj";
   };
 
-  buildInputs = stdenv.lib.optionals stdenv.isDarwin [ Security ];
+  buildInputs = lib.optionals stdenv.isDarwin [ Security ];
 
   cargoSha256 = "1ryi5qi1zz2yljyj4rn84q9zkzafc9w4nw3zc01hlzpnb1sjw5sw";
 
diff --git a/pkgs/development/tools/rust/cargo-make/default.nix b/pkgs/development/tools/rust/cargo-make/default.nix
index c90761309e6..e393184aebd 100644
--- a/pkgs/development/tools/rust/cargo-make/default.nix
+++ b/pkgs/development/tools/rust/cargo-make/default.nix
@@ -14,7 +14,7 @@ rustPlatform.buildRustPackage rec {
   nativeBuildInputs = [ pkg-config ];
 
   buildInputs = [ openssl ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ Security SystemConfiguration ];
+    ++ lib.optionals stdenv.isDarwin [ Security SystemConfiguration ];
 
   cargoSha256 = "sha256-Qh14lks72bsetwyv0ALF7nZo3m3FDEmVxzFkHJoEuzE=";
 
diff --git a/pkgs/development/tools/rust/cargo-raze/default.nix b/pkgs/development/tools/rust/cargo-raze/default.nix
index 56e38f78ca0..11a52e6ea08 100644
--- a/pkgs/development/tools/rust/cargo-raze/default.nix
+++ b/pkgs/development/tools/rust/cargo-raze/default.nix
@@ -17,7 +17,7 @@ rustPlatform.buildRustPackage rec {
 
   nativeBuildInputs = [ pkg-config ];
   buildInputs = [ curl libgit2 openssl ]
-    ++ stdenv.lib.optional stdenv.isDarwin Security;
+    ++ lib.optional stdenv.isDarwin Security;
 
   doCheck = true;
 
diff --git a/pkgs/development/tools/rust/cargo-udeps/default.nix b/pkgs/development/tools/rust/cargo-udeps/default.nix
index 9da28921ea7..dcbf539c1c1 100644
--- a/pkgs/development/tools/rust/cargo-udeps/default.nix
+++ b/pkgs/development/tools/rust/cargo-udeps/default.nix
@@ -16,7 +16,7 @@ rustPlatform.buildRustPackage rec {
   nativeBuildInputs = [ pkg-config ];
 
   buildInputs = [ openssl ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices Security libiconv ];
+    ++ lib.optionals stdenv.isDarwin [ CoreServices Security libiconv ];
 
   # Requires network access
   doCheck = false;
diff --git a/pkgs/development/tools/rust/cbindgen/default.nix b/pkgs/development/tools/rust/cbindgen/default.nix
index db2a1c4c660..50809055337 100644
--- a/pkgs/development/tools/rust/cbindgen/default.nix
+++ b/pkgs/development/tools/rust/cbindgen/default.nix
@@ -13,7 +13,7 @@ rustPlatform.buildRustPackage rec {
 
   cargoSha256 = "1lzzckzcgj496chbfd6lhwxcangv0krx8m5k2jwffnb9mfgac7hx";
 
-  buildInputs = stdenv.lib.optional stdenv.isDarwin Security;
+  buildInputs = lib.optional stdenv.isDarwin Security;
 
   checkFlags = [
     # https://github.com/eqrion/cbindgen/issues/338
diff --git a/pkgs/development/tools/rust/maturin/default.nix b/pkgs/development/tools/rust/maturin/default.nix
index b2340b21689..ff52824ef9a 100644
--- a/pkgs/development/tools/rust/maturin/default.nix
+++ b/pkgs/development/tools/rust/maturin/default.nix
@@ -19,8 +19,8 @@ in rustPlatform.buildRustPackage rec {
   nativeBuildInputs = [ pkg-config ];
 
   buildInputs = [ gmp openssl ]
-    ++ stdenv.lib.optional stdenv.isDarwin Security
-    ++ stdenv.lib.optional stdenv.isLinux dbus;
+    ++ lib.optional stdenv.isDarwin Security
+    ++ lib.optional stdenv.isLinux dbus;
 
   # Requires network access, fails in sandbox.
   doCheck = false;
diff --git a/pkgs/development/tools/rust/racer/default.nix b/pkgs/development/tools/rust/racer/default.nix
index d5482d58457..3ad4b54b47a 100644
--- a/pkgs/development/tools/rust/racer/default.nix
+++ b/pkgs/development/tools/rust/racer/default.nix
@@ -14,7 +14,7 @@ rustPlatform.buildRustPackage rec {
   cargoSha256 = "sha256-iUomr9viCdZk4nV75/OP8vHtJpMbmy+pq1IbaA2lLmE=";
 
   nativeBuildInputs = [ makeWrapper ];
-  buildInputs = stdenv.lib.optional stdenv.isDarwin Security;
+  buildInputs = lib.optional stdenv.isDarwin Security;
 
   # a nightly compiler is required unless we use this cheat code.
   RUSTC_BOOTSTRAP = 1;
diff --git a/pkgs/development/tools/rust/racerd/default.nix b/pkgs/development/tools/rust/racerd/default.nix
index 19cc3fdf580..33d6721610e 100644
--- a/pkgs/development/tools/rust/racerd/default.nix
+++ b/pkgs/development/tools/rust/racerd/default.nix
@@ -26,7 +26,7 @@ rustPlatform.buildRustPackage rec {
   doCheck = false;
 
   nativeBuildInputs = [ makeWrapper ];
-  buildInputs = stdenv.lib.optional stdenv.isDarwin Security;
+  buildInputs = lib.optional stdenv.isDarwin Security;
 
   RUST_SRC_PATH = rustPlatform.rustcSrc;
 
diff --git a/pkgs/development/tools/rust/rustup/default.nix b/pkgs/development/tools/rust/rustup/default.nix
index fa9b39e84a7..56097f9b98c 100644
--- a/pkgs/development/tools/rust/rustup/default.nix
+++ b/pkgs/development/tools/rust/rustup/default.nix
@@ -25,7 +25,7 @@ rustPlatform.buildRustPackage rec {
 
   buildInputs = [
     curl zlib
-  ] ++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices Security ];
+  ] ++ lib.optionals stdenv.isDarwin [ CoreServices Security ];
 
   cargoBuildFlags = [ "--features no-self-update" ];
 
diff --git a/pkgs/development/tools/sauce-connect/default.nix b/pkgs/development/tools/sauce-connect/default.nix
index 9560d45d681..12082de9842 100644
--- a/pkgs/development/tools/sauce-connect/default.nix
+++ b/pkgs/development/tools/sauce-connect/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ unzip ];
 
-  patchPhase = stdenv.lib.optionalString stdenv.isLinux ''
+  patchPhase = lib.optionalString stdenv.isLinux ''
     patchelf \
       --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
       --set-rpath "$out/lib:${makeLibraryPath [zlib]}" \
diff --git a/pkgs/development/tools/selenium/chromedriver/default.nix b/pkgs/development/tools/selenium/chromedriver/default.nix
index 5f01b98e8d1..d777d788aec 100644
--- a/pkgs/development/tools/selenium/chromedriver/default.nix
+++ b/pkgs/development/tools/selenium/chromedriver/default.nix
@@ -5,7 +5,7 @@
 }:
 
 let
-  upstream-info = (stdenv.lib.importJSON ../../../../applications/networking/browsers/chromium/upstream-info.json).stable.chromedriver;
+  upstream-info = (lib.importJSON ../../../../applications/networking/browsers/chromium/upstream-info.json).stable.chromedriver;
   allSpecs = {
     x86_64-linux = {
       system = "linux64";
@@ -21,7 +21,7 @@ let
   spec = allSpecs.${stdenv.hostPlatform.system}
     or (throw "missing chromedriver binary for ${stdenv.hostPlatform.system}");
 
-  libs = stdenv.lib.makeLibraryPath [
+  libs = lib.makeLibraryPath [
     stdenv.cc.cc.lib
     cairo fontconfig freetype
     gdk-pixbuf glib gtk2 gconf
@@ -44,7 +44,7 @@ in stdenv.mkDerivation rec {
 
   installPhase = ''
     install -m755 -D chromedriver $out/bin/chromedriver
-  '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
+  '' + lib.optionalString (!stdenv.isDarwin) ''
     patchelf --set-interpreter ${glibc.out}/lib/ld-linux-x86-64.so.2 $out/bin/chromedriver
     wrapProgram "$out/bin/chromedriver" --prefix LD_LIBRARY_PATH : "${libs}:\$LD_LIBRARY_PATH"
   '';
diff --git a/pkgs/development/tools/selenium/htmlunit-driver/default.nix b/pkgs/development/tools/selenium/htmlunit-driver/default.nix
index 400cf24012a..be3048cca25 100644
--- a/pkgs/development/tools/selenium/htmlunit-driver/default.nix
+++ b/pkgs/development/tools/selenium/htmlunit-driver/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "htmlunit-driver-standalone";
diff --git a/pkgs/development/tools/selenium/selendroid/default.nix b/pkgs/development/tools/selenium/selendroid/default.nix
index bf9eabec53c..c25190cab74 100644
--- a/pkgs/development/tools/selenium/selendroid/default.nix
+++ b/pkgs/development/tools/selenium/selendroid/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, makeWrapper, jdk, selenium-server-standalone }:
+{ lib, stdenv, fetchurl, makeWrapper, jdk, selenium-server-standalone }:
 
-with stdenv.lib;
+with lib;
 let
     name = "selendroid-standalone-${version}";
     pluginName = "selendroid-grid-plugin-${version}";
diff --git a/pkgs/development/tools/selenium/server/default.nix b/pkgs/development/tools/selenium/server/default.nix
index a6d60e33ee3..10893a9d170 100644
--- a/pkgs/development/tools/selenium/server/default.nix
+++ b/pkgs/development/tools/selenium/server/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchurl, makeWrapper, jre
+{ lib, stdenv, fetchurl, makeWrapper, jre
 , htmlunit-driver, chromedriver, chromeSupport ? true }:
 
-with stdenv.lib;
+with lib;
 
 let
   minorVersion = "3.141";
diff --git a/pkgs/development/tools/simavr/default.nix b/pkgs/development/tools/simavr/default.nix
index 987765a3217..1d47b325101 100644
--- a/pkgs/development/tools/simavr/default.nix
+++ b/pkgs/development/tools/simavr/default.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ which pkg-config avrgcc ];
   buildInputs = [ libelf freeglut libGLU libGL ]
-    ++ stdenv.lib.optional stdenv.isDarwin GLUT;
+    ++ lib.optional stdenv.isDarwin GLUT;
 
   # Hack to avoid TMPDIR in RPATHs.
   preFixup = ''rm -rf "$(pwd)" && mkdir "$(pwd)" '';
diff --git a/pkgs/development/tools/slimerjs/default.nix b/pkgs/development/tools/slimerjs/default.nix
index 49eea7213bd..b64776bac3c 100644
--- a/pkgs/development/tools/slimerjs/default.nix
+++ b/pkgs/development/tools/slimerjs/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchFromGitHub, zip, unzip, firefox, bash}:
+{lib, stdenv, fetchFromGitHub, zip, unzip, firefox, bash}:
 let
   s = # Generated upstream information
   rec {
@@ -43,8 +43,8 @@ stdenv.mkDerivation {
   meta = {
     inherit (s) version;
     description = ''Gecko-based programmatically-driven browser'';
-    license = stdenv.lib.licenses.mpl20 ;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.mpl20 ;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/pkgs/development/tools/so/default.nix b/pkgs/development/tools/so/default.nix
index 08481169dcd..99f9cdcd936 100644
--- a/pkgs/development/tools/so/default.nix
+++ b/pkgs/development/tools/so/default.nix
@@ -14,7 +14,7 @@ rustPlatform.buildRustPackage rec {
   cargoSha256 = "1ddbhy1plag4ckbmlyj47wnky7vgmfa68msl3hl25h1lwmzaf1aq";
 
   nativeBuildInputs = [ pkg-config ];
-  buildInputs = [ openssl ] ++ stdenv.lib.optionals stdenv.isDarwin [
+  buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [
     libiconv Security
   ];
 
diff --git a/pkgs/development/tools/sourcetrail/default.nix b/pkgs/development/tools/sourcetrail/default.nix
index d1e26662f0c..46f097e5b60 100644
--- a/pkgs/development/tools/sourcetrail/default.nix
+++ b/pkgs/development/tools/sourcetrail/default.nix
@@ -69,7 +69,7 @@ stdenv.mkDerivation rec {
     desktop-file-utils
     imagemagick
     javaIndexer # the resulting jar file is copied by our install script
-  ] ++ stdenv.lib.optionals doCheck testBinPath;
+  ] ++ lib.optionals doCheck testBinPath;
   buildInputs = [
     boost pythonIndexer shared-mime-info
   ] ++ (with qt5; [ qtbase qtsvg ])
@@ -86,9 +86,9 @@ stdenv.mkDerivation rec {
   ];
 
   postPatch = let
-    major = stdenv.lib.versions.major version;
-    minor = stdenv.lib.versions.minor version;
-    patch = stdenv.lib.versions.patch version;
+    major = lib.versions.major version;
+    minor = lib.versions.minor version;
+    patch = lib.versions.patch version;
   in ''
     # Upstream script obtains it's version from git:
     # https://github.com/CoatiSoftware/Sourcetrail/blob/master/cmake/version.cmake
@@ -176,7 +176,7 @@ stdenv.mkDerivation rec {
 
     mkdir -p $out/bin
     makeQtWrapper $out/opt/sourcetrail/bin/sourcetrail $out/bin/sourcetrail \
-      --prefix PATH : ${stdenv.lib.makeBinPath binPath}
+      --prefix PATH : ${lib.makeBinPath binPath}
   '';
 
   checkPhase = ''
@@ -188,7 +188,7 @@ stdenv.mkDerivation rec {
     # shorten PATH to prevent build failures
     wrapQtApp ./Sourcetrail_test \
       --set PATH "" \
-      --prefix PATH : ${stdenv.lib.makeBinPath testBinPath} \
+      --prefix PATH : ${lib.makeBinPath testBinPath} \
       --set MAVEN_OPTS "-Dmaven.repo.local=$TMPDIR/m2repo"
     ./Sourcetrail_test
     popd
diff --git a/pkgs/development/tools/sqsh/default.nix b/pkgs/development/tools/sqsh/default.nix
index 6b408592a0d..9c56efcb59f 100644
--- a/pkgs/development/tools/sqsh/default.nix
+++ b/pkgs/development/tools/sqsh/default.nix
@@ -17,7 +17,7 @@ in stdenv.mkDerivation rec {
 
     substituteInPlace src/cmd_connect.c \
       --replace CS_TDS_80 CS_TDS_73
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     substituteInPlace configure --replace "libct.so" "libct.dylib"
   '';
 
diff --git a/pkgs/development/tools/summon/default.nix b/pkgs/development/tools/summon/default.nix
index e01c60e3a89..5d851adc5ab 100644
--- a/pkgs/development/tools/summon/default.nix
+++ b/pkgs/development/tools/summon/default.nix
@@ -1,6 +1,6 @@
 { stdenv, buildGoModule, fetchFromGitHub, lib, patchResolver ? true }:
 
-with stdenv.lib;
+with lib;
 
 buildGoModule rec {
   pname = "summon";
diff --git a/pkgs/development/tools/sumneko-lua-language-server/default.nix b/pkgs/development/tools/sumneko-lua-language-server/default.nix
index 05281f1bb83..d63493ba7a1 100644
--- a/pkgs/development/tools/sumneko-lua-language-server/default.nix
+++ b/pkgs/development/tools/sumneko-lua-language-server/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, ninja, makeWrapper }:
+{ lib, stdenv, fetchFromGitHub, ninja, makeWrapper }:
 
 stdenv.mkDerivation rec {
   pname = "sumneko-lua-language-server";
@@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
       --metapath='~/.cache/sumneko_lua/meta'"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Lua Language Server coded by Lua ";
     homepage = "https://github.com/sumneko/lua-language-server";
     license = licenses.mit;
diff --git a/pkgs/development/tools/the-way/default.nix b/pkgs/development/tools/the-way/default.nix
index 7eec364c47b..1e88cfcdcc1 100644
--- a/pkgs/development/tools/the-way/default.nix
+++ b/pkgs/development/tools/the-way/default.nix
@@ -13,10 +13,10 @@ rustPlatform.buildRustPackage rec {
 
   nativeBuildInputs = [ installShellFiles ];
 
-  buildInputs = stdenv.lib.optionals stdenv.isDarwin  [ AppKit Security ];
+  buildInputs = lib.optionals stdenv.isDarwin  [ AppKit Security ];
 
   cargoSha256 = "1aiyfsvmrqcmlw0z1944i9s5g3yxc39na5mf16pb9a4bhw8zcwjr";
-  checkFlagsArray = stdenv.lib.optionals stdenv.isDarwin [ "--skip=copy" ];
+  checkFlagsArray = lib.optionals stdenv.isDarwin [ "--skip=copy" ];
   cargoParallelTestThreads = false;
 
   postInstall = ''
diff --git a/pkgs/development/tools/trellis/default.nix b/pkgs/development/tools/trellis/default.nix
index 003e3cec9ce..6ce1ad9a38a 100644
--- a/pkgs/development/tools/trellis/default.nix
+++ b/pkgs/development/tools/trellis/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
   version = "2021.01.02";
 
   # git describe --tags
-  realVersion = with stdenv.lib; with builtins;
+  realVersion = with lib; with builtins;
     "1.0-482-g${substring 0 7 (elemAt srcs 0).rev}";
 
   srcs = [
@@ -54,8 +54,8 @@ stdenv.mkDerivation rec {
       open Verilog to bitstream toolchain for these devices.
     '';
     homepage    = "https://github.com/SymbiFlow/prjtrellis";
-    license     = stdenv.lib.licenses.isc;
+    license     = lib.licenses.isc;
     maintainers = with maintainers; [ q3k thoughtpolice emily ];
-    platforms   = stdenv.lib.platforms.all;
+    platforms   = lib.platforms.all;
   };
 }
diff --git a/pkgs/development/tools/tychus/default.nix b/pkgs/development/tools/tychus/default.nix
index edd428480a0..8b330b36ea9 100644
--- a/pkgs/development/tools/tychus/default.nix
+++ b/pkgs/development/tools/tychus/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, buildGoPackage, CoreFoundation }:
+{ lib, stdenv, fetchFromGitHub, buildGoPackage, CoreFoundation }:
 
 buildGoPackage rec {
   pname = "tychus";
@@ -15,13 +15,13 @@ buildGoPackage rec {
     sha256 = "02ybxjsfga89gpg0k21zmykhhnpx1vy3ny8fcwj0qsg73i11alvw";
   };
 
-  buildInputs = stdenv.lib.optionals stdenv.hostPlatform.isDarwin [ CoreFoundation ];
+  buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ CoreFoundation ];
 
   buildFlags = [ "--tags" "release" ];
 
   meta = {
     description = "Command line utility to live-reload your application";
     homepage = "https://github.com/devlocker/tychus";
-    license = stdenv.lib.licenses.mit;
+    license = lib.licenses.mit;
   };
 }
diff --git a/pkgs/development/tools/uftrace/default.nix b/pkgs/development/tools/uftrace/default.nix
index 2fbf7366538..03ee7228901 100644
--- a/pkgs/development/tools/uftrace/default.nix
+++ b/pkgs/development/tools/uftrace/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchFromGitHub}:
+{lib, stdenv, fetchFromGitHub}:
 
 stdenv.mkDerivation rec {
   pname = "uftrace";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Function (graph) tracer for user-space";
     homepage = "https://github.com/namhyung/uftrace";
-    license = stdenv.lib.licenses.gpl2;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [stdenv.lib.maintainers.nthorne];
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.linux;
+    maintainers = [lib.maintainers.nthorne];
   };
 }
diff --git a/pkgs/development/tools/vcstool/default.nix b/pkgs/development/tools/vcstool/default.nix
index 95ebfcf64b4..65f91b3324f 100644
--- a/pkgs/development/tools/vcstool/default.nix
+++ b/pkgs/development/tools/vcstool/default.nix
@@ -14,7 +14,7 @@ buildPythonApplication rec {
 
   propagatedBuildInputs = [ pyyaml setuptools ];
 
-  makeWrapperArgs = ["--prefix" "PATH" ":" (stdenv.lib.makeBinPath [ git breezy subversion ])];
+  makeWrapperArgs = ["--prefix" "PATH" ":" (lib.makeBinPath [ git breezy subversion ])];
 
   doCheck = false; # requires network
 
diff --git a/pkgs/development/tools/vultr/default.nix b/pkgs/development/tools/vultr/default.nix
index 7c396f69f25..b9ca0febf97 100644
--- a/pkgs/development/tools/vultr/default.nix
+++ b/pkgs/development/tools/vultr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
 
 buildGoPackage rec {
   pname = "vultr";
@@ -15,7 +15,7 @@ buildGoPackage rec {
   meta = {
     description = "A command line tool for Vultr services, a provider for cloud virtual private servers";
     homepage = "https://github.com/JamesClonk/vultr";
-    license = stdenv.lib.licenses.mit;
-    maintainers = [ stdenv.lib.maintainers.zauberpony ];
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.zauberpony ];
   };
 }
diff --git a/pkgs/development/tools/wasm-pack/default.nix b/pkgs/development/tools/wasm-pack/default.nix
index c2a70f2de29..94ee6d3a1ba 100644
--- a/pkgs/development/tools/wasm-pack/default.nix
+++ b/pkgs/development/tools/wasm-pack/default.nix
@@ -27,7 +27,7 @@ rustPlatform.buildRustPackage rec {
     # gracefully exit while doing work.
     # See: https://github.com/rustwasm/wasm-pack/issues/650
     libressl
-  ] ++ stdenv.lib.optionals stdenv.isDarwin [ curl Security ];
+  ] ++ lib.optionals stdenv.isDarwin [ curl Security ];
 
   # Most tests rely on external resources and build artifacts.
   # Disabling check here to work with build sandboxing.
diff --git a/pkgs/development/tools/wiggle/default.nix b/pkgs/development/tools/wiggle/default.nix
index b89d36273f8..e861f20a919 100644
--- a/pkgs/development/tools/wiggle/default.nix
+++ b/pkgs/development/tools/wiggle/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ncurses, groff }:
+{ lib, stdenv, fetchurl, ncurses, groff }:
 
 stdenv.mkDerivation {
 
@@ -37,8 +37,8 @@ stdenv.mkDerivation {
        already been applied, and will ignore them.
     '';
 
-    license = stdenv.lib.licenses.gpl2Plus;
-    platforms = stdenv.lib.platforms.all;
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.all;
   };
 
 }
diff --git a/pkgs/development/tools/wrangler/default.nix b/pkgs/development/tools/wrangler/default.nix
index b7a37f8b8d7..c7b1c0329f3 100644
--- a/pkgs/development/tools/wrangler/default.nix
+++ b/pkgs/development/tools/wrangler/default.nix
@@ -13,10 +13,10 @@ rustPlatform.buildRustPackage rec {
 
   cargoSha256 = "0w845virvw7mvibc76ar2hbffhfzj2v8v1xkrsssrgzyaryb48jk";
 
-  nativeBuildInputs = [ perl ] ++ stdenv.lib.optionals stdenv.isLinux [ pkg-config ];
+  nativeBuildInputs = [ perl ] ++ lib.optionals stdenv.isLinux [ pkg-config ];
 
-  buildInputs = stdenv.lib.optionals stdenv.isLinux [ openssl ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [
+  buildInputs = lib.optionals stdenv.isLinux [ openssl ]
+    ++ lib.optionals stdenv.isDarwin [
       curl
       darwin.apple_sdk.frameworks.Security
       darwin.apple_sdk.frameworks.CoreServices
diff --git a/pkgs/development/tools/xcbuild/default.nix b/pkgs/development/tools/xcbuild/default.nix
index abc48b41446..1f38e49daee 100644
--- a/pkgs/development/tools/xcbuild/default.nix
+++ b/pkgs/development/tools/xcbuild/default.nix
@@ -36,11 +36,11 @@ in stdenv.mkDerivation {
     cp -r --no-preserve=all ${linenoise} ThirdParty/linenoise
   '';
 
-  postPatch = stdenv.lib.optionalString (!stdenv.isDarwin) ''
+  postPatch = lib.optionalString (!stdenv.isDarwin) ''
     # Avoid a glibc >= 2.25 deprecation warning that gets fatal via -Werror.
     sed 1i'#include <sys/sysmacros.h>' \
       -i Libraries/xcassets/Headers/xcassets/Slot/SystemVersion.h
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     # Apple Open Sourced LZFSE, but not libcompression, and it isn't
     # part of an impure framework we can add
     substituteInPlace Libraries/libcar/Sources/Rendition.cpp \
@@ -59,7 +59,7 @@ in stdenv.mkDerivation {
 
   nativeBuildInputs = [ cmake ninja ];
   buildInputs = [ zlib libxml2 libpng ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices CoreGraphics ImageIO ];
+    ++ lib.optionals stdenv.isDarwin [ CoreServices CoreGraphics ImageIO ];
 
   meta = with lib; {
     description = "Xcode-compatible build tool";
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..1af4024400a 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:
 
@@ -60,18 +60,17 @@ in
 
     configureFlags = let
       isCross = stdenv.hostPlatform != stdenv.buildPlatform;
-      host = stdenv.hostPlatform.platform;
-      isAarch32 = stdenv.hostPlatform.isAarch32;
+      inherit (stdenv.hostPlatform) gcc isArch32;
     in sharedConfigureFlags ++ [
       "--without-dtrace"
     ] ++ (optionals isCross [
       "--cross-compiling"
       "--without-intl"
       "--without-snapshot"
-    ]) ++ (optionals (isCross && isAarch32 && hasAttr "fpu" host.gcc) [
-      "--with-arm-fpu=${host.gcc.fpu}"
-    ]) ++ (optionals (isCross && isAarch32 && hasAttr "float-abi" host.gcc) [
-      "--with-arm-float-abi=${host.gcc.float-abi}"
+    ]) ++ (optionals (isCross && isAarch32 && hasAttr "fpu" gcc) [
+      "--with-arm-fpu=${gcc.fpu}"
+    ]) ++ (optionals (isCross && isAarch32 && hasAttr "float-abi" gcc) [
+      "--with-arm-float-abi=${gcc.float-abi}"
     ]) ++ (optionals (isCross && isAarch32) [
       "--dest-cpu=arm"
     ]) ++ extraConfigFlags;
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/games/crawl/crawl_purify.patch b/pkgs/games/crawl/crawl_purify.patch
index dda55b09f32..8650141744d 100644
--- a/pkgs/games/crawl/crawl_purify.patch
+++ b/pkgs/games/crawl/crawl_purify.patch
@@ -1,20 +1,5 @@
-diff --git a/crawl-ref/source/Makefile b/crawl-ref/source/Makefile
---- a/crawl-ref/source/Makefile
-+++ b/crawl-ref/source/Makefile
-@@ -248,9 +248,9 @@ ifeq ($(uname_S),Darwin)
- 	STRIP := strip -x
- 	NEED_APPKIT = YesPlease
- 	LIBNCURSES_IS_UNICODE = Yes
--	NO_PKGCONFIG = Yes
--	BUILD_SQLITE = YesPlease
--	BUILD_ZLIB = YesPlease
-+	#NO_PKGCONFIG = Yes
-+	#BUILD_SQLITE = YesPlease
-+	#BUILD_ZLIB = YesPlease
- 	ifdef TILES
- 		EXTRA_LIBS += -framework AppKit -framework AudioUnit -framework CoreAudio -framework ForceFeedback -framework Carbon -framework IOKit -framework OpenGL -framework AudioToolbox -framework CoreVideo contrib/install/$(ARCH)/lib/libSDL2main.a
- 		BUILD_FREETYPE = YesPlease
 diff --git a/crawl-ref/source/util/find_font b/crawl-ref/source/util/find_font
+index f8b576fd63..b95c21c0a1 100755
 --- a/crawl-ref/source/util/find_font
 +++ b/crawl-ref/source/util/find_font
 @@ -1,6 +1,6 @@
@@ -25,7 +10,7 @@ diff --git a/crawl-ref/source/util/find_font b/crawl-ref/source/util/find_font
  
  name=$1
  [ "$name" ] || { echo "Usage: $0 <fontname.ttf>" >&2; exit 100; }
-@@ -11,6 +11,6 @@
+@@ -11,6 +11,6 @@ name=$1
          for dir in $FONTDIRS; do
              [ -d "$dir" ] && echo "$dir"
          done
@@ -34,6 +19,7 @@ diff --git a/crawl-ref/source/util/find_font b/crawl-ref/source/util/find_font
        | head -n1
  } 2>/dev/null
 diff --git a/crawl-ref/source/windowmanager-sdl.cc b/crawl-ref/source/windowmanager-sdl.cc
+index e29ccff507..9bf01e040a 100644
 --- a/crawl-ref/source/windowmanager-sdl.cc
 +++ b/crawl-ref/source/windowmanager-sdl.cc
 @@ -20,7 +20,7 @@
diff --git a/pkgs/games/crawl/default.nix b/pkgs/games/crawl/default.nix
index ec8845b7869..8d16b2fe59c 100644
--- a/pkgs/games/crawl/default.nix
+++ b/pkgs/games/crawl/default.nix
@@ -8,13 +8,13 @@
 
 stdenv.mkDerivation rec {
   name = "crawl-${version}${lib.optionalString tileMode "-tiles"}";
-  version = "0.25.1";
+  version = "0.26.0";
 
   src = fetchFromGitHub {
     owner = "crawl";
     repo = "crawl";
     rev = version;
-    sha256 = "0i1cvwzwmcb07ynz1nk2svprfhsgcqmagvj5jfzayvcb1a2ww23b";
+    sha256 = "0g0icmhppb6f5amf5r2ksfylrlipz2cd8gd85pmd05k463nrmwqi";
   };
 
   # Patch hard-coded paths and remove force library builds
@@ -45,6 +45,7 @@ stdenv.mkDerivation rec {
   fontsPath = lib.optionalString tileMode dejavu_fonts;
 
   makeFlags = [ "prefix=${placeholder "out"}" "FORCE_CC=cc" "FORCE_CXX=c++" "HOSTCXX=c++"
+                "FORCE_PKGCONFIG=y"
                 "SAVEDIR=~/.crawl" "sqlite=${sqlite.dev}"
                 "DATADIR=${placeholder "out"}"
               ] ++ lib.optional tileMode "TILES=y"
diff --git a/pkgs/misc/vscode-extensions/default.nix b/pkgs/misc/vscode-extensions/default.nix
index 64dce8223c9..f561755fc4b 100644
--- a/pkgs/misc/vscode-extensions/default.nix
+++ b/pkgs/misc/vscode-extensions/default.nix
@@ -128,6 +128,18 @@ let
         };
       };
 
+      davidanson.vscode-markdownlint = buildVscodeMarketplaceExtension {
+        mktplcRef = {
+          name = "vscode-markdownlint";
+          publisher = "DavidAnson";
+          version = "0.38.0";
+          sha256 = "0d6hbsjrx1j8wrmfnvdwsa7sci1brplgxwkmy6sp74va7zxfjnqv";
+        };
+        meta = with lib; {
+          license = licenses.mit;
+        };
+      };
+
       dhall.dhall-lang = buildVscodeMarketplaceExtension {
         mktplcRef = {
           name = "dhall-lang";
@@ -292,6 +304,18 @@ let
         };
       };
 
+      gruntfuggly.todo-tree = buildVscodeMarketplaceExtension {
+        mktplcRef = {
+          name = "todo-tree";
+          publisher = "Gruntfuggly";
+          version = "0.0.196";
+          sha256 = "1l4f290018f2p76q6hn2b2injps6wz65as7dm537wrsvsivyg2qz";
+        };
+        meta = with lib; {
+          license = licenses.mit;
+        };
+      };
+
       haskell.haskell = buildVscodeMarketplaceExtension {
         mktplcRef = {
           name = "haskell";
@@ -304,6 +328,18 @@ let
         };
       };
 
+      hookyqr.beautify = buildVscodeMarketplaceExtension {
+        mktplcRef = {
+          name = "beautify";
+          publisher = "HookyQR";
+          version = "1.5.0";
+          sha256 = "1c0kfavdwgwham92xrh0gnyxkrl9qlkpv39l1yhrldn8vd10fj5i";
+        };
+        meta = with lib; {
+          license = licenses.mit;
+        };
+      };
+
       ibm.output-colorizer = buildVscodeMarketplaceExtension {
         mktplcRef = {
           name = "output-colorizer";
@@ -345,6 +381,18 @@ let
         };
       };
 
+      jock.svg = buildVscodeMarketplaceExtension {
+        mktplcRef = {
+          name = "svg";
+          publisher = "jock";
+          version = "1.4.4";
+          sha256 = "0kn2ic7pgbd4rbvzpsxfwyiwxa1iy92l0h3jsppxc8gk8xbqm2nc";
+        };
+        meta = with lib; {
+          license = licenses.mit;
+        };
+      };
+
       jpoissonnier.vscode-styled-components = buildVscodeMarketplaceExtension {
         mktplcRef = {
           name = "vscode-styled-components";
@@ -473,6 +521,18 @@ let
         };
       };
 
+      rubymaniac.vscode-paste-and-indent = buildVscodeMarketplaceExtension {
+        mktplcRef = {
+          name = "vscode-paste-and-indent";
+          publisher = "Rubymaniac";
+          version = "0.0.8";
+          sha256 = "0fqwcvwq37ndms6vky8jjv0zliy6fpfkh8d9raq8hkinfxq6klgl";
+        };
+        meta = with lib; {
+          license = licenses.mit;
+        };
+      };
+
       matklad.rust-analyzer = callPackage ./rust-analyzer {};
 
       ocamllabs.ocaml-platform = buildVscodeMarketplaceExtension {
@@ -564,6 +624,30 @@ let
         };
       };
 
+      spywhere.guides = buildVscodeMarketplaceExtension {
+        mktplcRef = {
+          name = "guides";
+          publisher = "spywhere";
+          version = "0.9.3";
+          sha256 = "1kvsj085w1xax6fg0kvsj1cizqh86i0pkzpwi0sbfvmcq21i6ghn";
+        };
+        meta = with lib; {
+          license = licenses.mit;
+        };
+      };
+
+      streetsidesoftware.code-spell-checker = buildVscodeMarketplaceExtension {
+        mktplcRef = {
+          name = "code-spell-checker";
+          publisher = "streetsidesoftware";
+          version = "1.10.2";
+          sha256 = "1ll046rf5dyc7294nbxqk5ya56g2bzqnmxyciqpz2w5x7j75rjib";
+        };
+        meta = with lib; {
+          license = licenses.mit;
+        };
+      };
+
       tamasfe.even-better-toml = buildVscodeMarketplaceExtension {
         mktplcRef = {
           name = "even-better-toml";
diff --git a/pkgs/os-specific/linux/exfat/default.nix b/pkgs/os-specific/linux/exfat/default.nix
index 88792346d70..958bcdb9f16 100644
--- a/pkgs/os-specific/linux/exfat/default.nix
+++ b/pkgs/os-specific/linux/exfat/default.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
   makeFlags = [
     "KDIR=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
-    "ARCH=${stdenv.hostPlatform.platform.kernelArch}"
+    "ARCH=${stdenv.hostPlatform.linuxArch}"
   ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [
     "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
   ];
diff --git a/pkgs/os-specific/linux/kernel-headers/default.nix b/pkgs/os-specific/linux/kernel-headers/default.nix
index b4e1d19e64b..7a81d9434e3 100644
--- a/pkgs/os-specific/linux/kernel-headers/default.nix
+++ b/pkgs/os-specific/linux/kernel-headers/default.nix
@@ -7,7 +7,7 @@ let
     pname = "linux-headers";
     inherit version;
 
-    ARCH = stdenvNoCC.hostPlatform.platform.kernelArch or stdenvNoCC.hostPlatform.kernelArch;
+    ARCH = stdenvNoCC.hostPlatform.linuxArch;
 
     # It may look odd that we use `stdenvNoCC`, and yet explicit depend on a cc.
     # We do this so we have a build->build, not build->host, C compiler.
diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix
index 31a90dc740f..ac9d6fbb2b5 100644
--- a/pkgs/os-specific/linux/kernel/generic.nix
+++ b/pkgs/os-specific/linux/kernel/generic.nix
@@ -42,7 +42,7 @@
   # symbolic name and `patch' is the actual patch.  The patch may
   # optionally be compressed with gzip or bzip2.
   kernelPatches ? []
-, ignoreConfigErrors ? stdenv.hostPlatform.platform.name != "pc" ||
+, ignoreConfigErrors ? stdenv.hostPlatform.linux-kernel.name != "pc" ||
                        stdenv.hostPlatform != stdenv.buildPlatform
 , extraMeta ? {}
 
@@ -51,10 +51,10 @@
 , isLibre    ? false
 , isHardened ? false
 
-# easy overrides to stdenv.hostPlatform.platform members
-, autoModules ? stdenv.hostPlatform.platform.kernelAutoModules
-, preferBuiltin ? stdenv.hostPlatform.platform.kernelPreferBuiltin or false
-, kernelArch ? stdenv.hostPlatform.platform.kernelArch
+# easy overrides to stdenv.hostPlatform.linux-kernel members
+, autoModules ? stdenv.hostPlatform.linux-kernel.autoModules
+, preferBuiltin ? stdenv.hostPlatform.linux-kernel.preferBuiltin or false
+, kernelArch ? stdenv.hostPlatform.linuxArch
 
 , ...
 }:
@@ -87,7 +87,7 @@ let
   intermediateNixConfig = configfile.moduleStructuredConfig.intermediateNixConfig
     # extra config in legacy string format
     + extraConfig
-    + lib.optionalString (stdenv.hostPlatform.platform ? kernelExtraConfig) stdenv.hostPlatform.platform.kernelExtraConfig;
+    + stdenv.hostPlatform.linux-kernel.extraConfig or "";
 
   structuredConfigFromPatches =
         map ({extraStructuredConfig ? {}, ...}: {settings=extraStructuredConfig;}) kernelPatches;
@@ -113,11 +113,11 @@ let
     nativeBuildInputs = [ perl gmp libmpc mpfr ]
       ++ lib.optionals (lib.versionAtLeast version "4.16") [ bison flex ];
 
-    platformName = stdenv.hostPlatform.platform.name;
+    platformName = stdenv.hostPlatform.linux-kernel.name;
     # e.g. "defconfig"
-    kernelBaseConfig = if defconfig != null then defconfig else stdenv.hostPlatform.platform.kernelBaseConfig;
+    kernelBaseConfig = if defconfig != null then defconfig else stdenv.hostPlatform.linux-kernel.baseConfig;
     # e.g. "bzImage"
-    kernelTarget = stdenv.hostPlatform.platform.kernelTarget;
+    kernelTarget = stdenv.hostPlatform.linux-kernel.target;
 
     prePatch = kernel.prePatch + ''
       # Patch kconfig to print "###" after every question so that
diff --git a/pkgs/os-specific/linux/kernel/manual-config.nix b/pkgs/os-specific/linux/kernel/manual-config.nix
index 67016b71918..2fc63322f5b 100644
--- a/pkgs/os-specific/linux/kernel/manual-config.nix
+++ b/pkgs/os-specific/linux/kernel/manual-config.nix
@@ -64,10 +64,10 @@ let
 
   commonMakeFlags = [
     "O=$(buildRoot)"
-  ] ++ lib.optionals (stdenv.hostPlatform.platform ? kernelMakeFlags)
-    stdenv.hostPlatform.platform.kernelMakeFlags;
+  ] ++ lib.optionals (stdenv.hostPlatform.linux-kernel ? makeFlags)
+    stdenv.hostPlatform.linux-kernel.makeFlags;
 
-  drvAttrs = config_: platform: kernelPatches: configfile:
+  drvAttrs = config_: kernelConf: kernelPatches: configfile:
     let
       config = let attrName = attr: "CONFIG_" + attr; in {
         isSet = attr: hasAttr (attrName attr) config;
@@ -171,7 +171,7 @@ let
 
       buildFlags = [
         "KBUILD_BUILD_VERSION=1-NixOS"
-        platform.kernelTarget
+        kernelConf.target
         "vmlinux"  # for "perf" and things like that
       ] ++ optional isModular "modules";
 
@@ -186,16 +186,16 @@ let
       '';
 
       # Some image types need special install targets (e.g. uImage is installed with make uinstall)
-      installTargets = [ (
-        if platform ? kernelInstallTarget then platform.kernelInstallTarget
-        else if platform.kernelTarget == "uImage" then "uinstall"
-        else if platform.kernelTarget == "zImage" || platform.kernelTarget == "Image.gz" then "zinstall"
-        else "install"
-      ) ];
+      installTargets = [
+        (kernelConf.installTarget or (
+          /**/ if kernelConf.target == "uImage" then "uinstall"
+          else if kernelConf.target == "zImage" || kernelConf.target == "Image.gz" then "zinstall"
+          else "install"))
+      ];
 
       postInstall = (optionalString installsFirmware ''
         mkdir -p $out/lib/firmware
-      '') + (if (platform ? kernelDTB && platform.kernelDTB) then ''
+      '') + (if (kernelConf.DTB or false) then ''
         make $makeFlags "''${makeFlagsArray[@]}" dtbs dtbs_install INSTALL_DTBS_PATH=$out/dtbs
       '' else "") + (if isModular then ''
         mkdir -p $dev
@@ -300,7 +300,7 @@ in
 assert (lib.versionAtLeast version "4.14" && lib.versionOlder version "5.8") -> libelf != null;
 assert lib.versionAtLeast version "5.8" -> elfutils != null;
 
-stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.platform kernelPatches configfile) // {
+stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.linux-kernel kernelPatches configfile) // {
   pname = "linux";
   inherit version;
 
@@ -308,7 +308,7 @@ stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.platform kernelPatches
 
   depsBuildBuild = [ buildPackages.stdenv.cc ];
   nativeBuildInputs = [ perl bc nettools openssl rsync gmp libmpc mpfr gawk zstd ]
-      ++ optional  (stdenv.hostPlatform.platform.kernelTarget == "uImage") buildPackages.ubootTools
+      ++ optional  (stdenv.hostPlatform.linux-kernel.target == "uImage") buildPackages.ubootTools
       ++ optional  (lib.versionAtLeast version "4.14" && lib.versionOlder version "5.8") libelf
       # Removed util-linuxMinimal since it should not be a dependency.
       ++ optionals (lib.versionAtLeast version "4.16") [ bison flex ]
@@ -322,10 +322,10 @@ stdenv.mkDerivation ((drvAttrs config stdenv.hostPlatform.platform kernelPatches
   makeFlags = commonMakeFlags ++ [
     "CC=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"
     "HOSTCC=${buildPackages.stdenv.cc}/bin/${buildPackages.stdenv.cc.targetPrefix}cc"
-    "ARCH=${stdenv.hostPlatform.platform.kernelArch}"
+    "ARCH=${stdenv.hostPlatform.linuxArch}"
   ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [
     "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
   ];
 
-  karch = stdenv.hostPlatform.platform.kernelArch;
+  karch = stdenv.hostPlatform.linuxArch;
 })
diff --git a/pkgs/os-specific/linux/klibc/default.nix b/pkgs/os-specific/linux/klibc/default.nix
index 65ab71bd562..dc96f3b6a62 100644
--- a/pkgs/os-specific/linux/klibc/default.nix
+++ b/pkgs/os-specific/linux/klibc/default.nix
@@ -25,11 +25,11 @@ stdenv.mkDerivation rec {
   hardeningDisable = [ "format" "stackprotector" ];
 
   makeFlags = commonMakeFlags ++ [
-    "KLIBCARCH=${stdenv.hostPlatform.platform.kernelArch}"
+    "KLIBCARCH=${stdenv.hostPlatform.linuxArch}"
     "KLIBCKERNELSRC=${linuxHeaders}"
   ] # TODO(@Ericson2314): We now can get the ABI from
     # `stdenv.hostPlatform.parsed.abi`, is this still a good idea?
-    ++ lib.optional (stdenv.hostPlatform.platform.kernelArch == "arm") "CONFIG_AEABI=y"
+    ++ lib.optional (stdenv.hostPlatform.linuxArch == "arm") "CONFIG_AEABI=y"
     ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "CROSS_COMPILE=${stdenv.cc.targetPrefix}";
 
   # Install static binaries as well.
diff --git a/pkgs/os-specific/linux/nvidia-x11/default.nix b/pkgs/os-specific/linux/nvidia-x11/default.nix
index f15ba884d3f..004858964a7 100644
--- a/pkgs/os-specific/linux/nvidia-x11/default.nix
+++ b/pkgs/os-specific/linux/nvidia-x11/default.nix
@@ -24,8 +24,7 @@ rec {
     then generic {
       version = "460.32.03";
       sha256_64bit = "0qb0f8djys55b7qgvpbwafw5lkwvmcslqz3i2kr3jm354gy248ag";
-      settingsVersion = "460.27.04";
-      settingsSha256 = "1z9ibkhyjqzhhzi3gj88f5jlpc1d76jsncsy6wxpnbdbak8ljkw5";
+      settingsSha256 = "0mfkw0s4gy1dx671cp1kbpkpkf9c4271w5dz0ykiacz22simi83l";
       persistencedSha256 = "1zrnmwlwqg3pgy1jvldy9iv994wr823rl7vjr1kqnngdmn7bflxl";
     }
     else legacy_390;
diff --git a/pkgs/os-specific/linux/rtl8723bs/default.nix b/pkgs/os-specific/linux/rtl8723bs/default.nix
index 056fd40d252..a862b351716 100644
--- a/pkgs/os-specific/linux/rtl8723bs/default.nix
+++ b/pkgs/os-specific/linux/rtl8723bs/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ nukeReferences ];
 
   makeFlags = [
-    "ARCH=${stdenv.hostPlatform.platform.kernelArch}" # Normally not needed, but the Makefile sets ARCH in a broken way.
+    "ARCH=${stdenv.hostPlatform.linuxArch}" # Normally not needed, but the Makefile sets ARCH in a broken way.
     "KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build" # Makefile uses $(uname -r); breaks us.
   ];
 
diff --git a/pkgs/os-specific/linux/rtl8812au/default.nix b/pkgs/os-specific/linux/rtl8812au/default.nix
index aeed87d3c19..68a88fb6778 100644
--- a/pkgs/os-specific/linux/rtl8812au/default.nix
+++ b/pkgs/os-specific/linux/rtl8812au/default.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
   '';
 
   makeFlags = [
-    "ARCH=${stdenv.hostPlatform.platform.kernelArch}"
+    "ARCH=${stdenv.hostPlatform.linuxArch}"
     "KSRC=${kernel.dev}/lib/modules/${kernel.modDirVersion}/build"
     ("CONFIG_PLATFORM_I386_PC=" + (if (stdenv.hostPlatform.isi686 || stdenv.hostPlatform.isx86_64) then "y" else "n"))
     ("CONFIG_PLATFORM_ARM_RPI=" + (if (stdenv.hostPlatform.isAarch32 || stdenv.hostPlatform.isAarch64) then "y" else "n"))
diff --git a/pkgs/os-specific/linux/uclibc/default.nix b/pkgs/os-specific/linux/uclibc/default.nix
index 7c95a98372d..7508e1faf15 100644
--- a/pkgs/os-specific/linux/uclibc/default.nix
+++ b/pkgs/os-specific/linux/uclibc/default.nix
@@ -68,7 +68,7 @@ stdenv.mkDerivation {
     cat << EOF | parseconfig
     ${nixConfig}
     ${extraConfig}
-    ${stdenv.hostPlatform.platform.uclibc.extraConfig or ""}
+    ${stdenv.hostPlatform.uclibc.extraConfig or ""}
     EOF
     ( set +o pipefail; yes "" | make oldconfig )
   '';
diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix
index 8ba845dc431..0f0737595af 100644
--- a/pkgs/servers/home-assistant/component-packages.nix
+++ b/pkgs/servers/home-assistant/component-packages.nix
@@ -27,7 +27,7 @@
     "amazon_polly" = ps: with ps; [ boto3 ];
     "ambiclimate" = ps: with ps; [ aiohttp-cors ambiclimate ];
     "ambient_station" = ps: with ps; [ ]; # missing inputs: aioambient
-    "amcrest" = ps: with ps; [ ha-ffmpeg ]; # missing inputs: amcrest
+    "amcrest" = ps: with ps; [ amcrest ha-ffmpeg ];
     "ampio" = ps: with ps; [ ]; # missing inputs: asmog
     "android_ip_webcam" = ps: with ps; [ ]; # missing inputs: pydroid-ipcam
     "androidtv" = ps: with ps; [ adb-shell androidtv pure-python-adb ];
@@ -121,7 +121,7 @@
     "clicksend_tts" = ps: with ps; [ ];
     "climate" = ps: with ps; [ ];
     "cloud" = ps: with ps; [ aiohttp-cors hass-nabucasa ];
-    "cloudflare" = ps: with ps; [ ]; # missing inputs: pycfdns
+    "cloudflare" = ps: with ps; [ pycfdns ];
     "cmus" = ps: with ps; [ ]; # missing inputs: pycmus
     "co2signal" = ps: with ps; [ ]; # missing inputs: co2signal
     "coinbase" = ps: with ps; [ ]; # missing inputs: coinbase
@@ -194,7 +194,7 @@
     "dweet" = ps: with ps; [ ]; # missing inputs: dweepy
     "dynalite" = ps: with ps; [ ]; # missing inputs: dynalite_devices
     "dyson" = ps: with ps; [ aiohttp-cors zeroconf ]; # missing inputs: libpurecool
-    "eafm" = ps: with ps; [ ]; # missing inputs: aioeafm
+    "eafm" = ps: with ps; [ aioeafm ];
     "ebox" = ps: with ps; [ ]; # missing inputs: pyebox
     "ebusd" = ps: with ps; [ ]; # missing inputs: ebusdpy
     "ecoal_boiler" = ps: with ps; [ ]; # missing inputs: ecoaliface
diff --git a/pkgs/servers/http/lighttpd/default.nix b/pkgs/servers/http/lighttpd/default.nix
index d4a2c91d60b..afc7c5c7453 100644
--- a/pkgs/servers/http/lighttpd/default.nix
+++ b/pkgs/servers/http/lighttpd/default.nix
@@ -15,11 +15,11 @@ assert enableWebDAV -> libuuid != null;
 assert enableExtendedAttrs -> attr != null;
 
 stdenv.mkDerivation rec {
-  name = "lighttpd-1.4.56";
+  name = "lighttpd-1.4.58";
 
   src = fetchurl {
     url = "https://download.lighttpd.net/lighttpd/releases-1.4.x/${name}.tar.xz";
-    sha256 = "0xyzahrkmldwskwgjgj4dc3rmfmgqiwwr9y7jfhqpbp8g76q9kp4";
+    sha256 = "sha256-Jn/v/aE6GQ69znsVFy2L4W2pgAhFfzD93s1ygy0SbQ4=";
   };
 
   postPatch = ''
diff --git a/pkgs/servers/monitoring/alertmanager-bot/default.nix b/pkgs/servers/monitoring/alertmanager-bot/default.nix
index 562bd1ea815..7f4959e58eb 100644
--- a/pkgs/servers/monitoring/alertmanager-bot/default.nix
+++ b/pkgs/servers/monitoring/alertmanager-bot/default.nix
@@ -1,19 +1,25 @@
-{ lib, stdenv, buildGoPackage, fetchFromGitHub }:
+{ lib, stdenv, buildGoModule, fetchFromGitHub }:
 
-buildGoPackage rec {
+buildGoModule rec {
   pname = "alertmanager-bot";
-  version = "0.4.0";
-
-  goPackagePath = "github.com/metalmatze/alertmanager-bot";
+  version = "0.4.3";
 
   src = fetchFromGitHub {
     owner = "metalmatze";
     repo = pname;
     rev = version;
-    sha256 = "10v0fxxcs5s6zmqindr30plyw7p2yg0a64rdw1b2cj2mc1m3byx3";
+    sha256 = "1hjfkksqb675gabzjc221b33h2m4s6qsanmkm382d3fyzqj71dh9";
   };
 
-  goDeps = ./deps.nix;
+  vendorSha256 = "1v0fgin8dn81b559zz4lqmrl7hikr46g4gb18sci4riql5qs1isj";
+
+  postPatch = ''
+    sed "s;/templates/default.tmpl;$out/share&;" -i cmd/alertmanager-bot/main.go
+  '';
+
+  postInstall = ''
+    install -Dm644 -t $out/share/templates $src/default.tmpl
+  '';
 
   meta = with lib; {
     description = "Bot for Prometheus' Alertmanager";
diff --git a/pkgs/servers/monitoring/alertmanager-bot/deps.nix b/pkgs/servers/monitoring/alertmanager-bot/deps.nix
deleted file mode 100644
index 51e98ccbc93..00000000000
--- a/pkgs/servers/monitoring/alertmanager-bot/deps.nix
+++ /dev/null
@@ -1,948 +0,0 @@
-# file generated from go.mod using vgo2nix (https://github.com/adisbladis/vgo2nix)
-[
-  {
-    goPackagePath = "github.com/DataDog/datadog-go";
-    fetch = {
-      type = "git";
-      url = "https://github.com/DataDog/datadog-go";
-      rev = "0ddda6bee211";
-      sha256 = "07ap1qhz8vwdypmlny5gxnc191c0qbm6acacs30m1d4p22x6wxip";
-    };
-  }
-  {
-    goPackagePath = "github.com/OneOfOne/xxhash";
-    fetch = {
-      type = "git";
-      url = "https://github.com/OneOfOne/xxhash";
-      rev = "v1.2.5";
-      sha256 = "15ai4nzm8cv8nqs4xm5h6ghnms19c2sp8z0zpkc46rld6y7k0xky";
-    };
-  }
-  {
-    goPackagePath = "github.com/alecthomas/template";
-    fetch = {
-      type = "git";
-      url = "https://github.com/alecthomas/template";
-      rev = "a0175ee3bccc";
-      sha256 = "0qjgvvh26vk1cyfq9fadyhfgdj36f1iapbmr5xp6zqipldz8ffxj";
-    };
-  }
-  {
-    goPackagePath = "github.com/alecthomas/units";
-    fetch = {
-      type = "git";
-      url = "https://github.com/alecthomas/units";
-      rev = "2efee857e7cf";
-      sha256 = "1j65b91qb9sbrml9cpabfrcf07wmgzzghrl7809hjjhrmbzri5bl";
-    };
-  }
-  {
-    goPackagePath = "github.com/armon/circbuf";
-    fetch = {
-      type = "git";
-      url = "https://github.com/armon/circbuf";
-      rev = "bbbad097214e";
-      sha256 = "1idpr0lzb2px2p3wgfq2276yl7jpaz43df6n91kf790404s4zmk3";
-    };
-  }
-  {
-    goPackagePath = "github.com/armon/go-metrics";
-    fetch = {
-      type = "git";
-      url = "https://github.com/armon/go-metrics";
-      rev = "f0300d1749da";
-      sha256 = "13l7c35ps0r27vxfil2w0xhhc7w5rh00awvlmn4cz0a937b9ffpv";
-    };
-  }
-  {
-    goPackagePath = "github.com/armon/go-radix";
-    fetch = {
-      type = "git";
-      url = "https://github.com/armon/go-radix";
-      rev = "7fddfc383310";
-      sha256 = "0y8chspn14n9xpsfb9gxnnf819rfpriaz64v81p7873a42kkhxb4";
-    };
-  }
-  {
-    goPackagePath = "github.com/beorn7/perks";
-    fetch = {
-      type = "git";
-      url = "https://github.com/beorn7/perks";
-      rev = "v1.0.1";
-      sha256 = "17n4yygjxa6p499dj3yaqzfww2g7528165cl13haj97hlx94dgl7";
-    };
-  }
-  {
-    goPackagePath = "github.com/bgentry/speakeasy";
-    fetch = {
-      type = "git";
-      url = "https://github.com/bgentry/speakeasy";
-      rev = "v0.1.0";
-      sha256 = "02dfrj0wyphd3db9zn2mixqxwiz1ivnyc5xc7gkz58l5l27nzp8s";
-    };
-  }
-  {
-    goPackagePath = "github.com/boltdb/bolt";
-    fetch = {
-      type = "git";
-      url = "https://github.com/boltdb/bolt";
-      rev = "v1.3.1";
-      sha256 = "0z7j06lijfi4y30ggf2znak2zf2srv2m6c68ar712wd2ys44qb3r";
-    };
-  }
-  {
-    goPackagePath = "github.com/cenkalti/backoff";
-    fetch = {
-      type = "git";
-      url = "https://github.com/cenkalti/backoff";
-      rev = "v2.1.1";
-      sha256 = "1mf4lsl3rbb8kk42x0mrhzzy4ikqy0jf6nxpzhkr02rdgwh6rjk8";
-    };
-  }
-  {
-    goPackagePath = "github.com/cespare/xxhash";
-    fetch = {
-      type = "git";
-      url = "https://github.com/cespare/xxhash";
-      rev = "v1.0.0";
-      sha256 = "02aii7z46sasagw816zz3v0gzax1z5d1hkjslz7ng25386p0gzk1";
-    };
-  }
-  {
-    goPackagePath = "github.com/circonus-labs/circonus-gometrics";
-    fetch = {
-      type = "git";
-      url = "https://github.com/circonus-labs/circonus-gometrics";
-      rev = "v2.0.0";
-      sha256 = "0d6cnswq28mjak7092vf89f9l0ga2ziwyamq9kdgfc7aavpwr6l9";
-    };
-  }
-  {
-    goPackagePath = "github.com/circonus-labs/circonusllhist";
-    fetch = {
-      type = "git";
-      url = "https://github.com/circonus-labs/circonusllhist";
-      rev = "6e85b9352cf0";
-      sha256 = "182gry1clk12m34574qif7bx74qpxib2zv0mr5kv2j9hfq7f9m01";
-    };
-  }
-  {
-    goPackagePath = "github.com/creack/pty";
-    fetch = {
-      type = "git";
-      url = "https://github.com/creack/pty";
-      rev = "v1.1.7";
-      sha256 = "1plwwlk1i9b80zv8zdplvv81shfyc9gf0flydnydsh5sr3ib5vrc";
-    };
-  }
-  {
-    goPackagePath = "github.com/davecgh/go-spew";
-    fetch = {
-      type = "git";
-      url = "https://github.com/davecgh/go-spew";
-      rev = "v1.1.1";
-      sha256 = "0hka6hmyvp701adzag2g26cxdj47g21x6jz4sc6jjz1mn59d474y";
-    };
-  }
-  {
-    goPackagePath = "github.com/docker/libkv";
-    fetch = {
-      type = "git";
-      url = "https://github.com/docker/libkv";
-      rev = "v0.2.1";
-      sha256 = "0blq7kxjy1bvm3j5q4i6csnc4i88c1wvj4gjvxbqfk3sny73gjkr";
-    };
-  }
-  {
-    goPackagePath = "github.com/fatih/color";
-    fetch = {
-      type = "git";
-      url = "https://github.com/fatih/color";
-      rev = "v1.7.0";
-      sha256 = "0v8msvg38r8d1iiq2i5r4xyfx0invhc941kjrsg5gzwvagv55inv";
-    };
-  }
-  {
-    goPackagePath = "github.com/fsnotify/fsnotify";
-    fetch = {
-      type = "git";
-      url = "https://github.com/fsnotify/fsnotify";
-      rev = "v1.4.7";
-      sha256 = "07va9crci0ijlivbb7q57d2rz9h27zgn2fsm60spjsqpdbvyrx4g";
-    };
-  }
-  {
-    goPackagePath = "github.com/go-kit/kit";
-    fetch = {
-      type = "git";
-      url = "https://github.com/go-kit/kit";
-      rev = "v0.8.0";
-      sha256 = "1rcywbc2pvab06qyf8pc2rdfjv7r6kxdv2v4wnpqnjhz225wqvc0";
-    };
-  }
-  {
-    goPackagePath = "github.com/go-logfmt/logfmt";
-    fetch = {
-      type = "git";
-      url = "https://github.com/go-logfmt/logfmt";
-      rev = "v0.3.0";
-      sha256 = "1gkgh3k5w1xwb2qbjq52p6azq3h1c1rr6pfwjlwj1zrijpzn2xb9";
-    };
-  }
-  {
-    goPackagePath = "github.com/go-stack/stack";
-    fetch = {
-      type = "git";
-      url = "https://github.com/go-stack/stack";
-      rev = "v1.8.0";
-      sha256 = "0wk25751ryyvxclyp8jdk5c3ar0cmfr8lrjb66qbg4808x66b96v";
-    };
-  }
-  {
-    goPackagePath = "github.com/gogo/protobuf";
-    fetch = {
-      type = "git";
-      url = "https://github.com/gogo/protobuf";
-      rev = "v1.1.1";
-      sha256 = "1525pq7r6h3s8dncvq8gxi893p2nq8dxpzvq0nfl5b4p6mq0v1c2";
-    };
-  }
-  {
-    goPackagePath = "github.com/golang/protobuf";
-    fetch = {
-      type = "git";
-      url = "https://github.com/golang/protobuf";
-      rev = "v1.3.2";
-      sha256 = "1k1wb4zr0qbwgpvz9q5ws9zhlal8hq7dmq62pwxxriksayl6hzym";
-    };
-  }
-  {
-    goPackagePath = "github.com/google/btree";
-    fetch = {
-      type = "git";
-      url = "https://github.com/google/btree";
-      rev = "4030bb1f1f0c";
-      sha256 = "0ba430m9fbnagacp57krgidsyrgp3ycw5r7dj71brgp5r52g82p6";
-    };
-  }
-  {
-    goPackagePath = "github.com/google/go-cmp";
-    fetch = {
-      type = "git";
-      url = "https://github.com/google/go-cmp";
-      rev = "v0.3.1";
-      sha256 = "1caw49i0plkjxir7kdf5qhwls3krqwfmi7g4h392rdfwi3kfahx1";
-    };
-  }
-  {
-    goPackagePath = "github.com/google/gofuzz";
-    fetch = {
-      type = "git";
-      url = "https://github.com/google/gofuzz";
-      rev = "v1.0.0";
-      sha256 = "0qz439qvccm91w0mmjz4fqgx48clxdwagkvvx89cr43q1d4iry36";
-    };
-  }
-  {
-    goPackagePath = "github.com/hako/durafmt";
-    fetch = {
-      type = "git";
-      url = "https://github.com/hako/durafmt";
-      rev = "ea3ab126a649";
-      sha256 = "1niq0v6av5vsn4rizfda4zq922jvavig5b0qg9g0gyz6cj62rjzs";
-    };
-  }
-  {
-    goPackagePath = "github.com/hashicorp/consul";
-    fetch = {
-      type = "git";
-      url = "https://github.com/hashicorp/consul";
-      rev = "v1.4.5";
-      sha256 = "0gpg3cbpsmzcaab3scqhpzz57892s95hwq5z0l9bq7qqm6iqfr9d";
-    };
-  }
-  {
-    goPackagePath = "github.com/hashicorp/errwrap";
-    fetch = {
-      type = "git";
-      url = "https://github.com/hashicorp/errwrap";
-      rev = "v1.0.0";
-      sha256 = "0slfb6w3b61xz04r32bi0a1bygc82rjzhqkxj2si2074wynqnr1c";
-    };
-  }
-  {
-    goPackagePath = "github.com/hashicorp/go-cleanhttp";
-    fetch = {
-      type = "git";
-      url = "https://github.com/hashicorp/go-cleanhttp";
-      rev = "3573b8b52aa7";
-      sha256 = "1pbl6p7w5wp1c70x7fp94h4ynk2ajfa76rqin3d2hq1w2fcb7byr";
-    };
-  }
-  {
-    goPackagePath = "github.com/hashicorp/go-immutable-radix";
-    fetch = {
-      type = "git";
-      url = "https://github.com/hashicorp/go-immutable-radix";
-      rev = "v1.0.0";
-      sha256 = "1v3nmsnk1s8bzpclrhirz7iq0g5xxbw9q5gvrg9ss6w9crs72qr6";
-    };
-  }
-  {
-    goPackagePath = "github.com/hashicorp/go-msgpack";
-    fetch = {
-      type = "git";
-      url = "https://github.com/hashicorp/go-msgpack";
-      rev = "v0.5.5";
-      sha256 = "0fqmfx3dxnvb0d23cpn2xpd067pibwlchdc58ln8w6lznzrbzaan";
-    };
-  }
-  {
-    goPackagePath = "github.com/hashicorp/go-multierror";
-    fetch = {
-      type = "git";
-      url = "https://github.com/hashicorp/go-multierror";
-      rev = "v1.0.0";
-      sha256 = "00nyn8llqzbfm8aflr9kwsvpzi4kv8v45c141v88xskxp5xf6z49";
-    };
-  }
-  {
-    goPackagePath = "github.com/hashicorp/go-retryablehttp";
-    fetch = {
-      type = "git";
-      url = "https://github.com/hashicorp/go-retryablehttp";
-      rev = "794af36148bf";
-      sha256 = "1686d4qav0ayj3f5881w3kd9pz4fxsmknfqwccbj9yklxm3khvp4";
-    };
-  }
-  {
-    goPackagePath = "github.com/hashicorp/go-rootcerts";
-    fetch = {
-      type = "git";
-      url = "https://github.com/hashicorp/go-rootcerts";
-      rev = "v1.0.1";
-      sha256 = "0ca5h7vlvrghf24dzh8l6w5px293n173qxfkjxb9kgsl6hsrsl3y";
-    };
-  }
-  {
-    goPackagePath = "github.com/hashicorp/go-sockaddr";
-    fetch = {
-      type = "git";
-      url = "https://github.com/hashicorp/go-sockaddr";
-      rev = "v1.0.2";
-      sha256 = "0y106nhd3s63lj7h7k21iq0br97h0z9qjrvx028zqcsq9407k9is";
-    };
-  }
-  {
-    goPackagePath = "github.com/hashicorp/go-syslog";
-    fetch = {
-      type = "git";
-      url = "https://github.com/hashicorp/go-syslog";
-      rev = "v1.0.0";
-      sha256 = "09vccqggz212cg0jir6vv708d6mx0f9w5bxrcdah3h6chgmal6v1";
-    };
-  }
-  {
-    goPackagePath = "github.com/hashicorp/go-uuid";
-    fetch = {
-      type = "git";
-      url = "https://github.com/hashicorp/go-uuid";
-      rev = "v1.0.1";
-      sha256 = "0jvb88m0rq41bwgirsadgw7mnayl27av3gd2vqa3xvxp3fy0hp5k";
-    };
-  }
-  {
-    goPackagePath = "github.com/hashicorp/golang-lru";
-    fetch = {
-      type = "git";
-      url = "https://github.com/hashicorp/golang-lru";
-      rev = "v0.5.3";
-      sha256 = "1p2igd58xkm8yaj2c2wxiplkf2hj6kxwrg6ss7mx61s5rd71v5xb";
-    };
-  }
-  {
-    goPackagePath = "github.com/hashicorp/logutils";
-    fetch = {
-      type = "git";
-      url = "https://github.com/hashicorp/logutils";
-      rev = "v1.0.0";
-      sha256 = "076wf4sh5p3f953ndqk1cc0x7jhmlqrxak9953rz79rcdw77rjvv";
-    };
-  }
-  {
-    goPackagePath = "github.com/hashicorp/mdns";
-    fetch = {
-      type = "git";
-      url = "https://github.com/hashicorp/mdns";
-      rev = "v1.0.1";
-      sha256 = "185zpyj1jf1jm7hihg73gqnspr0a359aqwv11v4a6mwd5bkdh19j";
-    };
-  }
-  {
-    goPackagePath = "github.com/hashicorp/memberlist";
-    fetch = {
-      type = "git";
-      url = "https://github.com/hashicorp/memberlist";
-      rev = "v0.1.4";
-      sha256 = "0l9qx8j7mm00ia6m41zbn39z7p77jjf95zph2nw8j2vihm56q9ql";
-    };
-  }
-  {
-    goPackagePath = "github.com/hashicorp/serf";
-    fetch = {
-      type = "git";
-      url = "https://github.com/hashicorp/serf";
-      rev = "v0.8.3";
-      sha256 = "0isaq2m08rpwvlzd72gvy3caapkrzgr9cwizl99ainsjgj2nkds9";
-    };
-  }
-  {
-    goPackagePath = "github.com/hashicorp/uuid";
-    fetch = {
-      type = "git";
-      url = "https://github.com/hashicorp/uuid";
-      rev = "ebb0a03e909c";
-      sha256 = "0bzqr8y81h96cw299lhc5nxi9203a7xpd7csjsm6rh4k1bx4hdlf";
-    };
-  }
-  {
-    goPackagePath = "github.com/hashicorp/yamux";
-    fetch = {
-      type = "git";
-      url = "https://github.com/hashicorp/yamux";
-      rev = "f5742cb6b856";
-      sha256 = "1k9b399ljsp443s1v69c1m5jqdiw1998ryz4b4lh86nkz775ws5s";
-    };
-  }
-  {
-    goPackagePath = "github.com/hpcloud/tail";
-    fetch = {
-      type = "git";
-      url = "https://github.com/hpcloud/tail";
-      rev = "v1.0.0";
-      sha256 = "1njpzc0pi1acg5zx9y6vj9xi6ksbsc5d387rd6904hy6rh2m6kn0";
-    };
-  }
-  {
-    goPackagePath = "github.com/joho/godotenv";
-    fetch = {
-      type = "git";
-      url = "https://github.com/joho/godotenv";
-      rev = "v1.3.0";
-      sha256 = "0ri8if0pc3x6jg4c3i8wr58xyfpxkwmcjk3rp8gb398a1aa3gpjm";
-    };
-  }
-  {
-    goPackagePath = "github.com/json-iterator/go";
-    fetch = {
-      type = "git";
-      url = "https://github.com/json-iterator/go";
-      rev = "v1.1.7";
-      sha256 = "0n79p4s67zl5zprxv7diayw3vavnmmfqkmd6snz0i9bxp825dsyz";
-    };
-  }
-  {
-    goPackagePath = "github.com/julienschmidt/httprouter";
-    fetch = {
-      type = "git";
-      url = "https://github.com/julienschmidt/httprouter";
-      rev = "v1.2.0";
-      sha256 = "1k8bylc9s4vpvf5xhqh9h246dl1snxrzzz0614zz88cdh8yzs666";
-    };
-  }
-  {
-    goPackagePath = "github.com/konsorten/go-windows-terminal-sequences";
-    fetch = {
-      type = "git";
-      url = "https://github.com/konsorten/go-windows-terminal-sequences";
-      rev = "v1.0.2";
-      sha256 = "09mn209ika7ciy87xf2x31dq5fnqw39jidgaljvmqxwk7ff1hnx7";
-    };
-  }
-  {
-    goPackagePath = "github.com/kr/logfmt";
-    fetch = {
-      type = "git";
-      url = "https://github.com/kr/logfmt";
-      rev = "b84e30acd515";
-      sha256 = "02ldzxgznrfdzvghfraslhgp19la1fczcbzh7wm2zdc6lmpd1qq9";
-    };
-  }
-  {
-    goPackagePath = "github.com/kr/pretty";
-    fetch = {
-      type = "git";
-      url = "https://github.com/kr/pretty";
-      rev = "v0.1.0";
-      sha256 = "18m4pwg2abd0j9cn5v3k2ksk9ig4vlwxmlw9rrglanziv9l967qp";
-    };
-  }
-  {
-    goPackagePath = "github.com/kr/pty";
-    fetch = {
-      type = "git";
-      url = "https://github.com/kr/pty";
-      rev = "v1.1.8";
-      sha256 = "1vcl6f90n0f8s8b4fyh0832ilybjqcypqyj233lqj1hx62fvgdbk";
-    };
-  }
-  {
-    goPackagePath = "github.com/kr/text";
-    fetch = {
-      type = "git";
-      url = "https://github.com/kr/text";
-      rev = "v0.1.0";
-      sha256 = "1gm5bsl01apvc84bw06hasawyqm4q84vx1pm32wr9jnd7a8vjgj1";
-    };
-  }
-  {
-    goPackagePath = "github.com/kylelemons/godebug";
-    fetch = {
-      type = "git";
-      url = "https://github.com/kylelemons/godebug";
-      rev = "v1.1.0";
-      sha256 = "0dkk3friykg8p6wgqryx6745ahhb9z1j740k7px9dac6v5xjp78c";
-    };
-  }
-  {
-    goPackagePath = "github.com/mattn/go-colorable";
-    fetch = {
-      type = "git";
-      url = "https://github.com/mattn/go-colorable";
-      rev = "v0.0.9";
-      sha256 = "1nwjmsppsjicr7anq8na6md7b1z84l9ppnlr045hhxjvbkqwalvx";
-    };
-  }
-  {
-    goPackagePath = "github.com/mattn/go-isatty";
-    fetch = {
-      type = "git";
-      url = "https://github.com/mattn/go-isatty";
-      rev = "v0.0.9";
-      sha256 = "0i3km37lajahh1y2392g4hpgvq05arcgiiv93yhzxxyv0fpqj72m";
-    };
-  }
-  {
-    goPackagePath = "github.com/matttproud/golang_protobuf_extensions";
-    fetch = {
-      type = "git";
-      url = "https://github.com/matttproud/golang_protobuf_extensions";
-      rev = "v1.0.1";
-      sha256 = "1d0c1isd2lk9pnfq2nk0aih356j30k3h1gi2w0ixsivi5csl7jya";
-    };
-  }
-  {
-    goPackagePath = "github.com/miekg/dns";
-    fetch = {
-      type = "git";
-      url = "https://github.com/miekg/dns";
-      rev = "v1.0.15";
-      sha256 = "051f51fyrsnj69j9ni9j72acqnrvvzqda4l831ijffy5h5jdl8f2";
-    };
-  }
-  {
-    goPackagePath = "github.com/mitchellh/cli";
-    fetch = {
-      type = "git";
-      url = "https://github.com/mitchellh/cli";
-      rev = "v1.0.0";
-      sha256 = "1i9kmr7rcf10d2hji8h4247hmc0nbairv7a0q51393aw2h1bnwg2";
-    };
-  }
-  {
-    goPackagePath = "github.com/mitchellh/go-homedir";
-    fetch = {
-      type = "git";
-      url = "https://github.com/mitchellh/go-homedir";
-      rev = "v1.1.0";
-      sha256 = "0ydzkipf28hwj2bfxqmwlww47khyk6d152xax4bnyh60f4lq3nx1";
-    };
-  }
-  {
-    goPackagePath = "github.com/mitchellh/go-testing-interface";
-    fetch = {
-      type = "git";
-      url = "https://github.com/mitchellh/go-testing-interface";
-      rev = "v1.0.0";
-      sha256 = "1dl2js8di858bawg7dadlf1qjpkl2g3apziihjyf5imri3znyfpw";
-    };
-  }
-  {
-    goPackagePath = "github.com/mitchellh/go-wordwrap";
-    fetch = {
-      type = "git";
-      url = "https://github.com/mitchellh/go-wordwrap";
-      rev = "v1.0.0";
-      sha256 = "1jffbwcr3nnq6c12c5856bwzv2nxjzqk3jwgvxkwi1xhpd2by0bf";
-    };
-  }
-  {
-    goPackagePath = "github.com/mitchellh/hashstructure";
-    fetch = {
-      type = "git";
-      url = "https://github.com/mitchellh/hashstructure";
-      rev = "2bca23e0e452";
-      sha256 = "0vpacsls26474wya360fjhzi6l4y8s8s251c4szvqxh17n5f5gk1";
-    };
-  }
-  {
-    goPackagePath = "github.com/mitchellh/mapstructure";
-    fetch = {
-      type = "git";
-      url = "https://github.com/mitchellh/mapstructure";
-      rev = "d0303fe80992";
-      sha256 = "1fjwi5ghc1ibyx93apz31n4hj6gcq1hzismpdfbg2qxwshyg0ya8";
-    };
-  }
-  {
-    goPackagePath = "github.com/modern-go/concurrent";
-    fetch = {
-      type = "git";
-      url = "https://github.com/modern-go/concurrent";
-      rev = "bacd9c7ef1dd";
-      sha256 = "0s0fxccsyb8icjmiym5k7prcqx36hvgdwl588y0491gi18k5i4zs";
-    };
-  }
-  {
-    goPackagePath = "github.com/modern-go/reflect2";
-    fetch = {
-      type = "git";
-      url = "https://github.com/modern-go/reflect2";
-      rev = "v1.0.1";
-      sha256 = "06a3sablw53n1dqqbr2f53jyksbxdmmk8axaas4yvnhyfi55k4lf";
-    };
-  }
-  {
-    goPackagePath = "github.com/mwitkow/go-conntrack";
-    fetch = {
-      type = "git";
-      url = "https://github.com/mwitkow/go-conntrack";
-      rev = "cc309e4a2223";
-      sha256 = "0nbrnpk7bkmqg9mzwsxlm0y8m7s9qd9phr1q30qlx2qmdmz7c1mf";
-    };
-  }
-  {
-    goPackagePath = "github.com/oklog/run";
-    fetch = {
-      type = "git";
-      url = "https://github.com/oklog/run";
-      rev = "v1.0.0";
-      sha256 = "1pbjza4claaj95fpqvvfrysvs10y7dm0pl6qr5lzh6qy1vnhmcgw";
-    };
-  }
-  {
-    goPackagePath = "github.com/onsi/ginkgo";
-    fetch = {
-      type = "git";
-      url = "https://github.com/onsi/ginkgo";
-      rev = "v1.6.0";
-      sha256 = "0x0gc89vgq38xhgmi2h22bhr73cf2gmk42g89nz89k8dgg9hhr25";
-    };
-  }
-  {
-    goPackagePath = "github.com/onsi/gomega";
-    fetch = {
-      type = "git";
-      url = "https://github.com/onsi/gomega";
-      rev = "v1.4.3";
-      sha256 = "1c8rqg5i2hz3snmq7s41yar1zjnzilb0fyiyhkg83v97afcfx79v";
-    };
-  }
-  {
-    goPackagePath = "github.com/pascaldekloe/goe";
-    fetch = {
-      type = "git";
-      url = "https://github.com/pascaldekloe/goe";
-      rev = "v0.1.0";
-      sha256 = "1dqd3mfb4z2vmv6pg6fhgvfc53vhndk24wcl9lj1rz02n6m279fq";
-    };
-  }
-  {
-    goPackagePath = "github.com/pkg/errors";
-    fetch = {
-      type = "git";
-      url = "https://github.com/pkg/errors";
-      rev = "v0.8.1";
-      sha256 = "0g5qcb4d4fd96midz0zdk8b9kz8xkzwfa8kr1cliqbg8sxsy5vd1";
-    };
-  }
-  {
-    goPackagePath = "github.com/pmezard/go-difflib";
-    fetch = {
-      type = "git";
-      url = "https://github.com/pmezard/go-difflib";
-      rev = "v1.0.0";
-      sha256 = "0c1cn55m4rypmscgf0rrb88pn58j3ysvc2d0432dp3c6fqg6cnzw";
-    };
-  }
-  {
-    goPackagePath = "github.com/posener/complete";
-    fetch = {
-      type = "git";
-      url = "https://github.com/posener/complete";
-      rev = "v1.1.2";
-      sha256 = "02xrnfkk9r2jarna8jqfkksrn469jdap716037zq84waq3d5xk3l";
-    };
-  }
-  {
-    goPackagePath = "github.com/prometheus/alertmanager";
-    fetch = {
-      type = "git";
-      url = "https://github.com/prometheus/alertmanager";
-      rev = "v0.9.1";
-      sha256 = "1lkfj63pp4jf58xmn015r7s42p1wyj6fryihpmdn0k76b0ccwqzj";
-    };
-  }
-  {
-    goPackagePath = "github.com/prometheus/client_golang";
-    fetch = {
-      type = "git";
-      url = "https://github.com/prometheus/client_golang";
-      rev = "v0.9.4";
-      sha256 = "0s134fj4i7k6pxdmxwkdi7amb1882yq33spv15hg3pkpbd3h311p";
-    };
-  }
-  {
-    goPackagePath = "github.com/prometheus/client_model";
-    fetch = {
-      type = "git";
-      url = "https://github.com/prometheus/client_model";
-      rev = "fd36f4220a90";
-      sha256 = "1bs5d72k361llflgl94c22n0w53j30rsfh84smgk8mbjbcmjsaa5";
-    };
-  }
-  {
-    goPackagePath = "github.com/prometheus/common";
-    fetch = {
-      type = "git";
-      url = "https://github.com/prometheus/common";
-      rev = "v0.4.1";
-      sha256 = "0sf4sjdckblz1hqdfvripk3zyp8xq89w7q75kbsyg4c078af896s";
-    };
-  }
-  {
-    goPackagePath = "github.com/prometheus/procfs";
-    fetch = {
-      type = "git";
-      url = "https://github.com/prometheus/procfs";
-      rev = "v0.0.3";
-      sha256 = "18c4m795fwng8f8qa395f3crvamlbk5y5afk8b5rzyisnmjq774y";
-    };
-  }
-  {
-    goPackagePath = "github.com/ryanuber/columnize";
-    fetch = {
-      type = "git";
-      url = "https://github.com/ryanuber/columnize";
-      rev = "v2.1.0";
-      sha256 = "0m9jhagb1k44zfcdai76xdf9vpi3bqdl7p078ffyibmz0z9jfap6";
-    };
-  }
-  {
-    goPackagePath = "github.com/satori/go.uuid";
-    fetch = {
-      type = "git";
-      url = "https://github.com/satori/go.uuid";
-      rev = "v1.1.0";
-      sha256 = "1nbydsmjr60904kz5d46nib0zid5kcv4gk9wayi44gn5wlzz80zp";
-    };
-  }
-  {
-    goPackagePath = "github.com/sean-/seed";
-    fetch = {
-      type = "git";
-      url = "https://github.com/sean-/seed";
-      rev = "e2103e2c3529";
-      sha256 = "0glir8jxi1w7aga2jwdb63pp1h8q4whknili7xixsqzwyy716125";
-    };
-  }
-  {
-    goPackagePath = "github.com/sirupsen/logrus";
-    fetch = {
-      type = "git";
-      url = "https://github.com/sirupsen/logrus";
-      rev = "v1.2.0";
-      sha256 = "0r6334x2bls8ddznvzaldx4g88msjjns4mlks95rqrrg7h0ijigg";
-    };
-  }
-  {
-    goPackagePath = "github.com/spaolacci/murmur3";
-    fetch = {
-      type = "git";
-      url = "https://github.com/spaolacci/murmur3";
-      rev = "v1.1.0";
-      sha256 = "1lv3zyz3jy2d76bhvvs8svygx66606iygdvwy5cwc0p5z8yghq25";
-    };
-  }
-  {
-    goPackagePath = "github.com/stretchr/objx";
-    fetch = {
-      type = "git";
-      url = "https://github.com/stretchr/objx";
-      rev = "v0.1.1";
-      sha256 = "0iph0qmpyqg4kwv8jsx6a56a7hhqq8swrazv40ycxk9rzr0s8yls";
-    };
-  }
-  {
-    goPackagePath = "github.com/stretchr/testify";
-    fetch = {
-      type = "git";
-      url = "https://github.com/stretchr/testify";
-      rev = "v1.3.0";
-      sha256 = "0wjchp2c8xbgcbbq32w3kvblk6q6yn533g78nxl6iskq6y95lxsy";
-    };
-  }
-  {
-    goPackagePath = "github.com/tucnak/telebot";
-    fetch = {
-      type = "git";
-      url = "https://github.com/tucnak/telebot";
-      rev = "00cebf376d79";
-      sha256 = "0yay3h7gp6yag8jbapbq10vhmszad7svn68nnq5yp6pl1hmykzd6";
-    };
-  }
-  {
-    goPackagePath = "github.com/weaveworks/mesh";
-    fetch = {
-      type = "git";
-      url = "https://github.com/weaveworks/mesh";
-      rev = "f74318fb713b";
-      sha256 = "093j5i7wrkq1g92xaprd0rlfv9i74381wns4941bhbp6x6ahdcz7";
-    };
-  }
-  {
-    goPackagePath = "golang.org/x/crypto";
-    fetch = {
-      type = "git";
-      url = "https://go.googlesource.com/crypto";
-      rev = "45a5f77698d3";
-      sha256 = "0636jjj89wkzqchajwwzgcn4aafc334p70nawh9jzavg2mkx0ch4";
-    };
-  }
-  {
-    goPackagePath = "golang.org/x/net";
-    fetch = {
-      type = "git";
-      url = "https://go.googlesource.com/net";
-      rev = "891ebc4b82d6";
-      sha256 = "1rgw5gl2lc6bkmsx0fak84s6zdc1bhzfxgqg4mg4yh5hlnhpwrki";
-    };
-  }
-  {
-    goPackagePath = "golang.org/x/sync";
-    fetch = {
-      type = "git";
-      url = "https://go.googlesource.com/sync";
-      rev = "37e7f081c4d4";
-      sha256 = "1bb0mw6ckb1k7z8v3iil2qlqwfj408fvvp8m1cik2b46p7snyjhm";
-    };
-  }
-  {
-    goPackagePath = "golang.org/x/sys";
-    fetch = {
-      type = "git";
-      url = "https://go.googlesource.com/sys";
-      rev = "fde4db37ae7a";
-      sha256 = "16k4w4pzziq1kln18k5fg01qgk4hpzb5xsm7175kaky6d6gwyhg3";
-    };
-  }
-  {
-    goPackagePath = "golang.org/x/text";
-    fetch = {
-      type = "git";
-      url = "https://go.googlesource.com/text";
-      rev = "v0.3.2";
-      sha256 = "0flv9idw0jm5nm8lx25xqanbkqgfiym6619w575p7nrdh0riqwqh";
-    };
-  }
-  {
-    goPackagePath = "golang.org/x/tools";
-    fetch = {
-      type = "git";
-      url = "https://go.googlesource.com/tools";
-      rev = "90fa682c2a6e";
-      sha256 = "03ic2xsy51jw9749wl7gszdbz99iijbd2bckgygl6cm9w5m364ak";
-    };
-  }
-  {
-    goPackagePath = "google.golang.org/appengine";
-    fetch = {
-      type = "git";
-      url = "https://github.com/golang/appengine";
-      rev = "v1.1.0";
-      sha256 = "1pz202zszg8f35dk5pfhwgcdi3r6dx1l4yk6x6ly7nb4j45zi96x";
-    };
-  }
-  {
-    goPackagePath = "gopkg.in/airbrake/gobrake.v2";
-    fetch = {
-      type = "git";
-      url = "https://gopkg.in/airbrake/gobrake.v2";
-      rev = "v2.0.9";
-      sha256 = "1x06f7n7qlyzqgyz0sdfcidf3w4ldn6zs6qx2mhibggk2z4whcjw";
-    };
-  }
-  {
-    goPackagePath = "gopkg.in/alecthomas/kingpin.v2";
-    fetch = {
-      type = "git";
-      url = "https://gopkg.in/alecthomas/kingpin.v2";
-      rev = "v2.2.6";
-      sha256 = "0mndnv3hdngr3bxp7yxfd47cas4prv98sqw534mx7vp38gd88n5r";
-    };
-  }
-  {
-    goPackagePath = "gopkg.in/check.v1";
-    fetch = {
-      type = "git";
-      url = "https://gopkg.in/check.v1";
-      rev = "788fd7840127";
-      sha256 = "0v3bim0j375z81zrpr5qv42knqs0y2qv2vkjiqi5axvb78slki1a";
-    };
-  }
-  {
-    goPackagePath = "gopkg.in/fsnotify.v1";
-    fetch = {
-      type = "git";
-      url = "https://gopkg.in/fsnotify.v1";
-      rev = "v1.4.7";
-      sha256 = "07va9crci0ijlivbb7q57d2rz9h27zgn2fsm60spjsqpdbvyrx4g";
-    };
-  }
-  {
-    goPackagePath = "gopkg.in/gemnasium/logrus-airbrake-hook.v2";
-    fetch = {
-      type = "git";
-      url = "https://gopkg.in/gemnasium/logrus-airbrake-hook.v2";
-      rev = "v2.1.2";
-      sha256 = "0sbg0dn6cysmf8f2bi209jwl4jnpiwp4rdghnxlzirw3c32ms5y5";
-    };
-  }
-  {
-    goPackagePath = "gopkg.in/tomb.v1";
-    fetch = {
-      type = "git";
-      url = "https://gopkg.in/tomb.v1";
-      rev = "dd632973f1e7";
-      sha256 = "1lqmq1ag7s4b3gc3ddvr792c5xb5k6sfn0cchr3i2s7f1c231zjv";
-    };
-  }
-  {
-    goPackagePath = "gopkg.in/vmihailenco/msgpack.v2";
-    fetch = {
-      type = "git";
-      url = "https://gopkg.in/vmihailenco/msgpack.v2";
-      rev = "v2.9.1";
-      sha256 = "0ah9j7i97ifyqhiscq8d43gcrhksb3bx83s2p1nyfi1bxw78jwfi";
-    };
-  }
-  {
-    goPackagePath = "gopkg.in/yaml.v2";
-    fetch = {
-      type = "git";
-      url = "https://gopkg.in/yaml.v2";
-      rev = "v2.2.2";
-      sha256 = "01wj12jzsdqlnidpyjssmj0r4yavlqy7dwrg7adqd8dicjc4ncsa";
-    };
-  }
-]
diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix
index 0eb799e4525..28d22a4bb47 100644
--- a/pkgs/stdenv/generic/make-derivation.nix
+++ b/pkgs/stdenv/generic/make-derivation.nix
@@ -278,8 +278,8 @@ in rec {
           enableParallelChecking = attrs.enableParallelChecking or true;
         } // lib.optionalAttrs (hardeningDisable != [] || hardeningEnable != []) {
           NIX_HARDENING_ENABLE = enabledHardeningOptions;
-        } // lib.optionalAttrs (stdenv.hostPlatform.isx86_64 && stdenv.hostPlatform ? platform.gcc.arch) {
-          requiredSystemFeatures = attrs.requiredSystemFeatures or [] ++ [ "gccarch-${stdenv.hostPlatform.platform.gcc.arch}" ];
+        } // lib.optionalAttrs (stdenv.hostPlatform.isx86_64 && stdenv.hostPlatform ? gcc.arch) {
+          requiredSystemFeatures = attrs.requiredSystemFeatures or [] ++ [ "gccarch-${stdenv.hostPlatform.gcc.arch}" ];
         } // lib.optionalAttrs (stdenv.buildPlatform.isDarwin) {
           inherit __darwinAllowLocalNetworking;
           # TODO: remove lib.unique once nix has a list canonicalization primitive
diff --git a/pkgs/tools/audio/abcmidi/default.nix b/pkgs/tools/audio/abcmidi/default.nix
index b3d250dfc78..cb856ab72d0 100644
--- a/pkgs/tools/audio/abcmidi/default.nix
+++ b/pkgs/tools/audio/abcmidi/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "abcMIDI";
-  version = "2020.12.10";
+  version = "2021.01.21";
 
   src = fetchzip {
     url = "https://ifdo.ca/~seymour/runabc/${pname}-${version}.zip";
-    sha256 = "0r9jwjwmdyyfq882mq7gkc2hjrv4ljnidxzlyycjipzndb1gv1ls";
+    sha256 = "184d59pc60dax60j3nzcsr5kflaygbjpbrwg6r4bky0q0sg17z5i";
   };
 
   # There is also a file called "makefile" which seems to be preferred by the standard build phase
diff --git a/pkgs/tools/backup/stenc/default.nix b/pkgs/tools/backup/stenc/default.nix
index e2f0cc7fe1f..b2a53f8ad07 100644
--- a/pkgs/tools/backup/stenc/default.nix
+++ b/pkgs/tools/backup/stenc/default.nix
@@ -1,14 +1,27 @@
-{ lib, stdenv, fetchFromGitHub }:
+{ lib
+, stdenv
+, fetchFromGitHub
+, genericUpdater
+, common-updater-scripts
+, autoreconfHook
+}:
 
 stdenv.mkDerivation rec {
-  version = "1.0.7";
   pname = "stenc";
+  version = "1.0.8";
 
   src = fetchFromGitHub {
     owner = "scsitape";
     repo = "stenc";
     rev = version;
-    sha256 = "1778m1zcyzyf42k5m496yqh0gv6kqhb0sq5983dhky1fccjl905k";
+    sha256 = "0dsmvr1xpwkcd9yawv4c4vna67yag7jb8jcgn2amywz7nkpzmyxd";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  passthru.updateScript = genericUpdater {
+    inherit pname version;
+    versionLister = "${common-updater-scripts}/bin/list-git-tags ${src.meta.homepage}";
   };
 
   meta = {
diff --git a/pkgs/tools/misc/esphome/default.nix b/pkgs/tools/misc/esphome/default.nix
index 74eccc029ac..de06a60fbf2 100644
--- a/pkgs/tools/misc/esphome/default.nix
+++ b/pkgs/tools/misc/esphome/default.nix
@@ -11,11 +11,11 @@ let
 
 in python.pkgs.buildPythonApplication rec {
   pname = "esphome";
-  version = "1.15.2";
+  version = "1.15.3";
 
   src = python.pkgs.fetchPypi {
     inherit pname version;
-    sha256 = "1wnmgn0q4n2vp2cdwsc36acsy7c7w5vyxdglii3432mr5drrgcsx";
+    sha256 = "a75b53e76fb8b4b394eca18fe74f622ca740bc13b7cbc02e6af5f50126b7aa0b";
   };
 
   ESPHOME_USE_SUBPROCESS = "";
diff --git a/pkgs/tools/misc/hdf5/default.nix b/pkgs/tools/misc/hdf5/default.nix
index 0a5032074c1..fc7bb635040 100644
--- a/pkgs/tools/misc/hdf5/default.nix
+++ b/pkgs/tools/misc/hdf5/default.nix
@@ -5,13 +5,14 @@
 , gfortran ? null
 , zlib ? null
 , szip ? null
-, mpi ? null
+, mpiSupport ? false
+, mpi
 , enableShared ? !stdenv.hostPlatform.isStatic
 }:
 
 # cpp and mpi options are mutually exclusive
 # (--enable-unsupported could be used to force the build)
-assert !cpp || mpi == null;
+assert !cpp || !mpiSupport;
 
 let inherit (lib) optional optionals; in
 
@@ -24,7 +25,7 @@ stdenv.mkDerivation rec {
   };
 
   passthru = {
-    mpiSupport = (mpi != null);
+    inherit mpiSupport;
     inherit mpi;
   };
 
@@ -38,13 +39,13 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = []
     ++ optional (zlib != null) zlib
-    ++ optional (mpi != null) mpi;
+    ++ optional mpiSupport mpi;
 
   configureFlags = []
     ++ optional cpp "--enable-cxx"
     ++ optional (gfortran != null) "--enable-fortran"
     ++ optional (szip != null) "--with-szlib=${szip}"
-    ++ optionals (mpi != null) ["--enable-parallel" "CC=${mpi}/bin/mpicc"]
+    ++ optionals mpiSupport ["--enable-parallel" "CC=${mpi}/bin/mpicc"]
     ++ optional enableShared "--enable-shared";
 
   patches = [
diff --git a/pkgs/tools/misc/hpcg/default.nix b/pkgs/tools/misc/hpcg/default.nix
index 29799641880..d6896527ad2 100644
--- a/pkgs/tools/misc/hpcg/default.nix
+++ b/pkgs/tools/misc/hpcg/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, openmpi } :
+{ lib, stdenv, fetchurl, mpi } :
 
 stdenv.mkDerivation rec {
   pname = "hpcg";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  buildInputs = [ openmpi ];
+  buildInputs = [ mpi ];
 
   makeFlags = [ "arch=Linux_MPI" ];
 
diff --git a/pkgs/tools/security/eschalot/default.nix b/pkgs/tools/security/eschalot/default.nix
index 04675061615..0c984c5d35e 100644
--- a/pkgs/tools/security/eschalot/default.nix
+++ b/pkgs/tools/security/eschalot/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "eschalot";
-  version = "2018-01-19";
+  version = "1.2.0.20191006";
 
   src = fetchFromGitHub {
     owner = "ReclaimYourPrivacy";
     repo = pname;
-    rev = "56a967b62631cfd3c7ef68541263dbd54cbbc2c4";
-    sha256 = "1iw1jrydasm9dmgpcdimd8dy9n281ys9krvf3fd3dlymkgsj604d";
+    rev = "a45bad5b9a3e4939340ddd8a751ceffa3c0db76a";
+    sha256 = "1wbi0azc2b57nmmx6c1wmvng70d9ph1s83yhnl5lxaaqaj85h22g";
   };
 
   buildInputs = [ openssl ];
diff --git a/pkgs/tools/system/ior/default.nix b/pkgs/tools/system/ior/default.nix
index 326602e3d4d..c2616797da3 100644
--- a/pkgs/tools/system/ior/default.nix
+++ b/pkgs/tools/system/ior/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, openmpi, perl, autoreconfHook }:
+{ lib, stdenv, fetchFromGitHub, mpi, perl, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "ior";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ autoreconfHook ];
-  buildInputs = [ openmpi perl ];
+  buildInputs = [ mpi perl ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 02ef97ba850..31b3acc23ae 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -4976,12 +4976,11 @@ in
   hdf5 = callPackage ../tools/misc/hdf5 {
     gfortran = null;
     szip = null;
-    mpi = null;
   };
 
   hdf5-mpi = appendToName "mpi" (hdf5.override {
     szip = null;
-    mpi = pkgs.openmpi;
+    mpiSupport = true;
   });
 
   hdf5-cpp = appendToName "cpp" (hdf5.override {
@@ -7185,6 +7184,10 @@ in
 
   pympress = callPackage ../applications/office/pympress { };
 
+  pyspread = python3Packages.callPackage ../applications/office/pyspread {
+    inherit (qt5) qtsvg wrapQtAppsHook;
+  };
+
   pythonIRClib = pythonPackages.pythonIRClib;
 
   pyditz = callPackage ../applications/misc/pyditz {
@@ -7217,6 +7220,8 @@ in
 
   openmpi = callPackage ../development/libraries/openmpi { };
 
+  mpi = openmpi; # this attribute should used to build MPI applications
+
   ucx = callPackage ../development/libraries/ucx {};
 
   openmodelica = callPackage ../applications/science/misc/openmodelica {
@@ -9524,7 +9529,9 @@ in
 
   elm2nix = haskell.lib.justStaticExecutables haskellPackages.elm2nix;
 
-  elmPackages = recurseIntoAttrs (callPackage ../development/compilers/elm { });
+  elmPackages = recurseIntoAttrs (callPackage ../development/compilers/elm {
+    inherit (darwin.apple_sdk.frameworks) Security;
+  });
 
   apache-flex-sdk = callPackage ../development/compilers/apache-flex-sdk { };
 
@@ -16149,7 +16156,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;
@@ -16164,7 +16171,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;
@@ -16179,7 +16186,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;
@@ -19295,7 +19302,7 @@ in
     buildPhase = ''
       set -x
       make \
-        ARCH=${stdenv.hostPlatform.kernelArch} \
+        ARCH=${stdenv.hostPlatform.linuxArch} \
         HOSTCC=${buildPackages.stdenv.cc.targetPrefix}gcc \
         ${makeTarget}
     '';
@@ -22096,9 +22103,7 @@ in
 
   fractal = callPackage ../applications/networking/instant-messengers/fractal { };
 
-  freecad = libsForQt5.callPackage ../applications/graphics/freecad {
-    mpi = openmpi;
-  };
+  freecad = libsForQt5.callPackage ../applications/graphics/freecad { };
 
   freemind = callPackage ../applications/misc/freemind {
     jdk = jdk8; # TODO: remove override https://github.com/NixOS/nixpkgs/pull/89731
@@ -22484,7 +22489,7 @@ in
 
   hpcg = callPackage ../tools/misc/hpcg/default.nix { };
 
-  hpl = callPackage ../tools/misc/hpl { mpi = openmpi; };
+  hpl = callPackage ../tools/misc/hpl { };
 
   hpmyroom = libsForQt5.callPackage ../applications/networking/hpmyroom { };
 
@@ -27258,15 +27263,11 @@ in
 
   quantum-espresso = callPackage ../applications/science/chemistry/quantum-espresso { };
 
-  quantum-espresso-mpi = callPackage ../applications/science/chemistry/quantum-espresso {
-     mpi = openmpi;
-  };
+  quantum-espresso-mpi = callPackage ../applications/science/chemistry/quantum-espresso { useMpi = true; };
 
   siesta = callPackage ../applications/science/chemistry/siesta { };
 
-  siesta-mpi = callPackage ../applications/science/chemistry/siesta {
-     mpi = openmpi;
-  };
+  siesta-mpi = callPackage ../applications/science/chemistry/siesta { useMpi = true; };
 
   ### SCIENCE/GEOMETRY
 
@@ -27397,7 +27398,7 @@ in
   };
 
   neuron-mpi = appendToName "mpi" (neuron.override {
-    mpi = pkgs.openmpi;
+    useMpi = true;
   });
 
   neuron-full = neuron-mpi.override { inherit python; };
@@ -27449,7 +27450,7 @@ in
   raxml = callPackage ../applications/science/biology/raxml { };
 
   raxml-mpi = appendToName "mpi" (raxml.override {
-    mpi = true;
+    useMpi = true;
   });
 
   sambamba = callPackage ../applications/science/biology/sambamba { };
@@ -27571,9 +27572,7 @@ in
 
   planarity = callPackage ../development/libraries/science/math/planarity { };
 
-  scalapack = callPackage ../development/libraries/science/math/scalapack {
-    mpi = openmpi;
-  };
+  scalapack = callPackage ../development/libraries/science/math/scalapack { };
 
   rankwidth = callPackage ../development/libraries/science/math/rankwidth { };
 
@@ -27603,9 +27602,7 @@ in
 
   petsc = callPackage ../development/libraries/science/math/petsc { };
 
-  parmetis = callPackage ../development/libraries/science/math/parmetis {
-    mpi = openmpi;
-  };
+  parmetis = callPackage ../development/libraries/science/math/parmetis { };
 
   QuadProgpp = callPackage ../development/libraries/science/math/QuadProgpp { };
 
@@ -27635,17 +27632,13 @@ in
 
   ### SCIENCE/MOLECULAR-DYNAMICS
 
-  dl-poly-classic-mpi = callPackage ../applications/science/molecular-dynamics/dl-poly-classic {
-    mpi = openmpi;
-  };
+  dl-poly-classic-mpi = callPackage ../applications/science/molecular-dynamics/dl-poly-classic { };
 
   lammps = callPackage ../applications/science/molecular-dynamics/lammps {
     fftw = fftw;
   };
 
-  lammps-mpi = lowPrio (lammps.override {
-    mpi = openmpi;
-  });
+  lammps-mpi = lowPrio (lammps.override { withMPI = true; });
 
   gromacs = callPackage ../applications/science/molecular-dynamics/gromacs {
     singlePrec = true;
diff --git a/pkgs/top-level/default.nix b/pkgs/top-level/default.nix
index dfa68ba31b8..10cf36d4d13 100644
--- a/pkgs/top-level/default.nix
+++ b/pkgs/top-level/default.nix
@@ -1,9 +1,8 @@
 /* This function composes the Nix Packages collection. It:
 
-     1. Applies the final stage to the given `config` if it is a function
+     1. Elaborates `localSystem` and `crossSystem` with defaults as needed.
 
-     2. Infers an appropriate `platform` based on the `system` if none is
-        provided
+     2. Applies the final stage to the given `config` if it is a function
 
      3. Defaults to no non-standard config and no cross-compilation target
 
@@ -50,6 +49,14 @@ let # Rename the function arguments
 in let
   lib = import ../../lib;
 
+  localSystem = lib.systems.elaborate args.localSystem;
+
+  # Condition preserves sharing which in turn affects equality.
+  crossSystem =
+    if crossSystem0 == null || crossSystem0 == args.localSystem
+    then localSystem
+    else lib.systems.elaborate crossSystem0;
+
   # Allow both:
   # { /* the config */ } and
   # { pkgs, ... } : { /* the config */ }
@@ -58,17 +65,6 @@ in let
     then config0 { inherit pkgs; }
     else config0;
 
-  # From a minimum of `system` or `config` (actually a target triple, *not*
-  # nixpkgs configuration), infer the other one and platform as needed.
-  localSystem = lib.systems.elaborate (if builtins.isAttrs args.localSystem then (
-    # Allow setting the platform in the config file. This take precedence over
-    # the inferred platform, but not over an explicitly passed-in one.
-    builtins.intersectAttrs { platform = null; } config1
-    // args.localSystem) else args.localSystem);
-
-  crossSystem = if crossSystem0 == null then localSystem
-                else lib.systems.elaborate crossSystem0;
-
   configEval = lib.evalModules {
     modules = [
       ./config.nix
diff --git a/pkgs/top-level/impure.nix b/pkgs/top-level/impure.nix
index 3ba6c08a140..6f7383c8e7a 100644
--- a/pkgs/top-level/impure.nix
+++ b/pkgs/top-level/impure.nix
@@ -12,17 +12,15 @@ let
 
 in
 
-{ # We combine legacy `system` and `platform` into `localSystem`, if
-  # `localSystem` was not passed. Strictly speaking, this is pure desugar, but
-  # it is most convient to do so before the impure `localSystem.system` default,
-  # so we do it now.
-  localSystem ? builtins.intersectAttrs { system = null; platform = null; } args
+{ # We put legacy `system` into `localSystem`, if `localSystem` was not passed.
+  # If neither is passed, assume we are building packages on the current
+  # (build, in GNU Autotools parlance) platform.
+  localSystem ? { system = args.system or builtins.currentSystem; }
 
-, # These are needed only because nix's `--arg` command-line logic doesn't work
-  # with unnamed parameters allowed by ...
-  system ? localSystem.system
-, platform ? localSystem.platform
-, crossSystem ? null
+# These are needed only because nix's `--arg` command-line logic doesn't work
+# with unnamed parameters allowed by ...
+, system ? localSystem.system
+, crossSystem ? localSystem
 
 , # Fallback: The contents of the configuration file found at $NIXPKGS_CONFIG or
   # $HOME/.config/nixpkgs/config.nix.
@@ -77,15 +75,11 @@ in
 , ...
 } @ args:
 
-# If `localSystem` was explicitly passed, legacy `system` and `platform` should
-# not be passed.
-assert args ? localSystem -> !(args ? system || args ? platform);
+# If `localSystem` was explicitly passed, legacy `system` should
+# not be passed, and vice-versa.
+assert args ? localSystem -> !(args ? system);
+assert args ? system -> !(args ? localSystem);
 
-import ./. (builtins.removeAttrs args [ "system" "platform" ] // {
-  inherit config overlays crossSystem crossOverlays;
-  # Fallback: Assume we are building packages on the current (build, in GNU
-  # Autotools parlance) system.
-  localSystem = if builtins.isString localSystem then localSystem
-                else (if args ? localSystem then {}
-                      else { system = builtins.currentSystem; }) // localSystem;
+import ./. (builtins.removeAttrs args [ "system" ] // {
+  inherit config overlays localSystem;
 })
diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix
index aded5f1c95e..186eb13a2b7 100644
--- a/pkgs/top-level/perl-packages.nix
+++ b/pkgs/top-level/perl-packages.nix
@@ -9641,6 +9641,21 @@ let
     buildInputs = [ TestNoWarnings ];
   };
 
+  HTTPAcceptLanguage = buildPerlModule {
+    pname = "HTTP-AcceptLanguage";
+    version = "0.02";
+    src = fetchurl {
+      url = "mirror://cpan/authors/id/Y/YA/YAPPO/HTTP-AcceptLanguage-0.02.tar.gz";
+      sha256 = "1bs29r72ibp0kmr3l1ypzszflpcw7z4yxxcgaijspsy99rb5yq1f";
+    };
+    buildInputs = [ ModuleBuildTiny ];
+    meta = {
+      homepage = "https://github.com/yappo/p5-HTTP-AcceptLanguage";
+      description = "Accept-Language header parser and find available language";
+      license = with lib.licenses; [ artistic1 gpl1Plus ];
+    };
+  };
+
   HTTPBody = buildPerlPackage {
     pname = "HTTP-Body";
     version = "1.22";
@@ -11137,10 +11152,10 @@ let
 
   LinkEmbedder = buildPerlPackage {
     pname = "LinkEmbedder";
-    version = "1.15";
+    version = "1.16";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/J/JH/JHTHORSEN/LinkEmbedder-1.15.tar.gz";
-      sha256 = "0ij2jvsiqnqz3qlzw8k3q37ys05wfh1ks2n692hs3bpg7ds3n8bc";
+      url = "mirror://cpan/authors/id/J/JH/JHTHORSEN/LinkEmbedder-1.16.tar.gz";
+      sha256 = "0pm5h5rlfparfvsi3ygj53mwjg8lwhql5mj0macfvsvfnfvnnp6j";
     };
     buildInputs = [ TestDeep ];
     propagatedBuildInputs = [ Mojolicious ];
@@ -13388,10 +13403,10 @@ let
 
   Mojolicious = buildPerlPackage {
     pname = "Mojolicious";
-    version = "8.67";
+    version = "8.71";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/S/SR/SRI/Mojolicious-8.67.tar.gz";
-      sha256 = "0b1ajsfvpzcmy7qp1rjr2n1z263yk5bkzmal0kx72ajg1l1dd85v";
+      url = "mirror://cpan/authors/id/S/SR/SRI/Mojolicious-8.71.tar.gz";
+      sha256 = "03bfxzq11v6k47axdwqhp2d3p1z17nwyxj0yww5z3x293p6zsnqm";
     };
     meta = {
       homepage = "https://mojolicious.org";
@@ -13498,10 +13513,10 @@ let
 
   MojoliciousPluginWebpack = buildPerlPackage {
     pname = "Mojolicious-Plugin-Webpack";
-    version = "0.13";
+    version = "0.14";
     src = fetchurl {
-      url = "mirror://cpan/authors/id/J/JH/JHTHORSEN/Mojolicious-Plugin-Webpack-0.13.tar.gz";
-      sha256 = "7848c0698e1b52909c71add638f7523f5affdfb8133b4ddb6f23a3bca485e761";
+      url = "mirror://cpan/authors/id/J/JH/JHTHORSEN/Mojolicious-Plugin-Webpack-0.14.tar.gz";
+      sha256 = "0b1a9rm5rlpqj6skgic4qzy4b1p35r2dhkh3rwaaypf9ha70i9gc";
     };
     propagatedBuildInputs = [ Mojolicious ];
     meta = {
@@ -14876,6 +14891,7 @@ let
     };
     propagatedBuildInputs = [ IOAsync Moo NetFrameLayerIPv6 namespaceclean ];
     buildInputs = [ TestFatal ];
+    preCheck = "rm t/icmp_ps.t t/icmpv6_ps.t"; # ping socket tests fail
     meta = {
       description = "asyncronously check remote host for reachability";
       license = with lib.licenses; [ artistic1 gpl1Plus ];
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 84c11b5cd0f..d37d837e4e1 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -206,6 +206,8 @@ in {
 
   aiodns = callPackage ../development/python-modules/aiodns { };
 
+  aioeafm = callPackage ../development/python-modules/aioeafm { };
+
   aioesphomeapi = callPackage ../development/python-modules/aioesphomeapi { };
 
   aioeventlet = callPackage ../development/python-modules/aioeventlet { };
@@ -318,6 +320,8 @@ in {
 
   ambiclimate = callPackage ../development/python-modules/ambiclimate { };
 
+  amcrest = callPackage ../development/python-modules/amcrest { };
+
   amply = callPackage ../development/python-modules/amply { };
 
   amqp = callPackage ../development/python-modules/amqp { };
@@ -2184,7 +2188,6 @@ in {
 
   fenics = callPackage ../development/libraries/science/math/fenics {
     inherit (pkgs) pkg-config;
-    mpi = pkgs.openmpi;
     pytest = self.pytest_4;
   };
 
@@ -3486,7 +3489,7 @@ in {
 
   labelbox = callPackage ../development/python-modules/labelbox { };
 
-  lammps-cython = callPackage ../development/python-modules/lammps-cython { mpi = pkgs.openmpi; };
+  lammps-cython = callPackage ../development/python-modules/lammps-cython { mpi = pkgs.mpi; };
 
   langcodes = callPackage ../development/python-modules/langcodes { };
 
@@ -4120,7 +4123,7 @@ in {
 
   mpd = callPackage ../development/python-modules/mpd { };
 
-  mpi4py = callPackage ../development/python-modules/mpi4py { mpi = pkgs.openmpi; };
+  mpi4py = callPackage ../development/python-modules/mpi4py { mpi = pkgs.mpi; };
 
   mplleaflet = callPackage ../development/python-modules/mplleaflet { };
 
@@ -5205,6 +5208,8 @@ in {
 
   pycdio = callPackage ../development/python-modules/pycdio { };
 
+  pycfdns = callPackage ../development/python-modules/pycfdns { };
+
   pychart = callPackage ../development/python-modules/pychart { };
 
   pychef = callPackage ../development/python-modules/pychef { };