about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/compilers
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/compilers')
-rw-r--r--nixpkgs/pkgs/development/compilers/4th/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/abcl/default.nix10
-rw-r--r--nixpkgs/pkgs/development/compilers/acme/default.nix10
-rw-r--r--nixpkgs/pkgs/development/compilers/adoptopenjdk-bin/jdk-darwin-base.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/adoptopenjdk-bin/jdk-linux-base.nix2
-rw-r--r--nixpkgs/pkgs/development/compilers/adoptopenjdk-icedtea-web/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/aldor/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/aliceml/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/apache-flex-sdk/default.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/arachne-pnr/default.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/asn1c/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/aspectj/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/ats/default.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/ats2/default.nix10
-rw-r--r--nixpkgs/pkgs/development/compilers/avian/default.nix10
-rw-r--r--nixpkgs/pkgs/development/compilers/avra/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/bigloo/default.nix20
-rw-r--r--nixpkgs/pkgs/development/compilers/binaryen/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/bluespec/default.nix10
-rw-r--r--nixpkgs/pkgs/development/compilers/bs-platform/build-bs-platform.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/bs-platform/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/bs-platform/ocaml.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/bupc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/cakelisp/default.nix42
-rw-r--r--nixpkgs/pkgs/development/compilers/carp/default.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/cc65/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/ccl/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/chez/default.nix12
-rw-r--r--nixpkgs/pkgs/development/compilers/chicken/4/chicken.nix9
-rw-r--r--nixpkgs/pkgs/development/compilers/chicken/4/egg2nix.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/chicken/4/eggDerivation.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/chicken/5/chicken.nix9
-rw-r--r--nixpkgs/pkgs/development/compilers/chicken/5/egg2nix.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/chicken/5/eggDerivation.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/ciao/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/clasp/default.nix14
-rw-r--r--nixpkgs/pkgs/development/compilers/clean/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/closure/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/cmdstan/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/cmucl/binary.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/colm/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/compcert/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/computecpp/default.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/copper/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/coreclr/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/crystal/build-package.nix14
-rw-r--r--nixpkgs/pkgs/development/compilers/crystal/default.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/cudatoolkit/common.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/dale/default.nix20
-rw-r--r--nixpkgs/pkgs/development/compilers/dasm/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/dev86/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/dmd/default.nix10
-rw-r--r--nixpkgs/pkgs/development/compilers/dotnet/build-dotnet.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/dtc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/ecl/16.1.2.nix12
-rw-r--r--nixpkgs/pkgs/development/compilers/ecl/default.nix12
-rw-r--r--nixpkgs/pkgs/development/compilers/eli/default.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/elm/default.nix97
-rw-r--r--nixpkgs/pkgs/development/compilers/elm/packages/elm-format.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/elm/packages/elm-instrument.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/elm/packages/elm-json.nix12
-rw-r--r--nixpkgs/pkgs/development/compilers/elm/packages/elm.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/elm/packages/elmi-to-json.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/elm/packages/indents.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/elm/packages/node-composition.nix2
-rw-r--r--nixpkgs/pkgs/development/compilers/elm/packages/node-packages.nix2
-rw-r--r--nixpkgs/pkgs/development/compilers/emscripten/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/eql/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/factor-lang/default.nix12
-rw-r--r--nixpkgs/pkgs/development/compilers/fasmg/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/flasm/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/flutter/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/flutter/flutter.nix65
-rw-r--r--nixpkgs/pkgs/development/compilers/flux/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/fpc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/fpc/lazarus.nix2
-rw-r--r--nixpkgs/pkgs/development/compilers/fsharp/default.nix10
-rw-r--r--nixpkgs/pkgs/development/compilers/fsharp41/default.nix10
-rw-r--r--nixpkgs/pkgs/development/compilers/fstar/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/gavrasm/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/gcc-arm-embedded/10/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/gcc-arm-embedded/6/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/gcc-arm-embedded/7/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/gcc-arm-embedded/8/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/gcc-arm-embedded/9/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/gcc/10/default.nix31
-rw-r--r--nixpkgs/pkgs/development/compilers/gcc/4.8/default.nix25
-rw-r--r--nixpkgs/pkgs/development/compilers/gcc/4.9/default.nix25
-rw-r--r--nixpkgs/pkgs/development/compilers/gcc/6/default.nix31
-rw-r--r--nixpkgs/pkgs/development/compilers/gcc/7/default.nix33
-rw-r--r--nixpkgs/pkgs/development/compilers/gcc/8/default.nix31
-rw-r--r--nixpkgs/pkgs/development/compilers/gcc/9/default.nix31
-rw-r--r--nixpkgs/pkgs/development/compilers/gcc/builder.sh5
-rw-r--r--nixpkgs/pkgs/development/compilers/gcc/common/configure-flags.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/gcc/common/extra-target-flags.nix2
-rw-r--r--nixpkgs/pkgs/development/compilers/gcc/common/platform-flags.nix2
-rw-r--r--nixpkgs/pkgs/development/compilers/gcl/2.6.13-pre.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/gcl/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/gforth/default.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/ghc/8.10.1.nix68
-rw-r--r--nixpkgs/pkgs/development/compilers/ghc/8.10.2-binary.nix46
-rw-r--r--nixpkgs/pkgs/development/compilers/ghc/8.10.2.nix66
-rw-r--r--nixpkgs/pkgs/development/compilers/ghc/8.10.3.nix66
-rw-r--r--nixpkgs/pkgs/development/compilers/ghc/8.2.2-binary.nix36
-rw-r--r--nixpkgs/pkgs/development/compilers/ghc/8.6.5-binary.nix38
-rw-r--r--nixpkgs/pkgs/development/compilers/ghc/8.6.5.nix64
-rw-r--r--nixpkgs/pkgs/development/compilers/ghc/8.8.2.nix66
-rw-r--r--nixpkgs/pkgs/development/compilers/ghc/8.8.3.nix68
-rw-r--r--nixpkgs/pkgs/development/compilers/ghc/8.8.4.nix70
-rw-r--r--nixpkgs/pkgs/development/compilers/ghc/9.0.1.nix66
-rw-r--r--nixpkgs/pkgs/development/compilers/ghc/head.nix76
-rw-r--r--nixpkgs/pkgs/development/compilers/ghcjs-ng/8.6/stage0.nix14
-rw-r--r--nixpkgs/pkgs/development/compilers/ghcjs-ng/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/ghcjs-ng/ghcjs-base.nix2
-rw-r--r--nixpkgs/pkgs/development/compilers/ghdl/default.nix16
-rw-r--r--nixpkgs/pkgs/development/compilers/gleam/default.nix12
-rw-r--r--nixpkgs/pkgs/development/compilers/glslang/default.nix22
-rw-r--r--nixpkgs/pkgs/development/compilers/gnatboot/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/gnu-cobol/default.nix11
-rw-r--r--nixpkgs/pkgs/development/compilers/gnu-smalltalk/default.nix14
-rw-r--r--nixpkgs/pkgs/development/compilers/go/1.14.nix17
-rw-r--r--nixpkgs/pkgs/development/compilers/go/1.15.nix17
-rw-r--r--nixpkgs/pkgs/development/compilers/go/1.4.nix9
-rw-r--r--nixpkgs/pkgs/development/compilers/go/2-dev.nix13
-rw-r--r--nixpkgs/pkgs/development/compilers/gprolog/default.nix10
-rw-r--r--nixpkgs/pkgs/development/compilers/graalvm/community-edition.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/graalvm/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/graalvm/enterprise-edition.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/gwt/2.4.0.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/haxe/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/hhvm/default.nix10
-rw-r--r--nixpkgs/pkgs/development/compilers/hop/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/iasl/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/idris2/default.nix12
-rw-r--r--nixpkgs/pkgs/development/compilers/inform6/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/inform7/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/intel-graphics-compiler/default.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/intercal/default.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/ios-cross-compile/9.2.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/ispc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/jasmin/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/javacard-devkit/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/jetbrains-jdk/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/julia/1.0.nix16
-rw-r--r--nixpkgs/pkgs/development/compilers/julia/1.3.nix14
-rw-r--r--nixpkgs/pkgs/development/compilers/julia/1.5.nix14
-rw-r--r--nixpkgs/pkgs/development/compilers/jwasm/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/kotlin/default.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/ldc/generic.nix20
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/10/clang/default.nix20
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/10/compiler-rt.nix29
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/10/default.nix22
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/10/libc++/default.nix20
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/10/libc++abi.nix24
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/10/libunwind.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/10/lld.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/10/lldb.nix18
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/10/llvm.nix16
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/10/openmp.nix9
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/11/clang/default.nix24
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/11/compiler-rt.nix31
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/11/default.nix32
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/11/libc++/default.nix18
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/11/libc++abi.nix26
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/11/libunwind.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/11/lld.nix10
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/11/lldb.nix20
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/11/llvm.nix26
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/11/openmp.nix11
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/5/clang/default.nix18
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/5/compiler-rt.nix29
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/5/default.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/5/libc++/default.nix14
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/5/libc++abi.nix14
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/5/lld.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/5/lldb.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/5/llvm.nix40
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/5/openmp.nix9
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/6/clang/default.nix18
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/6/compiler-rt.nix29
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/6/default.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/6/libc++/default.nix14
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/6/libc++abi.nix14
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/6/lld.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/6/lldb.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/6/llvm.nix18
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/6/openmp.nix9
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/7/clang/default.nix22
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/7/compiler-rt.nix31
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/7/default.nix16
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/7/libc++/default.nix16
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/7/libc++abi.nix22
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/7/lld.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/7/lldb.nix10
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/7/llvm.nix18
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/7/openmp.nix9
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/8/clang/default.nix22
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/8/compiler-rt.nix31
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/8/default.nix22
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/8/libc++/default.nix20
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/8/libc++abi.nix24
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/8/libunwind.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/8/lld.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/8/lldb.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/8/llvm.nix16
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/8/openmp.nix9
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/9/clang/default.nix22
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/9/compiler-rt.nix30
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/9/default.nix22
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/9/libc++/default.nix20
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/9/libc++abi.nix24
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/9/libunwind.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/9/lld.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/9/lldb.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/9/llvm.nix16
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/9/openmp.nix9
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/multi.nix16
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/rocm/clang.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/rocm/default.nix3
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/rocm/lld.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/llvm/rocm/llvm.nix12
-rw-r--r--nixpkgs/pkgs/development/compilers/lobster/default.nix5
-rw-r--r--nixpkgs/pkgs/development/compilers/manticore/default.nix14
-rw-r--r--nixpkgs/pkgs/development/compilers/matter-compiler/gemset.nix2
-rw-r--r--nixpkgs/pkgs/development/compilers/mcpp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/mercury/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/meta-environment/meta-build-env/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/mezzo/default.nix10
-rw-r--r--nixpkgs/pkgs/development/compilers/microscheme/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/miranda/default.nix2
-rw-r--r--nixpkgs/pkgs/development/compilers/mit-scheme/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/mkcl/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/mlkit/default.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/mlton/20130715.nix12
-rw-r--r--nixpkgs/pkgs/development/compilers/mlton/20180207-binary.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/mono/generic.nix14
-rw-r--r--nixpkgs/pkgs/development/compilers/mono/llvm.nix13
-rw-r--r--nixpkgs/pkgs/development/compilers/mosml/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/mozart/binary.nix10
-rw-r--r--nixpkgs/pkgs/development/compilers/mruby/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/nasm/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/neko/default.nix10
-rw-r--r--nixpkgs/pkgs/development/compilers/nextpnr/default.nix1
-rw-r--r--nixpkgs/pkgs/development/compilers/obliv-c/default.nix10
-rw-r--r--nixpkgs/pkgs/development/compilers/ocaml/3.08.0.nix2
-rw-r--r--nixpkgs/pkgs/development/compilers/ocaml/3.10.0.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/ocaml/3.11.2.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/ocaml/3.12.1.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/ocaml/4.00.1.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/ocaml/4.12.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/ocaml/ber-metaocaml.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/ocaml/generic.nix22
-rw-r--r--nixpkgs/pkgs/development/compilers/ocaml/metaocaml-3.09.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/opa/default.nix12
-rw-r--r--nixpkgs/pkgs/development/compilers/opendylan/bin.nix10
-rw-r--r--nixpkgs/pkgs/development/compilers/opendylan/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/openjdk/11.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/openjdk/12.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/openjdk/13.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/openjdk/14.nix158
-rw-r--r--nixpkgs/pkgs/development/compilers/openjdk/8.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/openjdk/darwin/11.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/openjdk/darwin/8.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/openjdk/darwin/default.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/openjdk/default.nix25
-rw-r--r--nixpkgs/pkgs/development/compilers/openjdk/openjfx/11.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/openjdk/openjfx/15.nix (renamed from nixpkgs/pkgs/development/compilers/openjdk/openjfx/14.nix)20
-rw-r--r--nixpkgs/pkgs/development/compilers/openspin/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix12
-rw-r--r--nixpkgs/pkgs/development/compilers/oraclejdk/jdk11-linux.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/oraclejdk/jdk14-linux.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/oraclejdk/jdk8-linux.nix10
-rw-r--r--nixpkgs/pkgs/development/compilers/orc/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/osl/default.nix14
-rw-r--r--nixpkgs/pkgs/development/compilers/owl-lisp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/pakcs/curry-base.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/pakcs/curry-frontend.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/pakcs/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/pforth/default.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/picat/default.nix10
-rw-r--r--nixpkgs/pkgs/development/compilers/polyml/5.6.nix12
-rw-r--r--nixpkgs/pkgs/development/compilers/polyml/5.7.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/polyml/default.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/ponyc/default.nix22
-rw-r--r--nixpkgs/pkgs/development/compilers/ponyc/pony-corral.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/ponyc/pony-stable.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/purescript/purescript/default.nix2
-rw-r--r--nixpkgs/pkgs/development/compilers/qbe/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/rasm/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/reason/default.nix11
-rw-r--r--nixpkgs/pkgs/development/compilers/rgbds/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/rust/1_45.nix3
-rw-r--r--nixpkgs/pkgs/development/compilers/rust/1_49.nix (renamed from nixpkgs/pkgs/development/compilers/rust/1_48.nix)26
-rw-r--r--nixpkgs/pkgs/development/compilers/rust/binary.nix14
-rw-r--r--nixpkgs/pkgs/development/compilers/rust/cargo.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/rust/clippy.nix6
-rwxr-xr-xnixpkgs/pkgs/development/compilers/rust/print-hashes.sh2
-rw-r--r--nixpkgs/pkgs/development/compilers/rust/rls/default.nix14
-rw-r--r--nixpkgs/pkgs/development/compilers/rust/rustc.nix14
-rw-r--r--nixpkgs/pkgs/development/compilers/rust/rustfmt.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/sagittarius-scheme/default.nix10
-rw-r--r--nixpkgs/pkgs/development/compilers/sbcl/2.0.9.nix12
-rw-r--r--nixpkgs/pkgs/development/compilers/sbcl/bootstrap.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/sbcl/default.nix12
-rw-r--r--nixpkgs/pkgs/development/compilers/scala/2.x.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/scala/dotty-bare.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/sdcc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/seexpr/default.nix7
-rw-r--r--nixpkgs/pkgs/development/compilers/serpent/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/shaderc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/smlnj/bootstrap.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/smlnj/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/solc/default.nix19
-rw-r--r--nixpkgs/pkgs/development/compilers/souffle/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/spasm-ng/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/spirv-llvm-translator/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/squeak/default.nix12
-rw-r--r--nixpkgs/pkgs/development/compilers/stalin/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/swi-prolog/default.nix16
-rw-r--r--nixpkgs/pkgs/development/compilers/swift/default.nix16
-rw-r--r--nixpkgs/pkgs/development/compilers/terra/default.nix10
-rw-r--r--nixpkgs/pkgs/development/compilers/teyjus/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/tvm/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/unison/default.nix10
-rw-r--r--nixpkgs/pkgs/development/compilers/urn/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/urweb/default.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/vala/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/vlang/default.nix6
-rw-r--r--nixpkgs/pkgs/development/compilers/vyper/default.nix54
-rw-r--r--nixpkgs/pkgs/development/compilers/wcc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/wla-dx/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/x11basic/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/yap/default.nix8
-rw-r--r--nixpkgs/pkgs/development/compilers/yasm/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/yosys/default.nix31
-rw-r--r--nixpkgs/pkgs/development/compilers/yosys/plugin-search-dirs.patch34
-rw-r--r--nixpkgs/pkgs/development/compilers/yosys/plugins/bluespec.nix32
-rw-r--r--nixpkgs/pkgs/development/compilers/yosys/plugins/ghdl.nix31
-rw-r--r--nixpkgs/pkgs/development/compilers/yosys/setup-hook.sh5
-rw-r--r--nixpkgs/pkgs/development/compilers/z88dk/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/zasm/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/zig/default.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/zulu/8.nix4
-rw-r--r--nixpkgs/pkgs/development/compilers/zulu/default.nix4
344 files changed, 2410 insertions, 2070 deletions
diff --git a/nixpkgs/pkgs/development/compilers/4th/default.nix b/nixpkgs/pkgs/development/compilers/4th/default.nix
index ee3050b8ba69..7205a979e279 100644
--- a/nixpkgs/pkgs/development/compilers/4th/default.nix
+++ b/nixpkgs/pkgs/development/compilers/4th/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "4th";
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
     "MANDIR=${placeholder "out"}/share/man"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A portable Forth compiler";
     homepage = "https://thebeez.home.xs4all.nl/4tH/index.html";
     license = licenses.lgpl3;
diff --git a/nixpkgs/pkgs/development/compilers/abcl/default.nix b/nixpkgs/pkgs/development/compilers/abcl/default.nix
index 22f6ca7a0dd2..fff88eddd19e 100644
--- a/nixpkgs/pkgs/development/compilers/abcl/default.nix
+++ b/nixpkgs/pkgs/development/compilers/abcl/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, ant, jre, jdk}:
+{lib, stdenv, fetchurl, ant, jre, jdk}:
 stdenv.mkDerivation rec {
   pname = "abcl";
   version = "1.8.0";
@@ -30,10 +30,10 @@ stdenv.mkDerivation rec {
   buildInputs = [jre ant jdk jre];
   meta = {
     inherit version;
-    description = ''A JVM-based Common Lisp implementation'';
-    license = stdenv.lib.licenses.gpl3 ;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.linux;
+    description = "A JVM-based Common Lisp implementation";
+    license = lib.licenses.gpl3 ;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.linux;
     homepage = "https://common-lisp.net/project/armedbear/";
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/acme/default.nix b/nixpkgs/pkgs/development/compilers/acme/default.nix
index 89c5620f5fce..f8731f554718 100644
--- a/nixpkgs/pkgs/development/compilers/acme/default.nix
+++ b/nixpkgs/pkgs/development/compilers/acme/default.nix
@@ -1,13 +1,13 @@
-{ stdenv, fetchsvn }:
+{ lib, stdenv, fetchsvn }:
 
 stdenv.mkDerivation rec {
   pname = "acme";
-  version = "120";
+  version = "unstable-2020-12-27";
 
   src = fetchsvn {
     url = "svn://svn.code.sf.net/p/acme-crossass/code-0/trunk";
-    rev = version;
-    sha256 = "0w17b8f8bis22m6l5bg8qg8nniy20f8yg2xmzjipblmc39vpv6s2";
+    rev = "314";
+    sha256 = "08zg26rh19nlif7id91nv0syx5n243ssxhfw0nk2r2bhjm5jrjz1";
   };
 
   sourceRoot = "code-0-r${src.rev}/src";
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
       --replace "= gcc" "?= gcc"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A multi-platform cross assembler for 6502/6510/65816 CPUs";
     homepage = "https://sourceforge.net/projects/acme-crossass/";
     license = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/compilers/adoptopenjdk-bin/jdk-darwin-base.nix b/nixpkgs/pkgs/development/compilers/adoptopenjdk-bin/jdk-darwin-base.nix
index 5e402b2d728b..31a7346108e7 100644
--- a/nixpkgs/pkgs/development/compilers/adoptopenjdk-bin/jdk-darwin-base.nix
+++ b/nixpkgs/pkgs/development/compilers/adoptopenjdk-bin/jdk-darwin-base.nix
@@ -1,7 +1,7 @@
 sourcePerArch:
 
 { swingSupport ? true # not used for now
-, stdenv
+, lib, stdenv
 , fetchurl
 }:
 
@@ -43,11 +43,11 @@ let cpuName = stdenv.hostPlatform.parsed.cpu.name;
 
   passthru.home = result;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     license = licenses.gpl2Classpath;
     description = "AdoptOpenJDK, prebuilt OpenJDK binary";
     platforms = [ "x86_64-darwin" ]; # some inherit jre.meta.platforms
-    maintainers = with stdenv.lib.maintainers; [ taku0 ];
+    maintainers = with lib.maintainers; [ taku0 ];
   };
 
 }; in result
diff --git a/nixpkgs/pkgs/development/compilers/adoptopenjdk-bin/jdk-linux-base.nix b/nixpkgs/pkgs/development/compilers/adoptopenjdk-bin/jdk-linux-base.nix
index 00945e325351..0fcad6c333f8 100644
--- a/nixpkgs/pkgs/development/compilers/adoptopenjdk-bin/jdk-linux-base.nix
+++ b/nixpkgs/pkgs/development/compilers/adoptopenjdk-bin/jdk-linux-base.nix
@@ -69,7 +69,7 @@ let result = stdenv.mkDerivation rec {
 
   passthru.home = result;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     license = licenses.gpl2Classpath;
     description = "AdoptOpenJDK, prebuilt OpenJDK binary";
     platforms = lib.mapAttrsToList (arch: _: arch + "-linux") sourcePerArch; # some inherit jre.meta.platforms
diff --git a/nixpkgs/pkgs/development/compilers/adoptopenjdk-icedtea-web/default.nix b/nixpkgs/pkgs/development/compilers/adoptopenjdk-icedtea-web/default.nix
index b62b9c95ef6a..e20983380a43 100644
--- a/nixpkgs/pkgs/development/compilers/adoptopenjdk-icedtea-web/default.nix
+++ b/nixpkgs/pkgs/development/compilers/adoptopenjdk-icedtea-web/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cargo, rustc, autoreconfHook, jdk, glib, xulrunner, zip, pkgconfig, npapi_sdk, bash, bc }:
+{ lib, stdenv, fetchFromGitHub, cargo, rustc, autoreconfHook, jdk, glib, xulrunner, zip, pkg-config, npapi_sdk, bash, bc }:
 
 stdenv.mkDerivation rec {
   pname = "adoptopenjdk-icedtea-web";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "0pxijw9v5k4j840jczglx9qyfd57df390g5jdaz3qafblfg0k10n";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig bc ];
+  nativeBuildInputs = [ autoreconfHook pkg-config bc ];
   buildInputs = [ cargo rustc glib xulrunner zip npapi_sdk ];
 
   preConfigure = ''
@@ -58,6 +58,6 @@ stdenv.mkDerivation rec {
       based on the NetX project.
     '';
     homepage = "https://github.com/adoptopenjdk/icedtea-web";
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/aldor/default.nix b/nixpkgs/pkgs/development/compilers/aldor/default.nix
index 09ccf9510bbd..2654cc467fe2 100644
--- a/nixpkgs/pkgs/development/compilers/aldor/default.nix
+++ b/nixpkgs/pkgs/development/compilers/aldor/default.nix
@@ -1,4 +1,4 @@
-{ fetchgit, stdenv, gmp, which, flex, bison, makeWrapper
+{ fetchgit, lib, stdenv, gmp, which, flex, bison, makeWrapper
 , autoconf, automake, libtool, jdk, perl }:
 
 stdenv.mkDerivation {
@@ -32,7 +32,7 @@ stdenv.mkDerivation {
     broken = true;
     homepage = "http://www.aldor.org/";
     description = "Programming language with an expressive type system";
-    license = stdenv.lib.licenses.asl20;
+    license = lib.licenses.asl20;
 
     longDescription = ''
       Aldor is a programming language with an expressive type system well-suited
@@ -47,6 +47,6 @@ stdenv.mkDerivation {
       and powerful properties of functional, object-oriented and aspect-oriented styles.
     '';
 
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/aliceml/default.nix b/nixpkgs/pkgs/development/compilers/aliceml/default.nix
index d3208b12dd68..8f560ef61981 100644
--- a/nixpkgs/pkgs/development/compilers/aliceml/default.nix
+++ b/nixpkgs/pkgs/development/compilers/aliceml/default.nix
@@ -1,4 +1,4 @@
-{stdenv, gcc, glibc, fetchurl, fetchgit, libtool, autoconf, automake, file, gnumake, which, zsh, m4, pkg-config, perl, gnome2, gtk2, pango, sqlite, libxml2, zlib, gmp, smlnj }:
+{lib, stdenv, gcc, glibc, fetchurl, fetchgit, libtool, autoconf, automake, file, gnumake, which, zsh, m4, pkg-config, perl, gnome2, gtk2, pango, sqlite, libxml2, zlib, gmp, smlnj }:
 
 stdenv.mkDerivation {
   name = "aliceml-1.4-7d44dc8e";
@@ -50,8 +50,8 @@ stdenv.mkDerivation {
       programming.
     '';
     homepage = "https://www.ps.uni-saarland.de/alice/";
-    license = stdenv.lib.licenses.mit;
-    maintainers = [ stdenv.lib.maintainers.doublec ];
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.doublec ];
     broken = true;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/apache-flex-sdk/default.nix b/nixpkgs/pkgs/development/compilers/apache-flex-sdk/default.nix
index ed6b2b2ff247..800b1ea55e38 100644
--- a/nixpkgs/pkgs/development/compilers/apache-flex-sdk/default.nix
+++ b/nixpkgs/pkgs/development/compilers/apache-flex-sdk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper, jre }:
+{ lib, stdenv, fetchurl, makeWrapper, jre }:
 
 let
   playerglobal_ver = "27.0";
@@ -38,16 +38,16 @@ in stdenv.mkDerivation rec {
     for i in $out/bin/!(aasdoc|acompc|amxmlc); do
       wrapProgram $i \
         --set FLEX_HOME $t \
-        --set PLAYERGLOBAL_HOME $t/frameworks/libs/player/ 
+        --set PLAYERGLOBAL_HOME $t/frameworks/libs/player/
     done
 
     mkdir -p $t/frameworks/libs/player/${playerglobal_ver}/
     cp ${playerglobal} $t/frameworks/libs/player/${playerglobal_ver}/playerglobal.swc
   '';
-  
+
   fixupPhase = ":";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Flex SDK for Adobe Flash / ActionScript";
     homepage = "https://flex.apache.org/";
     license = with licenses; [ asl20 ];
diff --git a/nixpkgs/pkgs/development/compilers/arachne-pnr/default.nix b/nixpkgs/pkgs/development/compilers/arachne-pnr/default.nix
index 613f3fa186aa..030da03add84 100644
--- a/nixpkgs/pkgs/development/compilers/arachne-pnr/default.nix
+++ b/nixpkgs/pkgs/development/compilers/arachne-pnr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, icestorm }:
+{ lib, stdenv, fetchFromGitHub, icestorm }:
 
 with builtins;
 
@@ -37,8 +37,8 @@ stdenv.mkDerivation rec {
       the IceStorm [2] icepack command.
     '';
     homepage = "https://github.com/cseed/arachne-pnr";
-    license = stdenv.lib.licenses.mit;
-    maintainers = with stdenv.lib.maintainers; [ shell thoughtpolice ];
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ shell thoughtpolice ];
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/asn1c/default.nix b/nixpkgs/pkgs/development/compilers/asn1c/default.nix
index 230ed36fff51..a4e822eec6da 100644
--- a/nixpkgs/pkgs/development/compilers/asn1c/default.nix
+++ b/nixpkgs/pkgs/development/compilers/asn1c/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl }:
+{ lib, stdenv, fetchurl, perl }:
 
 stdenv.mkDerivation rec {
   pname = "asn1c";
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://lionet.info/asn1c/compiler.html";
     description = "Open Source ASN.1 Compiler";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/compilers/aspectj/default.nix b/nixpkgs/pkgs/development/compilers/aspectj/default.nix
index 8fd47e937c80..24ff50f558cd 100644
--- a/nixpkgs/pkgs/development/compilers/aspectj/default.nix
+++ b/nixpkgs/pkgs/development/compilers/aspectj/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, jre}:
+{lib, stdenv, fetchurl, jre}:
 
 stdenv.mkDerivation rec {
   pname = "aspectj";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://www.eclipse.org/aspectj/";
     description = "A seamless aspect-oriented extension to the Java programming language";
-    platforms = stdenv.lib.platforms.unix;
-    license = stdenv.lib.licenses.epl10;
+    platforms = lib.platforms.unix;
+    license = lib.licenses.epl10;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/ats/default.nix b/nixpkgs/pkgs/development/compilers/ats/default.nix
index f086c36468d7..35e1b1dd1058 100644
--- a/nixpkgs/pkgs/development/compilers/ats/default.nix
+++ b/nixpkgs/pkgs/development/compilers/ats/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gmp }:
+{ lib, stdenv, fetchurl, gmp }:
 
 stdenv.mkDerivation rec {
   pname = "ats";
@@ -16,10 +16,10 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Functional programming language with dependent types";
     homepage    = "http://www.ats-lang.org";
-    license     = stdenv.lib.licenses.gpl3Plus;
+    license     = lib.licenses.gpl3Plus;
     # TODO: it looks like ATS requires gcc specifically. Someone with more knowledge
     # will need to experiment.
-    platforms   = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
+    platforms   = lib.platforms.linux;
+    maintainers = [ lib.maintainers.thoughtpolice ];
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/ats2/default.nix b/nixpkgs/pkgs/development/compilers/ats2/default.nix
index bbfbcdbbeb0e..c75600b5341a 100644
--- a/nixpkgs/pkgs/development/compilers/ats2/default.nix
+++ b/nixpkgs/pkgs/development/compilers/ats2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gmp
+{ lib, stdenv, fetchurl, gmp
 , withEmacsSupport ? true
 , withContrib ? true }:
 
@@ -10,14 +10,14 @@ let
     sha256 = "184m4hz2xszhcfc6w9fw9qibhmcvgjmikwfwkb345xypr59jm93d";
   };
 
-  postInstallContrib = stdenv.lib.optionalString withContrib
+  postInstallContrib = lib.optionalString withContrib
   ''
     local contribDir=$out/lib/ats2-postiats-*/ ;
     mkdir -p $contribDir ;
     tar -xzf "${contrib}" --strip-components 1 -C $contribDir ;
   '';
 
-  postInstallEmacs = stdenv.lib.optionalString withEmacsSupport
+  postInstallEmacs = lib.optionalString withEmacsSupport
   ''
     local siteLispDir=$out/share/emacs/site-lisp/ats2 ;
     mkdir -p $siteLispDir ;
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ gmp ];
 
-  setupHook = with stdenv.lib;
+  setupHook = with lib;
     let
       hookFiles =
         [ ./setup-hook.sh ]
@@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
 
   postInstall = postInstallContrib + postInstallEmacs;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Functional programming language with dependent types";
     homepage    = "http://www.ats-lang.org";
     license     = licenses.gpl3Plus;
diff --git a/nixpkgs/pkgs/development/compilers/avian/default.nix b/nixpkgs/pkgs/development/compilers/avian/default.nix
index 7c5db45f31b4..d39aa2806a45 100644
--- a/nixpkgs/pkgs/development/compilers/avian/default.nix
+++ b/nixpkgs/pkgs/development/compilers/avian/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, zlib, jdk, CoreServices, Foundation }:
+{ lib, stdenv, fetchFromGitHub, zlib, jdk, CoreServices, Foundation }:
 
 stdenv.mkDerivation rec {
   pname = "avian";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ zlib jdk ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices Foundation ];
+    ++ lib.optionals stdenv.isDarwin [ CoreServices Foundation ];
 
   NIX_CFLAGS_COMPILE = "-Wno-error";
 
@@ -36,8 +36,8 @@ stdenv.mkDerivation rec {
       building self-contained applications.
     '';
     homepage = "https://readytalk.github.io/avian/";
-    license = stdenv.lib.licenses.isc;
-    platforms = stdenv.lib.platforms.all;
-    maintainers = [ stdenv.lib.maintainers.earldouglas ];
+    license = lib.licenses.isc;
+    platforms = lib.platforms.all;
+    maintainers = [ lib.maintainers.earldouglas ];
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/avra/default.nix b/nixpkgs/pkgs/development/compilers/avra/default.nix
index 56bf3e657bec..9d360780053c 100644
--- a/nixpkgs/pkgs/development/compilers/avra/default.nix
+++ b/nixpkgs/pkgs/development/compilers/avra/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoconf, automake }:
+{ lib, stdenv, fetchurl, autoconf, automake }:
 stdenv.mkDerivation rec {
   name = "avra-1.3.0";
 
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
     automake -a
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Assembler for the Atmel AVR microcontroller family";
     homepage = "http://avra.sourceforge.net/";
     license = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/compilers/bigloo/default.nix b/nixpkgs/pkgs/development/compilers/bigloo/default.nix
index a3bac2b1722c..a4f4287523f4 100644
--- a/nixpkgs/pkgs/development/compilers/bigloo/default.nix
+++ b/nixpkgs/pkgs/development/compilers/bigloo/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, autoconf, automake, libtool, gmp
+{ fetchurl, lib, stdenv, autoconf, automake, libtool, gmp
 , darwin
 }:
 
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoconf automake libtool ];
 
-  buildInputs = stdenv.lib.optional stdenv.isDarwin
+  buildInputs = lib.optional stdenv.isDarwin
     darwin.apple_sdk.frameworks.ApplicationServices
   ;
 
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
 
   preConfigure =
     # For libuv on darwin
-    stdenv.lib.optionalString stdenv.isDarwin ''
+    lib.optionalString stdenv.isDarwin ''
       export LIBTOOLIZE=libtoolize
     '' +
     # Help libgc's configure.
@@ -32,14 +32,14 @@ stdenv.mkDerivation rec {
     # Fix absolute paths.
     sed -e 's=/bin/mv=mv=g' -e 's=/bin/rm=rm=g'			\
         -e 's=/tmp=$TMPDIR=g' -i autoconf/*		\
-	[Mm]akefile*   */[Mm]akefile*   */*/[Mm]akefile*	\
-	*/*/*/[Mm]akefile*   */*/*/*/[Mm]akefile*		\
-	comptime/Cc/cc.scm gc/install-*
+        [Mm]akefile*   */[Mm]akefile*   */*/[Mm]akefile*	\
+        */*/*/[Mm]akefile*   */*/*/*/[Mm]akefile*		\
+        comptime/Cc/cc.scm gc/install-*
 
     # Make sure we don't change string lengths in the generated
     # C files.
     sed -e 's=/bin/rm=     rm=g' -e 's=/bin/mv=     mv=g'	\
-	-i comptime/Cc/cc.c
+        -i comptime/Cc/cc.c
   '';
 
   checkTarget = "test";
@@ -50,9 +50,9 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Efficient Scheme compiler";
     homepage    = "http://www-sop.inria.fr/indes/fp/Bigloo/";
-    license     = stdenv.lib.licenses.gpl2Plus;
-    platforms   = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ thoughtpolice ];
+    license     = lib.licenses.gpl2Plus;
+    platforms   = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ thoughtpolice ];
 
     longDescription = ''
       Bigloo is a Scheme implementation devoted to one goal: enabling
diff --git a/nixpkgs/pkgs/development/compilers/binaryen/default.nix b/nixpkgs/pkgs/development/compilers/binaryen/default.nix
index 6de4e0fb3047..d2d866a2804b 100644
--- a/nixpkgs/pkgs/development/compilers/binaryen/default.nix
+++ b/nixpkgs/pkgs/development/compilers/binaryen/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, cmake, python3, fetchFromGitHub, fetchpatch, emscripten }:
+{ lib, stdenv, cmake, python3, fetchFromGitHub, fetchpatch, emscripten }:
 
 stdenv.mkDerivation rec {
   pname = "binaryen";
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake python3 ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/WebAssembly/binaryen";
     description = "Compiler infrastructure and toolchain library for WebAssembly, in C++";
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/compilers/bluespec/default.nix b/nixpkgs/pkgs/development/compilers/bluespec/default.nix
index df7b6585205a..defe78d7c318 100644
--- a/nixpkgs/pkgs/development/compilers/bluespec/default.nix
+++ b/nixpkgs/pkgs/development/compilers/bluespec/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , fetchpatch
 , autoconf
@@ -11,7 +11,7 @@
 , perl
 , flex
 , bison
-, pkgconfig
+, pkg-config
 , itktcl
 , incrtcl
 , tcl
@@ -53,7 +53,7 @@ in stdenv.mkDerivation rec {
     perl
     flex
     bison
-    pkgconfig
+    pkg-config
     ghcWithPackages
   ];
 
@@ -97,10 +97,10 @@ in stdenv.mkDerivation rec {
   meta = {
     description = "Toolchain for the Bluespec Hardware Definition Language";
     homepage    = "https://github.com/B-Lang-org/bsc";
-    license     = stdenv.lib.licenses.bsd3;
+    license     = lib.licenses.bsd3;
     platforms = [ "x86_64-linux" ];
     # darwin fails at https://github.com/B-Lang-org/bsc/pull/35#issuecomment-583731562
     # aarch64 fails, as GHC fails with "ghc: could not execute: opt"
-    maintainers = with stdenv.lib.maintainers; [ jcumming thoughtpolice ];
+    maintainers = with lib.maintainers; [ jcumming thoughtpolice ];
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/bs-platform/build-bs-platform.nix b/nixpkgs/pkgs/development/compilers/bs-platform/build-bs-platform.nix
index 18c61d0d923c..c73bb72b9d0f 100644
--- a/nixpkgs/pkgs/development/compilers/bs-platform/build-bs-platform.nix
+++ b/nixpkgs/pkgs/development/compilers/bs-platform/build-bs-platform.nix
@@ -1,12 +1,12 @@
 # This file is based on https://github.com/turboMaCk/bs-platform.nix/blob/master/build-bs-platform.nix
 # to make potential future updates simpler
 
-{ stdenv, fetchFromGitHub, ninja, runCommand, nodejs, python3,
+{ lib, stdenv, fetchFromGitHub, ninja, runCommand, nodejs, python3,
   ocaml-version, version, src,
   patches ? [],
   ocaml ? (import ./ocaml.nix {
     version = ocaml-version;
-    inherit stdenv;
+    inherit lib stdenv;
     src = "${src}/ocaml";
   }),
   custom-ninja ? (ninja.overrideAttrs (attrs: {
diff --git a/nixpkgs/pkgs/development/compilers/bs-platform/default.nix b/nixpkgs/pkgs/development/compilers/bs-platform/default.nix
index 6eb7d50bfc8c..50274c9eca67 100644
--- a/nixpkgs/pkgs/development/compilers/bs-platform/default.nix
+++ b/nixpkgs/pkgs/development/compilers/bs-platform/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, runCommand, fetchFromGitHub, ninja, nodejs, python3, ... }:
+{ lib, stdenv, runCommand, fetchFromGitHub, ninja, nodejs, python3, ... }:
 let
   build-bs-platform = import ./build-bs-platform.nix;
 in
 (build-bs-platform rec {
-  inherit stdenv runCommand fetchFromGitHub ninja nodejs python3;
+  inherit lib stdenv runCommand fetchFromGitHub ninja nodejs python3;
   version = "8.2.0";
   ocaml-version = "4.06.1";
 
@@ -17,7 +17,7 @@ in
     fetchSubmodules = true;
   };
 }).overrideAttrs (attrs: {
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A JavaScript backend for OCaml focused on smooth integration and clean generated code";
     homepage = "https://bucklescript.github.io";
     license = licenses.lgpl3;
diff --git a/nixpkgs/pkgs/development/compilers/bs-platform/ocaml.nix b/nixpkgs/pkgs/development/compilers/bs-platform/ocaml.nix
index 9aa34d02b362..d650d767a8d8 100644
--- a/nixpkgs/pkgs/development/compilers/bs-platform/ocaml.nix
+++ b/nixpkgs/pkgs/development/compilers/bs-platform/ocaml.nix
@@ -1,4 +1,4 @@
-{ stdenv, src, version }:
+{ lib, stdenv, src, version }:
 stdenv.mkDerivation rec {
   inherit src version;
   name = "ocaml-${version}+bs";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     make -j9 world.opt
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     branch = "4.06";
     platforms = platforms.all;
   };
diff --git a/nixpkgs/pkgs/development/compilers/bupc/default.nix b/nixpkgs/pkgs/development/compilers/bupc/default.nix
index ecdfe8d461a2..9b3a291a1a08 100644
--- a/nixpkgs/pkgs/development/compilers/bupc/default.nix
+++ b/nixpkgs/pkgs/development/compilers/bupc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, coreutils }:
+{ lib, stdenv, fetchurl, perl, coreutils }:
 
 stdenv.mkDerivation rec {
   name = "berkeley_upc-2.22.0";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ coreutils ];
   buildInputs = [ perl ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A compiler for the Berkely Unified Parallel C language";
     longDescription = ''
       Unified Parallel C (UPC) is an extension of the C programming language
diff --git a/nixpkgs/pkgs/development/compilers/cakelisp/default.nix b/nixpkgs/pkgs/development/compilers/cakelisp/default.nix
new file mode 100644
index 000000000000..15afb9fc25ec
--- /dev/null
+++ b/nixpkgs/pkgs/development/compilers/cakelisp/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchFromGitHub, gcc }:
+
+stdenv.mkDerivation rec {
+  pname = "cakelisp";
+  version = "0.1.0";
+
+  src = fetchFromGitHub {
+    owner = "makuto";
+    repo = "cakelisp";
+    rev = "v${version}";
+    sha256 = "126va59jy7rvy6c2wrf8j44m307f2d8jixqkc49s9wllxprj1dmg";
+  };
+
+  buildInputs = [ gcc ];
+
+  postPatch = ''
+    substituteInPlace runtime/HotReloading.cake \
+        --replace '"/usr/bin/g++"' '"${gcc}/bin/g++"'
+    substituteInPlace src/ModuleManager.cpp \
+        --replace '"/usr/bin/g++"' '"${gcc}/bin/g++"'
+  '' + lib.optionalString stdenv.isDarwin ''
+    substituteInPlace Build.sh --replace '--export-dynamic' '-export_dynamic'
+    substituteInPlace runtime/HotReloading.cake --replace '--export-dynamic' '-export_dynamic'
+    substituteInPlace Bootstrap.cake --replace '--export-dynamic' '-export_dynamic'
+  '';
+
+  buildPhase = ''
+    ./Build.sh
+  '';
+
+  installPhase = ''
+    install -Dm755 bin/cakelisp -t $out/bin
+  '';
+
+  meta = with lib; {
+    description = "A performance-oriented Lisp-like language";
+    homepage = "https://github.com/makuto/cakelisp";
+    license = licenses.gpl3Plus;
+    platforms = platforms.darwin ++ platforms.linux;
+    maintainers = [ maintainers.sbond75 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/compilers/carp/default.nix b/nixpkgs/pkgs/development/compilers/carp/default.nix
index f6c27436c767..0299c1797755 100644
--- a/nixpkgs/pkgs/development/compilers/carp/default.nix
+++ b/nixpkgs/pkgs/development/compilers/carp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, makeWrapper, clang, haskellPackages }:
+{ lib, stdenv, fetchFromGitHub, makeWrapper, clang, haskellPackages }:
 
 haskellPackages.mkDerivation rec {
 
@@ -39,10 +39,10 @@ haskellPackages.mkDerivation rec {
 
   description = "A statically typed lisp, without a GC, for real-time applications";
   homepage    = "https://github.com/carp-lang/Carp";
-  license     = stdenv.lib.licenses.asl20;
-  maintainers = with stdenv.lib.maintainers; [ jluttine ];
+  license     = lib.licenses.asl20;
+  maintainers = with lib.maintainers; [ jluttine ];
 
   # Windows not (yet) supported.
-  platforms   = with stdenv.lib.platforms; unix ++ darwin;
+  platforms   = with lib.platforms; unix ++ darwin;
 
 }
diff --git a/nixpkgs/pkgs/development/compilers/cc65/default.nix b/nixpkgs/pkgs/development/compilers/cc65/default.nix
index 1b5011365cf2..347382990d16 100644
--- a/nixpkgs/pkgs/development/compilers/cc65/default.nix
+++ b/nixpkgs/pkgs/development/compilers/cc65/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 }:
 
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   makeFlags = [ "PREFIX=${placeholder "out"}"];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://cc65.github.io/";
     description = "C compiler for processors of 6502 family";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/compilers/ccl/default.nix b/nixpkgs/pkgs/development/compilers/ccl/default.nix
index 8f292e358ae7..79e7d324ec94 100644
--- a/nixpkgs/pkgs/development/compilers/ccl/default.nix
+++ b/nixpkgs/pkgs/development/compilers/ccl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, runCommand, bootstrap_cmds, coreutils, glibc, m4, runtimeShell }:
+{ lib, stdenv, fetchurl, runCommand, bootstrap_cmds, coreutils, glibc, m4, runtimeShell }:
 
 let
   options = rec {
@@ -101,7 +101,7 @@ stdenv.mkDerivation rec {
 
   hardeningDisable = [ "format" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Clozure Common Lisp";
     homepage    = "https://ccl.clozure.com/";
     maintainers = with maintainers; [ raskin muflax tohl ];
diff --git a/nixpkgs/pkgs/development/compilers/chez/default.nix b/nixpkgs/pkgs/development/compilers/chez/default.nix
index 550f754639e6..c1c8eced83ba 100644
--- a/nixpkgs/pkgs/development/compilers/chez/default.nix
+++ b/nixpkgs/pkgs/development/compilers/chez/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub
+{ lib, stdenv, fetchFromGitHub
 , coreutils, cctools
 , ncurses, libiconv, libX11, libuuid
 }:
@@ -15,12 +15,12 @@ stdenv.mkDerivation rec {
     fetchSubmodules = true;
   };
 
-  nativeBuildInputs = [ coreutils ] ++ stdenv.lib.optional stdenv.isDarwin cctools;
+  nativeBuildInputs = [ coreutils ] ++ lib.optional stdenv.isDarwin cctools;
   buildInputs = [ ncurses libiconv libX11 libuuid ];
 
   enableParallelBuilding = true;
 
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-Wno-error=format-truncation";
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=format-truncation";
 
   /*
   ** We patch out a very annoying 'feature' in ./configure, which
@@ -70,9 +70,9 @@ stdenv.mkDerivation rec {
   meta = {
     description  = "A powerful and incredibly fast R6RS Scheme compiler";
     homepage     = "https://cisco.github.io/ChezScheme/";
-    license      = stdenv.lib.licenses.asl20;
-    maintainers  = with stdenv.lib.maintainers; [ thoughtpolice ];
-    platforms    = stdenv.lib.platforms.unix;
+    license      = lib.licenses.asl20;
+    maintainers  = with lib.maintainers; [ thoughtpolice ];
+    platforms    = lib.platforms.unix;
     badPlatforms = [ "aarch64-linux" ];
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/chicken/4/chicken.nix b/nixpkgs/pkgs/development/compilers/chicken/4/chicken.nix
index 50126fdac92c..8ea522a81a92 100644
--- a/nixpkgs/pkgs/development/compilers/chicken/4/chicken.nix
+++ b/nixpkgs/pkgs/development/compilers/chicken/4/chicken.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper, darwin, bootstrap-chicken ? null }:
+{ lib, stdenv, fetchurl, makeWrapper, darwin, bootstrap-chicken ? null }:
 
 let
   version = "4.13.0";
@@ -8,7 +8,6 @@ let
     else if (isFreeBSD || isOpenBSD) then "bsd"
     else if isSunOS then "solaris"
     else "linux"; # Should be a sane default
-  lib = stdenv.lib;
 in
 stdenv.mkDerivation {
   pname = "chicken";
@@ -70,9 +69,9 @@ stdenv.mkDerivation {
 
   meta = {
     homepage = "http://www.call-cc.org/";
-    license = stdenv.lib.licenses.bsd3;
-    maintainers = with stdenv.lib.maintainers; [ corngood ];
-    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; # Maybe other Unix
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ corngood ];
+    platforms = lib.platforms.linux ++ lib.platforms.darwin; # Maybe other Unix
     description = "A portable compiler for the Scheme programming language";
     longDescription = ''
       CHICKEN is a compiler for the Scheme programming language.
diff --git a/nixpkgs/pkgs/development/compilers/chicken/4/egg2nix.nix b/nixpkgs/pkgs/development/compilers/chicken/4/egg2nix.nix
index 977f34692f90..2775666f14c3 100644
--- a/nixpkgs/pkgs/development/compilers/chicken/4/egg2nix.nix
+++ b/nixpkgs/pkgs/development/compilers/chicken/4/egg2nix.nix
@@ -20,8 +20,8 @@ eggDerivation {
   meta = {
     description = "Generate nix-expression from CHICKEN scheme eggs";
     homepage = "https://github.com/the-kenny/egg2nix";
-    license = stdenv.lib.licenses.bsd3;
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ corngood ];
+    license = lib.licenses.bsd3;
+    platforms = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ corngood ];
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/chicken/4/eggDerivation.nix b/nixpkgs/pkgs/development/compilers/chicken/4/eggDerivation.nix
index cd340c221743..4c84ef8c42b0 100644
--- a/nixpkgs/pkgs/development/compilers/chicken/4/eggDerivation.nix
+++ b/nixpkgs/pkgs/development/compilers/chicken/4/eggDerivation.nix
@@ -1,4 +1,4 @@
-{ stdenv, chicken, makeWrapper }:
+{ lib, stdenv, chicken, makeWrapper }:
 { name, src
 , buildInputs ? []
 , chickenInstallFlags ? []
@@ -8,7 +8,7 @@
 let
   libPath = "${chicken}/var/lib/chicken/${toString chicken.binaryVersion}/";
   overrides = import ./overrides.nix;
-  baseName = stdenv.lib.getName name;
+  baseName = lib.getName name;
   override = if builtins.hasAttr baseName overrides
    then
      builtins.getAttr baseName overrides
@@ -20,7 +20,7 @@ stdenv.mkDerivation ({
   propagatedBuildInputs = buildInputs;
   buildInputs = [ makeWrapper chicken ];
 
-  CSC_OPTIONS = stdenv.lib.concatStringsSep " " cscOptions;
+  CSC_OPTIONS = lib.concatStringsSep " " cscOptions;
 
   CHICKEN_REPOSITORY = libPath;
   CHICKEN_INSTALL_PREFIX = "$out";
@@ -28,7 +28,7 @@ stdenv.mkDerivation ({
   installPhase = ''
     runHook preInstall
 
-    chicken-install -p $out ${stdenv.lib.concatStringsSep " " chickenInstallFlags}
+    chicken-install -p $out ${lib.concatStringsSep " " chickenInstallFlags}
 
     for f in $out/bin/*
     do
diff --git a/nixpkgs/pkgs/development/compilers/chicken/5/chicken.nix b/nixpkgs/pkgs/development/compilers/chicken/5/chicken.nix
index 712012643f33..9f2554b73436 100644
--- a/nixpkgs/pkgs/development/compilers/chicken/5/chicken.nix
+++ b/nixpkgs/pkgs/development/compilers/chicken/5/chicken.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper, darwin, bootstrap-chicken ? null }:
+{ lib, stdenv, fetchurl, makeWrapper, darwin, bootstrap-chicken ? null }:
 
 let
   version = "5.2.0";
@@ -8,7 +8,6 @@ let
     else if (isFreeBSD || isOpenBSD) then "bsd"
     else if isSunOS then "solaris"
     else "linux"; # Should be a sane default
-  lib = stdenv.lib;
 in
 stdenv.mkDerivation {
   pname = "chicken";
@@ -51,9 +50,9 @@ stdenv.mkDerivation {
 
   meta = {
     homepage = "http://www.call-cc.org/";
-    license = stdenv.lib.licenses.bsd3;
-    maintainers = with stdenv.lib.maintainers; [ corngood ];
-    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin; # Maybe other Unix
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ corngood ];
+    platforms = lib.platforms.linux ++ lib.platforms.darwin; # Maybe other Unix
     description = "A portable compiler for the Scheme programming language";
     longDescription = ''
       CHICKEN is a compiler for the Scheme programming language.
diff --git a/nixpkgs/pkgs/development/compilers/chicken/5/egg2nix.nix b/nixpkgs/pkgs/development/compilers/chicken/5/egg2nix.nix
index 0c18b8db2ded..69e8d9e62c35 100644
--- a/nixpkgs/pkgs/development/compilers/chicken/5/egg2nix.nix
+++ b/nixpkgs/pkgs/development/compilers/chicken/5/egg2nix.nix
@@ -1,4 +1,4 @@
-{ stdenv, eggDerivation, fetchFromGitHub, chickenEggs }:
+{ lib, stdenv, eggDerivation, fetchFromGitHub, chickenEggs }:
 
 # Note: This mostly reimplements the default.nix already contained in
 # the tarball. Is there a nicer way than duplicating code?
@@ -22,8 +22,8 @@ eggDerivation {
   meta = {
     description = "Generate nix-expression from CHICKEN scheme eggs";
     homepage = "https://github.com/the-kenny/egg2nix";
-    license = stdenv.lib.licenses.bsd3;
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ corngood ];
+    license = lib.licenses.bsd3;
+    platforms = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ corngood ];
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/chicken/5/eggDerivation.nix b/nixpkgs/pkgs/development/compilers/chicken/5/eggDerivation.nix
index f5ed4b4b7f8b..7102126206ae 100644
--- a/nixpkgs/pkgs/development/compilers/chicken/5/eggDerivation.nix
+++ b/nixpkgs/pkgs/development/compilers/chicken/5/eggDerivation.nix
@@ -1,4 +1,4 @@
-{ stdenv, chicken, makeWrapper }:
+{ lib, stdenv, chicken, makeWrapper }:
 { name, src
 , buildInputs ? []
 , chickenInstallFlags ? []
@@ -7,7 +7,7 @@
 
 let
   overrides = import ./overrides.nix;
-  baseName = stdenv.lib.getName name;
+  baseName = lib.getName name;
   override = if builtins.hasAttr baseName overrides
    then
      builtins.getAttr baseName overrides
@@ -19,14 +19,14 @@ stdenv.mkDerivation ({
   propagatedBuildInputs = buildInputs;
   buildInputs = [ makeWrapper chicken ];
 
-  CSC_OPTIONS = stdenv.lib.concatStringsSep " " cscOptions;
+  CSC_OPTIONS = lib.concatStringsSep " " cscOptions;
 
   installPhase = ''
     runHook preInstall
 
     export CHICKEN_INSTALL_PREFIX=$out
     export CHICKEN_INSTALL_REPOSITORY=$out/lib/chicken/${toString chicken.binaryVersion}
-    chicken-install ${stdenv.lib.concatStringsSep " " chickenInstallFlags}
+    chicken-install ${lib.concatStringsSep " " chickenInstallFlags}
 
     for f in $out/bin/*
     do
diff --git a/nixpkgs/pkgs/development/compilers/ciao/default.nix b/nixpkgs/pkgs/development/compilers/ciao/default.nix
index be39d81f5581..de8e73374c5e 100644
--- a/nixpkgs/pkgs/development/compilers/ciao/default.nix
+++ b/nixpkgs/pkgs/development/compilers/ciao/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "ciao";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     ./ciao-boot.sh install
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://ciao-lang.org/";
     description = "A general purpose, multi-paradigm programming language in the Prolog family";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/compilers/clasp/default.nix b/nixpkgs/pkgs/development/compilers/clasp/default.nix
index 664d84921135..31a669c313e0 100644
--- a/nixpkgs/pkgs/development/compilers/clasp/default.nix
+++ b/nixpkgs/pkgs/development/compilers/clasp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fetchFromGitLab
+{ lib, stdenv, fetchFromGitHub, fetchFromGitLab
 , llvmPackages
 , cmake, boehmgc, gmp, zlib, ncurses, boost, libelf
 , python, git, sbcl
@@ -72,14 +72,14 @@ stdenv.mkDerivation rec {
 
   buildInputs = with llvmPackages;
   (
-   builtins.map (x: stdenv.lib.overrideDerivation x
+   builtins.map (x: lib.overrideDerivation x
            (x: {NIX_CFLAGS_COMPILE= (x.NIX_CFLAGS_COMPILE or "") + " -frtti"; }))
    [ llvm clang clang-unwrapped clang ]) ++
   [
     gmp zlib ncurses
     boost boehmgc libelf
     (boost.override {enableStatic = true; enableShared = false;})
-    (stdenv.lib.overrideDerivation boehmgc
+    (lib.overrideDerivation boehmgc
       (x: {configureFlags = (x.configureFlags or []) ++ ["--enable-static"];}))
   ];
 
@@ -119,10 +119,10 @@ stdenv.mkDerivation rec {
 
   meta = {
     inherit version;
-    description = ''A Common Lisp implementation based on LLVM with C++ integration'';
-    license = stdenv.lib.licenses.lgpl21Plus ;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.linux;
+    description = "A Common Lisp implementation based on LLVM with C++ integration";
+    license = lib.licenses.lgpl21Plus ;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.linux;
     # Large, long to build, a private build of clang is needed, a prerelease.
     hydraPlatforms = [];
     homepage = "https://github.com/drmeister/clasp";
diff --git a/nixpkgs/pkgs/development/compilers/clean/default.nix b/nixpkgs/pkgs/development/compilers/clean/default.nix
index 0dfd05030b98..f8121958e292 100644
--- a/nixpkgs/pkgs/development/compilers/clean/default.nix
+++ b/nixpkgs/pkgs/development/compilers/clean/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation {
   name = "clean-3.0";
@@ -45,8 +45,8 @@ stdenv.mkDerivation {
     '';
 
     homepage = "http://wiki.clean.cs.ru.nl/Clean";
-    license = stdenv.lib.licenses.lgpl21;
-    maintainers = [ stdenv.lib.maintainers.kkallio ];
+    license = lib.licenses.lgpl21;
+    maintainers = [ lib.maintainers.kkallio ];
     platforms = [ "i686-linux" "x86_64-linux" ];
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/closure/default.nix b/nixpkgs/pkgs/development/compilers/closure/default.nix
index 7c0d42f1864e..b5ac2e187d8c 100644
--- a/nixpkgs/pkgs/development/compilers/closure/default.nix
+++ b/nixpkgs/pkgs/development/compilers/closure/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, jre, makeWrapper }:
+{ lib, stdenv, fetchurl, jre, makeWrapper }:
 
 stdenv.mkDerivation rec {
   pname = "closure-compiler";
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
       --add-flags "-jar $out/share/java/closure-compiler-v${version}.jar"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A tool for making JavaScript download and run faster";
     homepage = "https://developers.google.com/closure/compiler/";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/compilers/cmdstan/default.nix b/nixpkgs/pkgs/development/compilers/cmdstan/default.nix
index 87d3f0ef00ce..df674b67db85 100644
--- a/nixpkgs/pkgs/development/compilers/cmdstan/default.nix
+++ b/nixpkgs/pkgs/development/compilers/cmdstan/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, python, runtimeShell }:
+{ lib, stdenv, fetchurl, python, runtimeShell }:
 
 stdenv.mkDerivation {
   name = "cmdstan-2.17.1";
@@ -36,7 +36,7 @@ stdenv.mkDerivation {
       likelihood estimation with Optimization (L-BFGS).
     '';
     homepage = "https://mc-stan.org/interfaces/cmdstan.html";
-    license = stdenv.lib.licenses.bsd3;
-    platforms = stdenv.lib.platforms.all;
+    license = lib.licenses.bsd3;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/cmucl/binary.nix b/nixpkgs/pkgs/development/compilers/cmucl/binary.nix
index 480a7e522b53..b09f5f41b67a 100644
--- a/nixpkgs/pkgs/development/compilers/cmucl/binary.nix
+++ b/nixpkgs/pkgs/development/compilers/cmucl/binary.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 let
   inherit (stdenv.hostPlatform) system;
@@ -36,9 +36,9 @@ stdenv.mkDerivation {
       which runs on most major Unix platforms.  It mainly conforms to the
       ANSI Common Lisp standard.
     '';
-    license = stdenv.lib.licenses.free;		# public domain
+    license = lib.licenses.free;		# public domain
     homepage = "http://www.cons.org/cmucl/";
-    maintainers = [stdenv.lib.maintainers.tohl];
-    platforms = stdenv.lib.platforms.linux;
+    maintainers = [lib.maintainers.tohl];
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/colm/default.nix b/nixpkgs/pkgs/development/compilers/colm/default.nix
index 06a56dc42eaf..d7a0953a8035 100644
--- a/nixpkgs/pkgs/development/compilers/colm/default.nix
+++ b/nixpkgs/pkgs/development/compilers/colm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper, gcc, asciidoc, autoreconfHook }:
+{ lib, stdenv, fetchurl, makeWrapper, gcc, asciidoc, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "colm";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
       --prefix PATH ":" ${gcc}/bin
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A programming language for the analysis and transformation of computer languages";
     homepage = "http://www.colm.net/open-source/colm";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/compilers/compcert/default.nix b/nixpkgs/pkgs/development/compilers/compcert/default.nix
index 99bd09d8d9e5..611efb11f445 100644
--- a/nixpkgs/pkgs/development/compilers/compcert/default.nix
+++ b/nixpkgs/pkgs/development/compilers/compcert/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fetchpatch, makeWrapper
+{ lib, stdenv, fetchFromGitHub, fetchpatch, makeWrapper
 , coqPackages, ocamlPackages, coq2html
 , tools ? stdenv.cc
 , version ? "3.8"
@@ -8,7 +8,7 @@ let
   ocaml-pkgs      = with ocamlPackages; [ ocaml findlib menhir ];
   ccomp-platform = if stdenv.isDarwin then "x86_64-macosx" else "x86_64-linux";
   inherit (coqPackages) coq flocq;
-  inherit (stdenv.lib) optional optionalString;
+  inherit (lib) optional optionalString;
 in
 
 let param = {
@@ -83,7 +83,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "lib" "doc" "man" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Formally verified C compiler";
     homepage    = "https://compcert.org";
     license     = licenses.inria-compcert;
diff --git a/nixpkgs/pkgs/development/compilers/computecpp/default.nix b/nixpkgs/pkgs/development/compilers/computecpp/default.nix
index 7cfc60f050e4..0f9e877201b4 100644
--- a/nixpkgs/pkgs/development/compilers/computecpp/default.nix
+++ b/nixpkgs/pkgs/development/compilers/computecpp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchzip
 , pkg-config
 , autoPatchelfHook
@@ -9,11 +9,11 @@
 
 stdenv.mkDerivation rec {
   pname = "computecpp";
-  version = "2.2.1";
+  version = "2.3.0";
 
   src = fetchzip {
     url = "https://computecpp.codeplay.com/downloads/computecpp-ce/${version}/x86_64-linux-gnu.tar.gz";
-    hash = "sha256-niXNWbkXjd35col6dS66HdxFurXfJw/Xb2c5njukxcg=";
+    hash = "sha256-AUHSls4BOX20PVKzDAp3RqpeRDwgbgYzz6CRvRN+kdk=";
     stripRoot = true;
   };
 
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
     isClang = true;
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description =
       "Accelerate Complex C++ Applications on Heterogeneous Compute Systems using Open Standards";
     homepage = "https://www.codeplay.com/products/computesuite/computecpp";
diff --git a/nixpkgs/pkgs/development/compilers/copper/default.nix b/nixpkgs/pkgs/development/compilers/copper/default.nix
index 67bc786e669c..dd6af73547af 100644
--- a/nixpkgs/pkgs/development/compilers/copper/default.nix
+++ b/nixpkgs/pkgs/development/compilers/copper/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , libffi
 }:
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   installPhase = ''
     make BACKEND=elf64 install prefix=$out
   '';
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Simple imperative language, statically typed with type inference and genericity";
     homepage = "https://tibleiz.net/copper/";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/compilers/coreclr/default.nix b/nixpkgs/pkgs/development/compilers/coreclr/default.nix
index 2a44279209c1..f38a38059624 100644
--- a/nixpkgs/pkgs/development/compilers/coreclr/default.nix
+++ b/nixpkgs/pkgs/development/compilers/coreclr/default.nix
@@ -1,4 +1,4 @@
-{ config, stdenv
+{ config, lib, stdenv
 , fetchFromGitHub
 , fetchpatch
 , which
@@ -90,7 +90,7 @@ stdenv.mkDerivation rec {
     runHook postInstall
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/dotnet/core/";
     description = ".NET is a general purpose development platform";
     platforms = [ "x86_64-linux" ];
diff --git a/nixpkgs/pkgs/development/compilers/crystal/build-package.nix b/nixpkgs/pkgs/development/compilers/crystal/build-package.nix
index bcac4eeb9c46..67c8128f6b5d 100644
--- a/nixpkgs/pkgs/development/compilers/crystal/build-package.nix
+++ b/nixpkgs/pkgs/development/compilers/crystal/build-package.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, crystal, shards, git, pkgconfig, which, linkFarm, fetchFromGitHub, installShellFiles }:
+{ stdenv, lib, crystal, shards, git, pkg-config, which, linkFarm, fetchFromGitHub, installShellFiles }:
 
 {
   # Some projects do not include a lock file, so you can pass one
@@ -61,12 +61,12 @@ stdenv.mkDerivation (mkDerivationArgs // {
   buildInputs = args.buildInputs or [ ] ++ [ crystal ]
     ++ lib.optional (format != "crystal") shards;
 
-  nativeBuildInputs = args.nativeBuildInputs or [ ] ++ [ git installShellFiles pkgconfig which ];
+  nativeBuildInputs = args.nativeBuildInputs or [ ] ++ [ git installShellFiles pkg-config which ];
 
   buildPhase = args.buildPhase or (lib.concatStringsSep "\n" ([
     "runHook preBuild"
   ] ++ lib.optional (format == "make")
-    ''make ''${buildTargets:-build} $makeFlags''
+    "make \${buildTargets:-build} $makeFlags"
   ++ lib.optionals (format == "crystal") (lib.mapAttrsToList
     (bin: attrs: ''
       crystal ${lib.escapeShellArgs ([
@@ -84,14 +84,14 @@ stdenv.mkDerivation (mkDerivationArgs // {
   installPhase = args.installPhase or (lib.concatStringsSep "\n" ([
     "runHook preInstall"
   ] ++ lib.optional (format == "make")
-    ''make ''${installTargets:-install} $installFlags''
+    "make \${installTargets:-install} $installFlags"
   ++ lib.optionals (format == "crystal") (map
     (bin: ''
       install -Dm555 ${lib.escapeShellArgs [ bin "${placeholder "out"}/bin/${bin}" ]}
     '')
     (lib.attrNames crystalBinaries))
   ++ lib.optional (format == "shards")
-    ''install -Dm555 bin/* -t $out/bin''
+    "install -Dm555 bin/* -t $out/bin"
   ++ [
     ''
       for f in README* *.md LICENSE; do
@@ -111,9 +111,9 @@ stdenv.mkDerivation (mkDerivationArgs // {
   checkPhase = args.checkPhase or (lib.concatStringsSep "\n" ([
     "runHook preCheck"
   ] ++ lib.optional (format == "make")
-    ''make ''${checkTarget:-test} $checkFlags''
+    "make \${checkTarget:-test} $checkFlags"
   ++ lib.optional (format != "make")
-    ''crystal ''${checkTarget:-spec} $checkFlags''
+    "crystal \${checkTarget:-spec} $checkFlags"
   ++ [ "runHook postCheck" ]));
 
   doInstallCheck = args.doInstallCheck or true;
diff --git a/nixpkgs/pkgs/development/compilers/crystal/default.nix b/nixpkgs/pkgs/development/compilers/crystal/default.nix
index fa8198fabad9..489e9d28cbcd 100644
--- a/nixpkgs/pkgs/development/compilers/crystal/default.nix
+++ b/nixpkgs/pkgs/development/compilers/crystal/default.nix
@@ -18,7 +18,7 @@
 , makeWrapper
 , openssl
 , pcre
-, pkgconfig
+, pkg-config
 , readline
 , tzdata
 , which
@@ -63,7 +63,7 @@ let
   commonBuildInputs = extraBuildInputs: [
     boehmgc libatomic_ops pcre libevent libyaml zlib libxml2 openssl
   ] ++ extraBuildInputs
-    ++ stdenv.lib.optionals stdenv.isDarwin [ libiconv ];
+    ++ lib.optionals stdenv.isDarwin [ libiconv ];
 
   generic = (
     { version
@@ -134,7 +134,7 @@ let
 
         buildInputs = commonBuildInputs extraBuildInputs;
 
-        nativeBuildInputs = [ binary makeWrapper which pkgconfig llvmPackages.llvm ];
+        nativeBuildInputs = [ binary makeWrapper which pkg-config llvmPackages.llvm ];
 
         makeFlags = [
           "CRYSTAL_CONFIG_VERSION=${version}"
@@ -158,7 +158,7 @@ let
 
           install -Dm755 .build/crystal $bin/bin/crystal
           wrapProgram $bin/bin/crystal \
-            --suffix PATH : ${lib.makeBinPath [ pkgconfig llvmPackages.clang which ]} \
+            --suffix PATH : ${lib.makeBinPath [ pkg-config llvmPackages.clang which ]} \
             --suffix CRYSTAL_PATH : lib:$lib/crystal \
             --suffix CRYSTAL_LIBRARY_PATH : ${
               lib.makeLibraryPath (commonBuildInputs extraBuildInputs)
diff --git a/nixpkgs/pkgs/development/compilers/cudatoolkit/common.nix b/nixpkgs/pkgs/development/compilers/cudatoolkit/common.nix
index 92a684a6fbf8..c18eb9d534a2 100644
--- a/nixpkgs/pkgs/development/compilers/cudatoolkit/common.nix
+++ b/nixpkgs/pkgs/development/compilers/cudatoolkit/common.nix
@@ -61,7 +61,7 @@ stdenv.mkDerivation rec {
     gtk2 glib fontconfig freetype unixODBC alsaLib
   ];
 
-  rpath = "${stdenv.lib.makeLibraryPath runtimeDependencies}:${stdenv.cc.cc.lib}/lib64";
+  rpath = "${lib.makeLibraryPath runtimeDependencies}:${stdenv.cc.cc.lib}/lib64";
 
   unpackPhase = ''
     sh $src --keep --noexec
@@ -232,7 +232,7 @@ stdenv.mkDerivation rec {
     majorVersion = lib.versions.majorMinor version;
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A compiler for NVIDIA GPUs, math libraries, and tools";
     homepage = "https://developer.nvidia.com/cuda-toolkit";
     platforms = [ "x86_64-linux" ];
diff --git a/nixpkgs/pkgs/development/compilers/dale/default.nix b/nixpkgs/pkgs/development/compilers/dale/default.nix
index cbe4e7ec9260..addd7997d366 100644
--- a/nixpkgs/pkgs/development/compilers/dale/default.nix
+++ b/nixpkgs/pkgs/development/compilers/dale/default.nix
@@ -1,18 +1,16 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
-, pkgconfig
+, pkg-config
 , libffi
 , llvm_6
 , doCheck ? false
 , perl
 }:
 
-let version = "20181024";
-
-in stdenv.mkDerivation {
+stdenv.mkDerivation {
   pname = "dale";
-  inherit version;
+  version = "20181024";
 
   src = fetchFromGitHub {
     owner = "tomhrr";
@@ -21,17 +19,15 @@ in stdenv.mkDerivation {
     sha256 = "0v4ajrzrqvf279kd7wsd9flrpsav57lzxlwwimk9vnfwh7xpzf9v";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ cmake libffi llvm_6 ]
-             ++ stdenv.lib.optional doCheck perl;
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ libffi llvm_6 ];
 
   inherit doCheck;
+  checkInputs = [ perl ];
 
   checkTarget = "tests";
 
-  enableParallelBuilding = true;
-
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Lisp-flavoured C";
     longDescription = ''
       Dale is a system (no GC) programming language that uses
diff --git a/nixpkgs/pkgs/development/compilers/dasm/default.nix b/nixpkgs/pkgs/development/compilers/dasm/default.nix
index 627ac36329a0..7f57f47f2ed6 100644
--- a/nixpkgs/pkgs/development/compilers/dasm/default.nix
+++ b/nixpkgs/pkgs/development/compilers/dasm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "dasm";
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
   checkTarget = "test";
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Assembler for 6502 and other 8-bit microprocessors";
     homepage = "https://dasm-assembler.github.io";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/compilers/dev86/default.nix b/nixpkgs/pkgs/development/compilers/dev86/default.nix
index 88b46561241a..cea9ea37b4e5 100644
--- a/nixpkgs/pkgs/development/compilers/dev86/default.nix
+++ b/nixpkgs/pkgs/development/compilers/dev86/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "dev86";
@@ -16,6 +16,6 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Linux 8086 development environment";
     homepage = "http://v3.sk/~lkundrak/dev86/";
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/dmd/default.nix b/nixpkgs/pkgs/development/compilers/dmd/default.nix
index 4bfd6298c8f7..074646f5f416 100644
--- a/nixpkgs/pkgs/development/compilers/dmd/default.nix
+++ b/nixpkgs/pkgs/development/compilers/dmd/default.nix
@@ -16,7 +16,7 @@ let
       name = "dmd.conf";
       text = (lib.generators.toINI {} {
         Environment = {
-          DFLAGS = ''-I@out@/include/dmd -L-L@out@/lib -fPIC ${stdenv.lib.optionalString (!targetPackages.stdenv.cc.isClang) "-L--export-dynamic"}'';
+          DFLAGS = ''-I@out@/include/dmd -L-L@out@/lib -fPIC ${lib.optionalString (!targetPackages.stdenv.cc.isClang) "-L--export-dynamic"}'';
         };
       });
   };
@@ -77,16 +77,16 @@ stdenv.mkDerivation rec {
   postPatch = ''
       substituteInPlace dmd/test/dshell/test6952.d --replace "/usr/bin/env bash" "${bash}/bin/bash"
   ''
-  + stdenv.lib.optionalString stdenv.hostPlatform.isLinux ''
+  + lib.optionalString stdenv.hostPlatform.isLinux ''
       substituteInPlace phobos/std/socket.d --replace "assert(ih.addrList[0] == 0x7F_00_00_01);" ""
   ''
-  + stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
+  + lib.optionalString stdenv.hostPlatform.isDarwin ''
       substituteInPlace phobos/std/socket.d --replace "foreach (name; names)" "names = []; foreach (name; names)"
   '';
 
   nativeBuildInputs = [ makeWrapper unzip which gdb git ]
 
-  ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [
+  ++ lib.optional stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [
     Foundation
   ]);
 
@@ -163,7 +163,7 @@ stdenv.mkDerivation rec {
       substitute ${dmdConfFile} "$out/bin/dmd.conf" --subst-var out
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Official reference compiler for the D language";
     homepage = "http://dlang.org/";
     # Everything is now Boost licensed, even the backend.
diff --git a/nixpkgs/pkgs/development/compilers/dotnet/build-dotnet.nix b/nixpkgs/pkgs/development/compilers/dotnet/build-dotnet.nix
index 1162a75d0de2..56880826a19c 100644
--- a/nixpkgs/pkgs/development/compilers/dotnet/build-dotnet.nix
+++ b/nixpkgs/pkgs/development/compilers/dotnet/build-dotnet.nix
@@ -4,7 +4,7 @@
 }:
 
 assert builtins.elem type [ "aspnetcore" "netcore" "sdk"];
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , libunwind
 , openssl
@@ -41,7 +41,7 @@ let
 in stdenv.mkDerivation rec {
   inherit pname version;
 
-  rpath = stdenv.lib.makeLibraryPath [
+  rpath = lib.makeLibraryPath [
     curl
     icu
     libunwind
@@ -70,7 +70,7 @@ in stdenv.mkDerivation rec {
     runHook postInstall
   '';
 
-  postFixup = stdenv.lib.optionalString stdenv.isLinux ''
+  postFixup = lib.optionalString stdenv.isLinux ''
     patchelf --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" $out/dotnet
     patchelf --set-rpath "${rpath}" $out/dotnet
     find $out -type f -name "*.so" -exec patchelf --set-rpath '$ORIGIN:${rpath}' {} \;
@@ -82,7 +82,7 @@ in stdenv.mkDerivation rec {
     $out/bin/dotnet --info
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://dotnet.github.io/";
     description = builtins.getAttr type descriptions;
     platforms = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ];
diff --git a/nixpkgs/pkgs/development/compilers/dtc/default.nix b/nixpkgs/pkgs/development/compilers/dtc/default.nix
index 0a694e29ee83..c5d33590daad 100644
--- a/nixpkgs/pkgs/development/compilers/dtc/default.nix
+++ b/nixpkgs/pkgs/development/compilers/dtc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchgit, flex, bison, pkgconfig, which
+{ stdenv, lib, fetchgit, flex, bison, pkg-config, which
 , pythonSupport ? false, python, swig
 }:
 
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "0li992wwd7kgy71bikanqky49y4hq3p3vx35p2hvyxy1k0wfy7i8";
   };
 
-  nativeBuildInputs = [ flex bison pkgconfig which ] ++ lib.optionals pythonSupport [ python swig ];
+  nativeBuildInputs = [ flex bison pkg-config which ] ++ lib.optionals pythonSupport [ python swig ];
 
   postPatch = ''
     patchShebangs pylibfdt/
diff --git a/nixpkgs/pkgs/development/compilers/ecl/16.1.2.nix b/nixpkgs/pkgs/development/compilers/ecl/16.1.2.nix
index a7b2aa6be748..0789addb337b 100644
--- a/nixpkgs/pkgs/development/compilers/ecl/16.1.2.nix
+++ b/nixpkgs/pkgs/development/compilers/ecl/16.1.2.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch
+{ lib, stdenv, fetchurl, fetchpatch
 , libtool, autoconf, automake
 , gmp, mpfr, libffi, makeWrapper
 , noUnicode ? false
@@ -23,7 +23,7 @@ let
   ];
   propagatedBuildInputs = [
     libffi gmp mpfr gcc
-  ] ++ stdenv.lib.optionals useBoehmgc [
+  ] ++ lib.optionals useBoehmgc [
     # replaces ecl's own gc which other packages can depend on, thus propagated
     boehmgc
   ];
@@ -42,7 +42,7 @@ stdenv.mkDerivation {
     "--with-libffi-prefix=${libffi.dev}"
     ]
     ++
-    (stdenv.lib.optional (! noUnicode)
+    (lib.optional (! noUnicode)
       "--enable-unicode")
     ;
 
@@ -77,8 +77,8 @@ stdenv.mkDerivation {
   meta = {
     inherit (s) version;
     description = "Lisp implementation aiming to be small, fast and easy to embed";
-    license = stdenv.lib.licenses.mit ;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.mit ;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/ecl/default.nix b/nixpkgs/pkgs/development/compilers/ecl/default.nix
index 40f3e38e506c..0b4ea9b83890 100644
--- a/nixpkgs/pkgs/development/compilers/ecl/default.nix
+++ b/nixpkgs/pkgs/development/compilers/ecl/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl
+{lib, stdenv, fetchurl
 , libtool, autoconf, automake
 , texinfo
 , gmp, mpfr, libffi, makeWrapper
@@ -22,7 +22,7 @@ let
   propagatedBuildInputs = [
     libffi gmp mpfr gcc
     # replaces ecl's own gc which other packages can depend on, thus propagated
-  ] ++ stdenv.lib.optionals useBoehmgc [
+  ] ++ lib.optionals useBoehmgc [
     # replaces ecl's own gc which other packages can depend on, thus propagated
     boehmgc
   ];
@@ -76,7 +76,7 @@ stdenv.mkDerivation {
     "--with-libffi-prefix=${libffi.dev}"
     ]
     ++
-    (stdenv.lib.optional (! noUnicode)
+    (lib.optional (! noUnicode)
       "--enable-unicode")
     ;
 
@@ -94,8 +94,8 @@ stdenv.mkDerivation {
     inherit (s) version;
     description = "Lisp implementation aiming to be small, fast and easy to embed";
     homepage = "https://common-lisp.net/project/ecl/";
-    license = stdenv.lib.licenses.mit ;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.mit ;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/eli/default.nix b/nixpkgs/pkgs/development/compilers/eli/default.nix
index 61e5fd70a7c6..8920e34b6ee1 100644
--- a/nixpkgs/pkgs/development/compilers/eli/default.nix
+++ b/nixpkgs/pkgs/development/compilers/eli/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , symlinkJoin
 , makeWrapper
@@ -84,8 +84,8 @@ stdenv.mkDerivation rec {
       arbitrary special cases. Output is the C subset of C++.
     '';
     homepage = "http://eli-project.sourceforge.net/";
-    license = stdenv.lib.licenses.gpl2;
-    maintainers = with stdenv.lib.maintainers; [ timokau ];
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.gpl2;
+    maintainers = with lib.maintainers; [ timokau ];
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/elm/default.nix b/nixpkgs/pkgs/development/compilers/elm/default.nix
index 0dbf1a3306f3..7ee9e6e5d617 100644
--- a/nixpkgs/pkgs/development/compilers/elm/default.nix
+++ b/nixpkgs/pkgs/development/compilers/elm/default.nix
@@ -2,12 +2,13 @@
 , 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; };
 
   hsPkgs = haskell.packages.ghc883.override {
-    overrides = self: super: with haskell.lib;
+    overrides = self: super: with haskell.lib; with lib;
       let elmPkgs = rec {
             elm = overrideCabal (self.callPackage ./packages/elm.nix { }) (drv: {
               # sadly with parallelism most of the time breaks compilation
@@ -23,6 +24,11 @@ let
                 wrapProgram $out/bin/elm \
                   --prefix PATH ':' ${lib.makeBinPath [ nodejs ]}
               '';
+
+              description = "A delightful language for reliable webapps";
+              homepage = "https://elm-lang.org/";
+              license = licenses.bsd3;
+              maintainers = with maintainers; [ domenkozar turbomack ];
             });
 
             /*
@@ -31,6 +37,11 @@ let
             */
             elm-format = justStaticExecutables (overrideCabal (self.callPackage ./packages/elm-format.nix {}) (drv: {
               jailbreak = true;
+
+              description = "Formats Elm source code according to a standard set of rules based on the official Elm Style Guide";
+              homepage = "https://github.com/avh4/elm-format";
+              license = licenses.bsd3;
+              maintainers = with maintainers; [ turbomack ];
             }));
 
             elmi-to-json = justStaticExecutables (overrideCabal (self.callPackage ./packages/elmi-to-json.nix {}) (drv: {
@@ -39,6 +50,11 @@ let
                 hpack
               '';
               jailbreak = true;
+
+              description = "Tool that reads .elmi files (Elm interface file) generated by the elm compiler";
+              homepage = "https://github.com/stoeffel/elmi-to-json";
+              license = licenses.bsd3;
+              maintainers = [ maintainers.turbomack ];
             }));
 
             elm-instrument = justStaticExecutables (overrideCabal (self.callPackage ./packages/elm-instrument.nix {}) (drv: {
@@ -48,6 +64,11 @@ let
               jailbreak = true;
               # Tests are failing because of missing instances for Eq and Show type classes
               doCheck = false;
+
+              description = "Instrument Elm code as a preprocessing step for elm-coverage";
+              homepage = "https://github.com/zwilias/elm-instrument";
+              license = licenses.bsd3;
+              maintainers = [ maintainers.turbomack ];
             }));
 
             inherit fetchElmDeps;
@@ -74,9 +95,17 @@ let
     inherit (hsPkgs.elmPkgs) elm;
   };
 
-  elmRustPackages = {
+  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";
+        homepage = "https://github.com/zwilias/elm-json";
+        license = licenses.mit;
+        maintainers = [ maintainers.turbomack ];
+        platforms = platforms.linux;
+      };
     };
   };
 
@@ -89,10 +118,24 @@ let
     in with hsPkgs.elmPkgs; {
 
       elm-test = patchBinwrap [elmi-to-json]
-        nodePkgs.elm-test;
+        nodePkgs.elm-test // {
+          meta = with lib; {
+            description = "Runs elm-test suites from Node.js";
+            homepage = "https://github.com/rtfeldman/node-test-runner";
+            license = licenses.bsd3;
+            maintainers = [ maintainers.turbomack ];
+          };
+        };
 
       elm-verify-examples = patchBinwrap [elmi-to-json]
-        nodePkgs.elm-verify-examples;
+        nodePkgs.elm-verify-examples // {
+          meta = with lib; {
+            description = "Verify examples in your docs";
+            homepage = "https://github.com/stoeffel/elm-verify-examples";
+            license = licenses.bsd3;
+            maintainers = [ maintainers.turbomack ];
+          };
+        };
 
       elm-coverage =
         let patched = patchNpmElm (patchBinwrap [elmi-to-json] nodePkgs.elm-coverage);
@@ -111,17 +154,51 @@ let
             mkdir -p unpacked_bin
             ln -sf ${elm-instrument}/bin/elm-instrument unpacked_bin/elm-instrument
           '';
+          meta = with lib; {
+            description = "Work in progress - Code coverage tooling for Elm";
+            homepage = "https://github.com/zwilias/elm-coverage";
+            license = licenses.bsd3;
+            maintainers = [ maintainers.turbomack ];
+          };
         });
 
       create-elm-app = patchNpmElm (patchBinwrap [elmi-to-json]
-        nodePkgs.create-elm-app);
+        nodePkgs.create-elm-app) // {
+          meta = with lib; {
+            description = "Create Elm apps with no build configuration";
+            homepage = "https://github.com/halfzebra/create-elm-app";
+            license = licenses.mit;
+            maintainers = [ maintainers.turbomack ];
+          };
+        };
 
       elm-review = patchBinwrap [elmRustPackages.elm-json]
-        nodePkgs.elm-review;
+        nodePkgs.elm-review // {
+          meta = with lib; {
+            description = "Analyzes Elm projects, to help find mistakes before your users find them";
+            homepage = "https://package.elm-lang.org/packages/jfmengels/elm-review/${nodePkgs.elm-review.version}";
+            license = licenses.bsd3;
+            maintainers = [ maintainers.turbomack ];
+          };
+        };
 
-      elm-language-server = nodePkgs."@elm-tooling/elm-language-server";
+      elm-language-server = nodePkgs."@elm-tooling/elm-language-server" // {
+        meta = with lib; {
+          description = "Language server implementation for Elm";
+          homepage = "https://github.com/elm-tooling/elm-language-server";
+          license = licenses.mit;
+          maintainers = [ maintainers.turbomack ];
+        };
+      };
 
-      elm-optimize-level-2 = nodePkgs."elm-optimize-level-2";
+      elm-optimize-level-2 = nodePkgs."elm-optimize-level-2" // {
+        meta = with lib; {
+          description = "A second level of optimization for the Javascript that the Elm Compiler produces";
+          homepage = "https://github.com/mdgriffith/elm-optimize-level-2";
+          license = licenses.bsd3;
+          maintainers = [ maintainers.turbomack ];
+        };
+      };
 
       inherit (nodePkgs) elm-doc-preview elm-live elm-upgrade elm-xref elm-analyse;
     };
diff --git a/nixpkgs/pkgs/development/compilers/elm/packages/elm-format.nix b/nixpkgs/pkgs/development/compilers/elm/packages/elm-format.nix
index ff944cc4b647..71386e00ef11 100644
--- a/nixpkgs/pkgs/development/compilers/elm/packages/elm-format.nix
+++ b/nixpkgs/pkgs/development/compilers/elm/packages/elm-format.nix
@@ -1,7 +1,7 @@
 { mkDerivation, fetchgit, ansi-terminal, ansi-wl-pprint, array, base, binary
 , bytestring, cmark, containers, directory, filepath, free, HUnit
 , indents, json, mtl, optparse-applicative, parsec, process
-, QuickCheck, quickcheck-io, split, stdenv, tasty, tasty-golden
+, QuickCheck, quickcheck-io, split, lib, stdenv, tasty, tasty-golden
 , tasty-hunit, tasty-quickcheck, text
 }:
 mkDerivation {
@@ -36,5 +36,5 @@ mkDerivation {
   doHaddock = false;
   homepage = "https://elm-lang.org";
   description = "A source code formatter for Elm";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/nixpkgs/pkgs/development/compilers/elm/packages/elm-instrument.nix b/nixpkgs/pkgs/development/compilers/elm/packages/elm-instrument.nix
index 4d7efcf1083b..cd13eb4de4f1 100644
--- a/nixpkgs/pkgs/development/compilers/elm/packages/elm-instrument.nix
+++ b/nixpkgs/pkgs/development/compilers/elm/packages/elm-instrument.nix
@@ -2,7 +2,7 @@
 , bytestring, Cabal, cmark, containers, directory, elm-format
 , fetchgit, filepath, free, HUnit, indents, json, mtl
 , optparse-applicative, parsec, process, QuickCheck, quickcheck-io
-, split, stdenv, tasty, tasty-golden, tasty-hunit, tasty-quickcheck
+, split, lib, stdenv, tasty, tasty-golden, tasty-hunit, tasty-quickcheck
 , text
 }:
 mkDerivation {
@@ -30,5 +30,5 @@ mkDerivation {
   ];
   homepage = "https://elm-lang.org";
   description = "Instrumentation library for Elm";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/nixpkgs/pkgs/development/compilers/elm/packages/elm-json.nix b/nixpkgs/pkgs/development/compilers/elm/packages/elm-json.nix
index 44d300d254b0..810c1a91a00b 100644
--- a/nixpkgs/pkgs/development/compilers/elm/packages/elm-json.nix
+++ b/nixpkgs/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,18 +12,10 @@ rustPlatform.buildRustPackage rec {
 
   nativeBuildInputs = [ pkg-config ];
 
-  buildInputs = [ openssl ];
+  buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [ Security ];
 
   cargoSha256 = "0ylniriq073kpiykamkn9mxdaa6kyiza4pvf7gnfq2h1dvbqa6z7";
 
   # Tests perform networking and therefore can't work in sandbox
   doCheck = false;
-
-  meta = with stdenv.lib; {
-    description = "Install, upgrade and uninstall Elm dependencies";
-    homepage = "https://github.com/zwilias/elm-json";
-    license = licenses.mit;
-    maintainers = [ maintainers.turbomack ];
-    platforms = platforms.linux;
-  };
 }
diff --git a/nixpkgs/pkgs/development/compilers/elm/packages/elm.nix b/nixpkgs/pkgs/development/compilers/elm/packages/elm.nix
index 644a53fd6190..edb2ed6ed7a2 100644
--- a/nixpkgs/pkgs/development/compilers/elm/packages/elm.nix
+++ b/nixpkgs/pkgs/development/compilers/elm/packages/elm.nix
@@ -3,7 +3,7 @@
 , file-embed, filelock, filepath, ghc-prim, haskeline, HTTP
 , http-client, http-client-tls, http-types, language-glsl, mtl
 , network, parsec, process, raw-strings-qq, scientific, SHA
-, snap-core, snap-server, stdenv, template-haskell, time
+, snap-core, snap-server, lib, stdenv, template-haskell, time
 , unordered-containers, utf8-string, vector, zip-archive
 }:
 mkDerivation {
@@ -27,5 +27,5 @@ mkDerivation {
   ];
   homepage = "https://elm-lang.org";
   description = "The `elm` command line interface";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/nixpkgs/pkgs/development/compilers/elm/packages/elmi-to-json.nix b/nixpkgs/pkgs/development/compilers/elm/packages/elmi-to-json.nix
index eaed18c5297b..6788fce6a990 100644
--- a/nixpkgs/pkgs/development/compilers/elm/packages/elmi-to-json.nix
+++ b/nixpkgs/pkgs/development/compilers/elm/packages/elmi-to-json.nix
@@ -1,6 +1,6 @@
 { mkDerivation, aeson, base, binary, bytestring, containers
 , directory, fetchgit, filepath, ghc-prim, hpack
-, optparse-applicative, stdenv, text, unliftio
+, optparse-applicative, lib, stdenv, text, unliftio
 , unordered-containers
 }:
 mkDerivation {
@@ -23,5 +23,5 @@ mkDerivation {
   testHaskellDepends = [ base ];
   prePatch = "hpack";
   homepage = "https://github.com/stoeffel/elmi-to-json#readme";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/nixpkgs/pkgs/development/compilers/elm/packages/indents.nix b/nixpkgs/pkgs/development/compilers/elm/packages/indents.nix
index 6bf7fa7890e8..80f3c08d9e33 100644
--- a/nixpkgs/pkgs/development/compilers/elm/packages/indents.nix
+++ b/nixpkgs/pkgs/development/compilers/elm/packages/indents.nix
@@ -1,4 +1,4 @@
-{ mkDerivation, base, concatenative, mtl, parsec, stdenv }:
+{ mkDerivation, base, concatenative, mtl, parsec, lib, stdenv }:
 mkDerivation {
   pname = "indents";
   version = "0.3.3";
@@ -7,5 +7,5 @@ mkDerivation {
   doCheck = false;
   homepage = "http://patch-tag.com/r/salazar/indents";
   description = "indentation sensitive parser-combinators for parsec";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/nixpkgs/pkgs/development/compilers/elm/packages/node-composition.nix b/nixpkgs/pkgs/development/compilers/elm/packages/node-composition.nix
index c970861a86f0..c43e7cc7f25c 100644
--- a/nixpkgs/pkgs/development/compilers/elm/packages/node-composition.nix
+++ b/nixpkgs/pkgs/development/compilers/elm/packages/node-composition.nix
@@ -14,4 +14,4 @@ in
 import ./node-packages.nix {
   inherit (pkgs) fetchurl fetchgit;
   inherit nodeEnv;
-}
\ No newline at end of file
+}
diff --git a/nixpkgs/pkgs/development/compilers/elm/packages/node-packages.nix b/nixpkgs/pkgs/development/compilers/elm/packages/node-packages.nix
index c81d2acdf7f1..015958d1239e 100644
--- a/nixpkgs/pkgs/development/compilers/elm/packages/node-packages.nix
+++ b/nixpkgs/pkgs/development/compilers/elm/packages/node-packages.nix
@@ -15513,4 +15513,4 @@ in
     bypassCache = true;
     reconstructLock = true;
   };
-}
\ No newline at end of file
+}
diff --git a/nixpkgs/pkgs/development/compilers/emscripten/default.nix b/nixpkgs/pkgs/development/compilers/emscripten/default.nix
index ac13f9559305..648ec156abea 100644
--- a/nixpkgs/pkgs/development/compilers/emscripten/default.nix
+++ b/nixpkgs/pkgs/development/compilers/emscripten/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, python3, nodejs, closurecompiler
+{ lib, stdenv, fetchFromGitHub, python3, nodejs, closurecompiler
 , jre, binaryen
 , llvmPackages_11
 , symlinkJoin, makeWrapper
@@ -101,7 +101,7 @@ stdenv.mkDerivation rec {
     popd
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/emscripten-core/emscripten";
     description = "An LLVM-to-JavaScript Compiler";
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/compilers/eql/default.nix b/nixpkgs/pkgs/development/compilers/eql/default.nix
index ce42c1021154..a3fefbc1f480 100644
--- a/nixpkgs/pkgs/development/compilers/eql/default.nix
+++ b/nixpkgs/pkgs/development/compilers/eql/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, qt4, ecl, xorgserver, xkbcomp, xkeyboard_config }:
+{ lib, stdenv, fetchgit, qt4, ecl, xorgserver, xkbcomp, xkeyboard_config }:
 
 stdenv.mkDerivation rec {
   version = src.rev;
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
     ln -s $out/lib/eql/build-dir/libeql*.so* $out/lib
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Embedded Qt Lisp (ECL+Qt)";
     maintainers = with maintainers; [ raskin ];
     platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/development/compilers/factor-lang/default.nix b/nixpkgs/pkgs/development/compilers/factor-lang/default.nix
index 2c7edb9c1703..fc5f478177cb 100644
--- a/nixpkgs/pkgs/development/compilers/factor-lang/default.nix
+++ b/nixpkgs/pkgs/development/compilers/factor-lang/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, glib, git,
-  rlwrap, curl, pkgconfig, perl, makeWrapper, tzdata, ncurses,
+{ lib, stdenv, fetchurl, glib, git,
+  rlwrap, curl, pkg-config, perl, makeWrapper, tzdata, ncurses,
   pango, cairo, gtk2, gdk-pixbuf, gtkglext,
   mesa, xorg, openssl, unzip }:
 
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
     ./fuel-dir.patch
   ];
 
-  buildInputs = with xorg; [ git rlwrap curl pkgconfig perl makeWrapper
+  buildInputs = with xorg; [ git rlwrap curl pkg-config perl makeWrapper
     libX11 pango cairo gtk2 gdk-pixbuf gtkglext
     mesa libXmu libXt libICE libSM openssl unzip ];
 
@@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
     # out of known libraries. The side effect is that find-lib
     # will work only on the known libraries. There does not seem
     # to be a generic solution here.
-    find $(echo ${stdenv.lib.makeLibraryPath (with xorg; [
+    find $(echo ${lib.makeLibraryPath (with xorg; [
         glib libX11 pango cairo gtk2 gdk-pixbuf gtkglext
         mesa libXmu libXt libICE libSM ])} | sed -e 's#:# #g') -name \*.so.\* > $TMPDIR/so.lst
 
@@ -68,7 +68,7 @@ stdenv.mkDerivation rec {
 
     cp ./factor $out/bin
     wrapProgram $out/bin/factor --prefix LD_LIBRARY_PATH : \
-      "${stdenv.lib.makeLibraryPath (with xorg; [ glib
+      "${lib.makeLibraryPath (with xorg; [ glib
         libX11 pango cairo gtk2 gdk-pixbuf gtkglext
         mesa libXmu libXt libICE libSM openssl])}"
 
@@ -93,7 +93,7 @@ stdenv.mkDerivation rec {
     cp misc/fuel/*.el $out/share/emacs/site-lisp/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://factorcode.org";
     license = licenses.bsd2;
     description = "A concatenative, stack-based programming language";
diff --git a/nixpkgs/pkgs/development/compilers/fasmg/default.nix b/nixpkgs/pkgs/development/compilers/fasmg/default.nix
index 5233e248c074..611a2bdb8f14 100644
--- a/nixpkgs/pkgs/development/compilers/fasmg/default.nix
+++ b/nixpkgs/pkgs/development/compilers/fasmg/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchzip
 }:
 
@@ -48,7 +48,7 @@ stdenv.mkDerivation rec {
     cp docs/*.txt $doc/share/doc/fasmg
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "x86(-64) macro assembler to binary, MZ, PE, COFF, and ELF";
     homepage = "https://flatassembler.net";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/compilers/flasm/default.nix b/nixpkgs/pkgs/development/compilers/flasm/default.nix
index 9393d4fc59f4..4257feb87b99 100644
--- a/nixpkgs/pkgs/development/compilers/flasm/default.nix
+++ b/nixpkgs/pkgs/development/compilers/flasm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchzip, unzip, bison, flex, gperf, zlib }:
+{ lib, stdenv, fetchzip, unzip, bison, flex, gperf, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "flasm";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
     install -Dm755 flasm -t $out/bin
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Assembler and disassembler for Flash (SWF) bytecode";
     homepage = "http://flasm.sourceforge.net/";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/compilers/flutter/default.nix b/nixpkgs/pkgs/development/compilers/flutter/default.nix
index baab0583fb0c..3eea7f596b6b 100644
--- a/nixpkgs/pkgs/development/compilers/flutter/default.nix
+++ b/nixpkgs/pkgs/development/compilers/flutter/default.nix
@@ -1,5 +1,4 @@
 { callPackage, dart }:
-
 let
   dart_stable = dart.override { version = "2.10.0"; };
   dart_beta = dart.override { version = "2.10.0"; };
@@ -8,7 +7,8 @@ let
   getPatches = dir:
     let files = builtins.attrNames (builtins.readDir dir);
     in map (f: dir + ("/" + f)) files;
-in {
+in
+{
   mkFlutter = mkFlutter;
   stable = mkFlutter rec {
     pname = "flutter";
diff --git a/nixpkgs/pkgs/development/compilers/flutter/flutter.nix b/nixpkgs/pkgs/development/compilers/flutter/flutter.nix
index 7fda2d616f3e..a7ec87322507 100644
--- a/nixpkgs/pkgs/development/compilers/flutter/flutter.nix
+++ b/nixpkgs/pkgs/development/compilers/flutter/flutter.nix
@@ -1,10 +1,36 @@
-{ channel, pname, version, sha256Hash, patches, dart
-, filename ? "flutter_linux_${version}-${channel}.tar.xz"}:
-
-{ bash, buildFHSUserEnv, cacert, coreutils, git, makeWrapper, runCommand, stdenv
-, fetchurl, alsaLib, dbus, expat, libpulseaudio, libuuid, libX11, libxcb
-, libXcomposite, libXcursor, libXdamage, libXfixes, libGL, nspr, nss, systemd }:
-
+{ channel
+, pname
+, version
+, sha256Hash
+, patches
+, dart
+, filename ? "flutter_linux_${version}-${channel}.tar.xz"
+}:
+
+{ bash
+, buildFHSUserEnv
+, cacert
+, coreutils
+, git
+, runCommand
+, lib, stdenv
+, fetchurl
+, alsaLib
+, dbus
+, expat
+, libpulseaudio
+, libuuid
+, libX11
+, libxcb
+, libXcomposite
+, libXcursor
+, libXdamage
+, libXfixes
+, libGL
+, nspr
+, nss
+, systemd
+}:
 let
   drvName = "flutter-${channel}-${version}";
   flutter = stdenv.mkDerivation {
@@ -16,7 +42,7 @@ let
       sha256 = sha256Hash;
     };
 
-    buildInputs = [ makeWrapper git ];
+    buildInputs = [ git ];
 
     inherit patches;
 
@@ -31,28 +57,27 @@ let
       SNAPSHOT_PATH="$FLUTTER_ROOT/bin/cache/flutter_tools.snapshot"
       STAMP_PATH="$FLUTTER_ROOT/bin/cache/flutter_tools.stamp"
       SCRIPT_PATH="$FLUTTER_TOOLS_DIR/bin/flutter_tools.dart"
-      DART_SDK_PATH="$FLUTTER_ROOT/bin/cache/dart-sdk"
-
-      DART="$DART_SDK_PATH/bin/dart"
-      PUB="$DART_SDK_PATH/bin/pub"
+      DART_SDK_PATH="${dart}"
 
       HOME=../.. # required for pub upgrade --offline, ~/.pub-cache
                  # path is relative otherwise it's replaced by /build/flutter
 
-      (cd "$FLUTTER_TOOLS_DIR" && "$PUB" upgrade --offline)
+      (cd "$FLUTTER_TOOLS_DIR" && ${dart}/bin/pub upgrade --offline)
 
       local revision="$(cd "$FLUTTER_ROOT"; git rev-parse HEAD)"
-      "$DART" --snapshot="$SNAPSHOT_PATH" --packages="$FLUTTER_TOOLS_DIR/.packages" "$SCRIPT_PATH"
+      ${dart}/bin/dart --snapshot="$SNAPSHOT_PATH" --packages="$FLUTTER_TOOLS_DIR/.packages" "$SCRIPT_PATH"
       echo "$revision" > "$STAMP_PATH"
       echo -n "${version}" > version
 
-      rm -rf bin/cache/{artifacts,downloads}
+      rm -rf bin/cache/{artifacts,dart-sdk,downloads}
       rm -f  bin/cache/*.stamp
     '';
 
     installPhase = ''
       mkdir -p $out
       cp -r . $out
+      mkdir -p $out/bin/cache/
+      ln -sf ${dart} $out/bin/cache/dart-sdk
     '';
   };
 
@@ -100,7 +125,9 @@ let
       ];
   };
 
-in runCommand drvName {
+in
+runCommand drvName
+{
   startScript = ''
     #!${bash}/bin/bash
     export PUB_CACHE=''${PUB_CACHE:-"$HOME/.pub-cache"}
@@ -110,7 +137,7 @@ in runCommand drvName {
   preferLocalBuild = true;
   allowSubstitutes = false;
   passthru = { unwrapped = flutter; };
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Flutter is Google's SDK for building mobile, web and desktop with Dart";
     longDescription = ''
       Flutter is Google’s UI toolkit for building beautiful,
@@ -126,8 +153,4 @@ in runCommand drvName {
 
   echo -n "$startScript" > $out/bin/${pname}
   chmod +x $out/bin/${pname}
-
-  mkdir -p $out/bin/cache/dart-sdk/
-  cp -r ${dart}/* $out/bin/cache/dart-sdk/
-  ln $out/bin/cache/dart-sdk/bin/dart $out/bin/dart
 ''
diff --git a/nixpkgs/pkgs/development/compilers/flux/default.nix b/nixpkgs/pkgs/development/compilers/flux/default.nix
index c599c9f8baf5..75386f21f743 100644
--- a/nixpkgs/pkgs/development/compilers/flux/default.nix
+++ b/nixpkgs/pkgs/development/compilers/flux/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchFromGitHub, autoreconfHook, pkgconfig }:
+{ stdenv, lib, fetchFromGitHub, autoreconfHook, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "flux";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "11f3ypg0sdq5kj69zgz6kih1yrzgm48r16spyvzwvlswng147410";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
 
   meta = with lib; {
     description = "An interface description language used by DirectFB";
diff --git a/nixpkgs/pkgs/development/compilers/fpc/default.nix b/nixpkgs/pkgs/development/compilers/fpc/default.nix
index 6e7ffefca21f..5c8293866515 100644
--- a/nixpkgs/pkgs/development/compilers/fpc/default.nix
+++ b/nixpkgs/pkgs/development/compilers/fpc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gawk }:
+{ lib, stdenv, fetchurl, gawk }:
 
 let startFPC = import ./binary.nix { inherit stdenv fetchurl; }; in
 
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
     bootstrap = startFPC;
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Free Pascal Compiler from a source distribution";
     homepage = "https://www.freepascal.org";
     maintainers = [ maintainers.raskin ];
diff --git a/nixpkgs/pkgs/development/compilers/fpc/lazarus.nix b/nixpkgs/pkgs/development/compilers/fpc/lazarus.nix
index 713033057911..0b7ac647529d 100644
--- a/nixpkgs/pkgs/development/compilers/fpc/lazarus.nix
+++ b/nixpkgs/pkgs/development/compilers/fpc/lazarus.nix
@@ -97,7 +97,7 @@ stdenv.mkDerivation rec {
       --prefix PATH ':' "${lib.makeBinPath [ fpc gdb gnumake binutils ]}"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Graphical IDE for the FreePascal language";
     homepage = "https://www.lazarus.freepascal.org";
     license = licenses.gpl2Plus ;
diff --git a/nixpkgs/pkgs/development/compilers/fsharp/default.nix b/nixpkgs/pkgs/development/compilers/fsharp/default.nix
index 0c60403a6bee..19b79989dc23 100644
--- a/nixpkgs/pkgs/development/compilers/fsharp/default.nix
+++ b/nixpkgs/pkgs/development/compilers/fsharp/default.nix
@@ -1,6 +1,6 @@
 # Temporarily avoid dependency on dotnetbuildhelpers to avoid rebuilding many times while working on it
 
-{ stdenv, fetchurl, mono, pkgconfig, dotnetbuildhelpers, autoconf, automake, which }:
+{ lib, stdenv, fetchurl, mono, pkg-config, dotnetbuildhelpers, autoconf, automake, which }:
 
 stdenv.mkDerivation rec {
   pname = "fsharp";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "0mvmvwwpl4zq0yvgzdizww8l9azvlrc82xm32nz1fi1nw8x5qfqk";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ mono dotnetbuildhelpers autoconf automake which ];
 
   configurePhase = ''
@@ -41,8 +41,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A functional CLI language";
     homepage = "https://fsharp.org/";
-    license = stdenv.lib.licenses.asl20;
-    maintainers = with stdenv.lib.maintainers; [ thoughtpolice raskin ];
-    platforms = with stdenv.lib.platforms; unix;
+    license = lib.licenses.asl20;
+    maintainers = with lib.maintainers; [ thoughtpolice raskin ];
+    platforms = with lib.platforms; unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/fsharp41/default.nix b/nixpkgs/pkgs/development/compilers/fsharp41/default.nix
index 6475deb1026b..e9f9088df3a6 100644
--- a/nixpkgs/pkgs/development/compilers/fsharp41/default.nix
+++ b/nixpkgs/pkgs/development/compilers/fsharp41/default.nix
@@ -1,6 +1,6 @@
 # Temporaririly avoid dependency on dotnetbuildhelpers to avoid rebuilding many times while working on it
 
-{ stdenv, fetchurl, pkgconfig, autoconf, automake, which, mono, msbuild, dotnetbuildhelpers, dotnetPackages }:
+{ lib, stdenv, fetchurl, pkg-config, autoconf, automake, which, mono, msbuild, dotnetbuildhelpers, dotnetPackages }:
 
 stdenv.mkDerivation rec {
   pname = "fsharp";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "0cv6p5pin962vhbpsji40nkckkag5c96kq5qihvg60pc1z821p0i";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [
     autoconf
     automake
@@ -119,8 +119,8 @@ EOF
   meta = {
     description = "A functional CLI language";
     homepage = "https://fsharp.org/";
-    license = stdenv.lib.licenses.asl20;
-    maintainers = with stdenv.lib.maintainers; [ thoughtpolice raskin ];
-    platforms = with stdenv.lib.platforms; unix;
+    license = lib.licenses.asl20;
+    maintainers = with lib.maintainers; [ thoughtpolice raskin ];
+    platforms = with lib.platforms; unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/fstar/default.nix b/nixpkgs/pkgs/development/compilers/fstar/default.nix
index 548abeff78d0..73bf001f7520 100644
--- a/nixpkgs/pkgs/development/compilers/fstar/default.nix
+++ b/nixpkgs/pkgs/development/compilers/fstar/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, z3, ocamlPackages, makeWrapper, installShellFiles }:
+{ lib, stdenv, fetchFromGitHub, z3, ocamlPackages, makeWrapper, installShellFiles }:
 
 stdenv.mkDerivation rec {
   pname = "fstar";
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
     installShellCompletion --zsh --name _fstar.exe .completion/zsh/__fstar.exe
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "ML-like functional programming language aimed at program verification";
     homepage = "https://www.fstar-lang.org";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/compilers/gavrasm/default.nix b/nixpkgs/pkgs/development/compilers/gavrasm/default.nix
index 58e8b45b61af..6bd813b56cfb 100644
--- a/nixpkgs/pkgs/development/compilers/gavrasm/default.nix
+++ b/nixpkgs/pkgs/development/compilers/gavrasm/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchzip, fpc , lang ? "en" } :
-assert stdenv.lib.assertOneOf "lang" lang ["cn" "de" "en" "fr" "tr"];
+{ lib, stdenv, fetchzip, fpc , lang ? "en" } :
+assert lib.assertOneOf "lang" lang ["cn" "de" "en" "fr" "tr"];
 stdenv.mkDerivation rec {
   pname = "gavrasm";
   version = "4.5";
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     cp LiesMich.Txt $out/doc
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.avr-asm-tutorial.net/gavrasm";
     description = "AVR Assembler for ATMEL AVR-Processors";
     license = licenses.unfree;
diff --git a/nixpkgs/pkgs/development/compilers/gcc-arm-embedded/10/default.nix b/nixpkgs/pkgs/development/compilers/gcc-arm-embedded/10/default.nix
index b300a190e1c8..943ddd100a21 100644
--- a/nixpkgs/pkgs/development/compilers/gcc-arm-embedded/10/default.nix
+++ b/nixpkgs/pkgs/development/compilers/gcc-arm-embedded/10/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , ncurses5
 , python27
@@ -39,11 +39,11 @@ stdenv.mkDerivation rec {
     find $out -type f | while read f; do
       patchelf "$f" > /dev/null 2>&1 || continue
       patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true
-      patchelf --set-rpath ${stdenv.lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true
+      patchelf --set-rpath ${lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true
     done
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors";
     homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm";
     license = with licenses; [ bsd2 gpl2 gpl3 lgpl21 lgpl3 mit ];
diff --git a/nixpkgs/pkgs/development/compilers/gcc-arm-embedded/6/default.nix b/nixpkgs/pkgs/development/compilers/gcc-arm-embedded/6/default.nix
index 7d8a4b5b14d9..266863d95b2e 100644
--- a/nixpkgs/pkgs/development/compilers/gcc-arm-embedded/6/default.nix
+++ b/nixpkgs/pkgs/development/compilers/gcc-arm-embedded/6/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , ncurses5
 , python27
@@ -37,11 +37,11 @@ stdenv.mkDerivation rec {
     find $out -type f | while read f; do
       patchelf "$f" > /dev/null 2>&1 || continue
       patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true
-      patchelf --set-rpath ${stdenv.lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true
+      patchelf --set-rpath ${lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true
     done
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors";
     homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm";
     license = with licenses; [ bsd2 gpl2 gpl3 lgpl21 lgpl3 mit ];
diff --git a/nixpkgs/pkgs/development/compilers/gcc-arm-embedded/7/default.nix b/nixpkgs/pkgs/development/compilers/gcc-arm-embedded/7/default.nix
index 633ae054d050..4f2135446f61 100644
--- a/nixpkgs/pkgs/development/compilers/gcc-arm-embedded/7/default.nix
+++ b/nixpkgs/pkgs/development/compilers/gcc-arm-embedded/7/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , ncurses5
 , python27
@@ -37,11 +37,11 @@ stdenv.mkDerivation rec {
     find $out -type f | while read f; do
       patchelf "$f" > /dev/null 2>&1 || continue
       patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true
-      patchelf --set-rpath ${stdenv.lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true
+      patchelf --set-rpath ${lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true
     done
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors";
     homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm";
     license = with licenses; [ bsd2 gpl2 gpl3 lgpl21 lgpl3 mit ];
diff --git a/nixpkgs/pkgs/development/compilers/gcc-arm-embedded/8/default.nix b/nixpkgs/pkgs/development/compilers/gcc-arm-embedded/8/default.nix
index 99ec9d1b549d..2d85113527c0 100644
--- a/nixpkgs/pkgs/development/compilers/gcc-arm-embedded/8/default.nix
+++ b/nixpkgs/pkgs/development/compilers/gcc-arm-embedded/8/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , ncurses5
 , python27
@@ -37,11 +37,11 @@ stdenv.mkDerivation rec {
     find $out -type f | while read f; do
       patchelf "$f" > /dev/null 2>&1 || continue
       patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true
-      patchelf --set-rpath ${stdenv.lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true
+      patchelf --set-rpath ${lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true
     done
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors";
     homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm";
     license = with licenses; [ bsd2 gpl2 gpl3 lgpl21 lgpl3 mit ];
diff --git a/nixpkgs/pkgs/development/compilers/gcc-arm-embedded/9/default.nix b/nixpkgs/pkgs/development/compilers/gcc-arm-embedded/9/default.nix
index c4c1ebc1d8a6..944d7c7b1593 100644
--- a/nixpkgs/pkgs/development/compilers/gcc-arm-embedded/9/default.nix
+++ b/nixpkgs/pkgs/development/compilers/gcc-arm-embedded/9/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , ncurses5
 , python27
@@ -39,11 +39,11 @@ stdenv.mkDerivation rec {
     find $out -type f | while read f; do
       patchelf "$f" > /dev/null 2>&1 || continue
       patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f" || true
-      patchelf --set-rpath ${stdenv.lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true
+      patchelf --set-rpath ${lib.makeLibraryPath [ "$out" stdenv.cc.cc ncurses5 python27 ]} "$f" || true
     done
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Pre-built GNU toolchain from ARM Cortex-M & Cortex-R processors";
     homepage = "https://developer.arm.com/open-source/gnu-toolchain/gnu-rm";
     license = with licenses; [ bsd2 gpl2 gpl3 lgpl21 lgpl3 mit ];
diff --git a/nixpkgs/pkgs/development/compilers/gcc/10/default.nix b/nixpkgs/pkgs/development/compilers/gcc/10/default.nix
index c31e7c426e02..cbc4e0e09e96 100644
--- a/nixpkgs/pkgs/development/compilers/gcc/10/default.nix
+++ b/nixpkgs/pkgs/development/compilers/gcc/10/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
+{ lib, stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
 , langC ? true, langCC ? true, langFortran ? false
 , langAda ? false
 , langObjC ? stdenv.targetPlatform.isDarwin
@@ -48,7 +48,7 @@ assert langAda -> gnatboot != null;
 # threadsCross is just for MinGW
 assert threadsCross != null -> stdenv.targetPlatform.isWindows;
 
-with stdenv.lib;
+with lib;
 with builtins;
 
 let majorVersion = "10";
@@ -90,7 +90,7 @@ stdenv.mkDerivation ({
 
   inherit patches;
 
-  outputs = [ "out" "man" "info" ] ++ stdenv.lib.optional (!langJit) "lib";
+  outputs = [ "out" "man" "info" ] ++ lib.optional (!langJit) "lib";
   setOutputFlags = false;
   NIX_NO_SELF_RPATH = true;
 
@@ -100,7 +100,7 @@ stdenv.mkDerivation ({
 
   # This should kill all the stdinc frameworks that gcc and friends like to
   # insert into default search paths.
-  prePatch = stdenv.lib.optionalString hostPlatform.isDarwin ''
+  prePatch = lib.optionalString hostPlatform.isDarwin ''
     substituteInPlace gcc/config/darwin-c.c \
       --replace 'if (stdinc)' 'if (0)'
 
@@ -134,13 +134,13 @@ stdenv.mkDerivation ({
                  -e 's|define[[:blank:]]*MUSL_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define MUSL_DYNAMIC_LINKER\1 "${libc.out}\2"|g'
            done
         ''
-        + stdenv.lib.optionalString (targetPlatform.libc == "musl")
+        + lib.optionalString (targetPlatform.libc == "musl")
         ''
             sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR'
         ''
         )
     else "")
-      + stdenv.lib.optionalString targetPlatform.isAvr ''
+      + lib.optionalString targetPlatform.isAvr ''
             makeFlagsArray+=(
                'LIMITS_H_TEST=false'
             )
@@ -177,20 +177,21 @@ stdenv.mkDerivation ({
 
   depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
 
-  NIX_LDFLAGS = stdenv.lib.optionalString  hostPlatform.isSunOS "-lm -ldl";
+  NIX_LDFLAGS = lib.optionalString  hostPlatform.isSunOS "-lm -ldl";
 
   preConfigure = import ../common/pre-configure.nix {
-    inherit (stdenv) lib;
+    inherit lib;
     inherit version hostPlatform gnatboot langAda langGo;
   };
 
   dontDisableStatic = true;
 
   # TODO(@Ericson2314): Always pass "--target" and always prefix.
-  configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+  configurePlatforms = [ "build" "host" ] ++ lib.optional (targetPlatform != hostPlatform) "target";
 
   configureFlags = import ../common/configure-flags.nix {
     inherit
+      lib
       stdenv
       targetPackages
       crossStageStatic libcCross
@@ -262,7 +263,7 @@ stdenv.mkDerivation ({
 
   meta = {
     homepage = "https://gcc.gnu.org/";
-    license = stdenv.lib.licenses.gpl3Plus;  # runtime support libraries are typically LGPLv3+
+    license = lib.licenses.gpl3Plus;  # runtime support libraries are typically LGPLv3+
     description = "GNU Compiler Collection, version ${version}"
       + (if stripped then "" else " (with debugging info)");
 
@@ -275,13 +276,13 @@ stdenv.mkDerivation ({
       compiler used in the GNU system including the GNU/Linux variant.
     '';
 
-    maintainers = with stdenv.lib.maintainers; [ synthetica ];
+    maintainers = with lib.maintainers; [ synthetica ];
 
     platforms =
-      stdenv.lib.platforms.linux ++
-      stdenv.lib.platforms.freebsd ++
-      stdenv.lib.platforms.illumos ++
-      stdenv.lib.platforms.darwin;
+      lib.platforms.linux ++
+      lib.platforms.freebsd ++
+      lib.platforms.illumos ++
+      lib.platforms.darwin;
   };
 }
 
diff --git a/nixpkgs/pkgs/development/compilers/gcc/4.8/default.nix b/nixpkgs/pkgs/development/compilers/gcc/4.8/default.nix
index 617a19e238ba..69fdeefe87aa 100644
--- a/nixpkgs/pkgs/development/compilers/gcc/4.8/default.nix
+++ b/nixpkgs/pkgs/development/compilers/gcc/4.8/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
+{ lib, stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
 , langC ? true, langCC ? true, langFortran ? false
 , langObjC ? stdenv.targetPlatform.isDarwin
 , langObjCpp ? stdenv.targetPlatform.isDarwin
@@ -20,7 +20,7 @@
 , libelf                      # optional, for link-time optimizations (LTO)
 , cloog ? null, isl ? null # optional, for the Graphite optimization framework.
 , zlib ? null, boehmgc ? null
-, zip ? null, unzip ? null, pkgconfig ? null
+, zip ? null, unzip ? null, pkg-config ? null
 , gtk2 ? null, libart_lgpl ? null
 , libX11 ? null, libXt ? null, libSM ? null, libICE ? null, libXtst ? null
 , libXrender ? null, xorgproto ? null
@@ -58,7 +58,7 @@ assert langGo -> langCC;
 # threadsCross is just for MinGW
 assert threadsCross != null -> stdenv.targetPlatform.isWindows;
 
-with stdenv.lib;
+with lib;
 with builtins;
 
 let majorVersion = "4";
@@ -161,7 +161,7 @@ stdenv.mkDerivation ({
   depsBuildBuild = [ buildPackages.stdenv.cc ];
   nativeBuildInputs = [ texinfo which gettext ]
     ++ (optional (perl != null) perl)
-    ++ (optional javaAwtGtk pkgconfig);
+    ++ (optional javaAwtGtk pkg-config);
 
   # For building runtime libs
   depsBuildTarget =
@@ -190,17 +190,18 @@ stdenv.mkDerivation ({
   depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
 
   preConfigure = import ../common/pre-configure.nix {
-    inherit (stdenv) lib;
+    inherit lib;
     inherit version hostPlatform langJava langGo;
   };
 
   dontDisableStatic = true;
 
   # TODO(@Ericson2314): Always pass "--target" and always prefix.
-  configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+  configurePlatforms = [ "build" "host" ] ++ lib.optional (targetPlatform != hostPlatform) "target";
 
   configureFlags = import ../common/configure-flags.nix {
     inherit
+      lib
       stdenv
       targetPackages
       crossStageStatic libcCross
@@ -289,7 +290,7 @@ stdenv.mkDerivation ({
 
   meta = {
     homepage = "https://gcc.gnu.org/";
-    license = stdenv.lib.licenses.gpl3Plus;  # runtime support libraries are typically LGPLv3+
+    license = lib.licenses.gpl3Plus;  # runtime support libraries are typically LGPLv3+
     description = "GNU Compiler Collection, version ${version}"
       + (if stripped then "" else " (with debugging info)");
 
@@ -302,13 +303,13 @@ stdenv.mkDerivation ({
       compiler used in the GNU system including the GNU/Linux variant.
     '';
 
-    maintainers = with stdenv.lib.maintainers; [ peti veprbl ];
+    maintainers = with lib.maintainers; [ peti veprbl ];
 
     platforms =
-      stdenv.lib.platforms.linux ++
-      stdenv.lib.platforms.freebsd ++
-      stdenv.lib.platforms.illumos ++
-      stdenv.lib.platforms.darwin;
+      lib.platforms.linux ++
+      lib.platforms.freebsd ++
+      lib.platforms.illumos ++
+      lib.platforms.darwin;
     badPlatforms = [ "x86_64-darwin" ];
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/gcc/4.9/default.nix b/nixpkgs/pkgs/development/compilers/gcc/4.9/default.nix
index 7ea80ffbeb3f..4c0a144f14d1 100644
--- a/nixpkgs/pkgs/development/compilers/gcc/4.9/default.nix
+++ b/nixpkgs/pkgs/development/compilers/gcc/4.9/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
+{ lib, stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
 , langC ? true, langCC ? true, langFortran ? false
 , langObjC ? stdenv.targetPlatform.isDarwin
 , langObjCpp ? stdenv.targetPlatform.isDarwin
@@ -20,7 +20,7 @@
 , libelf                      # optional, for link-time optimizations (LTO)
 , cloog ? null, isl ? null # optional, for the Graphite optimization framework.
 , zlib ? null, boehmgc ? null
-, zip ? null, unzip ? null, pkgconfig ? null
+, zip ? null, unzip ? null, pkg-config ? null
 , gtk2 ? null, libart_lgpl ? null
 , libX11 ? null, libXt ? null, libSM ? null, libICE ? null, libXtst ? null
 , libXrender ? null, xorgproto ? null
@@ -58,7 +58,7 @@ assert langGo -> langCC;
 # threadsCross is just for MinGW
 assert threadsCross != null -> stdenv.targetPlatform.isWindows;
 
-with stdenv.lib;
+with lib;
 with builtins;
 
 let majorVersion = "4";
@@ -174,7 +174,7 @@ stdenv.mkDerivation ({
   depsBuildBuild = [ buildPackages.stdenv.cc ];
   nativeBuildInputs = [ texinfo which gettext ]
     ++ (optional (perl != null) perl)
-    ++ (optional javaAwtGtk pkgconfig);
+    ++ (optional javaAwtGtk pkg-config);
 
   # For building runtime libs
   depsBuildTarget =
@@ -203,17 +203,18 @@ stdenv.mkDerivation ({
   depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
 
   preConfigure = import ../common/pre-configure.nix {
-    inherit (stdenv) lib;
+    inherit lib;
     inherit version hostPlatform langJava langGo;
   };
 
   dontDisableStatic = true;
 
   # TODO(@Ericson2314): Always pass "--target" and always prefix.
-  configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+  configurePlatforms = [ "build" "host" ] ++ lib.optional (targetPlatform != hostPlatform) "target";
 
   configureFlags = import ../common/configure-flags.nix {
     inherit
+      lib
       stdenv
       targetPackages
       crossStageStatic libcCross
@@ -301,7 +302,7 @@ stdenv.mkDerivation ({
 
   meta = {
     homepage = "https://gcc.gnu.org/";
-    license = stdenv.lib.licenses.gpl3Plus;  # runtime support libraries are typically LGPLv3+
+    license = lib.licenses.gpl3Plus;  # runtime support libraries are typically LGPLv3+
     description = "GNU Compiler Collection, version ${version}"
       + (if stripped then "" else " (with debugging info)");
 
@@ -314,13 +315,13 @@ stdenv.mkDerivation ({
       compiler used in the GNU system including the GNU/Linux variant.
     '';
 
-    maintainers = with stdenv.lib.maintainers; [ peti veprbl ];
+    maintainers = with lib.maintainers; [ peti veprbl ];
 
     platforms =
-      stdenv.lib.platforms.linux ++
-      stdenv.lib.platforms.freebsd ++
-      stdenv.lib.platforms.illumos ++
-      stdenv.lib.platforms.darwin;
+      lib.platforms.linux ++
+      lib.platforms.freebsd ++
+      lib.platforms.illumos ++
+      lib.platforms.darwin;
     badPlatforms = [ "x86_64-darwin" ];
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/gcc/6/default.nix b/nixpkgs/pkgs/development/compilers/gcc/6/default.nix
index 029777430ffa..7d4cc2a3ea12 100644
--- a/nixpkgs/pkgs/development/compilers/gcc/6/default.nix
+++ b/nixpkgs/pkgs/development/compilers/gcc/6/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, targetPackages, fetchurl, fetchpatch, fetchFromGitHub, noSysDirs
+{ lib, stdenv, targetPackages, fetchurl, fetchpatch, fetchFromGitHub, noSysDirs
 , langC ? true, langCC ? true, langFortran ? false
 , langAda ? false
 , langObjC ? stdenv.targetPlatform.isDarwin
@@ -23,7 +23,7 @@
 , isl ? null # optional, for the Graphite optimization framework.
 , zlib ? null, boehmgc ? null
 , gnatboot ? null
-, zip ? null, unzip ? null, pkgconfig ? null
+, zip ? null, unzip ? null, pkg-config ? null
 , gtk2 ? null, libart_lgpl ? null
 , libX11 ? null, libXt ? null, libSM ? null, libICE ? null, libXtst ? null
 , libXrender ? null, xorgproto ? null
@@ -61,7 +61,7 @@ assert langAda -> gnatboot != null;
 # threadsCross is just for MinGW
 assert threadsCross != null -> stdenv.targetPlatform.isWindows;
 
-with stdenv.lib;
+with lib;
 with builtins;
 
 let majorVersion = "6";
@@ -148,7 +148,7 @@ stdenv.mkDerivation ({
   prePatch =
     # This should kill all the stdinc frameworks that gcc and friends like to
     # insert into default search paths.
-    stdenv.lib.optionalString hostPlatform.isDarwin ''
+    lib.optionalString hostPlatform.isDarwin ''
       substituteInPlace gcc/config/darwin-c.c \
         --replace 'if (stdinc)' 'if (0)'
 
@@ -177,7 +177,7 @@ stdenv.mkDerivation ({
                  -e 's|define[[:blank:]]*MUSL_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define MUSL_DYNAMIC_LINKER\1 "${libc.out}\2"|g'
            done
         ''
-        + stdenv.lib.optionalString (targetPlatform.libc == "musl")
+        + lib.optionalString (targetPlatform.libc == "musl")
         ''
             sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR'
         ''
@@ -190,7 +190,7 @@ stdenv.mkDerivation ({
   depsBuildBuild = [ buildPackages.stdenv.cc ];
   nativeBuildInputs = [ texinfo which gettext ]
     ++ (optional (perl != null) perl)
-    ++ (optional javaAwtGtk pkgconfig)
+    ++ (optional javaAwtGtk pkg-config)
     ++ (optional (with stdenv.targetPlatform; isVc4 || isRedox) flex);
 
   # For building runtime libs
@@ -219,20 +219,21 @@ stdenv.mkDerivation ({
 
   depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
 
-  NIX_LDFLAGS = stdenv.lib.optionalString  hostPlatform.isSunOS "-lm -ldl";
+  NIX_LDFLAGS = lib.optionalString  hostPlatform.isSunOS "-lm -ldl";
 
   preConfigure = import ../common/pre-configure.nix {
-    inherit (stdenv) lib;
+    inherit lib;
     inherit version hostPlatform gnatboot langJava langAda langGo;
   };
 
   dontDisableStatic = true;
 
   # TODO(@Ericson2314): Always pass "--target" and always prefix.
-  configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+  configurePlatforms = [ "build" "host" ] ++ lib.optional (targetPlatform != hostPlatform) "target";
 
   configureFlags = import ../common/configure-flags.nix {
     inherit
+      lib
       stdenv
       targetPackages
       crossStageStatic libcCross
@@ -320,7 +321,7 @@ stdenv.mkDerivation ({
 
   meta = {
     homepage = "https://gcc.gnu.org/";
-    license = stdenv.lib.licenses.gpl3Plus;  # runtime support libraries are typically LGPLv3+
+    license = lib.licenses.gpl3Plus;  # runtime support libraries are typically LGPLv3+
     description = "GNU Compiler Collection, version ${version}"
       + (if stripped then "" else " (with debugging info)");
 
@@ -333,13 +334,13 @@ stdenv.mkDerivation ({
       compiler used in the GNU system including the GNU/Linux variant.
     '';
 
-    maintainers = with stdenv.lib.maintainers; [ peti ];
+    maintainers = with lib.maintainers; [ peti ];
 
     platforms =
-      stdenv.lib.platforms.linux ++
-      stdenv.lib.platforms.freebsd ++
-      stdenv.lib.platforms.illumos ++
-      stdenv.lib.platforms.darwin;
+      lib.platforms.linux ++
+      lib.platforms.freebsd ++
+      lib.platforms.illumos ++
+      lib.platforms.darwin;
   };
 }
 
diff --git a/nixpkgs/pkgs/development/compilers/gcc/7/default.nix b/nixpkgs/pkgs/development/compilers/gcc/7/default.nix
index d950d6ac35bb..051307e4842c 100644
--- a/nixpkgs/pkgs/development/compilers/gcc/7/default.nix
+++ b/nixpkgs/pkgs/development/compilers/gcc/7/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
+{ lib, stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
 , langC ? true, langCC ? true, langFortran ? false
 , langObjC ? stdenv.targetPlatform.isDarwin
 , langObjCpp ? stdenv.targetPlatform.isDarwin
@@ -45,7 +45,7 @@ assert langGo -> langCC;
 # threadsCross is just for MinGW
 assert threadsCross != null -> stdenv.targetPlatform.isWindows;
 
-with stdenv.lib;
+with lib;
 with builtins;
 
 let majorVersion = "7";
@@ -97,7 +97,7 @@ stdenv.mkDerivation ({
 
   inherit patches;
 
-  outputs = [ "out" "man" "info" ] ++ stdenv.lib.optional (!langJit) "lib";
+  outputs = [ "out" "man" "info" ] ++ lib.optional (!langJit) "lib";
   setOutputFlags = false;
   NIX_NO_SELF_RPATH = true;
 
@@ -107,7 +107,7 @@ stdenv.mkDerivation ({
 
   # This should kill all the stdinc frameworks that gcc and friends like to
   # insert into default search paths.
-  prePatch = stdenv.lib.optionalString hostPlatform.isDarwin ''
+  prePatch = lib.optionalString hostPlatform.isDarwin ''
     substituteInPlace gcc/config/darwin-c.c \
       --replace 'if (stdinc)' 'if (0)'
 
@@ -141,13 +141,13 @@ stdenv.mkDerivation ({
                  -e 's|define[[:blank:]]*MUSL_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define MUSL_DYNAMIC_LINKER\1 "${libc.out}\2"|g'
            done
         ''
-        + stdenv.lib.optionalString (targetPlatform.libc == "musl")
+        + lib.optionalString (targetPlatform.libc == "musl")
         ''
             sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR'
         ''
         )
     else "")
-      + stdenv.lib.optionalString targetPlatform.isAvr ''
+      + lib.optionalString targetPlatform.isAvr ''
         makeFlagsArray+=(
            'LIMITS_H_TEST=false'
         )
@@ -183,21 +183,22 @@ stdenv.mkDerivation ({
 
   depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
 
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (stdenv.cc.isClang && langFortran) "-Wno-unused-command-line-argument";
-  NIX_LDFLAGS = stdenv.lib.optionalString  hostPlatform.isSunOS "-lm -ldl";
+  NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.cc.isClang && langFortran) "-Wno-unused-command-line-argument";
+  NIX_LDFLAGS = lib.optionalString  hostPlatform.isSunOS "-lm -ldl";
 
   preConfigure = import ../common/pre-configure.nix {
-    inherit (stdenv) lib;
+    inherit lib;
     inherit version hostPlatform langGo;
   };
 
   dontDisableStatic = true;
 
   # TODO(@Ericson2314): Always pass "--target" and always prefix.
-  configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+  configurePlatforms = [ "build" "host" ] ++ lib.optional (targetPlatform != hostPlatform) "target";
 
   configureFlags = import ../common/configure-flags.nix {
     inherit
+      lib
       stdenv
       targetPackages
       crossStageStatic libcCross
@@ -272,7 +273,7 @@ stdenv.mkDerivation ({
 
   meta = {
     homepage = "https://gcc.gnu.org/";
-    license = stdenv.lib.licenses.gpl3Plus;  # runtime support libraries are typically LGPLv3+
+    license = lib.licenses.gpl3Plus;  # runtime support libraries are typically LGPLv3+
     description = "GNU Compiler Collection, version ${version}"
       + (if stripped then "" else " (with debugging info)");
 
@@ -285,13 +286,13 @@ stdenv.mkDerivation ({
       compiler used in the GNU system including the GNU/Linux variant.
     '';
 
-    maintainers = with stdenv.lib.maintainers; [ ];
+    maintainers = with lib.maintainers; [ ];
 
     platforms =
-      stdenv.lib.platforms.linux ++
-      stdenv.lib.platforms.freebsd ++
-      stdenv.lib.platforms.illumos ++
-      stdenv.lib.platforms.darwin;
+      lib.platforms.linux ++
+      lib.platforms.freebsd ++
+      lib.platforms.illumos ++
+      lib.platforms.darwin;
   };
 }
 
diff --git a/nixpkgs/pkgs/development/compilers/gcc/8/default.nix b/nixpkgs/pkgs/development/compilers/gcc/8/default.nix
index 683a9edfe09d..6a072267019d 100644
--- a/nixpkgs/pkgs/development/compilers/gcc/8/default.nix
+++ b/nixpkgs/pkgs/development/compilers/gcc/8/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
+{ lib, stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
 , langC ? true, langCC ? true, langFortran ? false
 , langObjC ? stdenv.targetPlatform.isDarwin
 , langObjCpp ? stdenv.targetPlatform.isDarwin
@@ -45,7 +45,7 @@ assert langGo -> langCC;
 # threadsCross is just for MinGW
 assert threadsCross != null -> stdenv.targetPlatform.isWindows;
 
-with stdenv.lib;
+with lib;
 with builtins;
 
 let majorVersion = "8";
@@ -87,7 +87,7 @@ stdenv.mkDerivation ({
 
   inherit patches;
 
-  outputs = [ "out" "man" "info" ] ++ stdenv.lib.optional (!langJit) "lib";
+  outputs = [ "out" "man" "info" ] ++ lib.optional (!langJit) "lib";
   setOutputFlags = false;
   NIX_NO_SELF_RPATH = true;
 
@@ -97,7 +97,7 @@ stdenv.mkDerivation ({
 
   # This should kill all the stdinc frameworks that gcc and friends like to
   # insert into default search paths.
-  prePatch = stdenv.lib.optionalString hostPlatform.isDarwin ''
+  prePatch = lib.optionalString hostPlatform.isDarwin ''
     substituteInPlace gcc/config/darwin-c.c \
       --replace 'if (stdinc)' 'if (0)'
 
@@ -131,13 +131,13 @@ stdenv.mkDerivation ({
                  -e 's|define[[:blank:]]*MUSL_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define MUSL_DYNAMIC_LINKER\1 "${libc.out}\2"|g'
            done
         ''
-        + stdenv.lib.optionalString (targetPlatform.libc == "musl")
+        + lib.optionalString (targetPlatform.libc == "musl")
         ''
             sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR'
         ''
         )
     else "")
-      + stdenv.lib.optionalString targetPlatform.isAvr ''
+      + lib.optionalString targetPlatform.isAvr ''
             makeFlagsArray+=(
                'LIMITS_H_TEST=false'
             )
@@ -173,20 +173,21 @@ stdenv.mkDerivation ({
 
   depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
 
-  NIX_LDFLAGS = stdenv.lib.optionalString  hostPlatform.isSunOS "-lm -ldl";
+  NIX_LDFLAGS = lib.optionalString  hostPlatform.isSunOS "-lm -ldl";
 
   preConfigure = import ../common/pre-configure.nix {
-    inherit (stdenv) lib;
+    inherit lib;
     inherit version hostPlatform langGo;
   };
 
   dontDisableStatic = true;
 
   # TODO(@Ericson2314): Always pass "--target" and always prefix.
-  configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+  configurePlatforms = [ "build" "host" ] ++ lib.optional (targetPlatform != hostPlatform) "target";
 
   configureFlags = import ../common/configure-flags.nix {
     inherit
+      lib
       stdenv
       targetPackages
       crossStageStatic libcCross
@@ -257,7 +258,7 @@ stdenv.mkDerivation ({
 
   meta = {
     homepage = "https://gcc.gnu.org/";
-    license = stdenv.lib.licenses.gpl3Plus;  # runtime support libraries are typically LGPLv3+
+    license = lib.licenses.gpl3Plus;  # runtime support libraries are typically LGPLv3+
     description = "GNU Compiler Collection, version ${version}"
       + (if stripped then "" else " (with debugging info)");
 
@@ -270,13 +271,13 @@ stdenv.mkDerivation ({
       compiler used in the GNU system including the GNU/Linux variant.
     '';
 
-    maintainers = with stdenv.lib.maintainers; [ synthetica ];
+    maintainers = with lib.maintainers; [ synthetica ];
 
     platforms =
-      stdenv.lib.platforms.linux ++
-      stdenv.lib.platforms.freebsd ++
-      stdenv.lib.platforms.illumos ++
-      stdenv.lib.platforms.darwin;
+      lib.platforms.linux ++
+      lib.platforms.freebsd ++
+      lib.platforms.illumos ++
+      lib.platforms.darwin;
   };
 }
 
diff --git a/nixpkgs/pkgs/development/compilers/gcc/9/default.nix b/nixpkgs/pkgs/development/compilers/gcc/9/default.nix
index 7827cb985053..ea5172184cc6 100644
--- a/nixpkgs/pkgs/development/compilers/gcc/9/default.nix
+++ b/nixpkgs/pkgs/development/compilers/gcc/9/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
+{ lib, stdenv, targetPackages, fetchurl, fetchpatch, noSysDirs
 , langC ? true, langCC ? true, langFortran ? false
 , langAda ? false
 , langObjC ? stdenv.targetPlatform.isDarwin
@@ -54,7 +54,7 @@ assert langAda -> gnatboot != null;
 # threadsCross is just for MinGW
 assert threadsCross != null -> stdenv.targetPlatform.isWindows;
 
-with stdenv.lib;
+with lib;
 with builtins;
 
 let majorVersion = "9";
@@ -103,7 +103,7 @@ stdenv.mkDerivation ({
 
   inherit patches;
 
-  outputs = [ "out" "man" "info" ] ++ stdenv.lib.optional (!langJit) "lib";
+  outputs = [ "out" "man" "info" ] ++ lib.optional (!langJit) "lib";
   setOutputFlags = false;
   NIX_NO_SELF_RPATH = true;
 
@@ -113,7 +113,7 @@ stdenv.mkDerivation ({
 
   # This should kill all the stdinc frameworks that gcc and friends like to
   # insert into default search paths.
-  prePatch = stdenv.lib.optionalString hostPlatform.isDarwin ''
+  prePatch = lib.optionalString hostPlatform.isDarwin ''
     substituteInPlace gcc/config/darwin-c.c \
       --replace 'if (stdinc)' 'if (0)'
 
@@ -147,13 +147,13 @@ stdenv.mkDerivation ({
                  -e 's|define[[:blank:]]*MUSL_DYNAMIC_LINKER\([0-9]*\)[[:blank:]]"\([^\"]\+\)"$|define MUSL_DYNAMIC_LINKER\1 "${libc.out}\2"|g'
            done
         ''
-        + stdenv.lib.optionalString (targetPlatform.libc == "musl")
+        + lib.optionalString (targetPlatform.libc == "musl")
         ''
             sed -i gcc/config/linux.h -e '1i#undef LOCAL_INCLUDE_DIR'
         ''
         )
     else "")
-      + stdenv.lib.optionalString targetPlatform.isAvr ''
+      + lib.optionalString targetPlatform.isAvr ''
           makeFlagsArray+=(
              'LIMITS_H_TEST=false'
           )
@@ -190,20 +190,21 @@ stdenv.mkDerivation ({
 
   depsTargetTarget = optional (!crossStageStatic && threadsCross != null) threadsCross;
 
-  NIX_LDFLAGS = stdenv.lib.optionalString  hostPlatform.isSunOS "-lm -ldl";
+  NIX_LDFLAGS = lib.optionalString  hostPlatform.isSunOS "-lm -ldl";
 
   preConfigure = import ../common/pre-configure.nix {
-    inherit (stdenv) lib;
+    inherit lib;
     inherit version hostPlatform gnatboot langAda langGo langJit;
   };
 
   dontDisableStatic = true;
 
   # TODO(@Ericson2314): Always pass "--target" and always prefix.
-  configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+  configurePlatforms = [ "build" "host" ] ++ lib.optional (targetPlatform != hostPlatform) "target";
 
   configureFlags = import ../common/configure-flags.nix {
     inherit
+      lib
       stdenv
       targetPackages
       crossStageStatic libcCross
@@ -276,7 +277,7 @@ stdenv.mkDerivation ({
 
   meta = {
     homepage = "https://gcc.gnu.org/";
-    license = stdenv.lib.licenses.gpl3Plus;  # runtime support libraries are typically LGPLv3+
+    license = lib.licenses.gpl3Plus;  # runtime support libraries are typically LGPLv3+
     description = "GNU Compiler Collection, version ${version}"
       + (if stripped then "" else " (with debugging info)");
 
@@ -289,13 +290,13 @@ stdenv.mkDerivation ({
       compiler used in the GNU system including the GNU/Linux variant.
     '';
 
-    maintainers = with stdenv.lib.maintainers; [ synthetica ];
+    maintainers = with lib.maintainers; [ synthetica ];
 
     platforms =
-      stdenv.lib.platforms.linux ++
-      stdenv.lib.platforms.freebsd ++
-      stdenv.lib.platforms.illumos ++
-      stdenv.lib.platforms.darwin;
+      lib.platforms.linux ++
+      lib.platforms.freebsd ++
+      lib.platforms.illumos ++
+      lib.platforms.darwin;
   };
 }
 
diff --git a/nixpkgs/pkgs/development/compilers/gcc/builder.sh b/nixpkgs/pkgs/development/compilers/gcc/builder.sh
index e1c4768413f4..7d104b96624e 100644
--- a/nixpkgs/pkgs/development/compilers/gcc/builder.sh
+++ b/nixpkgs/pkgs/development/compilers/gcc/builder.sh
@@ -37,6 +37,9 @@ if test "$noSysDirs" = "1"; then
             # Figure out what extra flags when linking to pass to the gcc
             # compilers being generated to make sure that they use our libc.
             extraLDFlags=($(< "${!curBintools}/nix-support/libc-ldflags") $(< "${!curBintools}/nix-support/libc-ldflags-before" || true))
+            if [ -e ${!curBintools}/nix-support/ld-set-dynamic-linker ]; then
+                extraLDFlags=-dynamic-linker=$(< ${!curBintools}/nix-support/dynamic-linker)
+            fi
 
             # The path to the Libc binaries such as `crti.o'.
             libc_libdir="$(< "${!curBintools}/nix-support/orig-libc")/lib"
@@ -252,7 +255,7 @@ postInstall() {
 
     if [[ targetConfig == *"linux"* ]]; then
         # For some reason, when building for linux on darwin, the libs retain
-	# RPATH to $out.
+        # RPATH to $out.
         for i in "$lib"/"$targetConfig"/lib/{libtsan,libasan,libubsan}.so.*.*.*; do
             PREV_RPATH=`patchelf --print-rpath "$i"`
             NEW_RPATH=`echo "$PREV_RPATH" | sed "s,:${out}[^:]*,,g"`
diff --git a/nixpkgs/pkgs/development/compilers/gcc/common/configure-flags.nix b/nixpkgs/pkgs/development/compilers/gcc/common/configure-flags.nix
index 12d3f5d8987e..3f1866713e60 100644
--- a/nixpkgs/pkgs/development/compilers/gcc/common/configure-flags.nix
+++ b/nixpkgs/pkgs/development/compilers/gcc/common/configure-flags.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , targetPackages
 
 , crossStageStatic, libcCross
@@ -24,8 +24,8 @@
 , langJit
 }:
 
-assert cloog != null -> stdenv.lib.versionOlder version "5";
-assert langJava -> stdenv.lib.versionOlder version "7";
+assert cloog != null -> lib.versionOlder version "5";
+assert langJava -> lib.versionOlder version "7";
 
 # Note [Windows Exception Handling]
 # sjlj (short jump long jump) exception handling makes no sense on x86_64,
@@ -171,7 +171,7 @@ let
     ++ lib.optional javaAwtGtk "--enable-java-awt=gtk"
     ++ lib.optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}"
 
-    ++ (import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; })
+    ++ (import ../common/platform-flags.nix { inherit (stdenv)  targetPlatform; inherit lib; })
     ++ lib.optionals (targetPlatform != hostPlatform) crossConfigureFlags
     ++ lib.optional (targetPlatform != hostPlatform) "--disable-bootstrap"
 
diff --git a/nixpkgs/pkgs/development/compilers/gcc/common/extra-target-flags.nix b/nixpkgs/pkgs/development/compilers/gcc/common/extra-target-flags.nix
index 0a5a7a1bc1cb..6ced56cedc05 100644
--- a/nixpkgs/pkgs/development/compilers/gcc/common/extra-target-flags.nix
+++ b/nixpkgs/pkgs/development/compilers/gcc/common/extra-target-flags.nix
@@ -11,7 +11,7 @@ in
   EXTRA_FLAGS_FOR_TARGET = let
       mkFlags = dep: langD: lib.optionals (targetPlatform != hostPlatform && dep != null && !langD) ([
         "-O2 -idirafter ${lib.getDev dep}${dep.incdir or "/include"}"
-      ] ++ stdenv.lib.optionals (! crossStageStatic) [
+      ] ++ lib.optionals (! crossStageStatic) [
         "-B${lib.getLib dep}${dep.libdir or "/lib"}"
       ]);
     in mkFlags libcCross langD
diff --git a/nixpkgs/pkgs/development/compilers/gcc/common/platform-flags.nix b/nixpkgs/pkgs/development/compilers/gcc/common/platform-flags.nix
index f3cdce411939..66af8c4a4cc7 100644
--- a/nixpkgs/pkgs/development/compilers/gcc/common/platform-flags.nix
+++ b/nixpkgs/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/nixpkgs/pkgs/development/compilers/gcl/2.6.13-pre.nix b/nixpkgs/pkgs/development/compilers/gcl/2.6.13-pre.nix
index f4f63bc9b19f..50efbe5d3c54 100644
--- a/nixpkgs/pkgs/development/compilers/gcl/2.6.13-pre.nix
+++ b/nixpkgs/pkgs/development/compilers/gcl/2.6.13-pre.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, mpfr, m4, binutils, emacs, zlib, which
+{ lib, stdenv, fetchgit, mpfr, m4, binutils, emacs, zlib, which
 , texinfo, libX11, xorgproto, libXi, gmp, readline, strace
 , libXext, libXt, libXaw, libXmu } :
 
@@ -45,7 +45,7 @@ stdenv.mkDerivation {
 
   meta = {
     description = "GNU Common Lisp compiler working via GCC";
-    maintainers = [ stdenv.lib.maintainers.raskin ];
-    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ lib.maintainers.raskin ];
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/gcl/default.nix b/nixpkgs/pkgs/development/compilers/gcl/default.nix
index a8a1bf9fc1bd..6d0471dacbb5 100644
--- a/nixpkgs/pkgs/development/compilers/gcl/default.nix
+++ b/nixpkgs/pkgs/development/compilers/gcl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, mpfr, m4, binutils, emacs, zlib, which
+{ lib, stdenv, fetchurl, mpfr, m4, binutils, emacs, zlib, which
 , texinfo, libX11, xorgproto, libXi, gmp
 , libXext, libXt, libXaw, libXmu } :
 
@@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
 
   NIX_CFLAGS_COMPILE = "-fgnu89-inline";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "GNU Common Lisp compiler working via GCC";
     maintainers = [ maintainers.raskin ];
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/compilers/gforth/default.nix b/nixpkgs/pkgs/development/compilers/gforth/default.nix
index d2a2a7a85e3c..bdf172cb9b99 100644
--- a/nixpkgs/pkgs/development/compilers/gforth/default.nix
+++ b/nixpkgs/pkgs/development/compilers/gforth/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, m4 }:
+{ lib, stdenv, fetchurl, m4 }:
 
 let
   version = "0.7.3";
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
 
   buildInputs = [ m4 ];
 
-  configureFlags = stdenv.lib.optional stdenv.isDarwin [ "--build=x86_64-apple-darwin" ];
+  configureFlags = lib.optional stdenv.isDarwin [ "--build=x86_64-apple-darwin" ];
 
   postInstall = ''
     mkdir -p $out/share/emacs/site-lisp
@@ -23,7 +23,7 @@ stdenv.mkDerivation {
   meta = {
     description = "The Forth implementation of the GNU project";
     homepage = "https://www.gnu.org/software/gforth/";
-    license = stdenv.lib.licenses.gpl3;
-    platforms = stdenv.lib.platforms.all;
+    license = lib.licenses.gpl3;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/ghc/8.10.1.nix b/nixpkgs/pkgs/development/compilers/ghc/8.10.1.nix
index 42eb994b8fe2..661dd5cb0026 100644
--- a/nixpkgs/pkgs/development/compilers/ghc/8.10.1.nix
+++ b/nixpkgs/pkgs/development/compilers/ghc/8.10.1.nix
@@ -1,4 +1,4 @@
-{ stdenv, pkgsBuildTarget, targetPackages
+{ lib, stdenv, pkgsBuildTarget, targetPackages
 
 # build-tools
 , bootPkgs
@@ -18,7 +18,7 @@
 
 , # If enabled, GHC will be built with the GPL-free but slower integer-simple
   # library instead of the faster but GPLed integer-gmp library.
-  enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
+  enableIntegerSimple ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
 
 , # If enabled, use -fPIC when compiling static libs.
   enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
@@ -35,7 +35,7 @@
 
 , # What flavour to build. An empty string indicates no
   # specific flavour and falls back to ghc default values.
-  ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
+  ghcFlavour ? lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
     (if useLLVM then "perf-cross" else "perf-cross-ncg")
 
 , # Whether to disable the large address space allocator
@@ -51,7 +51,7 @@ let
   inherit (bootPkgs) ghc;
 
   # TODO(@Ericson2314) Make unconditional
-  targetPrefix = stdenv.lib.optionalString
+  targetPrefix = lib.optionalString
     (targetPlatform != hostPlatform)
     "${targetPlatform.config}-";
 
@@ -69,32 +69,32 @@ let
     # to actually link to our new Libc. The iOS simulator is a special
     # exception because we can’t actually run simulators binaries
     # ourselves.
-  + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
+  + lib.optionalString (targetPlatform != hostPlatform) ''
     Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"}
     CrossCompilePrefix = ${targetPrefix}
     HADDOCK_DOCS = NO
     BUILD_SPHINX_HTML = NO
     BUILD_SPHINX_PDF = NO
-  '' + stdenv.lib.optionalString dontStrip ''
+  '' + lib.optionalString dontStrip ''
     STRIP_CMD = :
-  '' + stdenv.lib.optionalString (!enableProfiledLibs) ''
+  '' + lib.optionalString (!enableProfiledLibs) ''
     GhcLibWays = "v dyn"
-  '' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
+  '' + lib.optionalString enableRelocatedStaticLibs ''
     GhcLibHcOpts += -fPIC
     GhcRtsHcOpts += -fPIC
-  '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
+  '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
     EXTRA_CC_OPTS += -std=gnu99
   '';
 
   # Splicer will pull out correct variations
-  libDeps = platform: stdenv.lib.optional enableTerminfo ncurses
+  libDeps = platform: lib.optional enableTerminfo ncurses
     ++ [libffi]
-    ++ stdenv.lib.optional (!enableIntegerSimple) gmp
-    ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
+    ++ lib.optional (!enableIntegerSimple) gmp
+    ++ lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
 
   toolsForTarget = [
     pkgsBuildTarget.targetPackages.stdenv.cc
-  ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm;
+  ] ++ lib.optional useLLVM buildLlvmPackages.llvm;
 
   targetCC = builtins.head toolsForTarget;
 
@@ -128,7 +128,7 @@ stdenv.mkDerivation (rec {
     export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
     export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
     # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
-    export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString useLdGold ".gold"}"
+    export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${lib.optionalString useLdGold ".gold"}"
     export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
     export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
     export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
@@ -138,13 +138,13 @@ stdenv.mkDerivation (rec {
 
     echo -n "${buildMK dontStrip}" > mk/build.mk
     sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
-  '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
+  '' + lib.optionalString (!stdenv.isDarwin) ''
     export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     export NIX_LDFLAGS+=" -no_dtrace_dof"
-  '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
+  '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
     sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
-  '' + stdenv.lib.optionalString targetPlatform.isMusl ''
+  '' + lib.optionalString targetPlatform.isMusl ''
       echo "patching llvm-targets for musl targets..."
       echo "Cloning these existing '*-linux-gnu*' targets:"
       grep linux-gnu llvm-targets | sed 's/^/  /'
@@ -164,29 +164,29 @@ stdenv.mkDerivation (rec {
 
   # TODO(@Ericson2314): Always pass "--target" and always prefix.
   configurePlatforms = [ "build" "host" ]
-    ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+    ++ lib.optional (targetPlatform != hostPlatform) "target";
 
   # `--with` flags for libraries needed for RTS linker
   configureFlags = [
     "--datadir=$doc/share/doc/ghc"
     "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
-  ] ++ stdenv.lib.optionals (libffi != null) [
+  ] ++ lib.optionals (libffi != null) [
     "--with-system-libffi"
     "--with-ffi-includes=${targetPackages.libffi.dev}/include"
     "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
+  ] ++ lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
     "--with-gmp-includes=${targetPackages.gmp.dev}/include"
     "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
+  ] ++ lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
     "--with-iconv-includes=${libiconv}/include"
     "--with-iconv-libraries=${libiconv}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
+  ] ++ lib.optionals (targetPlatform != hostPlatform) [
     "--enable-bootstrap-with-devel-snapshot"
-  ] ++ stdenv.lib.optionals useLdGold [
+  ] ++ lib.optionals useLdGold [
     "CFLAGS=-fuse-ld=gold"
     "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
     "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
-  ] ++ stdenv.lib.optionals (disableLargeAddressSpace) [
+  ] ++ lib.optionals (disableLargeAddressSpace) [
     "--disable-large-address-space"
   ];
 
@@ -194,7 +194,7 @@ stdenv.mkDerivation (rec {
   strictDeps = true;
 
   # Don’t add -liconv to LDFLAGS automatically so that GHC will add it itself.
-	dontAddExtraLibs = true;
+  dontAddExtraLibs = true;
 
   nativeBuildInputs = [
     perl autoconf automake m4 python3 sphinx
@@ -207,18 +207,18 @@ stdenv.mkDerivation (rec {
   buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
 
   propagatedBuildInputs = [ targetPackages.stdenv.cc ]
-    ++ stdenv.lib.optional useLLVM llvmPackages.llvm;
+    ++ lib.optional useLLVM llvmPackages.llvm;
 
-  depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform);
-  depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform);
+  depsTargetTarget = map lib.getDev (libDeps targetPlatform);
+  depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
 
   # required, because otherwise all symbols from HSffi.o are stripped, and
   # that in turn causes GHCi to abort
-  stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
+  stripDebugFlags = [ "-S" ] ++ lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
 
   checkTarget = "test";
 
-  hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
+  hardeningDisable = [ "format" ] ++ lib.optional stdenv.targetPlatform.isMusl "pie";
 
   postInstall = ''
     # Install the bash completion file.
@@ -228,7 +228,7 @@ stdenv.mkDerivation (rec {
     for i in "$out/bin/"*; do
       test ! -h $i || continue
       egrep --quiet '^#!' <(head -n 1 $i) || continue
-      sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
+      sed -i -e '2i export PATH="$PATH:${lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
     done
   '';
 
@@ -245,14 +245,14 @@ stdenv.mkDerivation (rec {
   meta = {
     homepage = "http://haskell.org/ghc";
     description = "The Glasgow Haskell Compiler";
-    maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ];
+    maintainers = with lib.maintainers; [ marcweber andres peti ];
     timeout = 24 * 3600;
     inherit (ghc.meta) license platforms;
   };
 
   dontStrip = (targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm);
 
-} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt{
+} // lib.optionalAttrs targetPlatform.useAndroidPrebuilt{
   dontPatchELF = true;
   noAuditTmpdir = true;
 })
diff --git a/nixpkgs/pkgs/development/compilers/ghc/8.10.2-binary.nix b/nixpkgs/pkgs/development/compilers/ghc/8.10.2-binary.nix
index 1a1a9ca0160e..02373d00b10f 100644
--- a/nixpkgs/pkgs/development/compilers/ghc/8.10.2-binary.nix
+++ b/nixpkgs/pkgs/development/compilers/ghc/8.10.2-binary.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl, perl, gcc
 , ncurses6, gmp, glibc, libiconv, numactl
 , llvmPackages
@@ -16,12 +16,12 @@ assert stdenv.targetPlatform == stdenv.hostPlatform;
 let
   useLLVM = !stdenv.targetPlatform.isx86;
 
-  libPath = stdenv.lib.makeLibraryPath ([
+  libPath = lib.makeLibraryPath ([
     ncurses6 gmp
-  ] ++ stdenv.lib.optional (stdenv.hostPlatform.isDarwin) libiconv
-    ++ stdenv.lib.optional (stdenv.hostPlatform.isAarch64) numactl);
+  ] ++ lib.optional (stdenv.hostPlatform.isDarwin) libiconv
+    ++ lib.optional (stdenv.hostPlatform.isAarch64) numactl);
 
-  libEnvVar = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin "DY"
+  libEnvVar = lib.optionalString stdenv.hostPlatform.isDarwin "DY"
     + "LD_LIBRARY_PATH";
 
   glibcDynLinker = assert stdenv.isLinux;
@@ -29,7 +29,7 @@ let
        # Could be stdenv.cc.bintools.dynamicLinker, keeping as-is to avoid rebuild.
        ''"$(cat $NIX_CC/nix-support/dynamic-linker)"''
     else
-      "${stdenv.lib.getLib glibc}/lib/ld-linux*";
+      "${lib.getLib glibc}/lib/ld-linux*";
 
 in
 
@@ -64,7 +64,7 @@ stdenv.mkDerivation rec {
     or (throw "cannot bootstrap GHC on this platform"));
 
   nativeBuildInputs = [ perl ];
-  propagatedBuildInputs = stdenv.lib.optionals useLLVM [ llvmPackages.llvm ];
+  propagatedBuildInputs = lib.optionals useLLVM [ llvmPackages.llvm ];
 
   # Cannot patchelf beforehand due to relative RPATHs that anticipate
   # the final install location/
@@ -73,7 +73,7 @@ stdenv.mkDerivation rec {
   postUnpack =
     # GHC has dtrace probes, which causes ld to try to open /usr/lib/libdtrace.dylib
     # during linking
-    stdenv.lib.optionalString stdenv.isDarwin ''
+    lib.optionalString stdenv.isDarwin ''
       export NIX_LDFLAGS+=" -no_dtrace_dof"
       # not enough room in the object files for the full path to libiconv :(
       for exe in $(find . -type f -executable); do
@@ -92,20 +92,20 @@ stdenv.mkDerivation rec {
     ''
       find . -name integer-gmp.buildinfo \
           -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${gmp.out}/lib@" {} \;
-    '' + stdenv.lib.optionalString stdenv.isDarwin ''
+    '' + lib.optionalString stdenv.isDarwin ''
       find . -name base.buildinfo \
           -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${libiconv}/lib@" {} \;
     '' +
     # aarch64 does HAVE_NUMA so -lnuma requires it in library-dirs in rts/package.conf.in
     # FFI_LIB_DIR is a good indication of places it must be needed.
-    stdenv.lib.optionalString stdenv.hostPlatform.isAarch64 ''
+    lib.optionalString stdenv.hostPlatform.isAarch64 ''
       find . -name package.conf.in \
           -exec sed -i "s@FFI_LIB_DIR@FFI_LIB_DIR ${numactl.out}/lib@g" {} \;
     '' +
     # Rename needed libraries and binaries, fix interpreter
-    stdenv.lib.optionalString stdenv.isLinux ''
+    lib.optionalString stdenv.isLinux ''
       find . -type f -perm -0100 -exec patchelf \
-          --replace-needed libncurses${stdenv.lib.optionalString stdenv.is64bit "w"}.so.6 libncurses.so \
+          --replace-needed libncurses${lib.optionalString stdenv.is64bit "w"}.so.6 libncurses.so \
           --interpreter ${glibcDynLinker} {} \;
 
       sed -i "s|/usr/bin/perl|perl\x00        |" ghc-${version}/ghc/stage2/build/tmp/ghc-stage2
@@ -117,21 +117,21 @@ stdenv.mkDerivation rec {
     # (`__strdup` is defined to be an alias of `strdup` anyway[1]).
     # [1] http://refspecs.linuxbase.org/LSB_4.0.0/LSB-Core-generic/LSB-Core-generic/baselib---strdup-1.html
     # Use objcopy magic to make the change:
-    stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+    lib.optionalString stdenv.hostPlatform.isMusl ''
       find ./ghc-${version}/rts -name "libHSrts*.a" -exec ''${OBJCOPY:-objcopy} --redefine-sym __strdup=strdup {} \;
     '';
 
   # fix for `configure: error: Your linker is affected by binutils #16177`
-  preConfigure = stdenv.lib.optionalString
+  preConfigure = lib.optionalString
     stdenv.targetPlatform.isAarch32
     "LD=ld.gold";
 
   configurePlatforms = [ ];
   configureFlags = [
-    "--with-gmp-libraries=${stdenv.lib.getLib gmp}/lib"
-    "--with-gmp-includes=${stdenv.lib.getDev gmp}/include"
-  ] ++ stdenv.lib.optional stdenv.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}"
-    ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override";
+    "--with-gmp-libraries=${lib.getLib gmp}/lib"
+    "--with-gmp-includes=${lib.getDev gmp}/include"
+  ] ++ lib.optional stdenv.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}"
+    ++ lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override";
 
   # No building is necessary, but calling make without flags ironically
   # calls install-strip ...
@@ -139,7 +139,7 @@ stdenv.mkDerivation rec {
 
   # On Linux, use patchelf to modify the executables so that they can
   # find editline/gmp.
-  postFixup = stdenv.lib.optionalString stdenv.isLinux
+  postFixup = lib.optionalString stdenv.isLinux
     (if stdenv.hostPlatform.isAarch64 then
       # Keep rpath as small as possible on aarch64 for patchelf#244.  All Elfs
       # are 2 directories deep from $out/lib, so pooling symlinks there makes
@@ -167,7 +167,7 @@ stdenv.mkDerivation rec {
           patchelf --set-rpath "${libPath}:$(patchelf --print-rpath $p)" $p
         fi
       done
-    '') + stdenv.lib.optionalString stdenv.isDarwin ''
+    '') + lib.optionalString stdenv.isDarwin ''
     # not enough room in the object files for the full path to libiconv :(
     for exe in $(find "$out" -type f -executable); do
       isScript $exe && continue
@@ -179,7 +179,7 @@ stdenv.mkDerivation rec {
       substituteInPlace $file --replace /usr/bin/ranlib "$(type -P ranlib)"
     done
   '' +
-  stdenv.lib.optionalString minimal ''
+  lib.optionalString minimal ''
     # Remove profiling files
     find $out -type f -name '*.p_o' -delete
     find $out -type f -name '*.p_hi' -delete
@@ -215,8 +215,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://haskell.org/ghc";
     description = "The Glasgow Haskell Compiler";
-    license = stdenv.lib.licenses.bsd3;
+    license = lib.licenses.bsd3;
     platforms = ["x86_64-linux" "armv7l-linux" "aarch64-linux" "i686-linux" "x86_64-darwin"];
-    maintainers = with stdenv.lib.maintainers; [ lostnet ];
+    maintainers = with lib.maintainers; [ lostnet ];
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/ghc/8.10.2.nix b/nixpkgs/pkgs/development/compilers/ghc/8.10.2.nix
index fac12099d5db..6e194b68faa2 100644
--- a/nixpkgs/pkgs/development/compilers/ghc/8.10.2.nix
+++ b/nixpkgs/pkgs/development/compilers/ghc/8.10.2.nix
@@ -1,4 +1,4 @@
-{ stdenv, pkgsBuildTarget, targetPackages
+{ lib, stdenv, pkgsBuildTarget, targetPackages
 
 # build-tools
 , bootPkgs
@@ -18,7 +18,7 @@
 
 , # If enabled, GHC will be built with the GPL-free but slower integer-simple
   # library instead of the faster but GPLed integer-gmp library.
-  enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
+  enableIntegerSimple ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
 
 , # If enabled, use -fPIC when compiling static libs.
   enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
@@ -35,7 +35,7 @@
 
 , # What flavour to build. An empty string indicates no
   # specific flavour and falls back to ghc default values.
-  ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
+  ghcFlavour ? lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
     (if useLLVM then "perf-cross" else "perf-cross-ncg")
 
 , # Whether to disable the large address space allocator
@@ -51,7 +51,7 @@ let
   inherit (bootPkgs) ghc;
 
   # TODO(@Ericson2314) Make unconditional
-  targetPrefix = stdenv.lib.optionalString
+  targetPrefix = lib.optionalString
     (targetPlatform != hostPlatform)
     "${targetPlatform.config}-";
 
@@ -62,30 +62,30 @@ let
     endif
     DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
     INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"}
-  '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
+  '' + lib.optionalString (targetPlatform != hostPlatform) ''
     Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
     CrossCompilePrefix = ${targetPrefix}
     HADDOCK_DOCS = NO
     BUILD_SPHINX_HTML = NO
     BUILD_SPHINX_PDF = NO
-  '' + stdenv.lib.optionalString (!enableProfiledLibs) ''
+  '' + lib.optionalString (!enableProfiledLibs) ''
     GhcLibWays = "v dyn"
-  '' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
+  '' + lib.optionalString enableRelocatedStaticLibs ''
     GhcLibHcOpts += -fPIC
     GhcRtsHcOpts += -fPIC
-  '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
+  '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
     EXTRA_CC_OPTS += -std=gnu99
   '';
 
   # Splicer will pull out correct variations
-  libDeps = platform: stdenv.lib.optional enableTerminfo ncurses
+  libDeps = platform: lib.optional enableTerminfo ncurses
     ++ [libffi]
-    ++ stdenv.lib.optional (!enableIntegerSimple) gmp
-    ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
+    ++ lib.optional (!enableIntegerSimple) gmp
+    ++ lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
 
   toolsForTarget = [
     pkgsBuildTarget.targetPackages.stdenv.cc
-  ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm;
+  ] ++ lib.optional useLLVM buildLlvmPackages.llvm;
 
   targetCC = builtins.head toolsForTarget;
 
@@ -110,7 +110,7 @@ stdenv.mkDerivation (rec {
   # https://gitlab.haskell.org/ghc/ghc/-/issues/18549
   patches = [
     ./issue-18549.patch
-  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+  ] ++ lib.optionals stdenv.isDarwin [
     # Make Block.h compile with c++ compilers. Remove with the next release
     (fetchpatch {
       url = "https://gitlab.haskell.org/ghc/ghc/-/commit/97d0b0a367e4c6a52a17c3299439ac7de129da24.patch";
@@ -130,7 +130,7 @@ stdenv.mkDerivation (rec {
     export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
     export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
     # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
-    export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString useLdGold ".gold"}"
+    export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${lib.optionalString useLdGold ".gold"}"
     export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
     export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
     export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
@@ -140,13 +140,13 @@ stdenv.mkDerivation (rec {
 
     echo -n "${buildMK}" > mk/build.mk
     sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
-  '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
+  '' + lib.optionalString (!stdenv.isDarwin) ''
     export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     export NIX_LDFLAGS+=" -no_dtrace_dof"
-  '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
+  '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
     sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
-  '' + stdenv.lib.optionalString targetPlatform.isMusl ''
+  '' + lib.optionalString targetPlatform.isMusl ''
       echo "patching llvm-targets for musl targets..."
       echo "Cloning these existing '*-linux-gnu*' targets:"
       grep linux-gnu llvm-targets | sed 's/^/  /'
@@ -166,29 +166,29 @@ stdenv.mkDerivation (rec {
 
   # TODO(@Ericson2314): Always pass "--target" and always prefix.
   configurePlatforms = [ "build" "host" ]
-    ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+    ++ lib.optional (targetPlatform != hostPlatform) "target";
 
   # `--with` flags for libraries needed for RTS linker
   configureFlags = [
     "--datadir=$doc/share/doc/ghc"
     "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
-  ] ++ stdenv.lib.optionals (libffi != null) [
+  ] ++ lib.optionals (libffi != null) [
     "--with-system-libffi"
     "--with-ffi-includes=${targetPackages.libffi.dev}/include"
     "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
+  ] ++ lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
     "--with-gmp-includes=${targetPackages.gmp.dev}/include"
     "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
+  ] ++ lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
     "--with-iconv-includes=${libiconv}/include"
     "--with-iconv-libraries=${libiconv}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
+  ] ++ lib.optionals (targetPlatform != hostPlatform) [
     "--enable-bootstrap-with-devel-snapshot"
-  ] ++ stdenv.lib.optionals useLdGold [
+  ] ++ lib.optionals useLdGold [
     "CFLAGS=-fuse-ld=gold"
     "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
     "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
-  ] ++ stdenv.lib.optionals (disableLargeAddressSpace) [
+  ] ++ lib.optionals (disableLargeAddressSpace) [
     "--disable-large-address-space"
   ];
 
@@ -209,18 +209,18 @@ stdenv.mkDerivation (rec {
   buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
 
   propagatedBuildInputs = [ targetPackages.stdenv.cc ]
-    ++ stdenv.lib.optional useLLVM llvmPackages.llvm;
+    ++ lib.optional useLLVM llvmPackages.llvm;
 
-  depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform);
-  depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform);
+  depsTargetTarget = map lib.getDev (libDeps targetPlatform);
+  depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
 
   # required, because otherwise all symbols from HSffi.o are stripped, and
   # that in turn causes GHCi to abort
-  stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
+  stripDebugFlags = [ "-S" ] ++ lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
 
   checkTarget = "test";
 
-  hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
+  hardeningDisable = [ "format" ] ++ lib.optional stdenv.targetPlatform.isMusl "pie";
 
   postInstall = ''
     # Install the bash completion file.
@@ -230,7 +230,7 @@ stdenv.mkDerivation (rec {
     for i in "$out/bin/"*; do
       test ! -h $i || continue
       egrep --quiet '^#!' <(head -n 1 $i) || continue
-      sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
+      sed -i -e '2i export PATH="$PATH:${lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
     done
   '';
 
@@ -247,12 +247,12 @@ stdenv.mkDerivation (rec {
   meta = {
     homepage = "http://haskell.org/ghc";
     description = "The Glasgow Haskell Compiler";
-    maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ];
+    maintainers = with lib.maintainers; [ marcweber andres peti ];
     timeout = 24 * 3600;
     inherit (ghc.meta) license platforms;
   };
 
-} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
+} // lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
   dontStrip = true;
   dontPatchELF = true;
   noAuditTmpdir = true;
diff --git a/nixpkgs/pkgs/development/compilers/ghc/8.10.3.nix b/nixpkgs/pkgs/development/compilers/ghc/8.10.3.nix
index c24b72fb43bd..582817cca070 100644
--- a/nixpkgs/pkgs/development/compilers/ghc/8.10.3.nix
+++ b/nixpkgs/pkgs/development/compilers/ghc/8.10.3.nix
@@ -1,4 +1,4 @@
-{ stdenv, pkgsBuildTarget, targetPackages
+{ lib, stdenv, pkgsBuildTarget, targetPackages
 
 # build-tools
 , bootPkgs
@@ -18,7 +18,7 @@
 
 , # If enabled, GHC will be built with the GPL-free but slower integer-simple
   # library instead of the faster but GPLed integer-gmp library.
-  enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
+  enableIntegerSimple ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
 
 , # If enabled, use -fPIC when compiling static libs.
   enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
@@ -35,7 +35,7 @@
 
 , # What flavour to build. An empty string indicates no
   # specific flavour and falls back to ghc default values.
-  ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
+  ghcFlavour ? lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
     (if useLLVM then "perf-cross" else "perf-cross-ncg")
 
 , # Whether to disable the large address space allocator
@@ -51,7 +51,7 @@ let
   inherit (bootPkgs) ghc;
 
   # TODO(@Ericson2314) Make unconditional
-  targetPrefix = stdenv.lib.optionalString
+  targetPrefix = lib.optionalString
     (targetPlatform != hostPlatform)
     "${targetPlatform.config}-";
 
@@ -62,30 +62,30 @@ let
     endif
     DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
     INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"}
-  '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
+  '' + lib.optionalString (targetPlatform != hostPlatform) ''
     Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
     CrossCompilePrefix = ${targetPrefix}
     HADDOCK_DOCS = NO
     BUILD_SPHINX_HTML = NO
     BUILD_SPHINX_PDF = NO
-  '' + stdenv.lib.optionalString (!enableProfiledLibs) ''
+  '' + lib.optionalString (!enableProfiledLibs) ''
     GhcLibWays = "v dyn"
-  '' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
+  '' + lib.optionalString enableRelocatedStaticLibs ''
     GhcLibHcOpts += -fPIC
     GhcRtsHcOpts += -fPIC
-  '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
+  '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
     EXTRA_CC_OPTS += -std=gnu99
   '';
 
   # Splicer will pull out correct variations
-  libDeps = platform: stdenv.lib.optional enableTerminfo ncurses
+  libDeps = platform: lib.optional enableTerminfo ncurses
     ++ [libffi]
-    ++ stdenv.lib.optional (!enableIntegerSimple) gmp
-    ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
+    ++ lib.optional (!enableIntegerSimple) gmp
+    ++ lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
 
   toolsForTarget = [
     pkgsBuildTarget.targetPackages.stdenv.cc
-  ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm;
+  ] ++ lib.optional useLLVM buildLlvmPackages.llvm;
 
   targetCC = builtins.head toolsForTarget;
 
@@ -107,7 +107,7 @@ stdenv.mkDerivation (rec {
 
   outputs = [ "out" "doc" ];
 
-  patches = stdenv.lib.optionals stdenv.isDarwin [
+  patches = lib.optionals stdenv.isDarwin [
     # Make Block.h compile with c++ compilers. Remove with the next release
     (fetchpatch {
       url = "https://gitlab.haskell.org/ghc/ghc/-/commit/97d0b0a367e4c6a52a17c3299439ac7de129da24.patch";
@@ -127,7 +127,7 @@ stdenv.mkDerivation (rec {
     export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
     export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
     # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
-    export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString useLdGold ".gold"}"
+    export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${lib.optionalString useLdGold ".gold"}"
     export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
     export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
     export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
@@ -137,13 +137,13 @@ stdenv.mkDerivation (rec {
 
     echo -n "${buildMK}" > mk/build.mk
     sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
-  '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
+  '' + lib.optionalString (!stdenv.isDarwin) ''
     export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     export NIX_LDFLAGS+=" -no_dtrace_dof"
-  '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
+  '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
     sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
-  '' + stdenv.lib.optionalString targetPlatform.isMusl ''
+  '' + lib.optionalString targetPlatform.isMusl ''
       echo "patching llvm-targets for musl targets..."
       echo "Cloning these existing '*-linux-gnu*' targets:"
       grep linux-gnu llvm-targets | sed 's/^/  /'
@@ -163,29 +163,29 @@ stdenv.mkDerivation (rec {
 
   # TODO(@Ericson2314): Always pass "--target" and always prefix.
   configurePlatforms = [ "build" "host" ]
-    ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+    ++ lib.optional (targetPlatform != hostPlatform) "target";
 
   # `--with` flags for libraries needed for RTS linker
   configureFlags = [
     "--datadir=$doc/share/doc/ghc"
     "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
-  ] ++ stdenv.lib.optionals (libffi != null) [
+  ] ++ lib.optionals (libffi != null) [
     "--with-system-libffi"
     "--with-ffi-includes=${targetPackages.libffi.dev}/include"
     "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
+  ] ++ lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
     "--with-gmp-includes=${targetPackages.gmp.dev}/include"
     "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
+  ] ++ lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
     "--with-iconv-includes=${libiconv}/include"
     "--with-iconv-libraries=${libiconv}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
+  ] ++ lib.optionals (targetPlatform != hostPlatform) [
     "--enable-bootstrap-with-devel-snapshot"
-  ] ++ stdenv.lib.optionals useLdGold [
+  ] ++ lib.optionals useLdGold [
     "CFLAGS=-fuse-ld=gold"
     "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
     "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
-  ] ++ stdenv.lib.optionals (disableLargeAddressSpace) [
+  ] ++ lib.optionals (disableLargeAddressSpace) [
     "--disable-large-address-space"
   ];
 
@@ -206,18 +206,18 @@ stdenv.mkDerivation (rec {
   buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
 
   propagatedBuildInputs = [ targetPackages.stdenv.cc ]
-    ++ stdenv.lib.optional useLLVM llvmPackages.llvm;
+    ++ lib.optional useLLVM llvmPackages.llvm;
 
-  depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform);
-  depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform);
+  depsTargetTarget = map lib.getDev (libDeps targetPlatform);
+  depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
 
   # required, because otherwise all symbols from HSffi.o are stripped, and
   # that in turn causes GHCi to abort
-  stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
+  stripDebugFlags = [ "-S" ] ++ lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
 
   checkTarget = "test";
 
-  hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
+  hardeningDisable = [ "format" ] ++ lib.optional stdenv.targetPlatform.isMusl "pie";
 
   postInstall = ''
     # Install the bash completion file.
@@ -227,7 +227,7 @@ stdenv.mkDerivation (rec {
     for i in "$out/bin/"*; do
       test ! -h $i || continue
       egrep --quiet '^#!' <(head -n 1 $i) || continue
-      sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
+      sed -i -e '2i export PATH="$PATH:${lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
     done
   '';
 
@@ -244,12 +244,12 @@ stdenv.mkDerivation (rec {
   meta = {
     homepage = "http://haskell.org/ghc";
     description = "The Glasgow Haskell Compiler";
-    maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ];
+    maintainers = with lib.maintainers; [ marcweber andres peti ];
     timeout = 24 * 3600;
     inherit (ghc.meta) license platforms;
   };
 
-} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
+} // lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
   dontStrip = true;
   dontPatchELF = true;
   noAuditTmpdir = true;
diff --git a/nixpkgs/pkgs/development/compilers/ghc/8.2.2-binary.nix b/nixpkgs/pkgs/development/compilers/ghc/8.2.2-binary.nix
index 9f546bcb541c..5f83c2b2afc2 100644
--- a/nixpkgs/pkgs/development/compilers/ghc/8.2.2-binary.nix
+++ b/nixpkgs/pkgs/development/compilers/ghc/8.2.2-binary.nix
@@ -1,4 +1,4 @@
-{ stdenv, substituteAll
+{ lib, stdenv, substituteAll
 , fetchurl, perl, gcc, llvm
 , ncurses5, gmp, glibc, libiconv
 , llvmPackages
@@ -10,11 +10,11 @@ assert stdenv.targetPlatform == stdenv.hostPlatform;
 let
   useLLVM = !stdenv.targetPlatform.isx86;
 
-  libPath = stdenv.lib.makeLibraryPath ([
+  libPath = lib.makeLibraryPath ([
     ncurses5 gmp
-  ] ++ stdenv.lib.optional (stdenv.hostPlatform.isDarwin) libiconv);
+  ] ++ lib.optional (stdenv.hostPlatform.isDarwin) libiconv);
 
-  libEnvVar = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin "DY"
+  libEnvVar = lib.optionalString stdenv.hostPlatform.isDarwin "DY"
     + "LD_LIBRARY_PATH";
 
   glibcDynLinker = assert stdenv.isLinux;
@@ -22,7 +22,7 @@ let
        # Could be stdenv.cc.bintools.dynamicLinker, keeping as-is to avoid rebuild.
        ''"$(cat $NIX_CC/nix-support/dynamic-linker)"''
     else
-      "${stdenv.lib.getLib glibc}/lib/ld-linux*";
+      "${lib.getLib glibc}/lib/ld-linux*";
 
 in
 
@@ -56,7 +56,7 @@ stdenv.mkDerivation rec {
     or (throw "cannot bootstrap GHC on this platform"));
 
   nativeBuildInputs = [ perl ];
-  propagatedBuildInputs = stdenv.lib.optionals useLLVM [ llvmPackages.llvm ];
+  propagatedBuildInputs = lib.optionals useLLVM [ llvmPackages.llvm ];
 
   # Cannot patchelf beforehand due to relative RPATHs that anticipate
   # the final install location/
@@ -65,7 +65,7 @@ stdenv.mkDerivation rec {
   postUnpack =
     # GHC has dtrace probes, which causes ld to try to open /usr/lib/libdtrace.dylib
     # during linking
-    stdenv.lib.optionalString stdenv.isDarwin ''
+    lib.optionalString stdenv.isDarwin ''
       export NIX_LDFLAGS+=" -no_dtrace_dof"
       # not enough room in the object files for the full path to libiconv :(
       for exe in $(find . -type f -executable); do
@@ -97,14 +97,14 @@ stdenv.mkDerivation rec {
     ''
       find . -name integer-gmp.buildinfo \
           -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${gmp.out}/lib@" {} \;
-    '' + stdenv.lib.optionalString stdenv.isDarwin ''
+    '' + lib.optionalString stdenv.isDarwin ''
       find . -name base.buildinfo \
           -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${libiconv}/lib@" {} \;
     '' +
     # Rename needed libraries and binaries, fix interpreter
-    stdenv.lib.optionalString stdenv.isLinux ''
+    lib.optionalString stdenv.isLinux ''
       find . -type f -perm -0100 -exec patchelf \
-          --replace-needed libncurses${stdenv.lib.optionalString stdenv.is64bit "w"}.so.5 libncurses.so \
+          --replace-needed libncurses${lib.optionalString stdenv.is64bit "w"}.so.5 libncurses.so \
           --replace-needed libtinfo.so libtinfo.so.5 \
           --interpreter ${glibcDynLinker} {} \;
 
@@ -117,7 +117,7 @@ stdenv.mkDerivation rec {
     # (`__strdup` is defined to be an alias of `strdup` anyway[1]).
     # [1] http://refspecs.linuxbase.org/LSB_4.0.0/LSB-Core-generic/LSB-Core-generic/baselib---strdup-1.html
     # Use objcopy magic to make the change:
-    stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+    lib.optionalString stdenv.hostPlatform.isMusl ''
       find ./ghc-${version}/rts -name "libHSrts*.a" -exec ''${OBJCOPY:-objcopy} --redefine-sym __strdup=strdup {} \;
     '';
 
@@ -130,10 +130,10 @@ stdenv.mkDerivation rec {
       src = ./gcc-clang-wrapper.sh;
     };
   in
-  [ "--with-gmp-libraries=${stdenv.lib.getLib gmp}/lib"
-    "--with-gmp-includes=${stdenv.lib.getDev gmp}/include"
-  ] ++ stdenv.lib.optional stdenv.isDarwin            "--with-gcc=${gcc-clang-wrapper}"
-    ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override";
+  [ "--with-gmp-libraries=${lib.getLib gmp}/lib"
+    "--with-gmp-includes=${lib.getDev gmp}/include"
+  ] ++ lib.optional stdenv.isDarwin            "--with-gcc=${gcc-clang-wrapper}"
+    ++ lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override";
 
   # Stripping combined with patchelf breaks the executables (they die
   # with a segfault or the kernel even refuses the execve). (NIXPKGS-85)
@@ -145,14 +145,14 @@ stdenv.mkDerivation rec {
 
   # On Linux, use patchelf to modify the executables so that they can
   # find editline/gmp.
-  preFixup = stdenv.lib.optionalString stdenv.isLinux ''
+  preFixup = lib.optionalString stdenv.isLinux ''
     for p in $(find "$out" -type f -executable); do
       if isELF "$p"; then
         echo "Patchelfing $p"
         patchelf --set-rpath "${libPath}:$(patchelf --print-rpath $p)" $p
       fi
     done
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     # not enough room in the object files for the full path to libiconv :(
     for exe in $(find "$out" -type f -executable); do
       isScript $exe && continue
@@ -186,6 +186,6 @@ stdenv.mkDerivation rec {
     enableShared = true;
   };
 
-  meta.license = stdenv.lib.licenses.bsd3;
+  meta.license = lib.licenses.bsd3;
   meta.platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin" "armv7l-linux" "aarch64-linux"];
 }
diff --git a/nixpkgs/pkgs/development/compilers/ghc/8.6.5-binary.nix b/nixpkgs/pkgs/development/compilers/ghc/8.6.5-binary.nix
index 9234e3b14571..ca984c36957d 100644
--- a/nixpkgs/pkgs/development/compilers/ghc/8.6.5-binary.nix
+++ b/nixpkgs/pkgs/development/compilers/ghc/8.6.5-binary.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl, perl, gcc
 , ncurses5, ncurses6, gmp, glibc, libiconv
 , llvmPackages
@@ -14,11 +14,11 @@ let
 
   ourNcurses = if useNcurses6 then ncurses6 else ncurses5;
 
-  libPath = stdenv.lib.makeLibraryPath ([
+  libPath = lib.makeLibraryPath ([
     ourNcurses gmp
-  ] ++ stdenv.lib.optional (stdenv.hostPlatform.isDarwin) libiconv);
+  ] ++ lib.optional (stdenv.hostPlatform.isDarwin) libiconv);
 
-  libEnvVar = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin "DY"
+  libEnvVar = lib.optionalString stdenv.hostPlatform.isDarwin "DY"
     + "LD_LIBRARY_PATH";
 
   glibcDynLinker = assert stdenv.isLinux;
@@ -26,7 +26,7 @@ let
        # Could be stdenv.cc.bintools.dynamicLinker, keeping as-is to avoid rebuild.
        ''"$(cat $NIX_CC/nix-support/dynamic-linker)"''
     else
-      "${stdenv.lib.getLib glibc}/lib/ld-linux*";
+      "${lib.getLib glibc}/lib/ld-linux*";
 
 in
 
@@ -61,7 +61,7 @@ stdenv.mkDerivation rec {
     or (throw "cannot bootstrap GHC on this platform"));
 
   nativeBuildInputs = [ perl ];
-  propagatedBuildInputs = stdenv.lib.optionals useLLVM [ llvmPackages.llvm ];
+  propagatedBuildInputs = lib.optionals useLLVM [ llvmPackages.llvm ];
 
   # Cannot patchelf beforehand due to relative RPATHs that anticipate
   # the final install location/
@@ -70,7 +70,7 @@ stdenv.mkDerivation rec {
   postUnpack =
     # GHC has dtrace probes, which causes ld to try to open /usr/lib/libdtrace.dylib
     # during linking
-    stdenv.lib.optionalString stdenv.isDarwin ''
+    lib.optionalString stdenv.isDarwin ''
       export NIX_LDFLAGS+=" -no_dtrace_dof"
       # not enough room in the object files for the full path to libiconv :(
       for exe in $(find . -type f -executable); do
@@ -90,17 +90,17 @@ stdenv.mkDerivation rec {
     ''
       find . -name integer-gmp.buildinfo \
           -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${gmp.out}/lib@" {} \;
-    '' + stdenv.lib.optionalString stdenv.isDarwin ''
+    '' + lib.optionalString stdenv.isDarwin ''
       find . -name base.buildinfo \
           -exec sed -i "s@extra-lib-dirs: @extra-lib-dirs: ${libiconv}/lib@" {} \;
     '' +
     # Rename needed libraries and binaries, fix interpreter
-    stdenv.lib.optionalString stdenv.isLinux ''
+    lib.optionalString stdenv.isLinux ''
       find . -type f -perm -0100 \
           -exec patchelf \
-          --replace-needed libncurses${stdenv.lib.optionalString stdenv.is64bit "w"}.so.5 libncurses.so \
+          --replace-needed libncurses${lib.optionalString stdenv.is64bit "w"}.so.5 libncurses.so \
           ${ # This isn't required for x86_64-linux where we use ncurses6
-             stdenv.lib.optionalString (!useNcurses6) "--replace-needed libtinfo.so libtinfo.so.5"
+             lib.optionalString (!useNcurses6) "--replace-needed libtinfo.so libtinfo.so.5"
            } \
           --interpreter ${glibcDynLinker} {} \;
 
@@ -113,16 +113,16 @@ stdenv.mkDerivation rec {
     # (`__strdup` is defined to be an alias of `strdup` anyway[1]).
     # [1] http://refspecs.linuxbase.org/LSB_4.0.0/LSB-Core-generic/LSB-Core-generic/baselib---strdup-1.html
     # Use objcopy magic to make the change:
-    stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+    lib.optionalString stdenv.hostPlatform.isMusl ''
       find ./ghc-${version}/rts -name "libHSrts*.a" -exec ''${OBJCOPY:-objcopy} --redefine-sym __strdup=strdup {} \;
     '';
 
   configurePlatforms = [ ];
   configureFlags = [
-    "--with-gmp-libraries=${stdenv.lib.getLib gmp}/lib"
-    "--with-gmp-includes=${stdenv.lib.getDev gmp}/include"
-  ] ++ stdenv.lib.optional stdenv.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}"
-    ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override";
+    "--with-gmp-libraries=${lib.getLib gmp}/lib"
+    "--with-gmp-includes=${lib.getDev gmp}/include"
+  ] ++ lib.optional stdenv.isDarwin "--with-gcc=${./gcc-clang-wrapper.sh}"
+    ++ lib.optional stdenv.hostPlatform.isMusl "--disable-ld-override";
 
   # No building is necessary, but calling make without flags ironically
   # calls install-strip ...
@@ -130,14 +130,14 @@ stdenv.mkDerivation rec {
 
   # On Linux, use patchelf to modify the executables so that they can
   # find editline/gmp.
-  postFixup = stdenv.lib.optionalString stdenv.isLinux ''
+  postFixup = lib.optionalString stdenv.isLinux ''
     for p in $(find "$out" -type f -executable); do
       if isELF "$p"; then
         echo "Patchelfing $p"
         patchelf --set-rpath "${libPath}:$(patchelf --print-rpath $p)" $p
       fi
     done
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     # not enough room in the object files for the full path to libiconv :(
     for exe in $(find "$out" -type f -executable); do
       isScript $exe && continue
@@ -171,6 +171,6 @@ stdenv.mkDerivation rec {
     enableShared = true;
   };
 
-  meta.license = stdenv.lib.licenses.bsd3;
+  meta.license = lib.licenses.bsd3;
   meta.platforms = ["x86_64-linux" "aarch64-linux" "i686-linux" "x86_64-darwin"];
 }
diff --git a/nixpkgs/pkgs/development/compilers/ghc/8.6.5.nix b/nixpkgs/pkgs/development/compilers/ghc/8.6.5.nix
index 7adacff597ca..219ace5a9164 100644
--- a/nixpkgs/pkgs/development/compilers/ghc/8.6.5.nix
+++ b/nixpkgs/pkgs/development/compilers/ghc/8.6.5.nix
@@ -1,4 +1,4 @@
-{ stdenv, pkgsBuildTarget, targetPackages
+{ lib, stdenv, pkgsBuildTarget, targetPackages
 
 # build-tools
 , bootPkgs
@@ -18,7 +18,7 @@
 
 , # If enabled, GHC will be built with the GPL-free but slower integer-simple
   # library instead of the faster but GPLed integer-gmp library.
-  enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
+  enableIntegerSimple ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
 
 , # If enabled, use -fPIC when compiling static libs.
   enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
@@ -32,7 +32,7 @@
 
 , # What flavour to build. An empty string indicates no
   # specific flavour and falls back to ghc default values.
-  ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
+  ghcFlavour ? lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
     (if useLLVM then "perf-cross" else "perf-cross-ncg")
 
 , # Whether to disable the large address space allocator
@@ -48,7 +48,7 @@ let
   inherit (bootPkgs) ghc;
 
   # TODO(@Ericson2314) Make unconditional
-  targetPrefix = stdenv.lib.optionalString
+  targetPrefix = lib.optionalString
     (targetPlatform != hostPlatform)
     "${targetPlatform.config}-";
 
@@ -66,28 +66,28 @@ let
     # to actually link to our new Libc. The iOS simulator is a special
     # exception because we can’t actually run simulators binaries
     # ourselves.
-  + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
+  + lib.optionalString (targetPlatform != hostPlatform) ''
     Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"}
     CrossCompilePrefix = ${targetPrefix}
     HADDOCK_DOCS = NO
     BUILD_SPHINX_HTML = NO
     BUILD_SPHINX_PDF = NO
-  '' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
+  '' + lib.optionalString enableRelocatedStaticLibs ''
     GhcLibHcOpts += -fPIC
     GhcRtsHcOpts += -fPIC
-  '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
+  '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
     EXTRA_CC_OPTS += -std=gnu99
   '';
 
   # Splicer will pull out correct variations
-  libDeps = platform: stdenv.lib.optional enableTerminfo ncurses
+  libDeps = platform: lib.optional enableTerminfo ncurses
     ++ [libffi]
-    ++ stdenv.lib.optional (!enableIntegerSimple) gmp
-    ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
+    ++ lib.optional (!enableIntegerSimple) gmp
+    ++ lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
 
   toolsForTarget = [
     pkgsBuildTarget.targetPackages.stdenv.cc
-  ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm;
+  ] ++ lib.optional useLLVM buildLlvmPackages.llvm;
 
   targetCC = builtins.head toolsForTarget;
 
@@ -136,7 +136,7 @@ stdenv.mkDerivation (rec {
     export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
     export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
     # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
-    export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString useLdGold ".gold"}"
+    export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${lib.optionalString useLdGold ".gold"}"
     export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
     export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
     export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
@@ -146,13 +146,13 @@ stdenv.mkDerivation (rec {
 
     echo -n "${buildMK}" > mk/build.mk
     sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
-  '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
+  '' + lib.optionalString (!stdenv.isDarwin) ''
     export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     export NIX_LDFLAGS+=" -no_dtrace_dof"
-  '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
+  '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
     sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
-  '' + stdenv.lib.optionalString targetPlatform.isMusl ''
+  '' + lib.optionalString targetPlatform.isMusl ''
       echo "patching llvm-targets for musl targets..."
       echo "Cloning these existing '*-linux-gnu*' targets:"
       grep linux-gnu llvm-targets | sed 's/^/  /'
@@ -172,23 +172,23 @@ stdenv.mkDerivation (rec {
 
   # TODO(@Ericson2314): Always pass "--target" and always prefix.
   configurePlatforms = [ "build" "host" ]
-    ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+    ++ lib.optional (targetPlatform != hostPlatform) "target";
   # `--with` flags for libraries needed for RTS linker
   configureFlags = [
     "--datadir=$doc/share/doc/ghc"
     "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
-  ] ++ stdenv.lib.optionals (libffi != null) ["--with-system-libffi" "--with-ffi-includes=${targetPackages.libffi.dev}/include" "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
+  ] ++ lib.optionals (libffi != null) ["--with-system-libffi" "--with-ffi-includes=${targetPackages.libffi.dev}/include" "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
+  ] ++ lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
     "--with-gmp-includes=${targetPackages.gmp.dev}/include" "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
+  ] ++ lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
     "--with-iconv-includes=${libiconv}/include" "--with-iconv-libraries=${libiconv}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
+  ] ++ lib.optionals (targetPlatform != hostPlatform) [
     "--enable-bootstrap-with-devel-snapshot"
-  ] ++ stdenv.lib.optionals useLdGold [
+  ] ++ lib.optionals useLdGold [
     "CFLAGS=-fuse-ld=gold"
     "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
     "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
-  ] ++ stdenv.lib.optionals (disableLargeAddressSpace) [
+  ] ++ lib.optionals (disableLargeAddressSpace) [
     "--disable-large-address-space"
   ];
 
@@ -209,14 +209,14 @@ stdenv.mkDerivation (rec {
   buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
 
   propagatedBuildInputs = [ targetPackages.stdenv.cc ]
-    ++ stdenv.lib.optional useLLVM llvmPackages.llvm;
+    ++ lib.optional useLLVM llvmPackages.llvm;
 
-  depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform);
-  depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform);
+  depsTargetTarget = map lib.getDev (libDeps targetPlatform);
+  depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
 
   # required, because otherwise all symbols from HSffi.o are stripped, and
   # that in turn causes GHCi to abort
-  stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
+  stripDebugFlags = [ "-S" ] ++ lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
 
   # See #63511 - the only unstripped file is the debug rts which isn't meant to
   # be stripped.
@@ -224,7 +224,7 @@ stdenv.mkDerivation (rec {
 
   checkTarget = "test";
 
-  hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
+  hardeningDisable = [ "format" ] ++ lib.optional stdenv.targetPlatform.isMusl "pie";
 
   postInstall = ''
     # Install the bash completion file.
@@ -234,11 +234,11 @@ stdenv.mkDerivation (rec {
     for i in "$out/bin/"*; do
       test ! -h $i || continue
       egrep --quiet '^#!' <(head -n 1 $i) || continue
-      sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
+      sed -i -e '2i export PATH="$PATH:${lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
     done
   ''
   # Temporary work-around for https://github.com/NixOS/nixpkgs/issues/66277
-  + stdenv.lib.optionalString hostPlatform.isAarch64 ''
+  + lib.optionalString hostPlatform.isAarch64 ''
     rm -rf "$doc/share/doc/ghc/html/libraries"
   '';
 
@@ -255,12 +255,12 @@ stdenv.mkDerivation (rec {
   meta = {
     homepage = "http://haskell.org/ghc";
     description = "The Glasgow Haskell Compiler";
-    maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ];
+    maintainers = with lib.maintainers; [ marcweber andres peti ];
     timeout = 24 * 3600;
     inherit (ghc.meta) license platforms;
   };
 
-} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
+} // lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
   dontStrip = true;
   dontPatchELF = true;
   noAuditTmpdir = true;
diff --git a/nixpkgs/pkgs/development/compilers/ghc/8.8.2.nix b/nixpkgs/pkgs/development/compilers/ghc/8.8.2.nix
index fbb75637df65..94553e56a811 100644
--- a/nixpkgs/pkgs/development/compilers/ghc/8.8.2.nix
+++ b/nixpkgs/pkgs/development/compilers/ghc/8.8.2.nix
@@ -1,4 +1,4 @@
-{ stdenv, pkgsBuildTarget, targetPackages
+{ lib, stdenv, pkgsBuildTarget, targetPackages
 
 # build-tools
 , bootPkgs
@@ -18,7 +18,7 @@
 
 , # If enabled, GHC will be built with the GPL-free but slower integer-simple
   # library instead of the faster but GPLed integer-gmp library.
-  enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
+  enableIntegerSimple ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
 
 , # If enabled, use -fPIC when compiling static libs.
   enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
@@ -32,7 +32,7 @@
 
 , # What flavour to build. An empty string indicates no
   # specific flavour and falls back to ghc default values.
-  ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
+  ghcFlavour ? lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
     (if useLLVM then "perf-cross" else "perf-cross-ncg")
 
 , # Whether to disable the large address space allocator
@@ -48,7 +48,7 @@ let
   inherit (bootPkgs) ghc;
 
   # TODO(@Ericson2314) Make unconditional
-  targetPrefix = stdenv.lib.optionalString
+  targetPrefix = lib.optionalString
     (targetPlatform != hostPlatform)
     "${targetPlatform.config}-";
 
@@ -66,30 +66,30 @@ let
     # to actually link to our new Libc. The iOS simulator is a special
     # exception because we can’t actually run simulators binaries
     # ourselves.
-  + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
+  + lib.optionalString (targetPlatform != hostPlatform) ''
     Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"}
     CrossCompilePrefix = ${targetPrefix}
     HADDOCK_DOCS = NO
     BUILD_SPHINX_HTML = NO
     BUILD_SPHINX_PDF = NO
-  '' + stdenv.lib.optionalString dontStrip ''
+  '' + lib.optionalString dontStrip ''
     STRIP_CMD = :
-  '' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
+  '' + lib.optionalString enableRelocatedStaticLibs ''
     GhcLibHcOpts += -fPIC
     GhcRtsHcOpts += -fPIC
-  '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
+  '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
     EXTRA_CC_OPTS += -std=gnu99
   '';
 
   # Splicer will pull out correct variations
-  libDeps = platform: stdenv.lib.optional enableTerminfo ncurses
+  libDeps = platform: lib.optional enableTerminfo ncurses
     ++ [libffi]
-    ++ stdenv.lib.optional (!enableIntegerSimple) gmp
-    ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
+    ++ lib.optional (!enableIntegerSimple) gmp
+    ++ lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
 
   toolsForTarget = [
     pkgsBuildTarget.targetPackages.stdenv.cc
-  ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm;
+  ] ++ lib.optional useLLVM buildLlvmPackages.llvm;
 
   targetCC = builtins.head toolsForTarget;
 
@@ -123,7 +123,7 @@ stdenv.mkDerivation (rec {
     export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
     export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
     # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
-    export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString useLdGold ".gold"}"
+    export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${lib.optionalString useLdGold ".gold"}"
     export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
     export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
     export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
@@ -133,13 +133,13 @@ stdenv.mkDerivation (rec {
 
     echo -n "${buildMK dontStrip}" > mk/build.mk
     sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
-  '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
+  '' + lib.optionalString (!stdenv.isDarwin) ''
     export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     export NIX_LDFLAGS+=" -no_dtrace_dof"
-  '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
+  '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
     sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
-  '' + stdenv.lib.optionalString targetPlatform.isMusl ''
+  '' + lib.optionalString targetPlatform.isMusl ''
       echo "patching llvm-targets for musl targets..."
       echo "Cloning these existing '*-linux-gnu*' targets:"
       grep linux-gnu llvm-targets | sed 's/^/  /'
@@ -159,29 +159,29 @@ stdenv.mkDerivation (rec {
 
   # TODO(@Ericson2314): Always pass "--target" and always prefix.
   configurePlatforms = [ "build" "host" ]
-    ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+    ++ lib.optional (targetPlatform != hostPlatform) "target";
 
   # `--with` flags for libraries needed for RTS linker
   configureFlags = [
     "--datadir=$doc/share/doc/ghc"
     "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
-  ] ++ stdenv.lib.optionals (libffi != null) [
+  ] ++ lib.optionals (libffi != null) [
     "--with-system-libffi"
     "--with-ffi-includes=${targetPackages.libffi.dev}/include"
     "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
+  ] ++ lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
     "--with-gmp-includes=${targetPackages.gmp.dev}/include"
     "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
+  ] ++ lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
     "--with-iconv-includes=${libiconv}/include"
     "--with-iconv-libraries=${libiconv}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
+  ] ++ lib.optionals (targetPlatform != hostPlatform) [
     "--enable-bootstrap-with-devel-snapshot"
-  ] ++ stdenv.lib.optionals useLdGold [
+  ] ++ lib.optionals useLdGold [
     "CFLAGS=-fuse-ld=gold"
     "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
     "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
-  ] ++ stdenv.lib.optionals (disableLargeAddressSpace) [
+  ] ++ lib.optionals (disableLargeAddressSpace) [
     "--disable-large-address-space"
   ];
 
@@ -189,7 +189,7 @@ stdenv.mkDerivation (rec {
   strictDeps = true;
 
   # Don’t add -liconv to LDFLAGS automatically so that GHC will add it itself.
-	dontAddExtraLibs = true;
+  dontAddExtraLibs = true;
 
   nativeBuildInputs = [
     perl autoconf automake m4 python3 sphinx
@@ -202,18 +202,18 @@ stdenv.mkDerivation (rec {
   buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
 
   propagatedBuildInputs = [ targetPackages.stdenv.cc ]
-    ++ stdenv.lib.optional useLLVM llvmPackages.llvm;
+    ++ lib.optional useLLVM llvmPackages.llvm;
 
-  depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform);
-  depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform);
+  depsTargetTarget = map lib.getDev (libDeps targetPlatform);
+  depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
 
   # required, because otherwise all symbols from HSffi.o are stripped, and
   # that in turn causes GHCi to abort
-  stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
+  stripDebugFlags = [ "-S" ] ++ lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
 
   checkTarget = "test";
 
-  hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
+  hardeningDisable = [ "format" ] ++ lib.optional stdenv.targetPlatform.isMusl "pie";
 
   postInstall = ''
     # Install the bash completion file.
@@ -223,7 +223,7 @@ stdenv.mkDerivation (rec {
     for i in "$out/bin/"*; do
       test ! -h $i || continue
       egrep --quiet '^#!' <(head -n 1 $i) || continue
-      sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
+      sed -i -e '2i export PATH="$PATH:${lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
     done
   '';
 
@@ -240,14 +240,14 @@ stdenv.mkDerivation (rec {
   meta = {
     homepage = "http://haskell.org/ghc";
     description = "The Glasgow Haskell Compiler";
-    maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ];
+    maintainers = with lib.maintainers; [ marcweber andres peti ];
     timeout = 24 * 3600;
     inherit (ghc.meta) license platforms;
   };
 
   dontStrip = (targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm);
 
-} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt{
+} // lib.optionalAttrs targetPlatform.useAndroidPrebuilt{
   dontPatchELF = true;
   noAuditTmpdir = true;
 })
diff --git a/nixpkgs/pkgs/development/compilers/ghc/8.8.3.nix b/nixpkgs/pkgs/development/compilers/ghc/8.8.3.nix
index 538655a0d056..ca4dc35ccdc4 100644
--- a/nixpkgs/pkgs/development/compilers/ghc/8.8.3.nix
+++ b/nixpkgs/pkgs/development/compilers/ghc/8.8.3.nix
@@ -1,4 +1,4 @@
-{ stdenv, pkgsBuildTarget, targetPackages
+{ lib, stdenv, pkgsBuildTarget, targetPackages
 
 # build-tools
 , bootPkgs
@@ -18,7 +18,7 @@
 
 , # If enabled, GHC will be built with the GPL-free but slower integer-simple
   # library instead of the faster but GPLed integer-gmp library.
-  enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
+  enableIntegerSimple ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
 
 , # If enabled, use -fPIC when compiling static libs.
   enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
@@ -35,7 +35,7 @@
 
 , # What flavour to build. An empty string indicates no
   # specific flavour and falls back to ghc default values.
-  ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
+  ghcFlavour ? lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
     (if useLLVM then "perf-cross" else "perf-cross-ncg")
 
 , # Whether to disable the large address space allocator
@@ -51,7 +51,7 @@ let
   inherit (bootPkgs) ghc;
 
   # TODO(@Ericson2314) Make unconditional
-  targetPrefix = stdenv.lib.optionalString
+  targetPrefix = lib.optionalString
     (targetPlatform != hostPlatform)
     "${targetPlatform.config}-";
 
@@ -69,32 +69,32 @@ let
     # to actually link to our new Libc. The iOS simulator is a special
     # exception because we can’t actually run simulators binaries
     # ourselves.
-  + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
+  + lib.optionalString (targetPlatform != hostPlatform) ''
     Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"}
     CrossCompilePrefix = ${targetPrefix}
     HADDOCK_DOCS = NO
     BUILD_SPHINX_HTML = NO
     BUILD_SPHINX_PDF = NO
-  '' + stdenv.lib.optionalString dontStrip ''
+  '' + lib.optionalString dontStrip ''
     STRIP_CMD = :
-  '' + stdenv.lib.optionalString (!enableProfiledLibs) ''
+  '' + lib.optionalString (!enableProfiledLibs) ''
     GhcLibWays = "v dyn"
-  '' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
+  '' + lib.optionalString enableRelocatedStaticLibs ''
     GhcLibHcOpts += -fPIC
     GhcRtsHcOpts += -fPIC
-  '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
+  '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
     EXTRA_CC_OPTS += -std=gnu99
   '';
 
   # Splicer will pull out correct variations
-  libDeps = platform: stdenv.lib.optional enableTerminfo ncurses
+  libDeps = platform: lib.optional enableTerminfo ncurses
     ++ [libffi]
-    ++ stdenv.lib.optional (!enableIntegerSimple) gmp
-    ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
+    ++ lib.optional (!enableIntegerSimple) gmp
+    ++ lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
 
   toolsForTarget = [
     pkgsBuildTarget.targetPackages.stdenv.cc
-  ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm;
+  ] ++ lib.optional useLLVM buildLlvmPackages.llvm;
 
   targetCC = builtins.head toolsForTarget;
 
@@ -128,7 +128,7 @@ stdenv.mkDerivation (rec {
     export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
     export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
     # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
-    export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString useLdGold ".gold"}"
+    export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${lib.optionalString useLdGold ".gold"}"
     export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
     export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
     export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
@@ -138,13 +138,13 @@ stdenv.mkDerivation (rec {
 
     echo -n "${buildMK dontStrip}" > mk/build.mk
     sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
-  '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
+  '' + lib.optionalString (!stdenv.isDarwin) ''
     export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     export NIX_LDFLAGS+=" -no_dtrace_dof"
-  '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
+  '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
     sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
-  '' + stdenv.lib.optionalString targetPlatform.isMusl ''
+  '' + lib.optionalString targetPlatform.isMusl ''
       echo "patching llvm-targets for musl targets..."
       echo "Cloning these existing '*-linux-gnu*' targets:"
       grep linux-gnu llvm-targets | sed 's/^/  /'
@@ -164,29 +164,29 @@ stdenv.mkDerivation (rec {
 
   # TODO(@Ericson2314): Always pass "--target" and always prefix.
   configurePlatforms = [ "build" "host" ]
-    ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+    ++ lib.optional (targetPlatform != hostPlatform) "target";
 
   # `--with` flags for libraries needed for RTS linker
   configureFlags = [
     "--datadir=$doc/share/doc/ghc"
     "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
-  ] ++ stdenv.lib.optionals (libffi != null) [
+  ] ++ lib.optionals (libffi != null) [
     "--with-system-libffi"
     "--with-ffi-includes=${targetPackages.libffi.dev}/include"
     "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
+  ] ++ lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
     "--with-gmp-includes=${targetPackages.gmp.dev}/include"
     "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
+  ] ++ lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
     "--with-iconv-includes=${libiconv}/include"
     "--with-iconv-libraries=${libiconv}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
+  ] ++ lib.optionals (targetPlatform != hostPlatform) [
     "--enable-bootstrap-with-devel-snapshot"
-  ] ++ stdenv.lib.optionals useLdGold [
+  ] ++ lib.optionals useLdGold [
     "CFLAGS=-fuse-ld=gold"
     "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
     "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
-  ] ++ stdenv.lib.optionals (disableLargeAddressSpace) [
+  ] ++ lib.optionals (disableLargeAddressSpace) [
     "--disable-large-address-space"
   ];
 
@@ -194,7 +194,7 @@ stdenv.mkDerivation (rec {
   strictDeps = true;
 
   # Don’t add -liconv to LDFLAGS automatically so that GHC will add it itself.
-	dontAddExtraLibs = true;
+  dontAddExtraLibs = true;
 
   nativeBuildInputs = [
     perl autoconf automake m4 python3 sphinx
@@ -207,18 +207,18 @@ stdenv.mkDerivation (rec {
   buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
 
   propagatedBuildInputs = [ targetPackages.stdenv.cc ]
-    ++ stdenv.lib.optional useLLVM llvmPackages.llvm;
+    ++ lib.optional useLLVM llvmPackages.llvm;
 
-  depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform);
-  depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform);
+  depsTargetTarget = map lib.getDev (libDeps targetPlatform);
+  depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
 
   # required, because otherwise all symbols from HSffi.o are stripped, and
   # that in turn causes GHCi to abort
-  stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
+  stripDebugFlags = [ "-S" ] ++ lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
 
   checkTarget = "test";
 
-  hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
+  hardeningDisable = [ "format" ] ++ lib.optional stdenv.targetPlatform.isMusl "pie";
 
   postInstall = ''
     # Install the bash completion file.
@@ -228,7 +228,7 @@ stdenv.mkDerivation (rec {
     for i in "$out/bin/"*; do
       test ! -h $i || continue
       egrep --quiet '^#!' <(head -n 1 $i) || continue
-      sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
+      sed -i -e '2i export PATH="$PATH:${lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
     done
   '';
 
@@ -245,14 +245,14 @@ stdenv.mkDerivation (rec {
   meta = {
     homepage = "http://haskell.org/ghc";
     description = "The Glasgow Haskell Compiler";
-    maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ];
+    maintainers = with lib.maintainers; [ marcweber andres peti ];
     timeout = 24 * 3600;
     inherit (ghc.meta) license platforms;
   };
 
   dontStrip = (targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm);
 
-} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt{
+} // lib.optionalAttrs targetPlatform.useAndroidPrebuilt{
   dontPatchELF = true;
   noAuditTmpdir = true;
 })
diff --git a/nixpkgs/pkgs/development/compilers/ghc/8.8.4.nix b/nixpkgs/pkgs/development/compilers/ghc/8.8.4.nix
index e69766bccdaa..ab5f2c12e230 100644
--- a/nixpkgs/pkgs/development/compilers/ghc/8.8.4.nix
+++ b/nixpkgs/pkgs/development/compilers/ghc/8.8.4.nix
@@ -1,4 +1,4 @@
-{ stdenv, pkgsBuildTarget, targetPackages
+{ lib, stdenv, pkgsBuildTarget, targetPackages
 
 # build-tools
 , bootPkgs
@@ -18,7 +18,7 @@
 
 , # If enabled, GHC will be built with the GPL-free but slower integer-simple
   # library instead of the faster but GPLed integer-gmp library.
-  enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
+  enableIntegerSimple ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
 
 , # If enabled, use -fPIC when compiling static libs.
   enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
@@ -35,7 +35,7 @@
 
 , # What flavour to build. An empty string indicates no
   # specific flavour and falls back to ghc default values.
-  ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
+  ghcFlavour ? lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
     (if useLLVM then "perf-cross" else "perf-cross-ncg")
 
 , # Whether to disable the large address space allocator
@@ -51,7 +51,7 @@ let
   inherit (bootPkgs) ghc;
 
   # TODO(@Ericson2314) Make unconditional
-  targetPrefix = stdenv.lib.optionalString
+  targetPrefix = lib.optionalString
     (targetPlatform != hostPlatform)
     "${targetPlatform.config}-";
 
@@ -69,32 +69,32 @@ let
     # to actually link to our new Libc. The iOS simulator is a special
     # exception because we can’t actually run simulators binaries
     # ourselves.
-  + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
+  + lib.optionalString (targetPlatform != hostPlatform) ''
     Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"}
     CrossCompilePrefix = ${targetPrefix}
     HADDOCK_DOCS = NO
     BUILD_SPHINX_HTML = NO
     BUILD_SPHINX_PDF = NO
-  '' + stdenv.lib.optionalString dontStrip ''
+  '' + lib.optionalString dontStrip ''
     STRIP_CMD = :
-  '' + stdenv.lib.optionalString (!enableProfiledLibs) ''
+  '' + lib.optionalString (!enableProfiledLibs) ''
     GhcLibWays = "v dyn"
-  '' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
+  '' + lib.optionalString enableRelocatedStaticLibs ''
     GhcLibHcOpts += -fPIC
     GhcRtsHcOpts += -fPIC
-  '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
+  '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
     EXTRA_CC_OPTS += -std=gnu99
   '';
 
   # Splicer will pull out correct variations
-  libDeps = platform: stdenv.lib.optional enableTerminfo ncurses
+  libDeps = platform: lib.optional enableTerminfo ncurses
     ++ [libffi]
-    ++ stdenv.lib.optional (!enableIntegerSimple) gmp
-    ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
+    ++ lib.optional (!enableIntegerSimple) gmp
+    ++ lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
 
   toolsForTarget = [
     pkgsBuildTarget.targetPackages.stdenv.cc
-  ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm;
+  ] ++ lib.optional useLLVM buildLlvmPackages.llvm;
 
   targetCC = builtins.head toolsForTarget;
 
@@ -119,7 +119,7 @@ stdenv.mkDerivation (rec {
   postPatch = "patchShebangs .";
 
   # GHC is a bit confused on its cross terminology.
-  preConfigure = stdenv.lib.optionalString stdenv.isAarch64 ''
+  preConfigure = lib.optionalString stdenv.isAarch64 ''
     # Aarch64 allow backward bootstrapping since earlier versions are unstable.
     find . -name \*\.cabal\* -exec sed -i -e 's/\(base.*\)4.14/\14.16/' {} \; \
       -exec sed -i -e 's/\(prim.*\)0.6/\10.8/' {} \;
@@ -132,7 +132,7 @@ stdenv.mkDerivation (rec {
     export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
     export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
     # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
-    export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString useLdGold ".gold"}"
+    export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${lib.optionalString useLdGold ".gold"}"
     export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
     export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
     export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
@@ -142,13 +142,13 @@ stdenv.mkDerivation (rec {
 
     echo -n "${buildMK dontStrip}" > mk/build.mk
     sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
-  '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
+  '' + lib.optionalString (!stdenv.isDarwin) ''
     export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     export NIX_LDFLAGS+=" -no_dtrace_dof"
-  '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
+  '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
     sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
-  '' + stdenv.lib.optionalString targetPlatform.isMusl ''
+  '' + lib.optionalString targetPlatform.isMusl ''
       echo "patching llvm-targets for musl targets..."
       echo "Cloning these existing '*-linux-gnu*' targets:"
       grep linux-gnu llvm-targets | sed 's/^/  /'
@@ -168,29 +168,29 @@ stdenv.mkDerivation (rec {
 
   # TODO(@Ericson2314): Always pass "--target" and always prefix.
   configurePlatforms = [ "build" "host" ]
-    ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+    ++ lib.optional (targetPlatform != hostPlatform) "target";
 
   # `--with` flags for libraries needed for RTS linker
   configureFlags = [
     "--datadir=$doc/share/doc/ghc"
     "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
-  ] ++ stdenv.lib.optionals (libffi != null) [
+  ] ++ lib.optionals (libffi != null) [
     "--with-system-libffi"
     "--with-ffi-includes=${targetPackages.libffi.dev}/include"
     "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
+  ] ++ lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
     "--with-gmp-includes=${targetPackages.gmp.dev}/include"
     "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
+  ] ++ lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
     "--with-iconv-includes=${libiconv}/include"
     "--with-iconv-libraries=${libiconv}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
+  ] ++ lib.optionals (targetPlatform != hostPlatform) [
     "--enable-bootstrap-with-devel-snapshot"
-  ] ++ stdenv.lib.optionals useLdGold [
+  ] ++ lib.optionals useLdGold [
     "CFLAGS=-fuse-ld=gold"
     "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
     "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
-  ] ++ stdenv.lib.optionals (disableLargeAddressSpace) [
+  ] ++ lib.optionals (disableLargeAddressSpace) [
     "--disable-large-address-space"
   ];
 
@@ -198,7 +198,7 @@ stdenv.mkDerivation (rec {
   strictDeps = true;
 
   # Don’t add -liconv to LDFLAGS automatically so that GHC will add it itself.
-	dontAddExtraLibs = true;
+  dontAddExtraLibs = true;
 
   nativeBuildInputs = [
     perl autoconf automake m4 python3 sphinx
@@ -211,18 +211,18 @@ stdenv.mkDerivation (rec {
   buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
 
   propagatedBuildInputs = [ targetPackages.stdenv.cc ]
-    ++ stdenv.lib.optional useLLVM llvmPackages.llvm;
+    ++ lib.optional useLLVM llvmPackages.llvm;
 
-  depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform);
-  depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform);
+  depsTargetTarget = map lib.getDev (libDeps targetPlatform);
+  depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
 
   # required, because otherwise all symbols from HSffi.o are stripped, and
   # that in turn causes GHCi to abort
-  stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
+  stripDebugFlags = [ "-S" ] ++ lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
 
   checkTarget = "test";
 
-  hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
+  hardeningDisable = [ "format" ] ++ lib.optional stdenv.targetPlatform.isMusl "pie";
 
   postInstall = ''
     # Install the bash completion file.
@@ -232,7 +232,7 @@ stdenv.mkDerivation (rec {
     for i in "$out/bin/"*; do
       test ! -h $i || continue
       egrep --quiet '^#!' <(head -n 1 $i) || continue
-      sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
+      sed -i -e '2i export PATH="$PATH:${lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
     done
   '';
 
@@ -249,14 +249,14 @@ stdenv.mkDerivation (rec {
   meta = {
     homepage = "http://haskell.org/ghc";
     description = "The Glasgow Haskell Compiler";
-    maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ];
+    maintainers = with lib.maintainers; [ marcweber andres peti ];
     timeout = 24 * 3600;
     inherit (ghc.meta) license platforms;
   };
 
   dontStrip = (targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm);
 
-} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt{
+} // lib.optionalAttrs targetPlatform.useAndroidPrebuilt{
   dontPatchELF = true;
   noAuditTmpdir = true;
 })
diff --git a/nixpkgs/pkgs/development/compilers/ghc/9.0.1.nix b/nixpkgs/pkgs/development/compilers/ghc/9.0.1.nix
index d86cce9849ca..39abe9c760e3 100644
--- a/nixpkgs/pkgs/development/compilers/ghc/9.0.1.nix
+++ b/nixpkgs/pkgs/development/compilers/ghc/9.0.1.nix
@@ -1,4 +1,4 @@
-{ stdenv, pkgsBuildTarget, targetPackages
+{ lib, stdenv, pkgsBuildTarget, targetPackages
 
 # build-tools
 , bootPkgs
@@ -19,7 +19,7 @@
 
 , # If enabled, GHC will be built with the GPL-free but slower integer-simple
   # library instead of the faster but GPLed integer-gmp library.
-  enableIntegerSimple ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
+  enableIntegerSimple ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms), gmp
 
 , # If enabled, use -fPIC when compiling static libs.
   enableRelocatedStaticLibs ? stdenv.targetPlatform != stdenv.hostPlatform
@@ -36,7 +36,7 @@
 
 , # What flavour to build. An empty string indicates no
   # specific flavour and falls back to ghc default values.
-  ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
+  ghcFlavour ? lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
     (if useLLVM then "perf-cross" else "perf-cross-ncg")
 
 , # Whether to disable the large address space allocator
@@ -52,7 +52,7 @@ let
   inherit (bootPkgs) ghc;
 
   # TODO(@Ericson2314) Make unconditional
-  targetPrefix = stdenv.lib.optionalString
+  targetPrefix = lib.optionalString
     (targetPlatform != hostPlatform)
     "${targetPlatform.config}-";
 
@@ -63,30 +63,30 @@ let
     endif
     DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
     INTEGER_LIBRARY = ${if enableIntegerSimple then "integer-simple" else "integer-gmp"}
-  '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
+  '' + lib.optionalString (targetPlatform != hostPlatform) ''
     Stage1Only = ${if targetPlatform.system == hostPlatform.system then "NO" else "YES"}
     CrossCompilePrefix = ${targetPrefix}
     HADDOCK_DOCS = NO
     BUILD_SPHINX_HTML = NO
     BUILD_SPHINX_PDF = NO
-  '' + stdenv.lib.optionalString (!enableProfiledLibs) ''
+  '' + lib.optionalString (!enableProfiledLibs) ''
     GhcLibWays = "v dyn"
-  '' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
+  '' + lib.optionalString enableRelocatedStaticLibs ''
     GhcLibHcOpts += -fPIC
     GhcRtsHcOpts += -fPIC
-  '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
+  '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
     EXTRA_CC_OPTS += -std=gnu99
   '';
 
   # Splicer will pull out correct variations
-  libDeps = platform: stdenv.lib.optional enableTerminfo ncurses
+  libDeps = platform: lib.optional enableTerminfo ncurses
     ++ [libffi]
-    ++ stdenv.lib.optional (!enableIntegerSimple) gmp
-    ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
+    ++ lib.optional (!enableIntegerSimple) gmp
+    ++ lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv;
 
   toolsForTarget = [
     pkgsBuildTarget.targetPackages.stdenv.cc
-  ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm;
+  ] ++ lib.optional useLLVM buildLlvmPackages.llvm;
 
   targetCC = builtins.head toolsForTarget;
 
@@ -123,7 +123,7 @@ stdenv.mkDerivation (rec {
     export CC="${targetCC}/bin/${targetCC.targetPrefix}cc"
     export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
     # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
-    export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString useLdGold ".gold"}"
+    export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${lib.optionalString useLdGold ".gold"}"
     export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
     export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
     export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
@@ -133,15 +133,15 @@ stdenv.mkDerivation (rec {
 
     echo -n "${buildMK}" > mk/build.mk
     sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
-  '' + stdenv.lib.optionalString (stdenv.isLinux) ''
+  '' + lib.optionalString (stdenv.isLinux) ''
     export LOCALE_ARCHIVE="${glibcLocales}/lib/locale/locale-archive"
-  '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
+  '' + lib.optionalString (!stdenv.isDarwin) ''
     export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     export NIX_LDFLAGS+=" -no_dtrace_dof"
-  '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
+  '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
     sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
-  '' + stdenv.lib.optionalString targetPlatform.isMusl ''
+  '' + lib.optionalString targetPlatform.isMusl ''
       echo "patching llvm-targets for musl targets..."
       echo "Cloning these existing '*-linux-gnu*' targets:"
       grep linux-gnu llvm-targets | sed 's/^/  /'
@@ -161,29 +161,29 @@ stdenv.mkDerivation (rec {
 
   # TODO(@Ericson2314): Always pass "--target" and always prefix.
   configurePlatforms = [ "build" "host" ]
-    ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+    ++ lib.optional (targetPlatform != hostPlatform) "target";
 
   # `--with` flags for libraries needed for RTS linker
   configureFlags = [
     "--datadir=$doc/share/doc/ghc"
     "--with-curses-includes=${ncurses.dev}/include" "--with-curses-libraries=${ncurses.out}/lib"
-  ] ++ stdenv.lib.optionals (libffi != null) [
+  ] ++ lib.optionals (libffi != null) [
     "--with-system-libffi"
     "--with-ffi-includes=${targetPackages.libffi.dev}/include"
     "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
+  ] ++ lib.optionals (targetPlatform == hostPlatform && !enableIntegerSimple) [
     "--with-gmp-includes=${targetPackages.gmp.dev}/include"
     "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
+  ] ++ lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
     "--with-iconv-includes=${libiconv}/include"
     "--with-iconv-libraries=${libiconv}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
+  ] ++ lib.optionals (targetPlatform != hostPlatform) [
     "--enable-bootstrap-with-devel-snapshot"
-  ] ++ stdenv.lib.optionals useLdGold [
+  ] ++ lib.optionals useLdGold [
     "CFLAGS=-fuse-ld=gold"
     "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
     "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
-  ] ++ stdenv.lib.optionals (disableLargeAddressSpace) [
+  ] ++ lib.optionals (disableLargeAddressSpace) [
     "--disable-large-address-space"
   ];
 
@@ -204,18 +204,18 @@ stdenv.mkDerivation (rec {
   buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
 
   propagatedBuildInputs = [ targetPackages.stdenv.cc ]
-    ++ stdenv.lib.optional useLLVM llvmPackages.llvm;
+    ++ lib.optional useLLVM llvmPackages.llvm;
 
-  depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform);
-  depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform);
+  depsTargetTarget = map lib.getDev (libDeps targetPlatform);
+  depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
 
   # required, because otherwise all symbols from HSffi.o are stripped, and
   # that in turn causes GHCi to abort
-  stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
+  stripDebugFlags = [ "-S" ] ++ lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
 
   checkTarget = "test";
 
-  hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
+  hardeningDisable = [ "format" ] ++ lib.optional stdenv.targetPlatform.isMusl "pie";
 
   postInstall = ''
     # Install the bash completion file.
@@ -225,7 +225,7 @@ stdenv.mkDerivation (rec {
     for i in "$out/bin/"*; do
       test ! -h $i || continue
       egrep --quiet '^#!' <(head -n 1 $i) || continue
-      sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
+      sed -i -e '2i export PATH="$PATH:${lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
     done
   '';
 
@@ -242,12 +242,12 @@ stdenv.mkDerivation (rec {
   meta = {
     homepage = "http://haskell.org/ghc";
     description = "The Glasgow Haskell Compiler";
-    maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ];
+    maintainers = with lib.maintainers; [ marcweber andres peti ];
     timeout = 24 * 3600;
     inherit (ghc.meta) license platforms;
   };
 
-} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
+} // lib.optionalAttrs targetPlatform.useAndroidPrebuilt {
   dontStrip = true;
   dontPatchELF = true;
   noAuditTmpdir = true;
diff --git a/nixpkgs/pkgs/development/compilers/ghc/head.nix b/nixpkgs/pkgs/development/compilers/ghc/head.nix
index 6f9f577743f5..3ba88763117d 100644
--- a/nixpkgs/pkgs/development/compilers/ghc/head.nix
+++ b/nixpkgs/pkgs/development/compilers/ghc/head.nix
@@ -1,4 +1,4 @@
-{ stdenv, pkgsBuildTarget, targetPackages
+{ lib, stdenv, pkgsBuildTarget, targetPackages
 
 # build-tools
 , bootPkgs
@@ -22,7 +22,7 @@
 
 , # If enabled, GHC will be built with the GPL-free but slightly slower native
   # bignum backend instead of the faster but GPLed gmp backend.
-  enableNativeBignum ? !(stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms)
+  enableNativeBignum ? !(lib.any (lib.meta.platformMatch stdenv.hostPlatform) gmp.meta.platforms)
 , gmp
 
 , # If enabled, use -fPIC when compiling static libs.
@@ -41,7 +41,7 @@
 , version ? "8.11.20200824"
 , # What flavour to build. An empty string indicates no
   # specific flavour and falls back to ghc default values.
-  ghcFlavour ? stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
+  ghcFlavour ? lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
     (if useLLVM then "perf-cross" else "perf-cross-ncg")
 
 , # Whether to disable the large address space allocator
@@ -57,7 +57,7 @@ let
   inherit (bootPkgs) ghc;
 
   # TODO(@Ericson2314) Make unconditional
-  targetPrefix = stdenv.lib.optionalString
+  targetPrefix = lib.optionalString
     (targetPlatform != hostPlatform)
     "${targetPlatform.config}-";
 
@@ -68,33 +68,33 @@ let
     endif
     DYNAMIC_GHC_PROGRAMS = ${if enableShared then "YES" else "NO"}
     BIGNUM_BACKEND = ${if enableNativeBignum then "native" else "gmp"}
-  '' + stdenv.lib.optionalString (targetPlatform != hostPlatform) ''
+  '' + lib.optionalString (targetPlatform != hostPlatform) ''
     Stage1Only = ${if (targetPlatform.system == hostPlatform.system && !targetPlatform.isiOS) then "NO" else "YES"}
     CrossCompilePrefix = ${targetPrefix}
     HADDOCK_DOCS = NO
     BUILD_SPHINX_HTML = NO
     BUILD_SPHINX_PDF = NO
-  '' + stdenv.lib.optionalString dontStrip ''
+  '' + lib.optionalString dontStrip ''
     STRIP_CMD = :
-  '' + stdenv.lib.optionalString (!enableProfiledLibs) ''
+  '' + lib.optionalString (!enableProfiledLibs) ''
     GhcLibWays = "v dyn"
-  '' + stdenv.lib.optionalString enableRelocatedStaticLibs ''
+  '' + lib.optionalString enableRelocatedStaticLibs ''
     GhcLibHcOpts += -fPIC
     GhcRtsHcOpts += -fPIC
-  '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
+  '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
     EXTRA_CC_OPTS += -std=gnu99
   '';
 
   # Splicer will pull out correct variations
-  libDeps = platform: stdenv.lib.optional enableTerminfo ncurses
+  libDeps = platform: lib.optional enableTerminfo ncurses
     ++ [libffi]
-    ++ stdenv.lib.optional (!enableNativeBignum) gmp
-    ++ stdenv.lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv
-    ++ stdenv.lib.optional enableDwarf elfutils;
+    ++ lib.optional (!enableNativeBignum) gmp
+    ++ lib.optional (platform.libc != "glibc" && !targetPlatform.isWindows) libiconv
+    ++ lib.optional enableDwarf elfutils;
 
   toolsForTarget = [
     pkgsBuildTarget.targetPackages.stdenv.cc
-  ] ++ stdenv.lib.optional useLLVM buildLlvmPackages.llvm;
+  ] ++ lib.optional useLLVM buildLlvmPackages.llvm;
 
   targetCC = builtins.head toolsForTarget;
 
@@ -131,7 +131,7 @@ stdenv.mkDerivation (rec {
     export CXX="${targetCC}/bin/${targetCC.targetPrefix}cxx"
     # Use gold to work around https://sourceware.org/bugzilla/show_bug.cgi?id=16177
     # and more generally have a faster linker.
-    export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${stdenv.lib.optionalString useLdGold ".gold"}"
+    export LD="${targetCC.bintools}/bin/${targetCC.bintools.targetPrefix}ld${lib.optionalString useLdGold ".gold"}"
     export AS="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}as"
     export AR="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}ar"
     export NM="${targetCC.bintools.bintools}/bin/${targetCC.bintools.targetPrefix}nm"
@@ -144,13 +144,13 @@ stdenv.mkDerivation (rec {
     echo ${src.rev} > GIT_COMMIT_ID
     ./boot
     sed -i -e 's|-isysroot /Developer/SDKs/MacOSX10.5.sdk||' configure
-  '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
+  '' + lib.optionalString (!stdenv.isDarwin) ''
     export NIX_LDFLAGS+=" -rpath $out/lib/ghc-${version}"
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     export NIX_LDFLAGS+=" -no_dtrace_dof"
-  '' + stdenv.lib.optionalString targetPlatform.useAndroidPrebuilt ''
+  '' + lib.optionalString targetPlatform.useAndroidPrebuilt ''
     sed -i -e '5i ,("armv7a-unknown-linux-androideabi", ("e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64", "cortex-a8", ""))' llvm-targets
-  '' + stdenv.lib.optionalString targetPlatform.isMusl ''
+  '' + lib.optionalString targetPlatform.isMusl ''
       echo "patching llvm-targets for musl targets..."
       echo "Cloning these existing '*-linux-gnu*' targets:"
       grep linux-gnu llvm-targets | sed 's/^/  /'
@@ -170,40 +170,40 @@ stdenv.mkDerivation (rec {
 
   # TODO(@Ericson2314): Always pass "--target" and always prefix.
   configurePlatforms = [ "build" "host" ]
-    ++ stdenv.lib.optional (targetPlatform != hostPlatform) "target";
+    ++ lib.optional (targetPlatform != hostPlatform) "target";
 
   # `--with` flags for libraries needed for RTS linker
   configureFlags = [
     "--datadir=$doc/share/doc/ghc"
     "--with-curses-libraries=${ncurses.out}/lib"
-  ] ++ stdenv.lib.optionals (libffi != null) [
+  ] ++ lib.optionals (libffi != null) [
     "--with-system-libffi"
     "--with-ffi-includes=${targetPackages.libffi.dev}/include"
     "--with-ffi-libraries=${targetPackages.libffi.out}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && !enableNativeBignum) [
+  ] ++ lib.optionals (targetPlatform == hostPlatform && !enableNativeBignum) [
     "--with-gmp-includes=${targetPackages.gmp.dev}/include"
     "--with-gmp-libraries=${targetPackages.gmp.out}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
+  ] ++ lib.optionals (targetPlatform == hostPlatform && hostPlatform.libc != "glibc" && !targetPlatform.isWindows) [
     "--with-iconv-includes=${libiconv}/include"
     "--with-iconv-libraries=${libiconv}/lib"
-  ] ++ stdenv.lib.optionals (targetPlatform != hostPlatform) [
+  ] ++ lib.optionals (targetPlatform != hostPlatform) [
     "--enable-bootstrap-with-devel-snapshot"
-  ] ++ stdenv.lib.optionals useLdGold [
+  ] ++ lib.optionals useLdGold [
     "CFLAGS=-fuse-ld=gold"
     "CONF_GCC_LINKER_OPTS_STAGE1=-fuse-ld=gold"
     "CONF_GCC_LINKER_OPTS_STAGE2=-fuse-ld=gold"
-  ] ++ stdenv.lib.optional disableLargeAddressSpace "--disable-large-address-space"
-    ++ stdenv.lib.optionals enableDwarf [
+  ] ++ lib.optional disableLargeAddressSpace "--disable-large-address-space"
+    ++ lib.optionals enableDwarf [
     "--enable-dwarf-unwind"
-    "--with-libdw-includes=${stdenv.lib.getDev elfutils}/include"
-    "--with-libdw-libraries=${stdenv.lib.getLib elfutils}/lib"
+    "--with-libdw-includes=${lib.getDev elfutils}/include"
+    "--with-libdw-libraries=${lib.getLib elfutils}/lib"
   ];
 
   # Make sure we never relax`$PATH` and hooks support for compatibility.
   strictDeps = true;
 
   # Don’t add -liconv to LDFLAGS automatically so that GHC will add it itself.
-	dontAddExtraLibs = true;
+  dontAddExtraLibs = true;
 
   nativeBuildInputs = [
     perl autoconf autoreconfHook automake m4 python3 sphinx
@@ -216,18 +216,18 @@ stdenv.mkDerivation (rec {
   buildInputs = [ perl bash ] ++ (libDeps hostPlatform);
 
   propagatedBuildInputs = [ targetPackages.stdenv.cc ]
-    ++ stdenv.lib.optional useLLVM llvmPackages.llvm;
+    ++ lib.optional useLLVM llvmPackages.llvm;
 
-  depsTargetTarget = map stdenv.lib.getDev (libDeps targetPlatform);
-  depsTargetTargetPropagated = map (stdenv.lib.getOutput "out") (libDeps targetPlatform);
+  depsTargetTarget = map lib.getDev (libDeps targetPlatform);
+  depsTargetTargetPropagated = map (lib.getOutput "out") (libDeps targetPlatform);
 
   # required, because otherwise all symbols from HSffi.o are stripped, and
   # that in turn causes GHCi to abort
-  stripDebugFlags = [ "-S" ] ++ stdenv.lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
+  stripDebugFlags = [ "-S" ] ++ lib.optional (!targetPlatform.isDarwin) "--keep-file-symbols";
 
   checkTarget = "test";
 
-  hardeningDisable = [ "format" ] ++ stdenv.lib.optional stdenv.targetPlatform.isMusl "pie";
+  hardeningDisable = [ "format" ] ++ lib.optional stdenv.targetPlatform.isMusl "pie";
 
   postInstall = ''
     # Install the bash completion file.
@@ -237,7 +237,7 @@ stdenv.mkDerivation (rec {
     for i in "$out/bin/"*; do
       test ! -h $i || continue
       egrep --quiet '^#!' <(head -n 1 $i) || continue
-      sed -i -e '2i export PATH="$PATH:${stdenv.lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
+      sed -i -e '2i export PATH="$PATH:${lib.makeBinPath [ targetPackages.stdenv.cc.bintools coreutils ]}"' $i
     done
   '';
 
@@ -254,13 +254,13 @@ stdenv.mkDerivation (rec {
   meta = {
     homepage = "http://haskell.org/ghc";
     description = "The Glasgow Haskell Compiler";
-    maintainers = with stdenv.lib.maintainers; [ marcweber andres peti ];
+    maintainers = with lib.maintainers; [ marcweber andres peti ];
     inherit (ghc.meta) license platforms;
   };
 
   dontStrip = (targetPlatform.useAndroidPrebuilt || targetPlatform.isWasm);
 
-} // stdenv.lib.optionalAttrs targetPlatform.useAndroidPrebuilt{
+} // lib.optionalAttrs targetPlatform.useAndroidPrebuilt{
   dontPatchELF = true;
   noAuditTmpdir = true;
 })
diff --git a/nixpkgs/pkgs/development/compilers/ghcjs-ng/8.6/stage0.nix b/nixpkgs/pkgs/development/compilers/ghcjs-ng/8.6/stage0.nix
index b957a6aa9e10..88630f996a94 100644
--- a/nixpkgs/pkgs/development/compilers/ghcjs-ng/8.6/stage0.nix
+++ b/nixpkgs/pkgs/development/compilers/ghcjs-ng/8.6/stage0.nix
@@ -55,7 +55,7 @@
         websockets yaml
       ];
       description = "Haskell to JavaScript compiler";
-      license = stdenv.lib.licenses.mit;
+      license = lib.licenses.mit;
     }) {};
 
   ghc-api-ghcjs = callPackage
@@ -76,7 +76,7 @@
       libraryToolDepends = [ alex happy ];
       homepage = "http://www.haskell.org/ghc/";
       description = "The GHC API (customized for GHCJS)";
-      license = stdenv.lib.licenses.bsd3;
+      license = lib.licenses.bsd3;
     }) {};
 
   ghci-ghcjs = callPackage
@@ -93,7 +93,7 @@
         ghc-boot-th ghc-heap template-haskell-ghcjs transformers unix
       ];
       description = "The library supporting GHC's interactive interpreter (customized for GHCJS)";
-      license = stdenv.lib.licenses.bsd3;
+      license = lib.licenses.bsd3;
     }) {};
 
   ghcjs-th = callPackage
@@ -109,7 +109,7 @@
         template-haskell-ghcjs
       ];
       homepage = "http://github.com/ghcjs";
-      license = stdenv.lib.licenses.mit;
+      license = lib.licenses.mit;
     }) {};
 
   haddock-api-ghcjs = callPackage
@@ -136,7 +136,7 @@
       testToolDepends = [ hspec-discover ];
       homepage = "http://www.haskell.org/haddock/";
       description = "A documentation-generation tool for Haskell libraries";
-      license = stdenv.lib.licenses.bsd3;
+      license = lib.licenses.bsd3;
     }) {};
 
   haddock-library-ghcjs = callPackage
@@ -160,7 +160,7 @@
       testToolDepends = [ hspec-discover ];
       homepage = "http://www.haskell.org/haddock/";
       description = "Library exposing some functionality of Haddock";
-      license = stdenv.lib.licenses.bsd3;
+      license = lib.licenses.bsd3;
     }) {};
 
   template-haskell-ghcjs = callPackage
@@ -171,7 +171,7 @@
       src = configuredSrc + /lib/template-haskell-ghcjs;
       libraryHaskellDepends = [ base ghc-boot-th pretty ];
       description = "Support library for Template Haskell (customized for GHCJS)";
-      license = stdenv.lib.licenses.bsd3;
+      license = lib.licenses.bsd3;
     }) {};
 
 }
diff --git a/nixpkgs/pkgs/development/compilers/ghcjs-ng/default.nix b/nixpkgs/pkgs/development/compilers/ghcjs-ng/default.nix
index c6c81491fe6d..8a04bc0c079c 100644
--- a/nixpkgs/pkgs/development/compilers/ghcjs-ng/default.nix
+++ b/nixpkgs/pkgs/development/compilers/ghcjs-ng/default.nix
@@ -12,7 +12,7 @@
 , makeWrapper
 , xorg
 , gmp
-, pkgconfig
+, pkg-config
 , gcc
 , lib
 , ghcjsDepOverrides ? (_:_:{})
@@ -73,7 +73,7 @@ in stdenv.mkDerivation {
       makeWrapper
       xorg.lndir
       gmp
-      pkgconfig
+      pkg-config
     ] ++ lib.optionals stdenv.isDarwin [
       gcc # https://github.com/ghcjs/ghcjs/issues/663
     ];
diff --git a/nixpkgs/pkgs/development/compilers/ghcjs-ng/ghcjs-base.nix b/nixpkgs/pkgs/development/compilers/ghcjs-ng/ghcjs-base.nix
index 7c10ce6572f8..82c37bd86177 100644
--- a/nixpkgs/pkgs/development/compilers/ghcjs-ng/ghcjs-base.nix
+++ b/nixpkgs/pkgs/development/compilers/ghcjs-ng/ghcjs-base.nix
@@ -25,5 +25,5 @@ mkDerivation {
   ];
   homepage = "https://github.com/ghcjs/ghcjs-base";
   description = "base library for GHCJS";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/nixpkgs/pkgs/development/compilers/ghdl/default.nix b/nixpkgs/pkgs/development/compilers/ghdl/default.nix
index 6d1fae337340..6181486f50c7 100644
--- a/nixpkgs/pkgs/development/compilers/ghdl/default.nix
+++ b/nixpkgs/pkgs/development/compilers/ghdl/default.nix
@@ -5,13 +5,15 @@ assert backend == "mcode" || backend == "llvm";
 
 stdenv.mkDerivation rec {
   pname = "ghdl-${backend}";
-  version = "0.37";
+  # NOTE(aseipp): move to 0.38 when it comes out, since it should support a stable
+  # version of the yosys plugin
+  version = "unstable-2021.01.14";
 
   src = fetchFromGitHub {
-    owner = "ghdl";
-    repo = "ghdl";
-    rev = "v${version}";
-    sha256 = "0b53yl4im33c1cd4mdyc4ks9cmrpixym17gzchfmplrl22w3l17y";
+    owner  = "ghdl";
+    repo   = "ghdl";
+    rev    = "4868294436574660552ccef50a5b0849559393de";
+    sha256 = "1wqjf0qc66dam1n2mskmlvj53bcsdwwk5rq9gimq6ah1vcwi222p";
   };
 
   LIBRARY_PATH = "${stdenv.cc.libc}/lib";
@@ -23,7 +25,7 @@ stdenv.mkDerivation rec {
     sed -i 's/check_version 7.0/check_version 7/g' configure
   '';
 
-  configureFlags = lib.optional (backend == "llvm")
+  configureFlags = [ "--enable-synth" ] ++ lib.optional (backend == "llvm")
     "--with-llvm-config=${llvm}/bin/llvm-config";
 
   hardeningDisable = [ "format" ];
@@ -33,7 +35,7 @@ stdenv.mkDerivation rec {
   meta = with lib; {
     homepage = "https://github.com/ghdl/ghdl";
     description = "VHDL 2008/93/87 simulator";
-    maintainers = with maintainers; [ lucus16 ];
+    maintainers = with maintainers; [ lucus16 thoughtpolice ];
     platforms = platforms.linux;
     license = licenses.gpl2;
   };
diff --git a/nixpkgs/pkgs/development/compilers/gleam/default.nix b/nixpkgs/pkgs/development/compilers/gleam/default.nix
index f96f2f724a60..b9c7e7e1e3d2 100644
--- a/nixpkgs/pkgs/development/compilers/gleam/default.nix
+++ b/nixpkgs/pkgs/development/compilers/gleam/default.nix
@@ -1,24 +1,24 @@
-{ stdenv, rustPlatform, fetchFromGitHub, pkg-config, openssl, Security }:
+{ lib, stdenv, rustPlatform, fetchFromGitHub, pkg-config, openssl, Security }:
 
 rustPlatform.buildRustPackage rec {
   pname = "gleam";
-  version = "0.12.1";
+  version = "0.13.2";
 
   src = fetchFromGitHub {
     owner = "gleam-lang";
     repo = pname;
     rev = "v${version}";
-    sha256 = "0n23pn7jk4i2waczw5cczsb7v4lal4x6xqmp01y280hb2vk176fg";
+    sha256 = "sha256-ka1GxukX3HR40fMeiiXHguyPKrpGngG2tXDColR7eQA=";
   };
 
   nativeBuildInputs = [ pkg-config ];
 
   buildInputs = [ openssl ] ++
-    stdenv.lib.optionals stdenv.isDarwin [ Security ];
+    lib.optionals stdenv.isDarwin [ Security ];
 
-  cargoSha256 = "0rnf9agpzlvk53x8zrg32w6r0gxcbank3fs32ydv53frvqv1spj3";
+  cargoSha256 = "sha256-/l54ezS68loljKNh7AdYMIuCiyIbsMI3jqD9ktjZLfc=";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A statically typed language for the Erlang VM";
     homepage = "https://gleam.run/";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/compilers/glslang/default.nix b/nixpkgs/pkgs/development/compilers/glslang/default.nix
index b3364b185da9..0cfb2502a0d9 100644
--- a/nixpkgs/pkgs/development/compilers/glslang/default.nix
+++ b/nixpkgs/pkgs/development/compilers/glslang/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchFromGitHub
+{ lib, stdenv
+, fetchFromGitHub
 , bison
 , cmake
 , jq
@@ -10,7 +11,7 @@
 }:
 # glslang requires custom versions of spirv-tools and spirb-headers.
 # The exact versions are taken from:
-# https://github.com/KhronosGroup/glslang/blob/master/known_good.json
+# https://github.com/KhronosGroup/glslang/blob/${version}/known_good.json
 
 let
   localSpirv-tools = if argSpirv-tools == null
@@ -18,8 +19,8 @@ let
       src = fetchFromGitHub {
         owner = "KhronosGroup";
         repo = "SPIRV-Tools";
-        rev = "fd8e130510a6b002b28eee5885a9505040a9bdc9";
-        sha256 = "00b7xgyrcb2qq63pp3cnw5q1xqx2d9rfn65lai6n6r89s1vh3vg6";
+        rev = "b27b1afd12d05bf238ac7368bb49de73cd620a8e";
+        sha256 = "0v26ws6qx23jn4dcpsq6rqmdxgyxpl5pcvfm90wb3nz6iqbqx294";
       };
     })
     else argSpirv-tools;
@@ -29,8 +30,8 @@ let
       src = fetchFromGitHub {
         owner = "KhronosGroup";
         repo = "SPIRV-Headers";
-        rev = "f8bf11a0253a32375c32cad92c841237b96696c0";
-        sha256 = "1znwjy02dl9rshqzl87rqsv9mfczw7gvwfhcirbl81idahgp4p6l";
+        rev = "f027d53ded7e230e008d37c8b47ede7cd308e19d";
+        sha256 = "12gp2mqcar6jj57jw9isfr62yn72kmvdcl0zga4gvrlyfhnf582q";
       };
     })
     else argSpirv-headers;
@@ -38,13 +39,13 @@ in
 
 stdenv.mkDerivation rec {
   pname = "glslang";
-  version = "8.13.3743";
+  version = "11.1.0";
 
   src = fetchFromGitHub {
     owner = "KhronosGroup";
     repo = "glslang";
     rev = version;
-    sha256 = "0d20wfpp2fmbnz1hnsjr9xc62lxpj86ik2qyviqbni0pqj212cry";
+    sha256 = "1j81pghy7whyr8ygk7lx6g6qph61rky7fkkc8xp87c7n695a48rw";
   };
 
   # These get set at all-packages, keep onto them for child drvs
@@ -54,7 +55,6 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ cmake python3 bison jq ];
-  enableParallelBuilding = true;
 
   postPatch = ''
     cp --no-preserve=mode -r "${localSpirv-tools.src}" External/spirv-tools
@@ -71,11 +71,11 @@ stdenv.mkDerivation rec {
     fi
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit (src.meta) homepage;
     description = "Khronos reference front-end for GLSL and ESSL";
     license = licenses.asl20;
-    platforms = platforms.linux;
+    platforms = platforms.unix;
     maintainers = [ maintainers.ralith ];
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/gnatboot/default.nix b/nixpkgs/pkgs/development/compilers/gnatboot/default.nix
index cb643d6123a6..d97298d02386 100644
--- a/nixpkgs/pkgs/development/compilers/gnatboot/default.nix
+++ b/nixpkgs/pkgs/development/compilers/gnatboot/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation {
   pname = "gentoo-gnatboot";
@@ -41,7 +41,7 @@ stdenv.mkDerivation {
     langAda = true;
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://gentoo.org";
     license = licenses.gpl3Plus;
     maintainers = [ maintainers.lucus16 ];
diff --git a/nixpkgs/pkgs/development/compilers/gnu-cobol/default.nix b/nixpkgs/pkgs/development/compilers/gnu-cobol/default.nix
index 146af98093d0..e208f262ebeb 100644
--- a/nixpkgs/pkgs/development/compilers/gnu-cobol/default.nix
+++ b/nixpkgs/pkgs/development/compilers/gnu-cobol/default.nix
@@ -1,9 +1,8 @@
-{ stdenv, fetchurl, gcc, makeWrapper
+{ lib, stdenv, fetchurl, gcc, makeWrapper
 , db, gmp, ncurses }:
 
 let
   version = "2.2";
-  lib = stdenv.lib;
 in
 stdenv.mkDerivation rec {
   pname = "gnu-cobol";
@@ -18,19 +17,19 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ db gmp ncurses ];
 
-  cflags  = stdenv.lib.concatMapStringsSep " " (p: "-L" + (lib.getLib p) + "/lib ") buildInputs;
-  ldflags = stdenv.lib.concatMapStringsSep " " (p: "-I" + (lib.getDev p) + "/include ") buildInputs;
+  cflags  = lib.concatMapStringsSep " " (p: "-L" + (lib.getLib p) + "/lib ") buildInputs;
+  ldflags = lib.concatMapStringsSep " " (p: "-I" + (lib.getDev p) + "/include ") buildInputs;
 
   cobolCCFlags = "-I$out/include ${ldflags} -L$out/lib ${cflags}";
 
-  postInstall = with stdenv.lib; ''
+  postInstall = with lib; ''
     wrapProgram "$out/bin/cobc" \
       --set COB_CC "${gcc}/bin/gcc" \
       --prefix COB_LDFLAGS " " "${cobolCCFlags}" \
       --prefix COB_CFLAGS " " "${cobolCCFlags}"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An open-source COBOL compiler";
     homepage = "https://sourceforge.net/projects/open-cobol/";
     license = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/compilers/gnu-smalltalk/default.nix b/nixpkgs/pkgs/development/compilers/gnu-smalltalk/default.nix
index f48cd6dfa1b1..cd33baad993b 100644
--- a/nixpkgs/pkgs/development/compilers/gnu-smalltalk/default.nix
+++ b/nixpkgs/pkgs/development/compilers/gnu-smalltalk/default.nix
@@ -1,4 +1,4 @@
-{ config, stdenv, fetchurl, pkgconfig, libtool
+{ config, lib, stdenv, fetchurl, pkg-config, libtool
 , zip, libffi, libsigsegv, readline, gmp
 , gnutls, gnome2, cairo, SDL, sqlite
 , emacsSupport ? config.emacsSupport or false, emacs ? null }:
@@ -11,7 +11,7 @@ let # The gnu-smalltalk project has a dependency to the libsigsegv library.
     # Adding --enable-static=libsigsegv to the gnu-smalltalk configuration flags
     # does not help, the error still occurs. The only solution is to build a
     # shared version of libsigsegv.
-    libsigsegv-shared = stdenv.lib.overrideDerivation libsigsegv (oldAttrs: {
+    libsigsegv-shared = lib.overrideDerivation libsigsegv (oldAttrs: {
       configureFlags = [ "--enable-shared" ];
     });
 
@@ -27,24 +27,24 @@ in stdenv.mkDerivation rec {
 
   # The dependencies and their justification are explained at
   # http://smalltalk.gnu.org/download
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [
     libtool zip libffi libsigsegv-shared readline gmp gnutls gnome2.gtk
     cairo SDL sqlite
   ]
-  ++ stdenv.lib.optional emacsSupport emacs;
+  ++ lib.optional emacsSupport emacs;
 
-  configureFlags = stdenv.lib.optional (!emacsSupport) "--without-emacs";
+  configureFlags = lib.optional (!emacsSupport) "--without-emacs";
 
   hardeningDisable = [ "format" ];
 
-  installFlags = stdenv.lib.optional emacsSupport "lispdir=$(out)/share/emacs/site-lisp";
+  installFlags = lib.optional emacsSupport "lispdir=$(out)/share/emacs/site-lisp";
 
   # For some reason the tests fail if executated with nix-build, but pass if
   # executed within nix-shell --pure.
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A free implementation of the Smalltalk-80 language";
     longDescription = ''
       GNU Smalltalk is a free implementation of the Smalltalk-80 language. It
diff --git a/nixpkgs/pkgs/development/compilers/go/1.14.nix b/nixpkgs/pkgs/development/compilers/go/1.14.nix
index 34b37926ea6f..0811e4bc7013 100644
--- a/nixpkgs/pkgs/development/compilers/go/1.14.nix
+++ b/nixpkgs/pkgs/development/compilers/go/1.14.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, tzdata, iana-etc, runCommand
-, perl, which, pkgconfig, patch, procps, pcre, cacert, Security, Foundation
+{ lib, stdenv, fetchurl, tzdata, iana-etc, runCommand
+, perl, which, pkg-config, patch, procps, pcre, cacert, Security, Foundation
 , mailcap, runtimeShell
 , buildPackages
 , pkgsBuildTarget
@@ -8,7 +8,7 @@
 
 let
 
-  inherit (stdenv.lib) optionals optionalString;
+  inherit (lib) optionals optionalString;
 
   goBootstrap = runCommand "go-bootstrap" {} ''
     mkdir $out
@@ -36,15 +36,15 @@ in
 
 stdenv.mkDerivation rec {
   pname = "go";
-  version = "1.14.13";
+  version = "1.14.14";
 
   src = fetchurl {
     url = "https://dl.google.com/go/go${version}.src.tar.gz";
-    sha256 = "0xxins5crcgghgvnzplmp0qyv2gbmh36v1fpl15d03jwdd6287ds";
+    sha256 = "0vx7r0bb1a500znnnh7v3wgw22ly3p2x06vzyi9hiblgylrby132";
   };
 
   # perl is used for testing go vet
-  nativeBuildInputs = [ perl which pkgconfig patch procps ];
+  nativeBuildInputs = [ perl which pkg-config patch procps ];
   buildInputs = [ cacert pcre ]
     ++ optionals stdenv.isLinux [ stdenv.cc.libc.out ]
     ++ optionals (stdenv.hostPlatform.libc == "glibc") [ stdenv.cc.libc.static ];
@@ -179,7 +179,7 @@ stdenv.mkDerivation rec {
     else
       null;
 
-  GOARM = toString (stdenv.lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]);
+  GOARM = toString (lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]);
   GO386 = 387; # from Arch: don't assume sse2 on i686
   CGO_ENABLED = 1;
   # Hopefully avoids test timeouts on Hydra
@@ -246,8 +246,7 @@ stdenv.mkDerivation rec {
 
   disallowedReferences = [ goBootstrap ];
 
-  meta = with stdenv.lib; {
-    branch = "1.14";
+  meta = with lib; {
     homepage = "http://golang.org/";
     description = "The Go Programming language";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/compilers/go/1.15.nix b/nixpkgs/pkgs/development/compilers/go/1.15.nix
index b0803b6c7a7d..61ab1b020329 100644
--- a/nixpkgs/pkgs/development/compilers/go/1.15.nix
+++ b/nixpkgs/pkgs/development/compilers/go/1.15.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, tzdata, iana-etc, runCommand
-, perl, which, pkgconfig, patch, procps, pcre, cacert, Security, Foundation
+{ lib, stdenv, fetchurl, tzdata, iana-etc, runCommand
+, perl, which, pkg-config, patch, procps, pcre, cacert, Security, Foundation
 , mailcap, runtimeShell
 , buildPackages
 , pkgsBuildTarget
@@ -8,7 +8,7 @@
 
 let
 
-  inherit (stdenv.lib) optionals optionalString;
+  inherit (lib) optionals optionalString;
 
   goBootstrap = runCommand "go-bootstrap" {} ''
     mkdir $out
@@ -36,15 +36,15 @@ in
 
 stdenv.mkDerivation rec {
   pname = "go";
-  version = "1.15.6";
+  version = "1.15.7";
 
   src = fetchurl {
     url = "https://dl.google.com/go/go${version}.src.tar.gz";
-    sha256 = "05sqcx4fm1nxfm46j6xriq0fnnah4bm8bqw027xrzcg2qmrvl2w9";
+    sha256 = "1g1a39y1cnvw3y0bjwjms55cz0s9icm8myrgxi295jwfznmb6cc6";
   };
 
   # perl is used for testing go vet
-  nativeBuildInputs = [ perl which pkgconfig patch procps ];
+  nativeBuildInputs = [ perl which pkg-config patch procps ];
   buildInputs = [ cacert pcre ]
     ++ optionals stdenv.isLinux [ stdenv.cc.libc.out ]
     ++ optionals (stdenv.hostPlatform.libc == "glibc") [ stdenv.cc.libc.static ];
@@ -182,7 +182,7 @@ stdenv.mkDerivation rec {
     else
       null;
 
-  GOARM = toString (stdenv.lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]);
+  GOARM = toString (lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]);
   GO386 = 387; # from Arch: don't assume sse2 on i686
   CGO_ENABLED = 1;
   # Hopefully avoids test timeouts on Hydra
@@ -249,8 +249,7 @@ stdenv.mkDerivation rec {
 
   disallowedReferences = [ goBootstrap ];
 
-  meta = with stdenv.lib; {
-    branch = "1.15";
+  meta = with lib; {
     homepage = "http://golang.org/";
     description = "The Go Programming language";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/compilers/go/1.4.nix b/nixpkgs/pkgs/development/compilers/go/1.4.nix
index 75667a6cb2b5..ec3fd97da9b9 100644
--- a/nixpkgs/pkgs/development/compilers/go/1.4.nix
+++ b/nixpkgs/pkgs/development/compilers/go/1.4.nix
@@ -1,5 +1,5 @@
 { stdenv, lib, fetchurl, fetchpatch, tzdata, iana-etc, libcCross
-, pkgconfig
+, pkg-config
 , pcre
 , Security }:
 
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     sha256 = "1zdyf883awaqdzm4r3fs76nbpiqx3iswl2p4qxclw2sl5vvynas5";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ pcre ];
   depsTargetTargetPropagated = lib.optional stdenv.isDarwin Security;
 
@@ -66,7 +66,7 @@ stdenv.mkDerivation rec {
            else if stdenv.hostPlatform.system == "x86_64-linux" then "amd64"
            else if stdenv.isAarch32 then "arm"
            else throw "Unsupported system";
-  GOARM = stdenv.lib.optionalString (stdenv.hostPlatform.system == "armv5tel-linux") "5";
+  GOARM = lib.optionalString (stdenv.hostPlatform.system == "armv5tel-linux") "5";
   GO386 = 387; # from Arch: don't assume sse2 on i686
   CGO_ENABLED = 0;
 
@@ -83,8 +83,7 @@ stdenv.mkDerivation rec {
     ./all.bash
   '';
 
-  meta = with stdenv.lib; {
-    branch = "1.4";
+  meta = with lib; {
     homepage = "http://golang.org/";
     description = "The Go Programming language";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/compilers/go/2-dev.nix b/nixpkgs/pkgs/development/compilers/go/2-dev.nix
index 9af08dde19e8..3e09f7c0fad2 100644
--- a/nixpkgs/pkgs/development/compilers/go/2-dev.nix
+++ b/nixpkgs/pkgs/development/compilers/go/2-dev.nix
@@ -1,5 +1,5 @@
-{ pkgs, stdenv, fetchurl, fetchgit, tzdata, iana-etc, runCommand
-, perl, which, pkgconfig, patch, procps, pcre, cacert, Security, Foundation
+{ pkgs, lib, stdenv, fetchurl, fetchgit, tzdata, iana-etc, runCommand
+, perl, which, pkg-config, patch, procps, pcre, cacert, Security, Foundation
 , mailcap, runtimeShell
 , buildPackages
 , pkgsBuildTarget
@@ -8,7 +8,7 @@
 
 let
 
-  inherit (stdenv.lib) optionals optionalString;
+  inherit (lib) optionals optionalString;
 
   goBootstrap = runCommand "go-bootstrap" {} ''
     mkdir $out
@@ -45,7 +45,7 @@ stdenv.mkDerivation rec {
   };
 
   # perl is used for testing go vet
-  nativeBuildInputs = [ perl which pkgconfig patch procps ];
+  nativeBuildInputs = [ perl which pkg-config patch procps ];
   buildInputs = [ cacert pcre ]
     ++ optionals stdenv.isLinux [ stdenv.cc.libc.out ]
     ++ optionals (stdenv.hostPlatform.libc == "glibc") [ stdenv.cc.libc.static ];
@@ -184,7 +184,7 @@ stdenv.mkDerivation rec {
     else
       null;
 
-  GOARM = toString (stdenv.lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]);
+  GOARM = toString (lib.intersectLists [(stdenv.hostPlatform.parsed.cpu.version or "")] ["5" "6" "7"]);
   GO386 = 387; # from Arch: don't assume sse2 on i686
   CGO_ENABLED = 1;
   # Hopefully avoids test timeouts on Hydra
@@ -251,8 +251,7 @@ stdenv.mkDerivation rec {
 
   disallowedReferences = [ goBootstrap ];
 
-  meta = with stdenv.lib; {
-    branch = "dev.go2go";
+  meta = with lib; {
     homepage = "http://golang.org/";
     description = "The Go Programming language";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/compilers/gprolog/default.nix b/nixpkgs/pkgs/development/compilers/gprolog/default.nix
index 0a1cc5128734..59f33db68cbd 100644
--- a/nixpkgs/pkgs/development/compilers/gprolog/default.nix
+++ b/nixpkgs/pkgs/development/compilers/gprolog/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "gprolog-1.4.5";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "0z4cc42n3k6i35b8mr816iwsvrpxshw6d7dgz6s2h1hy0l7g1p5z";
   };
 
-  hardeningDisable = stdenv.lib.optional stdenv.isi686 "pic";
+  hardeningDisable = lib.optional stdenv.isi686 "pic";
 
   patchPhase = ''
     sed -i -e "s|/tmp/make.log|$TMPDIR/make.log|g" src/Pl2Wam/check_boot
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://www.gnu.org/software/gprolog/";
     description = "GNU Prolog, a free Prolog compiler with constraint solving over finite domains";
-    license = stdenv.lib.licenses.lgpl3Plus;
+    license = lib.licenses.lgpl3Plus;
 
     longDescription = ''
       GNU Prolog is a free Prolog compiler with constraint solving
@@ -62,7 +62,7 @@ stdenv.mkDerivation rec {
       declarativity of logic programming.
     '';
 
-    maintainers = [ stdenv.lib.maintainers.peti ];
-    platforms = stdenv.lib.platforms.gnu ++ stdenv.lib.platforms.linux;
+    maintainers = [ lib.maintainers.peti ];
+    platforms = lib.platforms.gnu ++ lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/graalvm/community-edition.nix b/nixpkgs/pkgs/development/compilers/graalvm/community-edition.nix
index 71f3b1560c67..76245a440817 100644
--- a/nixpkgs/pkgs/development/compilers/graalvm/community-edition.nix
+++ b/nixpkgs/pkgs/development/compilers/graalvm/community-edition.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, unzip, glibc, zlib, setJavaClassPath }:
+{ lib, stdenv, fetchurl, perl, unzip, glibc, zlib, setJavaClassPath }:
 
 let
   common = javaVersion:
@@ -111,7 +111,7 @@ let
                       "11" = "$out/lib/jli:$out/lib/server:$out/lib";
                     }.${javaVersion}
                  }:${
-            stdenv.lib.makeLibraryPath [
+            lib.makeLibraryPath [
               stdenv.cc.cc.lib # libstdc++.so.6
               zlib             # libz.so.1
             ]}"
@@ -128,7 +128,7 @@ let
 
         doInstallCheck = true;
         installCheckPhase = ''
-          echo ${stdenv.lib.escapeShellArg ''
+          echo ${lib.escapeShellArg ''
                    public class HelloWorld {
                      public static void main(String[] args) {
                        System.out.println("Hello World");
@@ -151,7 +151,7 @@ let
 
         passthru.home = graalvmXXX-ce;
 
-        meta = with stdenv.lib; {
+        meta = with lib; {
           homepage = "https://www.graalvm.org/";
           description = "High-Performance Polyglot VM";
           license = with licenses; [ upl gpl2Classpath bsd3 ];
diff --git a/nixpkgs/pkgs/development/compilers/graalvm/default.nix b/nixpkgs/pkgs/development/compilers/graalvm/default.nix
index 337e0f735ebe..fc30e37e4b7c 100644
--- a/nixpkgs/pkgs/development/compilers/graalvm/default.nix
+++ b/nixpkgs/pkgs/development/compilers/graalvm/default.nix
@@ -270,7 +270,7 @@ in rec {
         --prefix PATH : ${lib.makeBinPath [ python27withPackages mercurial ]} \
         --set    FINDBUGS_HOME ${findbugs}
     '';
-    meta = with stdenv.lib; {
+    meta = with lib; {
       homepage = "https://github.com/graalvm/mx";
       description = "Command-line tool used for the development of Graal projects";
       license = licenses.gpl2;
@@ -527,7 +527,7 @@ in rec {
     enableParallelBuilding = true;
     passthru.home = graalvm8;
 
-    meta = with stdenv.lib; {
+    meta = with lib; {
       homepage = "https://github.com/oracle/graal";
       description = "High-Performance Polyglot VM";
       license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/compilers/graalvm/enterprise-edition.nix b/nixpkgs/pkgs/development/compilers/graalvm/enterprise-edition.nix
index 690bfdb425cf..c9c5206f6da3 100644
--- a/nixpkgs/pkgs/development/compilers/graalvm/enterprise-edition.nix
+++ b/nixpkgs/pkgs/development/compilers/graalvm/enterprise-edition.nix
@@ -1,4 +1,4 @@
-{ stdenv, requireFile, perl, unzip, glibc, zlib, bzip2, gdk-pixbuf, xorg, glib, fontconfig, freetype, cairo, pango, gtk3, gtk2, ffmpeg, libGL, atk, alsaLib, libav_0_8, setJavaClassPath }:
+{ lib, stdenv, requireFile, perl, unzip, glibc, zlib, bzip2, gdk-pixbuf, xorg, glib, fontconfig, freetype, cairo, pango, gtk3, gtk2, ffmpeg, libGL, atk, alsaLib, libav_0_8, setJavaClassPath }:
 
 let
   common = javaVersion:
@@ -124,7 +124,7 @@ let
                       "11" = "$out/lib/jli:$out/lib/server:$out/lib";
                     }.${javaVersion}
                  }:${
-            stdenv.lib.strings.makeLibraryPath [ glibc xorg.libXxf86vm xorg.libX11 xorg.libXext xorg.libXtst xorg.libXi xorg.libXrender
+            lib.strings.makeLibraryPath [ glibc xorg.libXxf86vm xorg.libX11 xorg.libXext xorg.libXtst xorg.libXi xorg.libXrender
                                                  glib zlib bzip2 alsaLib fontconfig freetype pango gtk3 gtk2 cairo gdk-pixbuf atk ffmpeg libGL ]}"
 
           for f in $(find $out -type f -perm -0100); do
@@ -141,7 +141,7 @@ let
 
         doInstallCheck = true;
         installCheckPhase = ''
-          echo ${stdenv.lib.escapeShellArg ''
+          echo ${lib.escapeShellArg ''
                    public class HelloWorld {
                      public static void main(String[] args) {
                        System.out.println("Hello World");
@@ -167,7 +167,7 @@ let
 
         passthru.home = graalvmXXX-ee;
 
-        meta = with stdenv.lib; {
+        meta = with lib; {
           homepage = "https://www.graalvm.org/";
           description = "High-Performance Polyglot VM";
           license = licenses.unfree;
diff --git a/nixpkgs/pkgs/development/compilers/gwt/2.4.0.nix b/nixpkgs/pkgs/development/compilers/gwt/2.4.0.nix
index 14bf940fadf1..e10d10120347 100644
--- a/nixpkgs/pkgs/development/compilers/gwt/2.4.0.nix
+++ b/nixpkgs/pkgs/development/compilers/gwt/2.4.0.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip }:
+{ lib, stdenv, fetchurl, unzip }:
 
 stdenv.mkDerivation {
   name = "gwt-java-2.4.0";
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = "http://www.gwtproject.org/";
     description = "A development toolkit for building and optimizing complex browser-based applications";
-    license = stdenv.lib.licenses.asl20;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.asl20;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/haxe/default.nix b/nixpkgs/pkgs/development/compilers/haxe/default.nix
index a3110c0c1af1..584511923961 100644
--- a/nixpkgs/pkgs/development/compilers/haxe/default.nix
+++ b/nixpkgs/pkgs/development/compilers/haxe/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, coreutils, ocamlPackages, zlib, pcre, neko }:
+{ lib, stdenv, fetchgit, coreutils, ocamlPackages, zlib, pcre, neko }:
 
 let inherit (ocamlPackages) ocaml camlp4; in
 
@@ -74,7 +74,7 @@ let
         popd > /dev/null
       '';
 
-      meta = with stdenv.lib; {
+      meta = with lib; {
         description = "Programming language targeting JavaScript, Flash, NekoVM, PHP, C++";
         homepage = "https://haxe.org";
         license = with licenses; [ gpl2 bsd2 /*?*/ ];  # -> docs/license.txt
diff --git a/nixpkgs/pkgs/development/compilers/hhvm/default.nix b/nixpkgs/pkgs/development/compilers/hhvm/default.nix
index 08ba9e468147..d8495977e780 100644
--- a/nixpkgs/pkgs/development/compilers/hhvm/default.nix
+++ b/nixpkgs/pkgs/development/compilers/hhvm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, cmake, pkgconfig, boost, libunwind, libmemcached
+{ lib, stdenv, fetchgit, cmake, pkg-config, boost, libunwind, libmemcached
 , pcre, libevent, gd, curl, libxml2, icu, flex, bison, openssl, zlib, php
 , expat, libcap, oniguruma, libdwarf, libmcrypt, tbb, gperftools, glog, libkrb5
 , bzip2, openldap, readline, libelf, uwimap, binutils, cyrus_sasl, pam, libpng
@@ -18,9 +18,10 @@ stdenv.mkDerivation rec {
     fetchSubmodules = true;
   };
 
+  nativeBuildInputs = [ cmake pkg-config flex bison ];
   buildInputs =
-    [ cmake pkgconfig boost libunwind libmysqlclient libmemcached pcre gdb git perl
-      libevent gd curl libxml2 icu flex bison openssl zlib php expat libcap
+    [ boost libunwind libmysqlclient libmemcached pcre gdb git perl
+      libevent gd curl libxml2 icu openssl zlib php expat libcap
       oniguruma libdwarf libmcrypt tbb gperftools bzip2 openldap readline
       libelf uwimap binutils cyrus_sasl pam glog libpng libxslt libkrb5
       gmp libyaml libedit libvpx imagemagick fribidi gperf which
@@ -31,7 +32,6 @@ stdenv.mkDerivation rec {
     ./flexible-array-members-gcc6.patch
   ];
 
-  enableParallelBuilding = true;
   dontUseCmakeBuildDir = true;
   NIX_LDFLAGS = "-lpam -L${pam}/lib";
 
@@ -62,7 +62,7 @@ stdenv.mkDerivation rec {
     homepage    = "https://hhvm.com";
     license     = "PHP/Zend";
     platforms   = [ "x86_64-linux" ];
-    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
+    maintainers = [ lib.maintainers.thoughtpolice ];
     broken = true; # Since 2018-04-21, see https://hydra.nixos.org/build/73059373
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/hop/default.nix b/nixpkgs/pkgs/development/compilers/hop/default.nix
index fd3ef137ae60..8e5bd6a7df03 100644
--- a/nixpkgs/pkgs/development/compilers/hop/default.nix
+++ b/nixpkgs/pkgs/development/compilers/hop/default.nix
@@ -1,8 +1,8 @@
-{ stdenv, fetchurl, bigloo }:
+{ lib, stdenv, fetchurl, bigloo }:
 
 # Compute the “release” version of bigloo (before the first dash, if any)
 let bigloo-release =
-  let inherit (stdenv.lib) head splitString; in
+  let inherit (lib) head splitString; in
   head (splitString "-" (builtins.parseDrvName bigloo.name).version)
 ; in
 
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     "--bigloolibdir=${bigloo}/lib/bigloo/${bigloo-release}/"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A multi-tier programming language for the Web 2.0 and the so-called diffuse Web";
     homepage = "http://hop.inria.fr/";
     license = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/compilers/iasl/default.nix b/nixpkgs/pkgs/development/compilers/iasl/default.nix
index d68fba1d624c..fb6bd41344ad 100644
--- a/nixpkgs/pkgs/development/compilers/iasl/default.nix
+++ b/nixpkgs/pkgs/development/compilers/iasl/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, fetchpatch, bison, flex}:
+{lib, stdenv, fetchurl, fetchpatch, bison, flex}:
 
 stdenv.mkDerivation rec {
   pname = "iasl";
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Intel ACPI Compiler";
     homepage = "http://www.acpica.org/";
-    license = stdenv.lib.licenses.iasl;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.iasl;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/idris2/default.nix b/nixpkgs/pkgs/development/compilers/idris2/default.nix
index 275c29444621..ec0d8fe5c727 100644
--- a/nixpkgs/pkgs/development/compilers/idris2/default.nix
+++ b/nixpkgs/pkgs/development/compilers/idris2/default.nix
@@ -1,17 +1,17 @@
-{ stdenv, fetchFromGitHub, makeWrapper
+{ lib, stdenv, fetchFromGitHub, makeWrapper
 , clang, chez
 }:
 
 # Uses scheme to bootstrap the build of idris2
 stdenv.mkDerivation rec {
   pname = "idris2";
-  version = "0.2.2";
+  version = "0.3.0";
 
   src = fetchFromGitHub {
     owner = "idris-lang";
     repo = "Idris2";
     rev = "v${version}";
-    sha256 = "18m483vccijfh9z6x4zgi37fql3q765x3ypkwixv3rwq9nxnd6hm";
+    sha256 = "0sa2lpb7n6xqfknwld9rzm4bnb6qcd0ja1n63cnc5v8wdzr8q7kh";
   };
 
   strictDeps = true;
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   '';
 
   makeFlags = [ "PREFIX=$(out)" ]
-    ++ stdenv.lib.optional stdenv.isDarwin "OS=";
+    ++ lib.optional stdenv.isDarwin "OS=";
 
   # The name of the main executable of pkgs.chez is `scheme`
   buildFlags = [ "bootstrap-build" "SCHEME=scheme" ];
@@ -71,8 +71,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A purely functional programming language with first class types";
     homepage = "https://github.com/idris-lang/Idris2";
-    license = stdenv.lib.licenses.bsd3;
-    maintainers = with stdenv.lib.maintainers; [ wchresta ];
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ wchresta ];
     inherit (chez.meta) platforms;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/inform6/default.nix b/nixpkgs/pkgs/development/compilers/inform6/default.nix
index 1d339a2b14bf..f0c182f02077 100644
--- a/nixpkgs/pkgs/development/compilers/inform6/default.nix
+++ b/nixpkgs/pkgs/development/compilers/inform6/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl }:
+{ lib, stdenv, fetchurl, perl }:
 
 stdenv.mkDerivation rec {
   pname = "inform6";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   makeFlags = [ "PREFIX=${placeholder "out"}" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Interactive fiction compiler and libraries";
     longDescription = ''
       Inform 6 is a C-like programming language for writing interactive fiction
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     homepage = "https://gitlab.com/DavidGriffith/inform6unix";
     changelog = "https://gitlab.com/DavidGriffith/inform6unix/-/raw/${version}/NEWS";
     license = licenses.artistic2;
-    maintainers = with stdenv.lib.maintainers; [ ddelabru ];
+    maintainers = with lib.maintainers; [ ddelabru ];
     platforms = platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/inform7/default.nix b/nixpkgs/pkgs/development/compilers/inform7/default.nix
index 8e5f02e792d6..80349b7e6dac 100644
--- a/nixpkgs/pkgs/development/compilers/inform7/default.nix
+++ b/nixpkgs/pkgs/development/compilers/inform7/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchzip, coreutils, perl, gnutar, gzip }:
+{ lib, stdenv, fetchzip, coreutils, perl, gnutar, gzip }:
 let
   version = "6M62";
 in stdenv.mkDerivation {
@@ -21,7 +21,7 @@ in stdenv.mkDerivation {
       --replace "/usr/bin/perl" "${perl}/bin/perl"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A design system for interactive fiction";
     homepage = "http://inform7.com/";
     license = licenses.artistic2;
diff --git a/nixpkgs/pkgs/development/compilers/intel-graphics-compiler/default.nix b/nixpkgs/pkgs/development/compilers/intel-graphics-compiler/default.nix
index 8ca85817f9e4..ebba160fc95a 100644
--- a/nixpkgs/pkgs/development/compilers/intel-graphics-compiler/default.nix
+++ b/nixpkgs/pkgs/development/compilers/intel-graphics-compiler/default.nix
@@ -1,7 +1,7 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
-, pkgconfig
+, pkg-config
 
 , bison
 , flex
@@ -19,7 +19,7 @@ let
   };
   inherit (llvmPkgs) llvm;
   inherit (if buildWithPatches then opencl-clang else llvmPkgs) clang clang-unwrapped spirv-llvm-translator;
-  inherit (stdenv.lib) getVersion optional optionals versionOlder versions;
+  inherit (lib) getVersion optional optionals versionOlder versions;
 in
 
 stdenv.mkDerivation rec {
@@ -63,7 +63,7 @@ stdenv.mkDerivation rec {
     "-DIGC_PREFERRED_LLVM_VERSION=${getVersion llvm}"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage    = "https://github.com/intel/intel-graphics-compiler";
     description = "LLVM-based compiler for OpenCL targeting Intel Gen graphics hardware";
     license     = licenses.mit;
diff --git a/nixpkgs/pkgs/development/compilers/intercal/default.nix b/nixpkgs/pkgs/development/compilers/intercal/default.nix
index 8b91e3f2c6d8..d696b6801ed5 100644
--- a/nixpkgs/pkgs/development/compilers/intercal/default.nix
+++ b/nixpkgs/pkgs/development/compilers/intercal/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchurl
-, pkgconfig
+{ lib, stdenv, fetchurl
+, pkg-config
 , bison, flex
 , makeWrapper }:
 
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
 
   pname = "intercal";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs =
-  [ pkgconfig bison flex makeWrapper ];
+  [ pkg-config bison flex makeWrapper ];
 
   # Intercal invokes gcc, so we need an explicit PATH
   postInstall = ''
diff --git a/nixpkgs/pkgs/development/compilers/ios-cross-compile/9.2.nix b/nixpkgs/pkgs/development/compilers/ios-cross-compile/9.2.nix
index e64c0c912d94..cabdbd9dcc01 100644
--- a/nixpkgs/pkgs/development/compilers/ios-cross-compile/9.2.nix
+++ b/nixpkgs/pkgs/development/compilers/ios-cross-compile/9.2.nix
@@ -1,4 +1,4 @@
-{ stdenv, git, clang,
+{ lib, stdenv, git, clang,
   fetchFromGitHub, requireFile,
   openssl, xz, gnutar,
   automake, autoconf, libtool, clangStdenv } :
@@ -57,9 +57,9 @@ clangStdenv.mkDerivation rec {
   meta = {
     description =
     "Provides an iOS cross compiler from 7.1 up to iOS-${version} and ldid";
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
     hydraPlatforms = [];
-    maintainers = with stdenv.lib.maintainers; [ fxfactorial ];
-    license = stdenv.lib.licenses.gpl2;
+    maintainers = with lib.maintainers; [ fxfactorial ];
+    license = lib.licenses.gpl2;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/ispc/default.nix b/nixpkgs/pkgs/development/compilers/ispc/default.nix
index 01e1eaca6e1d..d1ac7bcd0efe 100644
--- a/nixpkgs/pkgs/development/compilers/ispc/default.nix
+++ b/nixpkgs/pkgs/development/compilers/ispc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub
+{ lib, stdenv, fetchFromGitHub
 , cmake, which, m4, python3, bison, flex, llvmPackages
 
   # the default test target is sse4, but that is not supported by all Hydra agents
@@ -60,7 +60,7 @@ stdenv.mkDerivation rec {
     "-DARM_ENABLED=FALSE"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage    = "https://ispc.github.io/";
     description = "Intel 'Single Program, Multiple Data' Compiler, a vectorised language";
     license     = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/compilers/jasmin/default.nix b/nixpkgs/pkgs/development/compilers/jasmin/default.nix
index 7defdc5c689b..c61f267bf1af 100644
--- a/nixpkgs/pkgs/development/compilers/jasmin/default.nix
+++ b/nixpkgs/pkgs/development/compilers/jasmin/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , unzip
 , jdk8
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
     minimal-module = callPackage ./test-assemble-hello-world {};
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An assembler for the Java Virtual Machine";
     homepage = "http://jasmin.sourceforge.net/";
     downloadPage = "https://sourceforge.net/projects/jasmin/files/latest/download";
diff --git a/nixpkgs/pkgs/development/compilers/javacard-devkit/default.nix b/nixpkgs/pkgs/development/compilers/javacard-devkit/default.nix
index 5b691530d34b..88371406387c 100644
--- a/nixpkgs/pkgs/development/compilers/javacard-devkit/default.nix
+++ b/nixpkgs/pkgs/development/compilers/javacard-devkit/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, requireFile, unzip, makeWrapper, oraclejdk8, autoPatchelfHook
+{ lib, stdenv, requireFile, unzip, makeWrapper, oraclejdk8, autoPatchelfHook
 , pcsclite
 }:
 
@@ -62,8 +62,8 @@ stdenv.mkDerivation rec {
       For more details, please refer to the documentation by Oracle
     '';
     homepage = "https://www.oracle.com/technetwork/java/embedded/javacard/overview/index.html";
-    license = stdenv.lib.licenses.unfree;
-    maintainers = [ stdenv.lib.maintainers.ekleog ];
+    license = lib.licenses.unfree;
+    maintainers = [ lib.maintainers.ekleog ];
     platforms = [ "i686-linux" "x86_64-linux" ];
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/jetbrains-jdk/default.nix b/nixpkgs/pkgs/development/compilers/jetbrains-jdk/default.nix
index fd3270fa0d08..2edf93b7fc02 100644
--- a/nixpkgs/pkgs/development/compilers/jetbrains-jdk/default.nix
+++ b/nixpkgs/pkgs/development/compilers/jetbrains-jdk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, openjdk11, fetchFromGitHub, jetbrains }:
+{ lib, stdenv, openjdk11, fetchFromGitHub, jetbrains }:
 
 openjdk11.overrideAttrs (oldAttrs: rec {
   pname = "jetbrains-jdk";
@@ -6,11 +6,11 @@ openjdk11.overrideAttrs (oldAttrs: rec {
   src = fetchFromGitHub {
     owner = "JetBrains";
     repo = "JetBrainsRuntime";
-    rev = "jb${stdenv.lib.replaceStrings ["."] ["_"] version}";
+    rev = "jb${lib.replaceStrings ["."] ["_"] version}";
     sha256 = "1gxqi6dkyriv9j29ppan638w1ns2g9m4q1sq7arf9kwqr05zim90";
   };
   patches = [];
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An OpenJDK fork to better support Jetbrains's products.";
     longDescription = ''
      JetBrains Runtime is a runtime environment for running IntelliJ Platform
diff --git a/nixpkgs/pkgs/development/compilers/julia/1.0.nix b/nixpkgs/pkgs/development/compilers/julia/1.0.nix
index a98b69f50e9f..98d7ce90de3b 100644
--- a/nixpkgs/pkgs/development/compilers/julia/1.0.nix
+++ b/nixpkgs/pkgs/development/compilers/julia/1.0.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchpatch, fetchurl, fetchzip
+{ lib, stdenv, fetchpatch, fetchurl, fetchzip
 # build tools
 , gfortran, m4, makeWrapper, patchelf, perl, which, python2
 , cmake
@@ -84,7 +84,7 @@ stdenv.mkDerivation rec {
     pcre2.dev blas lapack openlibm openspecfun readline utf8proc
     zlib
   ]
-  ++ stdenv.lib.optionals stdenv.isDarwin [CoreServices ApplicationServices]
+  ++ lib.optionals stdenv.isDarwin [CoreServices ApplicationServices]
   ;
 
   patches = [
@@ -121,9 +121,9 @@ stdenv.mkDerivation rec {
 
   makeFlags =
     let
-      arch = stdenv.lib.head (stdenv.lib.splitString "-" stdenv.system);
+      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}
@@ -166,13 +166,11 @@ stdenv.mkDerivation rec {
       "USE_SYSTEM_ZLIB=1"
     ];
 
-  LD_LIBRARY_PATH = assert (blas.isILP64 == lapack.isILP64); (stdenv.lib.makeLibraryPath [
+  LD_LIBRARY_PATH = assert (blas.isILP64 == lapack.isILP64); (lib.makeLibraryPath [
     arpack fftw fftwSinglePrec gmp libgit2 mpfr blas lapack openlibm
     openspecfun pcre2
   ]);
 
-  enableParallelBuilding = true;
-
   doCheck = !stdenv.isDarwin;
   checkTarget = "testall";
   # Julia's tests require read/write access to $HOME
@@ -206,8 +204,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "High-level performance-oriented dynamical language for technical computing";
     homepage = "https://julialang.org/";
-    license = stdenv.lib.licenses.mit;
-    maintainers = with stdenv.lib.maintainers; [ raskin rob garrison ];
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ raskin rob garrison ];
     platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" "aarch64-linux" ];
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/julia/1.3.nix b/nixpkgs/pkgs/development/compilers/julia/1.3.nix
index 406ea73f2aed..da60fa8b9888 100644
--- a/nixpkgs/pkgs/development/compilers/julia/1.3.nix
+++ b/nixpkgs/pkgs/development/compilers/julia/1.3.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchzip, fetchFromGitHub
+{ lib, stdenv, fetchurl, fetchzip, fetchFromGitHub
 # build tools
 , gfortran, m4, makeWrapper, patchelf, perl, which, python2
 , cmake
@@ -14,7 +14,7 @@
 
 assert (!blas.isILP64) && (!lapack.isILP64);
 
-with stdenv.lib;
+with lib;
 
 let
   majorVersion = "1";
@@ -64,7 +64,7 @@ stdenv.mkDerivation rec {
     pcre2.dev blas lapack openlibm openspecfun readline utf8proc
     zlib
   ]
-  ++ stdenv.lib.optionals stdenv.isDarwin [CoreServices ApplicationServices]
+  ++ lib.optionals stdenv.isDarwin [CoreServices ApplicationServices]
   ;
 
   nativeBuildInputs = [ curl gfortran m4 makeWrapper patchelf perl python2 which ];
@@ -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}
@@ -119,8 +119,6 @@ stdenv.mkDerivation rec {
     openspecfun pcre2 lapack
   ];
 
-  enableParallelBuilding = true;
-
   # Other versions of Julia pass the tests, but we are not sure why these fail.
   doCheck = false;
   checkTarget = "testall";
@@ -155,8 +153,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "High-level performance-oriented dynamical language for technical computing";
     homepage = "https://julialang.org/";
-    license = stdenv.lib.licenses.mit;
-    maintainers = with stdenv.lib.maintainers; [ raskin rob garrison ];
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ raskin rob garrison ];
     platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ];
     broken = stdenv.isi686;
   };
diff --git a/nixpkgs/pkgs/development/compilers/julia/1.5.nix b/nixpkgs/pkgs/development/compilers/julia/1.5.nix
index 151cf83cecef..a523336b7b92 100644
--- a/nixpkgs/pkgs/development/compilers/julia/1.5.nix
+++ b/nixpkgs/pkgs/development/compilers/julia/1.5.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchzip, fetchFromGitHub
+{ lib, stdenv, fetchurl, fetchzip, fetchFromGitHub
 # build tools
 , gfortran, m4, makeWrapper, patchelf, perl, which, python2
 , cmake
@@ -14,7 +14,7 @@
 
 assert (!blas.isILP64) && (!lapack.isILP64);
 
-with stdenv.lib;
+with lib;
 
 let
   majorVersion = "1";
@@ -63,7 +63,7 @@ stdenv.mkDerivation rec {
     arpack fftw fftwSinglePrec libgit2 libunwind mpfr
     pcre2.dev blas lapack openlibm openspecfun readline utf8proc
     zlib
-  ] ++ stdenv.lib.optionals stdenv.isDarwin [CoreServices ApplicationServices];
+  ] ++ lib.optionals stdenv.isDarwin [CoreServices ApplicationServices];
 
   nativeBuildInputs = [ curl gfortran m4 makeWrapper patchelf perl python2 which cmake ];
 
@@ -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}
@@ -119,8 +119,6 @@ stdenv.mkDerivation rec {
     openspecfun pcre2 lapack
   ];
 
-  enableParallelBuilding = true;
-
   # Julia's tests require read/write access to $HOME
   preCheck = ''
     export HOME="$NIX_BUILD_TOP"
@@ -152,8 +150,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "High-level performance-oriented dynamical language for technical computing";
     homepage = "https://julialang.org/";
-    license = stdenv.lib.licenses.mit;
-    maintainers = with stdenv.lib.maintainers; [ raskin rob garrison ];
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ raskin rob garrison ];
     platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" "aarch64-linux" ];
     broken = stdenv.isi686;
   };
diff --git a/nixpkgs/pkgs/development/compilers/jwasm/default.nix b/nixpkgs/pkgs/development/compilers/jwasm/default.nix
index 8ce55c757959..2f1727ae0de0 100644
--- a/nixpkgs/pkgs/development/compilers/jwasm/default.nix
+++ b/nixpkgs/pkgs/development/compilers/jwasm/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchFromGitHub
+{ lib, stdenv, fetchFromGitHub
 , cmake }:
 
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
   pname = "jwasm";
   version = "2.13";
diff --git a/nixpkgs/pkgs/development/compilers/kotlin/default.nix b/nixpkgs/pkgs/development/compilers/kotlin/default.nix
index 934c9a848b92..cd613c1b33be 100644
--- a/nixpkgs/pkgs/development/compilers/kotlin/default.nix
+++ b/nixpkgs/pkgs/development/compilers/kotlin/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper, jre, unzip }:
+{ lib, stdenv, fetchurl, makeWrapper, jre, unzip }:
 
 let
   version = "1.4.21";
@@ -38,9 +38,9 @@ in stdenv.mkDerivation {
       and has external contributors.
     '';
     homepage = "https://kotlinlang.org/";
-    license = stdenv.lib.licenses.asl20;
-    maintainers = with stdenv.lib.maintainers;
+    license = lib.licenses.asl20;
+    maintainers = with lib.maintainers;
       [ ];
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/ldc/generic.nix b/nixpkgs/pkgs/development/compilers/ldc/generic.nix
index 214d64cfa76b..4261c2b65334 100644
--- a/nixpkgs/pkgs/development/compilers/ldc/generic.nix
+++ b/nixpkgs/pkgs/development/compilers/ldc/generic.nix
@@ -1,5 +1,5 @@
 { version, ldcSha256 }:
-{ stdenv, fetchurl, cmake, ninja, llvm_11, curl, tzdata
+{ lib, stdenv, fetchurl, cmake, ninja, llvm_11, curl, tzdata
 , libconfig, lit, gdb, unzip, darwin, bash
 , callPackage, makeWrapper, runCommand, targetPackages
 , ldcBootstrap ? callPackage ./bootstrap.nix { }
@@ -18,8 +18,6 @@ stdenv.mkDerivation rec {
   pname = "ldc";
   inherit version;
 
-  enableParallelBuilding = true;
-
   src = fetchurl {
     url = "https://github.com/ldc-developers/ldc/releases/download/v${version}/ldc-${version}-src.tar.gz";
     sha256 = ldcSha256;
@@ -39,7 +37,7 @@ stdenv.mkDerivation rec {
       # test depends on current year
       rm ldc-${version}-src/tests/d2/dmd-testsuite/compilable/ddocYear.d
   ''
-  + stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
+  + lib.optionalString stdenv.hostPlatform.isDarwin ''
       # https://github.com/NixOS/nixpkgs/issues/34817
       rm -r ldc-${version}-src/tests/plugins/addFuncEntryCall
   '';
@@ -48,20 +46,20 @@ stdenv.mkDerivation rec {
     # Setting SHELL=$SHELL when dmd testsuite is run doesn't work on Linux somehow
     substituteInPlace tests/d2/dmd-testsuite/Makefile --replace "SHELL=/bin/bash" "SHELL=${bash}/bin/bash"
   ''
-  + stdenv.lib.optionalString stdenv.hostPlatform.isLinux ''
+  + lib.optionalString stdenv.hostPlatform.isLinux ''
       substituteInPlace runtime/phobos/std/socket.d --replace "assert(ih.addrList[0] == 0x7F_00_00_01);" ""
   ''
-  + stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
+  + lib.optionalString stdenv.hostPlatform.isDarwin ''
       substituteInPlace runtime/phobos/std/socket.d --replace "foreach (name; names)" "names = []; foreach (name; names)"
   '';
 
   nativeBuildInputs = [
     cmake ldcBootstrap lit lit.python llvm_11 makeWrapper ninja unzip
   ]
-  ++ stdenv.lib.optionals stdenv.hostPlatform.isDarwin [
+  ++ lib.optionals stdenv.hostPlatform.isDarwin [
     darwin.apple_sdk.frameworks.Foundation
   ]
-  ++ stdenv.lib.optionals (!stdenv.hostPlatform.isDarwin) [
+  ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
     # https://github.com/NixOS/nixpkgs/pull/36378#issuecomment-385034818
     gdb
   ];
@@ -79,7 +77,7 @@ stdenv.mkDerivation rec {
 
   makeFlags = [ "DMD=$DMD" ];
 
-  fixNames = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin  ''
+  fixNames = lib.optionalString stdenv.hostPlatform.isDarwin  ''
     fixDarwinDylibNames() {
       local flags=()
 
@@ -99,7 +97,7 @@ stdenv.mkDerivation rec {
   '';
 
   # https://github.com/ldc-developers/ldc/issues/2497#issuecomment-459633746
-  additionalExceptions = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin
+  additionalExceptions = lib.optionalString stdenv.hostPlatform.isDarwin
     "|druntime-test-shared";
 
   checkPhase = ''
@@ -128,7 +126,7 @@ stdenv.mkDerivation rec {
         --set-default CC "${targetPackages.stdenv.cc}/bin/cc"
    '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "The LLVM-based D compiler";
     homepage = "https://github.com/ldc-developers/ldc";
     # from https://github.com/ldc-developers/ldc/blob/master/LICENSE
diff --git a/nixpkgs/pkgs/development/compilers/llvm/10/clang/default.nix b/nixpkgs/pkgs/development/compilers/llvm/10/clang/default.nix
index fef7720d726d..35b7ab313d8e 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/10/clang/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/10/clang/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python3, lld
+{ lib, stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python3, lld
 , fixDarwinDylibNames
 , enableManpages ? false
 }:
@@ -19,8 +19,8 @@ let
     '';
 
     nativeBuildInputs = [ cmake python3 lld ]
-      ++ stdenv.lib.optional enableManpages python3.pkgs.sphinx
-      ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+      ++ lib.optional enableManpages python3.pkgs.sphinx
+      ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
 
     buildInputs = [ libxml2 llvm ];
 
@@ -28,7 +28,7 @@ let
       "-DCMAKE_CXX_FLAGS=-std=c++14"
       "-DCLANGD_BUILD_XPC=OFF"
       "-DLLVM_ENABLE_RTTI=ON"
-    ] ++ stdenv.lib.optionals enableManpages [
+    ] ++ lib.optionals enableManpages [
       "-DCLANG_INCLUDE_DOCS=ON"
       "-DLLVM_ENABLE_SPHINX=ON"
       "-DSPHINX_OUTPUT_MAN=ON"
@@ -49,9 +49,9 @@ let
 
       # Patch for standalone doc building
       sed -i '1s,^,find_package(Sphinx REQUIRED)\n,' docs/CMakeLists.txt
-    '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+    '' + lib.optionalString stdenv.hostPlatform.isMusl ''
       sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp
-    '' + stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
+    '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
       substituteInPlace tools/extra/clangd/CMakeLists.txt \
         --replace "NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB" FALSE
     '';
@@ -82,8 +82,6 @@ let
       rm $out/bin/c-index-test
     '';
 
-    enableParallelBuilding = true;
-
     passthru = {
       isClang = true;
       inherit llvm;
@@ -92,10 +90,10 @@ let
     meta = {
       description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler";
       homepage    = "https://llvm.org/";
-      license     = stdenv.lib.licenses.ncsa;
-      platforms   = stdenv.lib.platforms.all;
+      license     = lib.licenses.ncsa;
+      platforms   = lib.platforms.all;
     };
-  } // stdenv.lib.optionalAttrs enableManpages {
+  } // lib.optionalAttrs enableManpages {
     pname = "clang-manpages";
 
     buildPhase = ''
diff --git a/nixpkgs/pkgs/development/compilers/llvm/10/compiler-rt.nix b/nixpkgs/pkgs/development/compilers/llvm/10/compiler-rt.nix
index e6882cbabb8b..37515b5039d8 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/10/compiler-rt.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/10/compiler-rt.nix
@@ -1,4 +1,4 @@
-{ stdenv, version, fetch, cmake, python3, llvm, libcxxabi }:
+{ lib, stdenv, version, fetch, cmake, python3, llvm, libcxxabi }:
 
 let
 
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   src = fetch pname "1yjqjri753w0fzmxcyz687nvd97sbc9rsqrxzpq720na47hwh3fr";
 
   nativeBuildInputs = [ cmake python3 llvm ];
-  buildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
+  buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
 
   NIX_CFLAGS_COMPILE = [
     "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0"
@@ -24,24 +24,24 @@ stdenv.mkDerivation rec {
     "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON"
     "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}"
     "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}"
-  ] ++ stdenv.lib.optionals (useLLVM || bareMetal || isMusl) [
+  ] ++ lib.optionals (useLLVM || bareMetal || isMusl) [
     "-DCOMPILER_RT_BUILD_SANITIZERS=OFF"
     "-DCOMPILER_RT_BUILD_XRAY=OFF"
     "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF"
     "-DCOMPILER_RT_BUILD_PROFILE=OFF"
-  ] ++ stdenv.lib.optionals (useLLVM || bareMetal) [
+  ] ++ lib.optionals (useLLVM || bareMetal) [
     "-DCMAKE_C_COMPILER_WORKS=ON"
     "-DCMAKE_CXX_COMPILER_WORKS=ON"
     "-DCOMPILER_RT_BAREMETAL_BUILD=ON"
     "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}"
-  ] ++ stdenv.lib.optionals (useLLVM) [
+  ] ++ lib.optionals (useLLVM) [
     "-DCOMPILER_RT_BUILD_BUILTINS=ON"
     "-DCMAKE_C_FLAGS=-nodefaultlibs"
     #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program
     "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY"
-  ] ++ stdenv.lib.optionals (bareMetal) [
+  ] ++ lib.optionals (bareMetal) [
     "-DCOMPILER_RT_OS_DIR=baremetal"
-  ] ++ stdenv.lib.optionals (stdenv.hostPlatform.isDarwin) [
+  ] ++ lib.optionals (stdenv.hostPlatform.isDarwin) [
     # The compiler-rt build infrastructure sniffs supported platforms on Darwin
     # and finds i386;x86_64;x86_64h. We only build for x86_64, so linking fails
     # when it tries to use libc++ and libc++api for i386.
@@ -53,8 +53,8 @@ stdenv.mkDerivation rec {
   patches = [
     ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory
     ./find-darwin-sdk-version.patch # don't test for macOS being >= 10.15
-  ]# ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
-    ++ stdenv.lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch;
+  ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
+    ++ lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch;
 
 
   # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
@@ -62,13 +62,13 @@ stdenv.mkDerivation rec {
   # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd
   # get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by
   # a flag and turn the flag off during the stdenv build.
-  postPatch = stdenv.lib.optionalString (!stdenv.isDarwin) ''
+  postPatch = lib.optionalString (!stdenv.isDarwin) ''
     substituteInPlace cmake/builtin-config-ix.cmake \
       --replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)'
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     substituteInPlace cmake/config-ix.cmake \
       --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)'
-  '' + stdenv.lib.optionalString (useLLVM) ''
+  '' + lib.optionalString (useLLVM) ''
     substituteInPlace lib/builtins/int_util.c \
       --replace "#include <stdlib.h>" ""
     substituteInPlace lib/builtins/clear_cache.c \
@@ -78,14 +78,13 @@ stdenv.mkDerivation rec {
   '';
 
   # Hack around weird upsream RPATH bug
-  postInstall = stdenv.lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) ''
+  postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) ''
     ln -s "$out/lib"/*/* "$out/lib"
-  '' + stdenv.lib.optionalString (useLLVM) ''
+  '' + lib.optionalString (useLLVM) ''
     ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o
     ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o
     ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o
     ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o
   '';
 
-  enableParallelBuilding = true;
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/10/default.nix b/nixpkgs/pkgs/development/compilers/llvm/10/default.nix
index 3d2cb3544b9f..978f28956664 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/10/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/10/default.nix
@@ -1,4 +1,4 @@
-{ lowPrio, newScope, pkgs, stdenv, cmake, gccForLibs
+{ lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs
 , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith
 , buildPackages
 , buildLlvmTools # tools, but from the previous stage, for cross
@@ -17,7 +17,7 @@ let
 
   clang-tools-extra_src = fetch "clang-tools-extra" "06n1yp638rh24xdxv9v2df0qajxbjz4w59b7dd4ky36drwmpi4yh";
 
-  tools = stdenv.lib.makeExtensible (tools: let
+  tools = lib.makeExtensible (tools: let
     callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
     mkExtraBuildCommands = cc: ''
       rsrc="$out/resource-root"
@@ -26,8 +26,6 @@ let
       ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
       ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share"
       echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
-    '' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
-      echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
     '';
   in {
 
@@ -101,15 +99,15 @@ let
       extraPackages = [
         targetLlvmLibraries.libcxxabi
         targetLlvmLibraries.compiler-rt
-      ] ++ stdenv.lib.optionals (!stdenv.targetPlatform.isWasm) [
+      ] ++ lib.optionals (!stdenv.targetPlatform.isWasm) [
         targetLlvmLibraries.libunwind
       ];
       extraBuildCommands = ''
         echo "-rtlib=compiler-rt -Wno-unused-command-line-argument" >> $out/nix-support/cc-cflags
         echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags
-      '' + stdenv.lib.optionalString (!stdenv.targetPlatform.isWasm) ''
+      '' + lib.optionalString (!stdenv.targetPlatform.isWasm) ''
         echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags
-      '' + stdenv.lib.optionalString stdenv.targetPlatform.isWasm ''
+      '' + lib.optionalString stdenv.targetPlatform.isWasm ''
         echo "-fno-exceptions" >> $out/nix-support/cc-cflags
       '' + mkExtraBuildCommands cc;
     };
@@ -161,12 +159,12 @@ let
 
   });
 
-  libraries = stdenv.lib.makeExtensible (libraries: let
+  libraries = lib.makeExtensible (libraries: let
     callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
   in {
 
     compiler-rt = callPackage ./compiler-rt.nix ({} //
-      (stdenv.lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
+      (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt;
       }));
 
@@ -175,12 +173,12 @@ let
     libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang;
 
     libcxx = callPackage ./libc++ ({} //
-      (stdenv.lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
+      (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
       }));
 
     libcxxabi = callPackage ./libc++abi.nix ({} //
-      (stdenv.lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
+      (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
         libunwind = libraries.libunwind;
       }));
@@ -188,7 +186,7 @@ let
     openmp = callPackage ./openmp.nix {};
 
     libunwind = callPackage ./libunwind.nix ({} //
-      (stdenv.lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
+      (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
       }));
 
diff --git a/nixpkgs/pkgs/development/compilers/llvm/10/libc++/default.nix b/nixpkgs/pkgs/development/compilers/llvm/10/libc++/default.nix
index 3511783be896..a3fb09273451 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/10/libc++/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/10/libc++/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
     export LIBCXXABI_INCLUDE_DIR="$PWD/$(ls -d libcxxabi-${version}*)/include"
   '';
 
-  patches = stdenv.lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch;
+  patches = lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch;
 
   preConfigure = ''
     # Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package
@@ -22,8 +22,8 @@ stdenv.mkDerivation {
     patchShebangs utils/cat_files.py
   '';
   nativeBuildInputs = [ cmake ]
-    ++ stdenv.lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) python3
-    ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+    ++ lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) python3
+    ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
 
   buildInputs = [ libcxxabi ];
 
@@ -31,15 +31,13 @@ stdenv.mkDerivation {
     "-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"
     "-DLIBCXX_LIBCPPABI_VERSION=2"
     "-DLIBCXX_CXX_ABI=libcxxabi"
-  ] ++ stdenv.lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) "-DLIBCXX_HAS_MUSL_LIBC=1"
-    ++ stdenv.lib.optional (stdenv.hostPlatform.useLLVM or false) "-DLIBCXX_USE_COMPILER_RT=ON"
-    ++ stdenv.lib.optional stdenv.hostPlatform.isWasm [
+  ] ++ lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) "-DLIBCXX_HAS_MUSL_LIBC=1"
+    ++ lib.optional (stdenv.hostPlatform.useLLVM or false) "-DLIBCXX_USE_COMPILER_RT=ON"
+    ++ lib.optional stdenv.hostPlatform.isWasm [
       "-DLIBCXX_ENABLE_THREADS=OFF"
       "-DLIBCXX_ENABLE_FILESYSTEM=OFF"
       "-DLIBCXX_ENABLE_EXCEPTIONS=OFF"
-    ] ++ stdenv.lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF";
-
-  enableParallelBuilding = true;
+    ] ++ lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF";
 
   passthru = {
     isLLVM = true;
@@ -48,7 +46,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = "https://libcxx.llvm.org/";
     description = "A new implementation of the C++ standard library, targeting C++11";
-    license = with stdenv.lib.licenses; [ ncsa mit ];
-    platforms = stdenv.lib.platforms.all;
+    license = with lib.licenses; [ ncsa mit ];
+    platforms = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/10/libc++abi.nix b/nixpkgs/pkgs/development/compilers/llvm/10/libc++abi.nix
index 7335d06e4fe3..61f778fbc55d 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/10/libc++abi.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/10/libc++abi.nix
@@ -1,4 +1,4 @@
-{ stdenv, cmake, fetch, libcxx, libunwind, llvm, version
+{ lib, stdenv, cmake, fetch, libcxx, libunwind, llvm, version
 , enableShared ? !stdenv.hostPlatform.isStatic
 }:
 
@@ -9,15 +9,15 @@ stdenv.mkDerivation {
   src = fetch "libcxxabi" "0yqs722y76cwvmfsq0lb917r9m3fci7bf5z3yzl71yz9n88ghzm9";
 
   nativeBuildInputs = [ cmake ];
-  buildInputs = stdenv.lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind;
+  buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind;
 
-  cmakeFlags = stdenv.lib.optionals (stdenv.hostPlatform.useLLVM or false) [
+  cmakeFlags = lib.optionals (stdenv.hostPlatform.useLLVM or false) [
     "-DLLVM_ENABLE_LIBCXX=ON"
     "-DLIBCXXABI_USE_LLVM_UNWINDER=ON"
-  ] ++ stdenv.lib.optionals stdenv.hostPlatform.isWasm [
+  ] ++ lib.optionals stdenv.hostPlatform.isWasm [
     "-DLIBCXXABI_ENABLE_THREADS=OFF"
     "-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF"
-  ] ++ stdenv.lib.optionals (!enableShared) [
+  ] ++ lib.optionals (!enableShared) [
     "-DLIBCXXABI_ENABLE_SHARED=OFF"
   ];
 
@@ -27,11 +27,11 @@ stdenv.mkDerivation {
     unpackFile ${libcxx.src}
     unpackFile ${llvm.src}
     cmakeFlags+=" -DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*)"
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     export TRIPLE=x86_64-apple-darwin
-  '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+  '' + lib.optionalString stdenv.hostPlatform.isMusl ''
     patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-0001-musl-hacks.patch}
-  '' + stdenv.lib.optionalString stdenv.hostPlatform.isWasm ''
+  '' + lib.optionalString stdenv.hostPlatform.isWasm ''
     patch -p1 -d $(ls -d llvm-*) -i ${./libcxxabi-wasm.patch}
   '';
 
@@ -52,7 +52,7 @@ stdenv.mkDerivation {
       install -d -m 755 $out/include $out/lib
       install -m 644 lib/libc++abi.a $out/lib
       install -m 644 ../include/cxxabi.h $out/include
-    '' + stdenv.lib.optionalString enableShared ''
+    '' + lib.optionalString enableShared ''
       install -m 644 lib/libc++abi.so.1.0 $out/lib
       ln -s libc++abi.so.1.0 $out/lib/libc++abi.so
       ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1
@@ -61,8 +61,8 @@ stdenv.mkDerivation {
   meta = {
     homepage = "https://libcxxabi.llvm.org/";
     description = "A new implementation of low level support for a standard C++ library";
-    license = with stdenv.lib.licenses; [ ncsa mit ];
-    maintainers = with stdenv.lib.maintainers; [ vlstill ];
-    platforms = stdenv.lib.platforms.all;
+    license = with lib.licenses; [ ncsa mit ];
+    maintainers = with lib.maintainers; [ vlstill ];
+    platforms = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/10/libunwind.nix b/nixpkgs/pkgs/development/compilers/llvm/10/libunwind.nix
index 75e42260b7fa..f0f45780a22c 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/10/libunwind.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/10/libunwind.nix
@@ -1,4 +1,4 @@
-{ stdenv, version, fetch, cmake, fetchpatch
+{ lib, stdenv, version, fetch, cmake, fetchpatch
 , enableShared ? !stdenv.hostPlatform.isStatic
 }:
 
@@ -10,7 +10,5 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  enableParallelBuilding = true;
-
-  cmakeFlags = stdenv.lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF";
+  cmakeFlags = lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF";
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/10/lld.nix b/nixpkgs/pkgs/development/compilers/llvm/10/lld.nix
index 5d513462820e..a94c1b5b0dd3 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/10/lld.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/10/lld.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetch
 , cmake
 , libxml2
@@ -17,8 +17,6 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" ];
 
-  enableParallelBuilding = true;
-
   postInstall = ''
     moveToOutput include "$dev"
     moveToOutput lib "$dev"
@@ -27,7 +25,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "The LLVM Linker";
     homepage    = "https://lld.llvm.org/";
-    license     = stdenv.lib.licenses.ncsa;
-    platforms   = stdenv.lib.platforms.all;
+    license     = lib.licenses.ncsa;
+    platforms   = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/10/lldb.nix b/nixpkgs/pkgs/development/compilers/llvm/10/lldb.nix
index c728efeb2a9b..e7dd48a23ce7 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/10/lldb.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/10/lldb.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetch
 , cmake
 , zlib
@@ -25,7 +25,7 @@ stdenv.mkDerivation (rec {
   patches = [ ./lldb-procfs.patch ];
 
   nativeBuildInputs = [ cmake python3 which swig lit ]
-    ++ stdenv.lib.optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ];
+    ++ lib.optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ];
 
   buildInputs = [
     ncurses
@@ -34,7 +34,7 @@ stdenv.mkDerivation (rec {
     libxml2
     llvm
   ]
-  ++ stdenv.lib.optionals stdenv.isDarwin [
+  ++ lib.optionals stdenv.isDarwin [
     darwin.libobjc
     darwin.apple_sdk.libs.xpc
     darwin.apple_sdk.frameworks.Foundation
@@ -49,18 +49,16 @@ stdenv.mkDerivation (rec {
     "-DLLVM_ENABLE_RTTI=OFF"
     "-DClang_DIR=${clang-unwrapped}/lib/cmake"
     "-DLLVM_EXTERNAL_LIT=${lit}/bin/lit"
-  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+  ] ++ lib.optionals stdenv.isDarwin [
     "-DLLDB_USE_SYSTEM_DEBUGSERVER=ON"
-  ] ++ stdenv.lib.optionals (!stdenv.isDarwin) [
+  ] ++ lib.optionals (!stdenv.isDarwin) [
     "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic
-  ] ++ stdenv.lib.optionals enableManpages [
+  ] ++ lib.optionals enableManpages [
     "-DLLVM_ENABLE_SPHINX=ON"
     "-DSPHINX_OUTPUT_MAN=ON"
     "-DSPHINX_OUTPUT_HTML=OFF"
   ];
 
-  enableParallelBuilding = true;
-
   postInstall = ''
     # Editor support
     # vscode:
@@ -69,13 +67,13 @@ stdenv.mkDerivation (rec {
     ln -s $out/bin/lldb-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A next-generation high-performance debugger";
     homepage = "https://lldb.llvm.org";
     license = licenses.ncsa;
     platforms = platforms.all;
   };
-} // stdenv.lib.optionalAttrs enableManpages {
+} // lib.optionalAttrs enableManpages {
   pname = "lldb-manpages";
 
   buildPhase = ''
diff --git a/nixpkgs/pkgs/development/compilers/llvm/10/llvm.nix b/nixpkgs/pkgs/development/compilers/llvm/10/llvm.nix
index 7394d4033d21..e951375a833e 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/10/llvm.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/10/llvm.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetch
 , cmake
 , python3
@@ -22,10 +22,10 @@
 }:
 
 let
-  inherit (stdenv.lib) optional optionals optionalString;
+  inherit (lib) optional optionals optionalString;
 
   # Used when creating a version-suffixed symlink of libLLVM.dylib
-  shortVersion = with stdenv.lib;
+  shortVersion = with lib;
     concatStringsSep "." (take 1 (splitString "." release_version));
 
 in stdenv.mkDerivation (rec {
@@ -154,17 +154,15 @@ in stdenv.mkDerivation (rec {
 
   checkTarget = "check-all";
 
-  enableParallelBuilding = true;
-
   requiredSystemFeatures = [ "big-parallel" ];
   meta = {
     description = "Collection of modular and reusable compiler and toolchain technologies";
     homepage    = "https://llvm.org/";
-    license     = stdenv.lib.licenses.ncsa;
-    maintainers = with stdenv.lib.maintainers; [ lovek323 raskin dtzWill ];
-    platforms   = stdenv.lib.platforms.all;
+    license     = lib.licenses.ncsa;
+    maintainers = with lib.maintainers; [ lovek323 raskin dtzWill ];
+    platforms   = lib.platforms.all;
   };
-} // stdenv.lib.optionalAttrs enableManpages {
+} // lib.optionalAttrs enableManpages {
   pname = "llvm-manpages";
 
   buildPhase = ''
diff --git a/nixpkgs/pkgs/development/compilers/llvm/10/openmp.nix b/nixpkgs/pkgs/development/compilers/llvm/10/openmp.nix
index 0927448d2b49..2946c51fafe2 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/10/openmp.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/10/openmp.nix
@@ -1,4 +1,5 @@
-{ stdenv
+{ lib
+, stdenv
 , fetch
 , cmake
 , llvm
@@ -15,12 +16,10 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake perl ];
   buildInputs = [ llvm ];
 
-  enableParallelBuilding = true;
-
   meta = {
     description = "Components required to build an executable OpenMP program";
     homepage    = "https://openmp.llvm.org/";
-    license     = stdenv.lib.licenses.mit;
-    platforms   = stdenv.lib.platforms.all;
+    license     = lib.licenses.mit;
+    platforms   = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/11/clang/default.nix b/nixpkgs/pkgs/development/compilers/llvm/11/clang/default.nix
index 2de5f65b4a13..3a3e384ad982 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/11/clang/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/11/clang/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python3, lld
+{ lib, stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python3, lld
 , fixDarwinDylibNames
 , enableManpages ? false
 }:
@@ -8,27 +8,27 @@ let
     pname = "clang";
     inherit version;
 
-    src = fetch "clang" "02ajkij85966vd150iy246mv16dsaph1kfi0y8wnncp8w6nar5hg";
+    src = fetch "clang" "0kab4zmkxffg98a3rx95756jlwhxflalin5w05g1anpwxv175xbk";
     inherit clang-tools-extra_src;
 
     unpackPhase = ''
       unpackFile $src
-      mv clang-${version}* clang
+      mv clang-* clang
       sourceRoot=$PWD/clang
       unpackFile ${clang-tools-extra_src}
       mv clang-tools-extra-* $sourceRoot/tools/extra
     '';
 
     nativeBuildInputs = [ cmake python3 lld ]
-      ++ stdenv.lib.optional enableManpages python3.pkgs.sphinx
-      ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+      ++ lib.optional enableManpages python3.pkgs.sphinx
+      ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
 
     buildInputs = [ libxml2 llvm ];
 
     cmakeFlags = [
       "-DCMAKE_CXX_FLAGS=-std=c++14"
       "-DCLANGD_BUILD_XPC=OFF"
-    ] ++ stdenv.lib.optionals enableManpages [
+    ] ++ lib.optionals enableManpages [
       "-DCLANG_INCLUDE_DOCS=ON"
       "-DLLVM_ENABLE_SPHINX=ON"
       "-DSPHINX_OUTPUT_MAN=ON"
@@ -48,9 +48,9 @@ let
 
       # Patch for standalone doc building
       sed -i '1s,^,find_package(Sphinx REQUIRED)\n,' docs/CMakeLists.txt
-    '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+    '' + lib.optionalString stdenv.hostPlatform.isMusl ''
       sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp
-    '' + stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
+    '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
       substituteInPlace tools/extra/clangd/CMakeLists.txt \
         --replace "NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB" FALSE
     '';
@@ -81,8 +81,6 @@ let
       rm $out/bin/c-index-test
     '';
 
-    enableParallelBuilding = true;
-
     passthru = {
       isClang = true;
       inherit llvm;
@@ -91,10 +89,10 @@ let
     meta = {
       description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler";
       homepage    = "https://llvm.org/";
-      license     = stdenv.lib.licenses.ncsa;
-      platforms   = stdenv.lib.platforms.all;
+      license     = lib.licenses.ncsa;
+      platforms   = lib.platforms.all;
     };
-  } // stdenv.lib.optionalAttrs enableManpages {
+  } // lib.optionalAttrs enableManpages {
     pname = "clang-manpages";
 
     buildPhase = ''
diff --git a/nixpkgs/pkgs/development/compilers/llvm/11/compiler-rt.nix b/nixpkgs/pkgs/development/compilers/llvm/11/compiler-rt.nix
index b8a5fcd5661c..091f327550b8 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/11/compiler-rt.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/11/compiler-rt.nix
@@ -1,4 +1,4 @@
-{ stdenv, version, fetch, cmake, python3, llvm, libcxxabi }:
+{ lib, stdenv, version, fetch, cmake, python3, llvm, libcxxabi }:
 
 let
 
@@ -11,10 +11,10 @@ in
 stdenv.mkDerivation rec {
   pname = "compiler-rt";
   inherit version;
-  src = fetch pname "0d5j5l8phwqjjscmk8rmqn0i2i0abl537gdbkagl8fjpzy1gyjip";
+  src = fetch pname "1z470r8c5aahdwkmflglx998n0i77j8b1c69d7cir1kf27qy6yq8";
 
   nativeBuildInputs = [ cmake python3 llvm ];
-  buildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
+  buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
 
   NIX_CFLAGS_COMPILE = [
     "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0"
@@ -24,24 +24,24 @@ stdenv.mkDerivation rec {
     "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON"
     "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}"
     "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}"
-  ] ++ stdenv.lib.optionals (stdenv.isDarwin) [
+  ] ++ lib.optionals (stdenv.isDarwin) [
     "-DDARWIN_macosx_OVERRIDE_SDK_VERSION=ON"
-  ] ++ stdenv.lib.optionals (useLLVM || bareMetal || isMusl) [
+  ] ++ lib.optionals (useLLVM || bareMetal || isMusl) [
     "-DCOMPILER_RT_BUILD_SANITIZERS=OFF"
     "-DCOMPILER_RT_BUILD_XRAY=OFF"
     "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF"
     "-DCOMPILER_RT_BUILD_PROFILE=OFF"
-  ] ++ stdenv.lib.optionals (useLLVM || bareMetal) [
+  ] ++ lib.optionals (useLLVM || bareMetal) [
     "-DCMAKE_C_COMPILER_WORKS=ON"
     "-DCMAKE_CXX_COMPILER_WORKS=ON"
     "-DCOMPILER_RT_BAREMETAL_BUILD=ON"
     "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}"
-  ] ++ stdenv.lib.optionals (useLLVM) [
+  ] ++ lib.optionals (useLLVM) [
     "-DCOMPILER_RT_BUILD_BUILTINS=ON"
     "-DCMAKE_C_FLAGS=-nodefaultlibs"
     #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program
     "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY"
-  ] ++ stdenv.lib.optionals (bareMetal) [
+  ] ++ lib.optionals (bareMetal) [
     "-DCOMPILER_RT_OS_DIR=baremetal"
   ];
 
@@ -50,8 +50,8 @@ stdenv.mkDerivation rec {
   patches = [
     ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory
     ./compiler-rt-X86-support-extension.patch # Add support for i486 i586 i686 by reusing i386 config
-  ]# ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
-    ++ stdenv.lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch;
+  ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
+    ++ lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch;
 
 
   # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
@@ -59,15 +59,15 @@ stdenv.mkDerivation rec {
   # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd
   # get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by
   # a flag and turn the flag off during the stdenv build.
-  postPatch = stdenv.lib.optionalString (!stdenv.isDarwin) ''
+  postPatch = lib.optionalString (!stdenv.isDarwin) ''
     substituteInPlace cmake/builtin-config-ix.cmake \
       --replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)'
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     substituteInPlace cmake/builtin-config-ix.cmake \
       --replace 'set(ARM64 arm64 arm64e)' 'set(ARM64)'
     substituteInPlace cmake/config-ix.cmake \
       --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)'
-  '' + stdenv.lib.optionalString (useLLVM) ''
+  '' + lib.optionalString (useLLVM) ''
     substituteInPlace lib/builtins/int_util.c \
       --replace "#include <stdlib.h>" ""
     substituteInPlace lib/builtins/clear_cache.c \
@@ -77,14 +77,13 @@ stdenv.mkDerivation rec {
   '';
 
   # Hack around weird upsream RPATH bug
-  postInstall = stdenv.lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) ''
+  postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) ''
     ln -s "$out/lib"/*/* "$out/lib"
-  '' + stdenv.lib.optionalString (useLLVM) ''
+  '' + lib.optionalString (useLLVM) ''
     ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o
     ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o
     ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o
     ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o
   '';
 
-  enableParallelBuilding = true;
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/11/default.nix b/nixpkgs/pkgs/development/compilers/llvm/11/default.nix
index e6765ec68990..ca9ef4382b4b 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/11/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/11/default.nix
@@ -1,4 +1,4 @@
-{ lowPrio, newScope, pkgs, stdenv, cmake, gccForLibs
+{ lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs
 , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith
 , buildPackages
 , buildLlvmTools # tools, but from the previous stage, for cross
@@ -6,18 +6,20 @@
 }:
 
 let
-  release_version = "11.0.0";
-  version = release_version; # differentiating these (variables) is important for RCs
+  release_version = "11.0.1";
+  candidate = ""; # empty or "rcN"
+  dash-candidate = lib.optionalString (candidate != "") "-${candidate}";
+  version = "${release_version}${dash-candidate}"; # differentiating these (variables) is important for RCs
   targetConfig = stdenv.targetPlatform.config;
 
   fetch = name: sha256: fetchurl {
-    url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-${release_version}/${name}-${version}.src.tar.xz";
+    url = "https://github.com/llvm/llvm-project/releases/download/llvmorg-${version}/${name}-${release_version}${candidate}.src.tar.xz";
     inherit sha256;
   };
 
-  clang-tools-extra_src = fetch "clang-tools-extra" "02bcwwn54661madhq4nxc069s7p7pj5gpqi8ww50w3anbpviilzy";
+  clang-tools-extra_src = fetch "clang-tools-extra" "1j8n6n4l54k2lrdxh266y1fl4z8vy5dc76wsf0csk5n3ikfi38ic";
 
-  tools = stdenv.lib.makeExtensible (tools: let
+  tools = lib.makeExtensible (tools: let
     callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
     mkExtraBuildCommands = cc: ''
       rsrc="$out/resource-root"
@@ -26,8 +28,6 @@ let
       ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
       ln -s "${targetLlvmLibraries.compiler-rt.out}/share" "$rsrc/share"
       echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
-    '' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
-      echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
     '';
   in {
 
@@ -101,15 +101,15 @@ let
       extraPackages = [
         targetLlvmLibraries.libcxxabi
         targetLlvmLibraries.compiler-rt
-      ] ++ stdenv.lib.optionals (!stdenv.targetPlatform.isWasm) [
+      ] ++ lib.optionals (!stdenv.targetPlatform.isWasm) [
         targetLlvmLibraries.libunwind
       ];
       extraBuildCommands = ''
         echo "-rtlib=compiler-rt -Wno-unused-command-line-argument" >> $out/nix-support/cc-cflags
         echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags
-      '' + stdenv.lib.optionalString (!stdenv.targetPlatform.isWasm) ''
+      '' + lib.optionalString (!stdenv.targetPlatform.isWasm) ''
         echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags
-      '' + stdenv.lib.optionalString stdenv.targetPlatform.isWasm ''
+      '' + lib.optionalString stdenv.targetPlatform.isWasm ''
         echo "-fno-exceptions" >> $out/nix-support/cc-cflags
       '' + mkExtraBuildCommands cc;
     };
@@ -161,12 +161,12 @@ let
 
   });
 
-  libraries = stdenv.lib.makeExtensible (libraries: let
+  libraries = lib.makeExtensible (libraries: let
     callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
   in {
 
     compiler-rt = callPackage ./compiler-rt.nix ({} //
-      (stdenv.lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
+      (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt;
       }));
 
@@ -175,12 +175,12 @@ let
     libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang;
 
     libcxx = callPackage ./libc++ ({} //
-      (stdenv.lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
+      (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
       }));
 
     libcxxabi = callPackage ./libc++abi.nix ({} //
-      (stdenv.lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
+      (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
         libunwind = libraries.libunwind;
       }));
@@ -188,7 +188,7 @@ let
     openmp = callPackage ./openmp.nix {};
 
     libunwind = callPackage ./libunwind.nix ({} //
-      (stdenv.lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
+      (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
       }));
 
diff --git a/nixpkgs/pkgs/development/compilers/llvm/11/libc++/default.nix b/nixpkgs/pkgs/development/compilers/llvm/11/libc++/default.nix
index 5c3ec87617c9..7a34977afe24 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/11/libc++/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/11/libc++/default.nix
@@ -6,7 +6,7 @@ stdenv.mkDerivation {
   pname = "libc++";
   inherit version;
 
-  src = fetch "libcxx" "0ylbkcd38zrrz9xmkq9na3d9s8d96hc286dwfwd73wi205lyc7kc";
+  src = fetch "libcxx" "0gaybwkn76vhakvipxslp7pmv2wm7agxkqwk5f5aizhzc9lzdmcz";
 
   postUnpack = ''
     unpackFile ${libcxxabi.src}
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
     mv llvm-* llvm
   '';
 
-  patches = stdenv.lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch;
+  patches = lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch;
 
   preConfigure = lib.optionalString stdenv.hostPlatform.isMusl ''
     patchShebangs utils/cat_files.py
@@ -28,15 +28,13 @@ stdenv.mkDerivation {
 
   cmakeFlags = [
     "-DLIBCXX_CXX_ABI=libcxxabi"
-  ] ++ stdenv.lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) "-DLIBCXX_HAS_MUSL_LIBC=1"
-    ++ stdenv.lib.optional (stdenv.hostPlatform.useLLVM or false) "-DLIBCXX_USE_COMPILER_RT=ON"
-    ++ stdenv.lib.optional stdenv.hostPlatform.isWasm [
+  ] ++ lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) "-DLIBCXX_HAS_MUSL_LIBC=1"
+    ++ lib.optional (stdenv.hostPlatform.useLLVM or false) "-DLIBCXX_USE_COMPILER_RT=ON"
+    ++ lib.optional stdenv.hostPlatform.isWasm [
       "-DLIBCXX_ENABLE_THREADS=OFF"
       "-DLIBCXX_ENABLE_FILESYSTEM=OFF"
       "-DLIBCXX_ENABLE_EXCEPTIONS=OFF"
-    ] ++ stdenv.lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF";
-
-  enableParallelBuilding = true;
+    ] ++ lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF";
 
   passthru = {
     isLLVM = true;
@@ -45,7 +43,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = "https://libcxx.llvm.org/";
     description = "A new implementation of the C++ standard library, targeting C++11";
-    license = with stdenv.lib.licenses; [ ncsa mit ];
-    platforms = stdenv.lib.platforms.all;
+    license = with lib.licenses; [ ncsa mit ];
+    platforms = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/11/libc++abi.nix b/nixpkgs/pkgs/development/compilers/llvm/11/libc++abi.nix
index d173b1735cbe..22e4ac4abe4c 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/11/libc++abi.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/11/libc++abi.nix
@@ -1,4 +1,4 @@
-{ stdenv, cmake, fetch, libcxx, libunwind, llvm, version
+{ lib, stdenv, cmake, fetch, libcxx, libunwind, llvm, version
 , enableShared ? !stdenv.hostPlatform.isStatic
 }:
 
@@ -6,18 +6,18 @@ stdenv.mkDerivation {
   pname = "libc++abi";
   inherit version;
 
-  src = fetch "libcxxabi" "05ac7rkjbla03bc0lf92f901dfjgxdvp8cr9fpn59a5p4x27ssaq";
+  src = fetch "libcxxabi" "0gv8pxq95gvsybldj21hdfkmm0r5cn1z7jhd72l231n0lmb70saa";
 
   nativeBuildInputs = [ cmake ];
-  buildInputs = stdenv.lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind;
+  buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind;
 
-  cmakeFlags = stdenv.lib.optionals (stdenv.hostPlatform.useLLVM or false) [
+  cmakeFlags = lib.optionals (stdenv.hostPlatform.useLLVM or false) [
     "-DLLVM_ENABLE_LIBCXX=ON"
     "-DLIBCXXABI_USE_LLVM_UNWINDER=ON"
-  ] ++ stdenv.lib.optionals stdenv.hostPlatform.isWasm [
+  ] ++ lib.optionals stdenv.hostPlatform.isWasm [
     "-DLIBCXXABI_ENABLE_THREADS=OFF"
     "-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF"
-  ] ++ stdenv.lib.optionals (!enableShared) [
+  ] ++ lib.optionals (!enableShared) [
     "-DLIBCXXABI_ENABLE_SHARED=OFF"
   ];
 
@@ -28,11 +28,11 @@ stdenv.mkDerivation {
     mv libcxx-* libcxx
     unpackFile ${llvm.src}
     mv llvm-* llvm
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     export TRIPLE=x86_64-apple-darwin
-  '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+  '' + lib.optionalString stdenv.hostPlatform.isMusl ''
     patch -p1 -d libcxx -i ${../libcxx-0001-musl-hacks.patch}
-  '' + stdenv.lib.optionalString stdenv.hostPlatform.isWasm ''
+  '' + lib.optionalString stdenv.hostPlatform.isWasm ''
     patch -p1 -d llvm -i ${./libcxxabi-wasm.patch}
   '';
 
@@ -53,7 +53,7 @@ stdenv.mkDerivation {
       install -d -m 755 $out/include $out/lib
       install -m 644 lib/libc++abi.a $out/lib
       install -m 644 ../include/cxxabi.h $out/include
-    '' + stdenv.lib.optionalString enableShared ''
+    '' + lib.optionalString enableShared ''
       install -m 644 lib/libc++abi.so.1.0 $out/lib
       ln -s libc++abi.so.1.0 $out/lib/libc++abi.so
       ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1
@@ -62,8 +62,8 @@ stdenv.mkDerivation {
   meta = {
     homepage = "https://libcxxabi.llvm.org/";
     description = "A new implementation of low level support for a standard C++ library";
-    license = with stdenv.lib.licenses; [ ncsa mit ];
-    maintainers = with stdenv.lib.maintainers; [ vlstill ];
-    platforms = stdenv.lib.platforms.all;
+    license = with lib.licenses; [ ncsa mit ];
+    maintainers = with lib.maintainers; [ vlstill ];
+    platforms = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/11/libunwind.nix b/nixpkgs/pkgs/development/compilers/llvm/11/libunwind.nix
index b22da214417f..1b5fe0f57880 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/11/libunwind.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/11/libunwind.nix
@@ -1,4 +1,4 @@
-{ stdenv, version, fetch, cmake, fetchpatch
+{ lib, stdenv, version, fetch, cmake, fetchpatch
 , enableShared ? !stdenv.hostPlatform.isStatic
 }:
 
@@ -6,11 +6,9 @@ stdenv.mkDerivation rec {
   pname = "libunwind";
   inherit version;
 
-  src = fetch pname "0bwjd2xf51r2apn8p0f9shb6nc8hnqzq1n9gggjvyjmi6cf02mc4";
+  src = fetch pname "0zsixkaiwp007afxlpsf5dc7wfrv8sj9wxzjw6f1r4bjv1rv3cvd";
 
   nativeBuildInputs = [ cmake ];
 
-  enableParallelBuilding = true;
-
-  cmakeFlags = stdenv.lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF";
+  cmakeFlags = lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF";
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/11/lld.nix b/nixpkgs/pkgs/development/compilers/llvm/11/lld.nix
index 20eb87c548f6..cead886f49b7 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/11/lld.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/11/lld.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetch
 , cmake
 , libxml2
@@ -10,15 +10,13 @@ stdenv.mkDerivation rec {
   pname = "lld";
   inherit version;
 
-  src = fetch pname "077xyh7sij6mhp4dc4kdcmp9whrpz332fa12rwxnzp3wgd5bxrzg";
+  src = fetch pname "1dq82dkam8x2niha18v7ckh30zmzyclydzipqkf7h41r3ah0vfk0";
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ llvm libxml2 ];
 
   outputs = [ "out" "dev" ];
 
-  enableParallelBuilding = true;
-
   postInstall = ''
     moveToOutput include "$dev"
     moveToOutput lib "$dev"
@@ -27,7 +25,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "The LLVM Linker";
     homepage    = "https://lld.llvm.org/";
-    license     = stdenv.lib.licenses.ncsa;
-    platforms   = stdenv.lib.platforms.all;
+    license     = lib.licenses.ncsa;
+    platforms   = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/11/lldb.nix b/nixpkgs/pkgs/development/compilers/llvm/11/lldb.nix
index 0ae55d45349a..fcc73cfdeb6d 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/11/lldb.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/11/lldb.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetch
 , cmake
 , zlib
@@ -20,12 +20,12 @@ stdenv.mkDerivation (rec {
   pname = "lldb";
   inherit version;
 
-  src = fetch pname "0wic9lyb2la9bkzdc13szkm4f793w1mddp50xvh237iraygw0w45";
+  src = fetch pname "1yzjbsn81l2r3v9js2fxrglkwvz1f2rxyxh6430nydbrs0bqklz8";
 
   patches = [ ./lldb-procfs.patch ];
 
   nativeBuildInputs = [ cmake python3 which swig lit ]
-    ++ stdenv.lib.optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ];
+    ++ lib.optionals enableManpages [ python3.pkgs.sphinx python3.pkgs.recommonmark ];
 
   buildInputs = [
     ncurses
@@ -34,7 +34,7 @@ stdenv.mkDerivation (rec {
     libxml2
     llvm
   ]
-  ++ stdenv.lib.optionals stdenv.isDarwin [
+  ++ lib.optionals stdenv.isDarwin [
     darwin.libobjc
     darwin.apple_sdk.libs.xpc
     darwin.apple_sdk.frameworks.Foundation
@@ -49,18 +49,16 @@ stdenv.mkDerivation (rec {
     "-DLLVM_ENABLE_RTTI=OFF"
     "-DClang_DIR=${clang-unwrapped}/lib/cmake"
     "-DLLVM_EXTERNAL_LIT=${lit}/bin/lit"
-  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+  ] ++ lib.optionals stdenv.isDarwin [
     "-DLLDB_USE_SYSTEM_DEBUGSERVER=ON"
-  ] ++ stdenv.lib.optionals (!stdenv.isDarwin) [
+  ] ++ lib.optionals (!stdenv.isDarwin) [
     "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic
-  ] ++ stdenv.lib.optionals enableManpages [
+  ] ++ lib.optionals enableManpages [
     "-DLLVM_ENABLE_SPHINX=ON"
     "-DSPHINX_OUTPUT_MAN=ON"
     "-DSPHINX_OUTPUT_HTML=OFF"
   ];
 
-  enableParallelBuilding = true;
-
   postInstall = ''
     # Editor support
     # vscode:
@@ -69,13 +67,13 @@ stdenv.mkDerivation (rec {
     ln -s $out/bin/lldb-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A next-generation high-performance debugger";
     homepage = "https://lldb.llvm.org";
     license = licenses.ncsa;
     platforms = platforms.all;
   };
-} // stdenv.lib.optionalAttrs enableManpages {
+} // lib.optionalAttrs enableManpages {
   pname = "lldb-manpages";
 
   buildPhase = ''
diff --git a/nixpkgs/pkgs/development/compilers/llvm/11/llvm.nix b/nixpkgs/pkgs/development/compilers/llvm/11/llvm.nix
index c2b70a149bf5..868da1a5b207 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/11/llvm.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/11/llvm.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetch
 , cmake
 , python3
@@ -22,22 +22,22 @@
 }:
 
 let
-  inherit (stdenv.lib) optional optionals optionalString;
+  inherit (lib) optional optionals optionalString;
 
   # Used when creating a version-suffixed symlink of libLLVM.dylib
-  shortVersion = with stdenv.lib;
+  shortVersion = with lib;
     concatStringsSep "." (take 1 (splitString "." release_version));
 
 in stdenv.mkDerivation (rec {
   pname = "llvm";
   inherit version;
 
-  src = fetch pname "0s94lwil98w7zb7cjrbnxli0z7gklb312pkw74xs1d6zk346hgwi";
-  polly_src = fetch "polly" "0h442ivcslr3dv3q3g1nw5avh77f8cxsp6zild1hgspj266xpynw";
+  src = fetch pname "0a5mb65xa5bal8q6cb37xgkqis2bip87fsafgq3wbsva9cjprn6c";
+  polly_src = fetch "polly" "1smrqm9s0r2g9h0v0nil6y9wn2ih4l5bddk4dhgn538ngc7cxpq8";
 
   unpackPhase = ''
     unpackFile $src
-    mv llvm-${version}* llvm
+    mv llvm-${release_version}* llvm
     sourceRoot=$PWD/llvm
   '' + optionalString enablePolly ''
     unpackFile $polly_src
@@ -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 = ''
@@ -152,21 +152,19 @@ in stdenv.mkDerivation (rec {
     ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${release_version}.dylib
   '';
 
-  doCheck = stdenv.isLinux && (!stdenv.isx86_32);
+  doCheck = stdenv.isLinux && (!stdenv.isx86_32) && (!stdenv.hostPlatform.isMusl);
 
   checkTarget = "check-all";
 
-  enableParallelBuilding = true;
-
   requiredSystemFeatures = [ "big-parallel" ];
   meta = {
     description = "Collection of modular and reusable compiler and toolchain technologies";
     homepage    = "https://llvm.org/";
-    license     = stdenv.lib.licenses.ncsa;
-    maintainers = with stdenv.lib.maintainers; [ lovek323 raskin dtzWill primeos ];
-    platforms   = stdenv.lib.platforms.all;
+    license     = lib.licenses.ncsa;
+    maintainers = with lib.maintainers; [ lovek323 raskin dtzWill primeos ];
+    platforms   = lib.platforms.all;
   };
-} // stdenv.lib.optionalAttrs enableManpages {
+} // lib.optionalAttrs enableManpages {
   pname = "llvm-manpages";
 
   buildPhase = ''
diff --git a/nixpkgs/pkgs/development/compilers/llvm/11/openmp.nix b/nixpkgs/pkgs/development/compilers/llvm/11/openmp.nix
index 5fd6c62840db..5503a98ae5f6 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/11/openmp.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/11/openmp.nix
@@ -1,4 +1,5 @@
-{ stdenv
+{ lib
+, stdenv
 , fetch
 , cmake
 , llvm
@@ -10,17 +11,15 @@ stdenv.mkDerivation rec {
   pname = "openmp";
   inherit version;
 
-  src = fetch pname "0k389d0g9zlfyzh1kpb3i5jdawzpn0hrdxzbjinpvdv7rbw4sw1d";
+  src = fetch pname "19rcv25y41ww3zlfg0lwprzijl3cn7jgc0v5540jzpp7j0ds45ad";
 
   nativeBuildInputs = [ cmake perl ];
   buildInputs = [ llvm ];
 
-  enableParallelBuilding = true;
-
   meta = {
     description = "Components required to build an executable OpenMP program";
     homepage    = "https://openmp.llvm.org/";
-    license     = stdenv.lib.licenses.mit;
-    platforms   = stdenv.lib.platforms.all;
+    license     = lib.licenses.mit;
+    platforms   = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/5/clang/default.nix b/nixpkgs/pkgs/development/compilers/llvm/5/clang/default.nix
index b5e7b54fa5be..21961f4f0413 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/5/clang/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/5/clang/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python3
+{ lib, stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python3
 , fixDarwinDylibNames
 , enableManpages ? false
 }:
@@ -19,15 +19,15 @@ let
     '';
 
     nativeBuildInputs = [ cmake python3 ]
-      ++ stdenv.lib.optional enableManpages python3.pkgs.sphinx
-      ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+      ++ lib.optional enableManpages python3.pkgs.sphinx
+      ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
 
     buildInputs = [ libxml2 llvm ];
 
     cmakeFlags = [
       "-DCMAKE_CXX_FLAGS=-std=c++11"
       "-DLLVM_ENABLE_RTTI=ON"
-    ] ++ stdenv.lib.optionals enableManpages [
+    ] ++ lib.optionals enableManpages [
       "-DCLANG_INCLUDE_DOCS=ON"
       "-DLLVM_ENABLE_SPHINX=ON"
       "-DSPHINX_OUTPUT_MAN=ON"
@@ -44,7 +44,7 @@ let
 
       # Patch for standalone doc building
       sed -i '1s,^,find_package(Sphinx REQUIRED)\n,' docs/CMakeLists.txt
-    '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+    '' + lib.optionalString stdenv.hostPlatform.isMusl ''
       sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp
     '';
 
@@ -72,8 +72,6 @@ let
       rm $out/bin/c-index-test
     '';
 
-    enableParallelBuilding = true;
-
     passthru = {
       isClang = true;
       inherit llvm;
@@ -82,10 +80,10 @@ let
     meta = {
       description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler";
       homepage    = "https://llvm.org/";
-      license     = stdenv.lib.licenses.ncsa;
-      platforms   = stdenv.lib.platforms.all;
+      license     = lib.licenses.ncsa;
+      platforms   = lib.platforms.all;
     };
-  } // stdenv.lib.optionalAttrs enableManpages {
+  } // lib.optionalAttrs enableManpages {
     pname = "clang-manpages";
 
     buildPhase = ''
diff --git a/nixpkgs/pkgs/development/compilers/llvm/5/compiler-rt.nix b/nixpkgs/pkgs/development/compilers/llvm/5/compiler-rt.nix
index 41f2b24b057e..909c6b190536 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/5/compiler-rt.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/5/compiler-rt.nix
@@ -1,4 +1,4 @@
-{ stdenv, version, fetch, cmake, python3, llvm, libcxxabi }:
+{ lib, stdenv, version, fetch, cmake, python3, llvm, libcxxabi }:
 
 let
 
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
   src = fetch "compiler-rt" "0ipd4jdxpczgr2w6lzrabymz6dhzj69ywmyybjjc1q397zgrvziy";
 
   nativeBuildInputs = [ cmake python3 llvm ];
-  buildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
+  buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
 
   NIX_CFLAGS_COMPILE = [
     "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0"
@@ -24,24 +24,24 @@ stdenv.mkDerivation {
     "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON"
     "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}"
     "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}"
-  ] ++ stdenv.lib.optionals (useLLVM || bareMetal || isMusl) [
+  ] ++ lib.optionals (useLLVM || bareMetal || isMusl) [
     "-DCOMPILER_RT_BUILD_SANITIZERS=OFF"
     "-DCOMPILER_RT_BUILD_XRAY=OFF"
     "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF"
     "-DCOMPILER_RT_BUILD_PROFILE=OFF"
-  ] ++ stdenv.lib.optionals (useLLVM || bareMetal) [
+  ] ++ lib.optionals (useLLVM || bareMetal) [
     "-DCMAKE_C_COMPILER_WORKS=ON"
     "-DCMAKE_CXX_COMPILER_WORKS=ON"
     "-DCOMPILER_RT_BAREMETAL_BUILD=ON"
     "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}"
-  ] ++ stdenv.lib.optionals (useLLVM) [
+  ] ++ lib.optionals (useLLVM) [
     "-DCOMPILER_RT_BUILD_BUILTINS=ON"
     "-DCMAKE_C_FLAGS=-nodefaultlibs"
     #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program
     "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY"
-  ] ++ stdenv.lib.optionals (bareMetal) [
+  ] ++ lib.optionals (bareMetal) [
     "-DCOMPILER_RT_OS_DIR=baremetal"
-  ] ++ stdenv.lib.optionals (stdenv.hostPlatform.isDarwin) [
+  ] ++ lib.optionals (stdenv.hostPlatform.isDarwin) [
     # The compiler-rt build infrastructure sniffs supported platforms on Darwin
     # and finds i386;x86_64;x86_64h. We only build for x86_64, so linking fails
     # when it tries to use libc++ and libc++api for i386.
@@ -53,19 +53,19 @@ stdenv.mkDerivation {
   patches = [
     ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory
     ../7/compiler-rt-glibc.patch
-  ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
-    ++ stdenv.lib.optional (stdenv.hostPlatform.libc == "glibc") ./compiler-rt-sys-ustat.patch
-    ++ stdenv.lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch;
+  ] ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
+    ++ lib.optional (stdenv.hostPlatform.libc == "glibc") ./compiler-rt-sys-ustat.patch
+    ++ lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch;
 
   # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
   # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra
   # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd
   # get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by
   # a flag and turn the flag off during the stdenv build.
-  postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
+  postPatch = lib.optionalString stdenv.isDarwin ''
     substituteInPlace cmake/config-ix.cmake \
       --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)'
-  '' + stdenv.lib.optionalString (useLLVM) ''
+  '' + lib.optionalString (useLLVM) ''
     substituteInPlace lib/builtins/int_util.c \
       --replace "#include <stdlib.h>" ""
     substituteInPlace lib/builtins/clear_cache.c \
@@ -75,14 +75,13 @@ stdenv.mkDerivation {
   '';
 
   # Hack around weird upsream RPATH bug
-  postInstall = stdenv.lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) ''
+  postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) ''
     ln -s "$out/lib"/*/* "$out/lib"
-  '' + stdenv.lib.optionalString (useLLVM) ''
+  '' + lib.optionalString (useLLVM) ''
     ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/linux/crtbegin.o
     ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/linux/crtend.o
     ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/linux/crtbeginS.o
     ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/linux/crtendS.o
   '';
 
-  enableParallelBuilding = true;
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/5/default.nix b/nixpkgs/pkgs/development/compilers/llvm/5/default.nix
index 36495249d16f..f03325cd4270 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/5/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/5/default.nix
@@ -1,4 +1,4 @@
-{ lowPrio, newScope, pkgs, stdenv, cmake, gccForLibs
+{ lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs
 , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith
 , buildPackages
 , buildLlvmTools # tools, but from the previous stage, for cross
@@ -17,7 +17,7 @@ let
 
   clang-tools-extra_src = fetch "clang-tools-extra" "018b3fiwah8f8br5i26qmzh6sjvzchpn358sn8v079m49f2jldm3";
 
-  tools = stdenv.lib.makeExtensible (tools: let
+  tools = lib.makeExtensible (tools: let
     callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
     mkExtraBuildCommands = cc: ''
       rsrc="$out/resource-root"
@@ -25,8 +25,6 @@ let
       ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
       ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
       echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
-    '' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
-      echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
     '';
   in {
 
@@ -75,7 +73,7 @@ let
     lldb = callPackage ./lldb.nix {};
   });
 
-  libraries = stdenv.lib.makeExtensible (libraries: let
+  libraries = lib.makeExtensible (libraries: let
     callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
   in {
 
diff --git a/nixpkgs/pkgs/development/compilers/llvm/5/libc++/default.nix b/nixpkgs/pkgs/development/compilers/llvm/5/libc++/default.nix
index 9bebedbc0442..164836e1a4ce 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/5/libc++/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/5/libc++/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
     export LIBCXXABI_INCLUDE_DIR="$PWD/$(ls -d libcxxabi-${version}*)/include"
   '';
 
-  patches = stdenv.lib.optionals stdenv.hostPlatform.isMusl [
+  patches = lib.optionals stdenv.hostPlatform.isMusl [
     ../../libcxx-0001-musl-hacks.patch
   ];
 
@@ -26,8 +26,8 @@ stdenv.mkDerivation {
     patchShebangs utils/cat_files.py
   '';
   nativeBuildInputs = [ cmake ]
-    ++ stdenv.lib.optional stdenv.hostPlatform.isMusl python3
-    ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+    ++ lib.optional stdenv.hostPlatform.isMusl python3
+    ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
 
   buildInputs = [ libcxxabi ];
 
@@ -35,9 +35,7 @@ stdenv.mkDerivation {
     "-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"
     "-DLIBCXX_LIBCPPABI_VERSION=2"
     "-DLIBCXX_CXX_ABI=libcxxabi"
-  ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1";
-
-  enableParallelBuilding = true;
+  ] ++ lib.optional stdenv.hostPlatform.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1";
 
   passthru = {
     isLLVM = true;
@@ -46,7 +44,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = "https://libcxx.llvm.org/";
     description = "A new implementation of the C++ standard library, targeting C++11";
-    license = with stdenv.lib.licenses; [ ncsa mit ];
-    platforms = stdenv.lib.platforms.unix;
+    license = with lib.licenses; [ ncsa mit ];
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/5/libc++abi.nix b/nixpkgs/pkgs/development/compilers/llvm/5/libc++abi.nix
index 96d6e78e01e4..8fc9ef9fded8 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/5/libc++abi.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/5/libc++abi.nix
@@ -1,4 +1,4 @@
-{ stdenv, cmake, fetch, libcxx, libunwind, llvm, version }:
+{ lib, stdenv, cmake, fetch, libcxx, libunwind, llvm, version }:
 
 stdenv.mkDerivation {
   pname = "libc++abi";
@@ -7,15 +7,15 @@ stdenv.mkDerivation {
   src = fetch "libcxxabi" "12lp799rskr4fc2xr64qn4jfkjnfd8b1aymvsxyn4k9ar7r9pgqv";
 
   nativeBuildInputs = [ cmake ];
-  buildInputs = stdenv.lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD) libunwind;
+  buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD) libunwind;
 
   postUnpack = ''
     unpackFile ${libcxx.src}
     unpackFile ${llvm.src}
     export cmakeFlags="-DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*)"
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     export TRIPLE=x86_64-apple-darwin
-  '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+  '' + lib.optionalString stdenv.hostPlatform.isMusl ''
     patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-0001-musl-hacks.patch}
   '';
 
@@ -44,8 +44,8 @@ stdenv.mkDerivation {
   meta = {
     homepage = "https://libcxxabi.llvm.org/";
     description = "A new implementation of low level support for a standard C++ library";
-    license = with stdenv.lib.licenses; [ ncsa mit ];
-    maintainers = with stdenv.lib.maintainers; [ vlstill ];
-    platforms = stdenv.lib.platforms.unix;
+    license = with lib.licenses; [ ncsa mit ];
+    maintainers = with lib.maintainers; [ vlstill ];
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/5/lld.nix b/nixpkgs/pkgs/development/compilers/llvm/5/lld.nix
index 3d9ed6ee6635..244960cf41ba 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/5/lld.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/5/lld.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetch
 , cmake
 , llvm
@@ -16,8 +16,6 @@ stdenv.mkDerivation {
 
   outputs = [ "out" "dev" ];
 
-  enableParallelBuilding = true;
-
   postInstall = ''
     moveToOutput include "$dev"
     moveToOutput lib "$dev"
@@ -26,8 +24,8 @@ stdenv.mkDerivation {
   meta = {
     description = "The LLVM Linker";
     homepage    = "https://lld.llvm.org/";
-    license     = stdenv.lib.licenses.ncsa;
-    platforms   = stdenv.lib.platforms.all;
+    license     = lib.licenses.ncsa;
+    platforms   = lib.platforms.all;
     badPlatforms = [ "x86_64-darwin" ];
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/5/lldb.nix b/nixpkgs/pkgs/development/compilers/llvm/5/lldb.nix
index e827f76231f1..61a9e60391c8 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/5/lldb.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/5/lldb.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetch
 , fetchpatch
 , cmake
@@ -42,7 +42,7 @@ stdenv.mkDerivation {
 
   nativeBuildInputs = [ cmake python3 which swig ];
   buildInputs = [ ncurses zlib libedit libxml2 llvm ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ darwin.libobjc darwin.apple_sdk.libs.xpc darwin.apple_sdk.frameworks.Foundation darwin.bootstrap_cmds darwin.apple_sdk.frameworks.Carbon darwin.apple_sdk.frameworks.Cocoa ];
+    ++ lib.optionals stdenv.isDarwin [ darwin.libobjc darwin.apple_sdk.libs.xpc darwin.apple_sdk.frameworks.Foundation darwin.bootstrap_cmds darwin.apple_sdk.frameworks.Carbon darwin.apple_sdk.frameworks.Cocoa ];
 
   CXXFLAGS = "-fno-rtti";
   hardeningDisable = [ "format" ];
@@ -51,14 +51,12 @@ stdenv.mkDerivation {
     "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic
   ];
 
-  enableParallelBuilding = true;
-
   postInstall = ''
     mkdir -p $out/share/man/man1
     cp ../docs/lldb.1 $out/share/man/man1/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A next-generation high-performance debugger";
     homepage    = "https://llvm.org/";
     license     = licenses.ncsa;
diff --git a/nixpkgs/pkgs/development/compilers/llvm/5/llvm.nix b/nixpkgs/pkgs/development/compilers/llvm/5/llvm.nix
index 987e6258527a..c91e94204352 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/5/llvm.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/5/llvm.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetch
 , fetchpatch
 , cmake
@@ -17,7 +17,7 @@
 
 let
   # Used when creating a versioned symlinks of libLLVM.dylib
-  versionSuffixes = with stdenv.lib;
+  versionSuffixes = with lib;
     let parts = splitVersion release_version; in
     imap (i: _: concatStringsSep "." (take i parts)) parts;
 in
@@ -35,10 +35,10 @@ stdenv.mkDerivation ({
   '';
 
   outputs = [ "out" "python" ]
-    ++ stdenv.lib.optional enableSharedLibraries "lib";
+    ++ lib.optional enableSharedLibraries "lib";
 
   nativeBuildInputs = [ cmake python3 ]
-    ++ stdenv.lib.optional enableManpages python3.pkgs.sphinx;
+    ++ lib.optional enableManpages python3.pkgs.sphinx;
 
   buildInputs = [ libxml2 libffi ];
 
@@ -58,13 +58,13 @@ stdenv.mkDerivation ({
     #  stripLen = 1;
     #})
   ];
-  postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
+  postPatch = lib.optionalString stdenv.isDarwin ''
     substituteInPlace cmake/modules/AddLLVM.cmake \
       --replace 'set(_install_name_dir INSTALL_NAME_DIR "@rpath")' "set(_install_name_dir)" \
       --replace 'set(_install_rpath "@loader_path/../lib" ''${extra_libdir})' ""
   ''
   # Patch llvm-config to return correct library path based on --link-{shared,static}.
-  + stdenv.lib.optionalString (enableSharedLibraries) ''
+  + lib.optionalString (enableSharedLibraries) ''
     substitute '${./llvm-outputs.patch}' ./llvm-outputs.patch --subst-var lib
     patch -p1 < ./llvm-outputs.patch
   '' + ''
@@ -72,9 +72,9 @@ stdenv.mkDerivation ({
     substituteInPlace unittests/Support/CMakeLists.txt \
       --replace "Path.cpp" ""
     rm unittests/Support/Path.cpp
-  '' + stdenv.lib.optionalString stdenv.isAarch64 ''
+  '' + lib.optionalString stdenv.isAarch64 ''
     patch -p0 < ${../aarch64.patch}
-  '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+  '' + lib.optionalString stdenv.hostPlatform.isMusl ''
     patch -p1 -i ${../TLI-musl.patch}
     substituteInPlace unittests/Support/CMakeLists.txt \
       --replace "add_subdirectory(DynamicLibrary)" ""
@@ -98,18 +98,18 @@ stdenv.mkDerivation ({
     "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}"
     "-DTARGET_TRIPLE=${stdenv.hostPlatform.config}"
   ]
-  ++ stdenv.lib.optional enableSharedLibraries
+  ++ lib.optional enableSharedLibraries
     "-DLLVM_LINK_LLVM_DYLIB=ON"
-  ++ stdenv.lib.optionals enableManpages [
+  ++ lib.optionals enableManpages [
     "-DLLVM_BUILD_DOCS=ON"
     "-DLLVM_ENABLE_SPHINX=ON"
     "-DSPHINX_OUTPUT_MAN=ON"
     "-DSPHINX_OUTPUT_HTML=OFF"
     "-DSPHINX_WARNINGS_AS_ERRORS=OFF"
   ]
-  ++ stdenv.lib.optional (!isDarwin)
+  ++ lib.optional (!isDarwin)
     "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include"
-  ++ stdenv.lib.optionals (isDarwin) [
+  ++ lib.optionals (isDarwin) [
     "-DLLVM_ENABLE_LIBCXX=ON"
     "-DCAN_TARGET_i386=false"
   ];
@@ -126,18 +126,18 @@ stdenv.mkDerivation ({
     mkdir -p $python/share
     mv $out/share/opt-viewer $python/share/opt-viewer
   ''
-  + stdenv.lib.optionalString enableSharedLibraries ''
+  + lib.optionalString enableSharedLibraries ''
     moveToOutput "lib/libLLVM-*" "$lib"
     moveToOutput "lib/libLLVM${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib"
     moveToOutput "lib/libLTO${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib"
     substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \
       --replace "\''${_IMPORT_PREFIX}/lib/libLLVM-" "$lib/lib/libLLVM-"
   ''
-  + stdenv.lib.optionalString (stdenv.isDarwin && enableSharedLibraries) ''
+  + lib.optionalString (stdenv.isDarwin && enableSharedLibraries) ''
     substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \
       --replace "\''${_IMPORT_PREFIX}/lib/libLLVM.dylib" "$lib/lib/libLLVM.dylib" \
       --replace "\''${_IMPORT_PREFIX}/lib/libLTO.dylib" "$lib/lib/libLTO.dylib"
-    ${stdenv.lib.concatMapStringsSep "\n" (v: ''
+    ${lib.concatMapStringsSep "\n" (v: ''
       ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${v}.dylib
     '') versionSuffixes}
   '';
@@ -146,17 +146,15 @@ stdenv.mkDerivation ({
 
   checkTarget = "check-all";
 
-  enableParallelBuilding = true;
-
   requiredSystemFeatures = [ "big-parallel" ];
   meta = {
     description = "Collection of modular and reusable compiler and toolchain technologies";
     homepage    = "https://llvm.org/";
-    license     = stdenv.lib.licenses.ncsa;
-    maintainers = with stdenv.lib.maintainers; [ lovek323 raskin dtzWill ];
-    platforms   = stdenv.lib.platforms.all;
+    license     = lib.licenses.ncsa;
+    maintainers = with lib.maintainers; [ lovek323 raskin dtzWill ];
+    platforms   = lib.platforms.all;
   };
-} // stdenv.lib.optionalAttrs enableManpages {
+} // lib.optionalAttrs enableManpages {
   pname = "llvm-manpages";
 
   buildPhase = ''
diff --git a/nixpkgs/pkgs/development/compilers/llvm/5/openmp.nix b/nixpkgs/pkgs/development/compilers/llvm/5/openmp.nix
index da328de24d13..169c9c50324e 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/5/openmp.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/5/openmp.nix
@@ -1,4 +1,5 @@
-{ stdenv
+{ lib
+, stdenv
 , fetch
 , cmake
 , llvm
@@ -15,12 +16,10 @@ stdenv.mkDerivation {
   nativeBuildInputs = [ cmake perl ];
   buildInputs = [ llvm ];
 
-  enableParallelBuilding = true;
-
   meta = {
     description = "Components required to build an executable OpenMP program";
     homepage    = "https://openmp.llvm.org/";
-    license     = stdenv.lib.licenses.mit;
-    platforms   = stdenv.lib.platforms.all;
+    license     = lib.licenses.mit;
+    platforms   = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/6/clang/default.nix b/nixpkgs/pkgs/development/compilers/llvm/6/clang/default.nix
index ec3effebfd77..41202dd3f5dc 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/6/clang/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/6/clang/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python3
+{ lib, stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python3
 , fixDarwinDylibNames
 , enableManpages ? false
 }:
@@ -19,15 +19,15 @@ let
     '';
 
     nativeBuildInputs = [ cmake python3 ]
-      ++ stdenv.lib.optional enableManpages python3.pkgs.sphinx
-      ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+      ++ lib.optional enableManpages python3.pkgs.sphinx
+      ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
 
     buildInputs = [ libxml2 llvm ];
 
     cmakeFlags = [
       "-DCMAKE_CXX_FLAGS=-std=c++11"
       "-DLLVM_ENABLE_RTTI=ON"
-    ] ++ stdenv.lib.optionals enableManpages [
+    ] ++ lib.optionals enableManpages [
       "-DCLANG_INCLUDE_DOCS=ON"
       "-DLLVM_ENABLE_SPHINX=ON"
       "-DSPHINX_OUTPUT_MAN=ON"
@@ -44,7 +44,7 @@ let
 
       # Patch for standalone doc building
       sed -i '1s,^,find_package(Sphinx REQUIRED)\n,' docs/CMakeLists.txt
-    '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+    '' + lib.optionalString stdenv.hostPlatform.isMusl ''
       sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp
     '';
 
@@ -72,8 +72,6 @@ let
       rm $out/bin/c-index-test
     '';
 
-    enableParallelBuilding = true;
-
     passthru = {
       isClang = true;
       inherit llvm;
@@ -82,10 +80,10 @@ let
     meta = {
       description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler";
       homepage    = "https://llvm.org/";
-      license     = stdenv.lib.licenses.ncsa;
-      platforms   = stdenv.lib.platforms.all;
+      license     = lib.licenses.ncsa;
+      platforms   = lib.platforms.all;
     };
-  } // stdenv.lib.optionalAttrs enableManpages {
+  } // lib.optionalAttrs enableManpages {
     pname = "clang-manpages";
 
     buildPhase = ''
diff --git a/nixpkgs/pkgs/development/compilers/llvm/6/compiler-rt.nix b/nixpkgs/pkgs/development/compilers/llvm/6/compiler-rt.nix
index 8bd61f5d7f70..6e47ffe8acaf 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/6/compiler-rt.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/6/compiler-rt.nix
@@ -1,4 +1,4 @@
-{ stdenv, version, fetch, cmake, python3, llvm, libcxxabi }:
+{ lib, stdenv, version, fetch, cmake, python3, llvm, libcxxabi }:
 
 let
 
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
   src = fetch "compiler-rt" "1fcr3jn24yr8lh36nc0c4ikli4744i2q9m1ik67p1jymwwaixkgl";
 
   nativeBuildInputs = [ cmake python3 llvm ];
-  buildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
+  buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
 
   NIX_CFLAGS_COMPILE = [
     "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0"
@@ -24,24 +24,24 @@ stdenv.mkDerivation {
     "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON"
     "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}"
     "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}"
-  ] ++ stdenv.lib.optionals (useLLVM || bareMetal || isMusl) [
+  ] ++ lib.optionals (useLLVM || bareMetal || isMusl) [
     "-DCOMPILER_RT_BUILD_SANITIZERS=OFF"
     "-DCOMPILER_RT_BUILD_XRAY=OFF"
     "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF"
     "-DCOMPILER_RT_BUILD_PROFILE=OFF"
-  ] ++ stdenv.lib.optionals (useLLVM || bareMetal) [
+  ] ++ lib.optionals (useLLVM || bareMetal) [
     "-DCMAKE_C_COMPILER_WORKS=ON"
     "-DCMAKE_CXX_COMPILER_WORKS=ON"
     "-DCOMPILER_RT_BAREMETAL_BUILD=ON"
     "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}"
-  ] ++ stdenv.lib.optionals (useLLVM) [
+  ] ++ lib.optionals (useLLVM) [
     "-DCOMPILER_RT_BUILD_BUILTINS=ON"
     "-DCMAKE_C_FLAGS=-nodefaultlibs"
     #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program
     "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY"
-  ] ++ stdenv.lib.optionals (bareMetal) [
+  ] ++ lib.optionals (bareMetal) [
     "-DCOMPILER_RT_OS_DIR=baremetal"
-  ] ++ stdenv.lib.optionals (stdenv.hostPlatform.isDarwin) [
+  ] ++ lib.optionals (stdenv.hostPlatform.isDarwin) [
     # The compiler-rt build infrastructure sniffs supported platforms on Darwin
     # and finds i386;x86_64;x86_64h. We only build for x86_64, so linking fails
     # when it tries to use libc++ and libc++api for i386.
@@ -53,21 +53,21 @@ stdenv.mkDerivation {
   patches = [
     ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory
     ../7/compiler-rt-glibc.patch
-  ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
-    ++ stdenv.lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch;
+  ] ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
+    ++ lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch;
 
   # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
   # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra
   # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd
   # get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by
   # a flag and turn the flag off during the stdenv build.
-  postPatch = stdenv.lib.optionalString (!stdenv.isDarwin) ''
+  postPatch = lib.optionalString (!stdenv.isDarwin) ''
     substituteInPlace cmake/builtin-config-ix.cmake \
       --replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)'
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     substituteInPlace cmake/config-ix.cmake \
       --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)'
-  '' + stdenv.lib.optionalString (useLLVM) ''
+  '' + lib.optionalString (useLLVM) ''
     substituteInPlace lib/builtins/int_util.c \
       --replace "#include <stdlib.h>" ""
     substituteInPlace lib/builtins/clear_cache.c \
@@ -77,14 +77,13 @@ stdenv.mkDerivation {
   '';
 
   # Hack around weird upsream RPATH bug
-  postInstall = stdenv.lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) ''
+  postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) ''
     ln -s "$out/lib"/*/* "$out/lib"
-  '' + stdenv.lib.optionalString (useLLVM) ''
+  '' + lib.optionalString (useLLVM) ''
     ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/linux/crtbegin.o
     ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/linux/crtend.o
     ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/linux/crtbeginS.o
     ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/linux/crtendS.o
   '';
 
-  enableParallelBuilding = true;
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/6/default.nix b/nixpkgs/pkgs/development/compilers/llvm/6/default.nix
index 4c2e87ec5e1a..a98314d1181f 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/6/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/6/default.nix
@@ -1,4 +1,4 @@
-{ lowPrio, newScope, pkgs, stdenv, cmake, gccForLibs
+{ lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs
 , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith
 , buildPackages
 , buildLlvmTools # tools, but from the previous stage, for cross
@@ -17,7 +17,7 @@ let
 
   clang-tools-extra_src = fetch "clang-tools-extra" "1w8ml7fyn4vyxmy59n2qm4r1k1kgwgwkaldp6m45fdv4g0kkfbhd";
 
-  tools = stdenv.lib.makeExtensible (tools: let
+  tools = lib.makeExtensible (tools: let
     callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
     mkExtraBuildCommands = cc: ''
       rsrc="$out/resource-root"
@@ -25,8 +25,6 @@ let
       ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
       ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
       echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
-    '' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
-      echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
     '';
   in {
 
@@ -75,7 +73,7 @@ let
     lldb = callPackage ./lldb.nix {};
   });
 
-  libraries = stdenv.lib.makeExtensible (libraries: let
+  libraries = lib.makeExtensible (libraries: let
     callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
   in {
 
diff --git a/nixpkgs/pkgs/development/compilers/llvm/6/libc++/default.nix b/nixpkgs/pkgs/development/compilers/llvm/6/libc++/default.nix
index 727a32260872..ac489db54fcf 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/6/libc++/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/6/libc++/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
     export LIBCXXABI_INCLUDE_DIR="$PWD/$(ls -d libcxxabi-${version}*)/include"
   '';
 
-  patches = stdenv.lib.optionals stdenv.hostPlatform.isMusl [
+  patches = lib.optionals stdenv.hostPlatform.isMusl [
     ../../libcxx-0001-musl-hacks.patch
   ];
 
@@ -26,8 +26,8 @@ stdenv.mkDerivation {
     patchShebangs utils/cat_files.py
   '';
   nativeBuildInputs = [ cmake ]
-    ++ stdenv.lib.optional stdenv.hostPlatform.isMusl python3
-    ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+    ++ lib.optional stdenv.hostPlatform.isMusl python3
+    ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
 
   buildInputs = [ libcxxabi ];
 
@@ -35,9 +35,7 @@ stdenv.mkDerivation {
     "-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"
     "-DLIBCXX_LIBCPPABI_VERSION=2"
     "-DLIBCXX_CXX_ABI=libcxxabi"
-  ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1";
-
-  enableParallelBuilding = true;
+  ] ++ lib.optional stdenv.hostPlatform.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1";
 
   passthru = {
     isLLVM = true;
@@ -46,7 +44,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = "https://libcxx.llvm.org/";
     description = "A new implementation of the C++ standard library, targeting C++11";
-    license = with stdenv.lib.licenses; [ ncsa mit ];
-    platforms = stdenv.lib.platforms.unix;
+    license = with lib.licenses; [ ncsa mit ];
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/6/libc++abi.nix b/nixpkgs/pkgs/development/compilers/llvm/6/libc++abi.nix
index 246bc6153e59..6e99f2d287a6 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/6/libc++abi.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/6/libc++abi.nix
@@ -1,4 +1,4 @@
-{ stdenv, cmake, fetch, libcxx, libunwind, llvm, version }:
+{ lib, stdenv, cmake, fetch, libcxx, libunwind, llvm, version }:
 
 stdenv.mkDerivation {
   pname = "libc++abi";
@@ -7,15 +7,15 @@ stdenv.mkDerivation {
   src = fetch "libcxxabi" "0prqvdj317qrc8nddaq1hh2ag9algkd9wbkj3y4mr5588k12x7r0";
 
   nativeBuildInputs = [ cmake ];
-  buildInputs = stdenv.lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD) libunwind;
+  buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD) libunwind;
 
   postUnpack = ''
     unpackFile ${libcxx.src}
     unpackFile ${llvm.src}
     export cmakeFlags="-DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*)"
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     export TRIPLE=x86_64-apple-darwin
-  '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+  '' + lib.optionalString stdenv.hostPlatform.isMusl ''
     patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-0001-musl-hacks.patch}
   '';
 
@@ -44,8 +44,8 @@ stdenv.mkDerivation {
   meta = {
     homepage = "https://libcxxabi.llvm.org/";
     description = "A new implementation of low level support for a standard C++ library";
-    license = with stdenv.lib.licenses; [ ncsa mit ];
-    maintainers = with stdenv.lib.maintainers; [ vlstill ];
-    platforms = stdenv.lib.platforms.unix;
+    license = with lib.licenses; [ ncsa mit ];
+    maintainers = with lib.maintainers; [ vlstill ];
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/6/lld.nix b/nixpkgs/pkgs/development/compilers/llvm/6/lld.nix
index 81b94df31194..b80385248059 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/6/lld.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/6/lld.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetch
 , cmake
 , libxml2
@@ -17,8 +17,6 @@ stdenv.mkDerivation {
 
   outputs = [ "out" "dev" ];
 
-  enableParallelBuilding = true;
-
   postInstall = ''
     moveToOutput include "$dev"
     moveToOutput lib "$dev"
@@ -27,7 +25,7 @@ stdenv.mkDerivation {
   meta = {
     description = "The LLVM Linker";
     homepage    = "https://lld.llvm.org/";
-    license     = stdenv.lib.licenses.ncsa;
-    platforms   = stdenv.lib.platforms.all;
+    license     = lib.licenses.ncsa;
+    platforms   = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/6/lldb.nix b/nixpkgs/pkgs/development/compilers/llvm/6/lldb.nix
index 629749e10f3c..7c6f8b1bd979 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/6/lldb.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/6/lldb.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetch
 , fetchpatch
 , cmake
@@ -42,7 +42,7 @@ stdenv.mkDerivation {
 
   nativeBuildInputs = [ cmake python3 which swig ];
   buildInputs = [ ncurses zlib libedit libxml2 llvm ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ darwin.libobjc darwin.apple_sdk.libs.xpc darwin.apple_sdk.frameworks.Foundation darwin.bootstrap_cmds darwin.apple_sdk.frameworks.Carbon darwin.apple_sdk.frameworks.Cocoa ];
+    ++ lib.optionals stdenv.isDarwin [ darwin.libobjc darwin.apple_sdk.libs.xpc darwin.apple_sdk.frameworks.Foundation darwin.bootstrap_cmds darwin.apple_sdk.frameworks.Carbon darwin.apple_sdk.frameworks.Cocoa ];
 
   CXXFLAGS = "-fno-rtti";
   hardeningDisable = [ "format" ];
@@ -51,14 +51,12 @@ stdenv.mkDerivation {
     "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic
   ];
 
-  enableParallelBuilding = true;
-
   postInstall = ''
     mkdir -p $out/share/man/man1
     cp ../docs/lldb.1 $out/share/man/man1/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A next-generation high-performance debugger";
     homepage    = "https://llvm.org/";
     license     = licenses.ncsa;
diff --git a/nixpkgs/pkgs/development/compilers/llvm/6/llvm.nix b/nixpkgs/pkgs/development/compilers/llvm/6/llvm.nix
index 22dbb75d2d50..7d429e3ecf30 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/6/llvm.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/6/llvm.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetch
 , cmake
 , python3
@@ -17,10 +17,10 @@
 }:
 
 let
-  inherit (stdenv.lib) optional optionals optionalString;
+  inherit (lib) optional optionals optionalString;
 
   # Used when creating a versioned symlinks of libLLVM.dylib
-  versionSuffixes = with stdenv.lib;
+  versionSuffixes = with lib;
     let parts = splitVersion release_version; in
     imap (i: _: concatStringsSep "." (take i parts)) parts;
 in
@@ -136,7 +136,7 @@ stdenv.mkDerivation ({
   + optionalString (stdenv.isDarwin && enableSharedLibraries) ''
     substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \
       --replace "\''${_IMPORT_PREFIX}/lib/libLLVM.dylib" "$lib/lib/libLLVM.dylib"
-    ${stdenv.lib.concatMapStringsSep "\n" (v: ''
+    ${lib.concatMapStringsSep "\n" (v: ''
       ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${v}.dylib
     '') versionSuffixes}
   '';
@@ -145,17 +145,15 @@ stdenv.mkDerivation ({
 
   checkTarget = "check-all";
 
-  enableParallelBuilding = true;
-
   requiredSystemFeatures = [ "big-parallel" ];
   meta = {
     description = "Collection of modular and reusable compiler and toolchain technologies";
     homepage    = "https://llvm.org/";
-    license     = stdenv.lib.licenses.ncsa;
-    maintainers = with stdenv.lib.maintainers; [ lovek323 raskin dtzWill ];
-    platforms   = stdenv.lib.platforms.all;
+    license     = lib.licenses.ncsa;
+    maintainers = with lib.maintainers; [ lovek323 raskin dtzWill ];
+    platforms   = lib.platforms.all;
   };
-} // stdenv.lib.optionalAttrs enableManpages {
+} // lib.optionalAttrs enableManpages {
   pname = "llvm-manpages";
 
   buildPhase = ''
diff --git a/nixpkgs/pkgs/development/compilers/llvm/6/openmp.nix b/nixpkgs/pkgs/development/compilers/llvm/6/openmp.nix
index c1a4480a5524..9de18065918c 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/6/openmp.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/6/openmp.nix
@@ -1,4 +1,5 @@
-{ stdenv
+{ lib
+, stdenv
 , fetch
 , cmake
 , llvm
@@ -15,12 +16,10 @@ stdenv.mkDerivation {
   nativeBuildInputs = [ cmake perl ];
   buildInputs = [ llvm ];
 
-  enableParallelBuilding = true;
-
   meta = {
     description = "Components required to build an executable OpenMP program";
     homepage    = "https://openmp.llvm.org/";
-    license     = stdenv.lib.licenses.mit;
-    platforms   = stdenv.lib.platforms.all;
+    license     = lib.licenses.mit;
+    platforms   = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/7/clang/default.nix b/nixpkgs/pkgs/development/compilers/llvm/7/clang/default.nix
index 969938681fe9..4ab13441e36f 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/7/clang/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/7/clang/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python3, lld
+{ lib, stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python3, lld
 , fixDarwinDylibNames
 , enableManpages ? false
 , enablePolly ? false # TODO: get this info from llvm (passthru?)
@@ -20,21 +20,21 @@ let
     '';
 
     nativeBuildInputs = [ cmake python3 ]
-      ++ stdenv.lib.optional enableManpages python3.pkgs.sphinx
-      ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+      ++ lib.optional enableManpages python3.pkgs.sphinx
+      ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
 
     buildInputs = [ libxml2 llvm lld ];
 
     cmakeFlags = [
       "-DCMAKE_CXX_FLAGS=-std=c++11"
       "-DLLVM_ENABLE_RTTI=ON"
-    ] ++ stdenv.lib.optionals enableManpages [
+    ] ++ lib.optionals enableManpages [
       "-DCLANG_INCLUDE_DOCS=ON"
       "-DLLVM_ENABLE_SPHINX=ON"
       "-DSPHINX_OUTPUT_MAN=ON"
       "-DSPHINX_OUTPUT_HTML=OFF"
       "-DSPHINX_WARNINGS_AS_ERRORS=OFF"
-    ] ++ stdenv.lib.optionals enablePolly [
+    ] ++ lib.optionals enablePolly [
       "-DWITH_POLLY=ON"
       "-DLINK_POLLY_INTO_TOOLS=ON"
     ];
@@ -52,9 +52,9 @@ let
 
       # Patch for standalone doc building
       sed -i '1s,^,find_package(Sphinx REQUIRED)\n,' docs/CMakeLists.txt
-    '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+    '' + lib.optionalString stdenv.hostPlatform.isMusl ''
       sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp
-    '' + stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
+    '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
       substituteInPlace tools/extra/clangd/CMakeLists.txt \
         --replace "NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB" FALSE
     '';
@@ -83,8 +83,6 @@ let
       rm $out/bin/c-index-test
     '';
 
-    enableParallelBuilding = true;
-
     passthru = {
       isClang = true;
       inherit llvm;
@@ -93,10 +91,10 @@ let
     meta = {
       description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler";
       homepage    = "https://llvm.org/";
-      license     = stdenv.lib.licenses.ncsa;
-      platforms   = stdenv.lib.platforms.all;
+      license     = lib.licenses.ncsa;
+      platforms   = lib.platforms.all;
     };
-  } // stdenv.lib.optionalAttrs enableManpages {
+  } // lib.optionalAttrs enableManpages {
     pname = "clang-manpages";
 
     buildPhase = ''
diff --git a/nixpkgs/pkgs/development/compilers/llvm/7/compiler-rt.nix b/nixpkgs/pkgs/development/compilers/llvm/7/compiler-rt.nix
index ec9b7e6e6ad4..6320a3405d27 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/7/compiler-rt.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/7/compiler-rt.nix
@@ -1,4 +1,4 @@
-{ stdenv, version, fetch, cmake, python3, llvm, libcxxabi }:
+{ lib, stdenv, version, fetch, cmake, python3, llvm, libcxxabi }:
 
 let
 
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
   src = fetch "compiler-rt" "1n48p8gjarihkws0i2bay5w9bdwyxyxxbpwyng7ba58jb30dlyq5";
 
   nativeBuildInputs = [ cmake python3 llvm ];
-  buildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
+  buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
 
   NIX_CFLAGS_COMPILE = [
     "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0"
@@ -24,24 +24,24 @@ stdenv.mkDerivation {
     "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON"
     "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}"
     "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}"
-  ] ++ stdenv.lib.optionals (useLLVM || bareMetal || isMusl) [
+  ] ++ lib.optionals (useLLVM || bareMetal || isMusl) [
     "-DCOMPILER_RT_BUILD_SANITIZERS=OFF"
     "-DCOMPILER_RT_BUILD_XRAY=OFF"
     "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF"
     "-DCOMPILER_RT_BUILD_PROFILE=OFF"
-  ] ++ stdenv.lib.optionals (useLLVM || bareMetal) [
+  ] ++ lib.optionals (useLLVM || bareMetal) [
     "-DCMAKE_C_COMPILER_WORKS=ON"
     "-DCMAKE_CXX_COMPILER_WORKS=ON"
     "-DCOMPILER_RT_BAREMETAL_BUILD=ON"
     "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}"
-  ] ++ stdenv.lib.optionals (useLLVM) [
+  ] ++ lib.optionals (useLLVM) [
     "-DCOMPILER_RT_BUILD_BUILTINS=ON"
     "-DCMAKE_C_FLAGS=-nodefaultlibs"
     #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program
     "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY"
-  ] ++ stdenv.lib.optionals (bareMetal) [
+  ] ++ lib.optionals (bareMetal) [
     "-DCOMPILER_RT_OS_DIR=baremetal"
-  ] ++ stdenv.lib.optionals (stdenv.hostPlatform.isDarwin) [
+  ] ++ lib.optionals (stdenv.hostPlatform.isDarwin) [
     # The compiler-rt build infrastructure sniffs supported platforms on Darwin
     # and finds i386;x86_64;x86_64h. We only build for x86_64, so linking fails
     # when it tries to use libc++ and libc++api for i386.
@@ -55,22 +55,22 @@ stdenv.mkDerivation {
     ./compiler-rt-glibc.patch
 
     ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory
-  ] ++ stdenv.lib.optional (useLLVM) ./crtbegin-and-end.patch
-    ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
-    ++ stdenv.lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch;
+  ] ++ lib.optional (useLLVM) ./crtbegin-and-end.patch
+    ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
+    ++ lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch;
 
   # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
   # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra
   # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd
   # get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by
   # a flag and turn the flag off during the stdenv build.
-  postPatch = stdenv.lib.optionalString (!stdenv.isDarwin) ''
+  postPatch = lib.optionalString (!stdenv.isDarwin) ''
     substituteInPlace cmake/builtin-config-ix.cmake \
       --replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)'
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     substituteInPlace cmake/config-ix.cmake \
       --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)'
-  '' + stdenv.lib.optionalString (useLLVM) ''
+  '' + lib.optionalString (useLLVM) ''
     substituteInPlace lib/builtins/int_util.c \
       --replace "#include <stdlib.h>" ""
     substituteInPlace lib/builtins/clear_cache.c \
@@ -80,14 +80,13 @@ stdenv.mkDerivation {
   '';
 
   # Hack around weird upsream RPATH bug
-  postInstall = stdenv.lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) ''
+  postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) ''
     ln -s "$out/lib"/*/* "$out/lib"
-  '' + stdenv.lib.optionalString (useLLVM) ''
+  '' + lib.optionalString (useLLVM) ''
     ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/linux/crtbegin.o
     ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/linux/crtend.o
     ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/linux/crtbeginS.o
     ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/linux/crtendS.o
   '';
 
-  enableParallelBuilding = true;
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/7/default.nix b/nixpkgs/pkgs/development/compilers/llvm/7/default.nix
index 3dd067ae607e..111ccbb9a38b 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/7/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/7/default.nix
@@ -1,4 +1,4 @@
-{ lowPrio, newScope, pkgs, stdenv, cmake, gccForLibs
+{ lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs
 , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith
 , buildPackages
 , buildLlvmTools # tools, but from the previous stage, for cross
@@ -17,7 +17,7 @@ let
 
   clang-tools-extra_src = fetch "clang-tools-extra" "0lb4kdh7j2fhfz8kd6iv5df7m3pikiryk1vvwsf87spc90n09q0w";
 
-  tools = stdenv.lib.makeExtensible (tools: let
+  tools = lib.makeExtensible (tools: let
     callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
     mkExtraBuildCommands = cc: ''
       rsrc="$out/resource-root"
@@ -25,8 +25,6 @@ let
       ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
       ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
       echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
-    '' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
-      echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
     '';
   in {
 
@@ -103,9 +101,9 @@ let
       extraBuildCommands = ''
         echo "-rtlib=compiler-rt -Wno-unused-command-line-argument" >> $out/nix-support/cc-cflags
         echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags
-      '' + stdenv.lib.optionalString (!stdenv.targetPlatform.isWasm) ''
+      '' + lib.optionalString (!stdenv.targetPlatform.isWasm) ''
         echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags
-      '' + stdenv.lib.optionalString stdenv.targetPlatform.isWasm ''
+      '' + lib.optionalString stdenv.targetPlatform.isWasm ''
         echo "-fno-exceptions" >> $out/nix-support/cc-cflags
       '' + mkExtraBuildCommands cc;
     };
@@ -157,7 +155,7 @@ let
 
   });
 
-  libraries = stdenv.lib.makeExtensible (libraries: let
+  libraries = lib.makeExtensible (libraries: let
     callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
   in {
 
@@ -172,12 +170,12 @@ let
     libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang;
 
     libcxx = callPackage ./libc++ ({} //
-      (stdenv.lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
+      (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
       }));
 
     libcxxabi = callPackage ./libc++abi.nix ({} //
-      (stdenv.lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
+      (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
         libunwind = libraries.libunwind;
       }));
diff --git a/nixpkgs/pkgs/development/compilers/llvm/7/libc++/default.nix b/nixpkgs/pkgs/development/compilers/llvm/7/libc++/default.nix
index ed4192a232e3..fb50c4e24d72 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/7/libc++/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/7/libc++/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
     export LIBCXXABI_INCLUDE_DIR="$PWD/$(ls -d libcxxabi-${version}*)/include"
   '';
 
-  patches = stdenv.lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch;
+  patches = lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch;
 
   prePatch = ''
     substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++"
@@ -27,8 +27,8 @@ stdenv.mkDerivation {
   '';
 
   nativeBuildInputs = [ cmake ]
-    ++ stdenv.lib.optional stdenv.hostPlatform.isMusl python3
-    ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+    ++ lib.optional stdenv.hostPlatform.isMusl python3
+    ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
 
   buildInputs = [ libcxxabi ] ;
 
@@ -36,10 +36,8 @@ stdenv.mkDerivation {
     "-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"
     "-DLIBCXX_LIBCPPABI_VERSION=2"
     "-DLIBCXX_CXX_ABI=libcxxabi"
-  ] ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1"
-  ++ stdenv.lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF" ;
-
-  enableParallelBuilding = true;
+  ] ++ lib.optional stdenv.hostPlatform.isMusl "-DLIBCXX_HAS_MUSL_LIBC=1"
+  ++ lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF" ;
 
   passthru = {
     isLLVM = true;
@@ -48,7 +46,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = "https://libcxx.llvm.org/";
     description = "A new implementation of the C++ standard library, targeting C++11";
-    license = with stdenv.lib.licenses; [ ncsa mit ];
-    platforms = stdenv.lib.platforms.unix;
+    license = with lib.licenses; [ ncsa mit ];
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/7/libc++abi.nix b/nixpkgs/pkgs/development/compilers/llvm/7/libc++abi.nix
index 4c46aeaa1910..61879be91dad 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/7/libc++abi.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/7/libc++abi.nix
@@ -1,4 +1,4 @@
-{ stdenv, cmake, fetch, libcxx, llvm, version
+{ lib, stdenv, cmake, fetch, libcxx, llvm, version
 , standalone ? false
   # on musl the shared objects don't build
 , enableShared ? !stdenv.hostPlatform.isStatic
@@ -16,15 +16,15 @@ stdenv.mkDerivation {
     unpackFile ${libcxx.src}
     unpackFile ${llvm.src}
     cmakeFlagsArray=($cmakeFlagsArray -DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*) )
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     export TRIPLE=x86_64-apple-darwin
-  '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+  '' + lib.optionalString stdenv.hostPlatform.isMusl ''
     patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-0001-musl-hacks.patch}
   '';
 
   cmakeFlags =
-     stdenv.lib.optional standalone "-DLLVM_ENABLE_LIBCXX=ON" ++
-     stdenv.lib.optional (!enableShared) "-DLIBCXXABI_ENABLE_SHARED=OFF";
+     lib.optional standalone "-DLLVM_ENABLE_LIBCXX=ON" ++
+     lib.optional (!enableShared) "-DLIBCXXABI_ENABLE_SHARED=OFF";
 
   installPhase = if stdenv.isDarwin
     then ''
@@ -42,17 +42,17 @@ stdenv.mkDerivation {
     else ''
       install -d -m 755 $out/include $out/lib
       install -m 644 lib/libc++abi.a $out/lib
-      ${stdenv.lib.optionalString enableShared "install -m 644 lib/libc++abi.so.1.0 $out/lib"}
+      ${lib.optionalString enableShared "install -m 644 lib/libc++abi.so.1.0 $out/lib"}
       install -m 644 ../include/cxxabi.h $out/include
-      ${stdenv.lib.optionalString enableShared "ln -s libc++abi.so.1.0 $out/lib/libc++abi.so"}
-      ${stdenv.lib.optionalString enableShared "ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1"}
+      ${lib.optionalString enableShared "ln -s libc++abi.so.1.0 $out/lib/libc++abi.so"}
+      ${lib.optionalString enableShared "ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1"}
     '';
 
   meta = {
     homepage = "https://libcxxabi.llvm.org/";
     description = "A new implementation of low level support for a standard C++ library";
-    license = with stdenv.lib.licenses; [ ncsa mit ];
-    maintainers = with stdenv.lib.maintainers; [ vlstill ];
-    platforms = stdenv.lib.platforms.unix;
+    license = with lib.licenses; [ ncsa mit ];
+    maintainers = with lib.maintainers; [ vlstill ];
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/7/lld.nix b/nixpkgs/pkgs/development/compilers/llvm/7/lld.nix
index bee9202ed6c1..f4c58abef8a3 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/7/lld.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/7/lld.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetch
 , cmake
 , libxml2
@@ -17,8 +17,6 @@ stdenv.mkDerivation {
 
   outputs = [ "out" "dev" ];
 
-  enableParallelBuilding = true;
-
   postInstall = ''
     moveToOutput include "$dev"
     moveToOutput lib "$dev"
@@ -27,7 +25,7 @@ stdenv.mkDerivation {
   meta = {
     description = "The LLVM Linker";
     homepage    = "https://lld.llvm.org/";
-    license     = stdenv.lib.licenses.ncsa;
-    platforms   = stdenv.lib.platforms.all;
+    license     = lib.licenses.ncsa;
+    platforms   = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/7/lldb.nix b/nixpkgs/pkgs/development/compilers/llvm/7/lldb.nix
index 8fadd3cf7849..3fa5b411f634 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/7/lldb.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/7/lldb.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetch
 , cmake
 , zlib
@@ -23,7 +23,7 @@ stdenv.mkDerivation {
 
   nativeBuildInputs = [ cmake perl python3 which swig ];
   buildInputs = [ ncurses zlib libedit libxml2 llvm ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ darwin.libobjc darwin.apple_sdk.libs.xpc darwin.apple_sdk.frameworks.Foundation darwin.bootstrap_cmds darwin.apple_sdk.frameworks.Carbon darwin.apple_sdk.frameworks.Cocoa ];
+    ++ lib.optionals stdenv.isDarwin [ darwin.libobjc darwin.apple_sdk.libs.xpc darwin.apple_sdk.frameworks.Foundation darwin.bootstrap_cmds darwin.apple_sdk.frameworks.Carbon darwin.apple_sdk.frameworks.Cocoa ];
 
 
   postPatch = ''
@@ -50,16 +50,14 @@ stdenv.mkDerivation {
   CXXFLAGS = "-fno-rtti";
   hardeningDisable = [ "format" ];
 
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-I${libxml2.dev}/include/libxml2";
-
-  enableParallelBuilding = true;
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-I${libxml2.dev}/include/libxml2";
 
   postInstall = ''
     mkdir -p $out/share/man/man1
     cp ../docs/lldb.1 $out/share/man/man1/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A next-generation high-performance debugger";
     homepage    = "https://llvm.org/";
     license     = licenses.ncsa;
diff --git a/nixpkgs/pkgs/development/compilers/llvm/7/llvm.nix b/nixpkgs/pkgs/development/compilers/llvm/7/llvm.nix
index dc57d0d6bd5c..2d6f0d187226 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/7/llvm.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/7/llvm.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetch
 , fetchpatch
 , cmake
@@ -23,10 +23,10 @@
 }:
 
 let
-  inherit (stdenv.lib) optional optionals optionalString;
+  inherit (lib) optional optionals optionalString;
 
   # Used when creating a versioned symlinks of libLLVM.dylib
-  versionSuffixes = with stdenv.lib;
+  versionSuffixes = with lib;
     let parts = splitVersion release_version; in
     imap (i: _: concatStringsSep "." (take i parts)) parts;
 
@@ -158,7 +158,7 @@ in stdenv.mkDerivation ({
   + optionalString (stdenv.isDarwin && enableSharedLibraries) ''
     substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \
       --replace "\''${_IMPORT_PREFIX}/lib/libLLVM.dylib" "$lib/lib/libLLVM.dylib"
-    ${stdenv.lib.concatMapStringsSep "\n" (v: ''
+    ${lib.concatMapStringsSep "\n" (v: ''
       ln -s $lib/lib/libLLVM.dylib $lib/lib/libLLVM-${v}.dylib
     '') versionSuffixes}
   '';
@@ -167,17 +167,15 @@ in stdenv.mkDerivation ({
 
   checkTarget = "check-all";
 
-  enableParallelBuilding = true;
-
   requiredSystemFeatures = [ "big-parallel" ];
   meta = {
     description = "Collection of modular and reusable compiler and toolchain technologies";
     homepage    = "https://llvm.org/";
-    license     = stdenv.lib.licenses.ncsa;
-    maintainers = with stdenv.lib.maintainers; [ lovek323 raskin dtzWill ];
-    platforms   = stdenv.lib.platforms.all;
+    license     = lib.licenses.ncsa;
+    maintainers = with lib.maintainers; [ lovek323 raskin dtzWill ];
+    platforms   = lib.platforms.all;
   };
-} // stdenv.lib.optionalAttrs enableManpages {
+} // lib.optionalAttrs enableManpages {
   pname = "llvm-manpages";
 
   buildPhase = ''
diff --git a/nixpkgs/pkgs/development/compilers/llvm/7/openmp.nix b/nixpkgs/pkgs/development/compilers/llvm/7/openmp.nix
index 898d49dce834..53f52c326c55 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/7/openmp.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/7/openmp.nix
@@ -1,4 +1,5 @@
-{ stdenv
+{ lib
+, stdenv
 , fetch
 , cmake
 , llvm
@@ -15,12 +16,10 @@ stdenv.mkDerivation {
   nativeBuildInputs = [ cmake perl ];
   buildInputs = [ llvm ];
 
-  enableParallelBuilding = true;
-
   meta = {
     description = "Components required to build an executable OpenMP program";
     homepage    = "https://openmp.llvm.org/";
-    license     = stdenv.lib.licenses.mit;
-    platforms   = stdenv.lib.platforms.all;
+    license     = lib.licenses.mit;
+    platforms   = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/8/clang/default.nix b/nixpkgs/pkgs/development/compilers/llvm/8/clang/default.nix
index 5c1dca5e33b1..8f44ffc0615d 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/8/clang/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/8/clang/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python3, lld
+{ lib, stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python3, lld
 , fixDarwinDylibNames
 , enableManpages ? false
 , enablePolly ? false # TODO: get this info from llvm (passthru?)
@@ -20,8 +20,8 @@ let
     '';
 
     nativeBuildInputs = [ cmake python3 ]
-      ++ stdenv.lib.optional enableManpages python3.pkgs.sphinx
-      ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+      ++ lib.optional enableManpages python3.pkgs.sphinx
+      ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
 
     buildInputs = [ libxml2 llvm lld ];
 
@@ -29,13 +29,13 @@ let
       "-DCMAKE_CXX_FLAGS=-std=c++11"
       "-DCLANGD_BUILD_XPC=OFF"
       "-DLLVM_ENABLE_RTTI=ON"
-    ] ++ stdenv.lib.optionals enableManpages [
+    ] ++ lib.optionals enableManpages [
       "-DCLANG_INCLUDE_DOCS=ON"
       "-DLLVM_ENABLE_SPHINX=ON"
       "-DSPHINX_OUTPUT_MAN=ON"
       "-DSPHINX_OUTPUT_HTML=OFF"
       "-DSPHINX_WARNINGS_AS_ERRORS=OFF"
-    ] ++ stdenv.lib.optionals enablePolly [
+    ] ++ lib.optionals enablePolly [
       "-DWITH_POLLY=ON"
       "-DLINK_POLLY_INTO_TOOLS=ON"
     ];
@@ -62,9 +62,9 @@ let
 
       # Patch for standalone doc building
       sed -i '1s,^,find_package(Sphinx REQUIRED)\n,' docs/CMakeLists.txt
-    '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+    '' + lib.optionalString stdenv.hostPlatform.isMusl ''
       sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp
-    '' + stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
+    '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
       substituteInPlace tools/extra/clangd/CMakeLists.txt \
         --replace "NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB" FALSE
     '';
@@ -93,8 +93,6 @@ let
       rm $out/bin/c-index-test
     '';
 
-    enableParallelBuilding = true;
-
     passthru = {
       isClang = true;
       inherit llvm;
@@ -103,10 +101,10 @@ let
     meta = {
       description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler";
       homepage    = "https://llvm.org/";
-      license     = stdenv.lib.licenses.ncsa;
-      platforms   = stdenv.lib.platforms.all;
+      license     = lib.licenses.ncsa;
+      platforms   = lib.platforms.all;
     };
-  } // stdenv.lib.optionalAttrs enableManpages {
+  } // lib.optionalAttrs enableManpages {
     pname = "clang-manpages";
 
     buildPhase = ''
diff --git a/nixpkgs/pkgs/development/compilers/llvm/8/compiler-rt.nix b/nixpkgs/pkgs/development/compilers/llvm/8/compiler-rt.nix
index 3c6265c4fca0..2e49ef17346d 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/8/compiler-rt.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/8/compiler-rt.nix
@@ -1,4 +1,4 @@
-{ stdenv, version, fetch, cmake, python3, llvm, libcxxabi }:
+{ lib, stdenv, version, fetch, cmake, python3, llvm, libcxxabi }:
 
 let
 
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
   src = fetch "compiler-rt" "0dqqf8f930l8gag4d9qjgn1n0pj0nbv2anviqqhdi1rkhas8z0hi";
 
   nativeBuildInputs = [ cmake python3 llvm ];
-  buildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
+  buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
 
   NIX_CFLAGS_COMPILE = [
     "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0"
@@ -24,24 +24,24 @@ stdenv.mkDerivation {
     "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON"
     "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}"
     "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}"
-  ] ++ stdenv.lib.optionals (useLLVM || bareMetal || isMusl) [
+  ] ++ lib.optionals (useLLVM || bareMetal || isMusl) [
     "-DCOMPILER_RT_BUILD_SANITIZERS=OFF"
     "-DCOMPILER_RT_BUILD_XRAY=OFF"
     "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF"
     "-DCOMPILER_RT_BUILD_PROFILE=OFF"
-  ] ++ stdenv.lib.optionals (useLLVM || bareMetal) [
+  ] ++ lib.optionals (useLLVM || bareMetal) [
     "-DCMAKE_C_COMPILER_WORKS=ON"
     "-DCMAKE_CXX_COMPILER_WORKS=ON"
     "-DCOMPILER_RT_BAREMETAL_BUILD=ON"
     "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}"
-  ] ++ stdenv.lib.optionals (useLLVM) [
+  ] ++ lib.optionals (useLLVM) [
     "-DCOMPILER_RT_BUILD_BUILTINS=ON"
     "-DCMAKE_C_FLAGS=-nodefaultlibs"
     #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program
     "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY"
-  ] ++ stdenv.lib.optionals (bareMetal) [
+  ] ++ lib.optionals (bareMetal) [
     "-DCOMPILER_RT_OS_DIR=baremetal"
-  ] ++ stdenv.lib.optionals (stdenv.hostPlatform.isDarwin) [
+  ] ++ lib.optionals (stdenv.hostPlatform.isDarwin) [
     # The compiler-rt build infrastructure sniffs supported platforms on Darwin
     # and finds i386;x86_64;x86_64h. We only build for x86_64, so linking fails
     # when it tries to use libc++ and libc++api for i386.
@@ -53,22 +53,22 @@ stdenv.mkDerivation {
   patches = [
     ../7/compiler-rt-glibc.patch
     ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory
-  ]# ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
-    ++ stdenv.lib.optional (useLLVM) ./crtbegin-and-end.patch
-    ++ stdenv.lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch;
+  ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
+    ++ lib.optional (useLLVM) ./crtbegin-and-end.patch
+    ++ lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch;
 
   # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
   # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra
   # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd
   # get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by
   # a flag and turn the flag off during the stdenv build.
-  postPatch = stdenv.lib.optionalString (!stdenv.isDarwin) ''
+  postPatch = lib.optionalString (!stdenv.isDarwin) ''
     substituteInPlace cmake/builtin-config-ix.cmake \
       --replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)'
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     substituteInPlace cmake/config-ix.cmake \
       --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)'
-  '' + stdenv.lib.optionalString (useLLVM) ''
+  '' + lib.optionalString (useLLVM) ''
     substituteInPlace lib/builtins/int_util.c \
       --replace "#include <stdlib.h>" ""
     substituteInPlace lib/builtins/clear_cache.c \
@@ -78,14 +78,13 @@ stdenv.mkDerivation {
   '';
 
   # Hack around weird upsream RPATH bug
-  postInstall = stdenv.lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) ''
+  postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) ''
     ln -s "$out/lib"/*/* "$out/lib"
-  '' + stdenv.lib.optionalString (useLLVM) ''
+  '' + lib.optionalString (useLLVM) ''
     ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o
     ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o
     ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o
     ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o
   '';
 
-  enableParallelBuilding = true;
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/8/default.nix b/nixpkgs/pkgs/development/compilers/llvm/8/default.nix
index 6e80737f32ad..313b97455e50 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/8/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/8/default.nix
@@ -1,4 +1,4 @@
-{ lowPrio, newScope, pkgs, stdenv, cmake, gccForLibs
+{ lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs
 , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith
 , buildPackages
 , buildLlvmTools # tools, but from the previous stage, for cross
@@ -17,7 +17,7 @@ let
 
   clang-tools-extra_src = fetch "clang-tools-extra" "1qf3097bc5ia8p6cpmbx985rjr3yaah5s8fc0nv7pw742yv7jw8q";
 
-  tools = stdenv.lib.makeExtensible (tools: let
+  tools = lib.makeExtensible (tools: let
     callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
     mkExtraBuildCommands = cc: ''
       rsrc="$out/resource-root"
@@ -25,8 +25,6 @@ let
       ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
       ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
       echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
-    '' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
-      echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
     '';
   in {
 
@@ -100,15 +98,15 @@ let
       extraPackages = [
         targetLlvmLibraries.libcxxabi
         targetLlvmLibraries.compiler-rt
-      ] ++ stdenv.lib.optionals (!stdenv.targetPlatform.isWasm) [
+      ] ++ lib.optionals (!stdenv.targetPlatform.isWasm) [
         targetLlvmLibraries.libunwind
       ];
       extraBuildCommands = ''
         echo "-rtlib=compiler-rt -Wno-unused-command-line-argument" >> $out/nix-support/cc-cflags
         echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags
-      '' + stdenv.lib.optionalString (!stdenv.targetPlatform.isWasm) ''
+      '' + lib.optionalString (!stdenv.targetPlatform.isWasm) ''
         echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags
-      '' + stdenv.lib.optionalString stdenv.targetPlatform.isWasm ''
+      '' + lib.optionalString stdenv.targetPlatform.isWasm ''
         echo "-fno-exceptions" >> $out/nix-support/cc-cflags
       '' + mkExtraBuildCommands cc;
     };
@@ -160,12 +158,12 @@ let
 
   });
 
-  libraries = stdenv.lib.makeExtensible (libraries: let
+  libraries = lib.makeExtensible (libraries: let
     callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
   in {
 
     compiler-rt = callPackage ./compiler-rt.nix ({} //
-      (stdenv.lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
+      (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt;
       }));
 
@@ -174,12 +172,12 @@ let
     libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang;
 
     libcxx = callPackage ./libc++ ({} //
-      (stdenv.lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
+      (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
       }));
 
     libcxxabi = callPackage ./libc++abi.nix ({} //
-      (stdenv.lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
+      (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
         libunwind = libraries.libunwind;
       }));
@@ -187,7 +185,7 @@ let
     openmp = callPackage ./openmp.nix {};
 
     libunwind = callPackage ./libunwind.nix ({} //
-      (stdenv.lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
+      (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
       }));
 
diff --git a/nixpkgs/pkgs/development/compilers/llvm/8/libc++/default.nix b/nixpkgs/pkgs/development/compilers/llvm/8/libc++/default.nix
index 2ed54a22069b..70e4d9e1a65e 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/8/libc++/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/8/libc++/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
     export LIBCXXABI_INCLUDE_DIR="$PWD/$(ls -d libcxxabi-${version}*)/include"
   '';
 
-  patches = stdenv.lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch;
+  patches = lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch;
 
   prePatch = ''
     substituteInPlace lib/CMakeLists.txt --replace "/usr/lib/libc++" "\''${LIBCXX_LIBCXXABI_LIB_PATH}/libc++"
@@ -26,8 +26,8 @@ stdenv.mkDerivation {
     patchShebangs utils/cat_files.py
   '';
   nativeBuildInputs = [ cmake ]
-    ++ stdenv.lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) python3
-    ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+    ++ lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) python3
+    ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
 
   buildInputs = [ libcxxabi ];
 
@@ -35,15 +35,13 @@ stdenv.mkDerivation {
     "-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"
     "-DLIBCXX_LIBCPPABI_VERSION=2"
     "-DLIBCXX_CXX_ABI=libcxxabi"
-  ] ++ stdenv.lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) "-DLIBCXX_HAS_MUSL_LIBC=1"
-    ++ stdenv.lib.optional (stdenv.hostPlatform.useLLVM or false) "-DLIBCXX_USE_COMPILER_RT=ON"
-    ++ stdenv.lib.optional stdenv.hostPlatform.isWasm [
+  ] ++ lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) "-DLIBCXX_HAS_MUSL_LIBC=1"
+    ++ lib.optional (stdenv.hostPlatform.useLLVM or false) "-DLIBCXX_USE_COMPILER_RT=ON"
+    ++ lib.optional stdenv.hostPlatform.isWasm [
       "-DLIBCXX_ENABLE_THREADS=OFF"
       "-DLIBCXX_ENABLE_FILESYSTEM=OFF"
       "-DLIBCXX_ENABLE_EXCEPTIONS=OFF"
-    ] ++ stdenv.lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF";
-
-  enableParallelBuilding = true;
+    ] ++ lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF";
 
   passthru = {
     isLLVM = true;
@@ -52,7 +50,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = "https://libcxx.llvm.org/";
     description = "A new implementation of the C++ standard library, targeting C++11";
-    license = with stdenv.lib.licenses; [ ncsa mit ];
-    platforms = stdenv.lib.platforms.all;
+    license = with lib.licenses; [ ncsa mit ];
+    platforms = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/8/libc++abi.nix b/nixpkgs/pkgs/development/compilers/llvm/8/libc++abi.nix
index 50a38dfa967b..5a74981eba8b 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/8/libc++abi.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/8/libc++abi.nix
@@ -1,4 +1,4 @@
-{ stdenv, cmake, fetch, libcxx, libunwind, llvm, version
+{ lib, stdenv, cmake, fetch, libcxx, libunwind, llvm, version
 , enableShared ? !stdenv.hostPlatform.isStatic
 }:
 
@@ -9,15 +9,15 @@ stdenv.mkDerivation {
   src = fetch "libcxxabi" "1vznz8n1z1h8af0ga451m98lc2hjnv4fyzl71napsvjhvk4g6nxp";
 
   nativeBuildInputs = [ cmake ];
-  buildInputs = stdenv.lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind;
+  buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind;
 
-  cmakeFlags = stdenv.lib.optionals (stdenv.hostPlatform.useLLVM or false) [
+  cmakeFlags = lib.optionals (stdenv.hostPlatform.useLLVM or false) [
     "-DLLVM_ENABLE_LIBCXX=ON"
     "-DLIBCXXABI_USE_LLVM_UNWINDER=ON"
-  ] ++ stdenv.lib.optionals stdenv.hostPlatform.isWasm [
+  ] ++ lib.optionals stdenv.hostPlatform.isWasm [
     "-DLIBCXXABI_ENABLE_THREADS=OFF"
     "-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF"
-  ] ++ stdenv.lib.optionals (!enableShared) [
+  ] ++ lib.optionals (!enableShared) [
     "-DLIBCXXABI_ENABLE_SHARED=OFF"
   ];
 
@@ -27,11 +27,11 @@ stdenv.mkDerivation {
     unpackFile ${libcxx.src}
     unpackFile ${llvm.src}
     cmakeFlags+=" -DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*)"
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     export TRIPLE=x86_64-apple-darwin
-  '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+  '' + lib.optionalString stdenv.hostPlatform.isMusl ''
     patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-0001-musl-hacks.patch}
-  '' + stdenv.lib.optionalString stdenv.hostPlatform.isWasm ''
+  '' + lib.optionalString stdenv.hostPlatform.isWasm ''
     patch -p1 -d $(ls -d llvm-*) -i ${./libcxxabi-wasm.patch}
   '';
 
@@ -52,7 +52,7 @@ stdenv.mkDerivation {
       install -d -m 755 $out/include $out/lib
       install -m 644 lib/libc++abi.a $out/lib
       install -m 644 ../include/cxxabi.h $out/include
-    '' + stdenv.lib.optionalString enableShared ''
+    '' + lib.optionalString enableShared ''
       install -m 644 lib/libc++abi.so.1.0 $out/lib
       ln -s libc++abi.so.1.0 $out/lib/libc++abi.so
       ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1
@@ -61,8 +61,8 @@ stdenv.mkDerivation {
   meta = {
     homepage = "https://libcxxabi.llvm.org/";
     description = "A new implementation of low level support for a standard C++ library";
-    license = with stdenv.lib.licenses; [ ncsa mit ];
-    maintainers = with stdenv.lib.maintainers; [ vlstill ];
-    platforms = stdenv.lib.platforms.all;
+    license = with lib.licenses; [ ncsa mit ];
+    maintainers = with lib.maintainers; [ vlstill ];
+    platforms = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/8/libunwind.nix b/nixpkgs/pkgs/development/compilers/llvm/8/libunwind.nix
index 3295d3922034..d1bd54fbd349 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/8/libunwind.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/8/libunwind.nix
@@ -1,4 +1,4 @@
-{ stdenv, version, fetch, cmake, fetchpatch
+{ lib, stdenv, version, fetch, cmake, fetchpatch
 , enableShared ? !stdenv.hostPlatform.isStatic
 }:
 
@@ -21,7 +21,5 @@ stdenv.mkDerivation {
     })
   ];
 
-  enableParallelBuilding = true;
-
-  cmakeFlags = stdenv.lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF";
+  cmakeFlags = lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF";
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/8/lld.nix b/nixpkgs/pkgs/development/compilers/llvm/8/lld.nix
index ba9cf3c57d77..8009beb7bc13 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/8/lld.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/8/lld.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetch
 , cmake
 , libxml2
@@ -17,8 +17,6 @@ stdenv.mkDerivation {
 
   outputs = [ "out" "dev" ];
 
-  enableParallelBuilding = true;
-
   postInstall = ''
     moveToOutput include "$dev"
     moveToOutput lib "$dev"
@@ -27,7 +25,7 @@ stdenv.mkDerivation {
   meta = {
     description = "The LLVM Linker";
     homepage    = "https://lld.llvm.org/";
-    license     = stdenv.lib.licenses.ncsa;
-    platforms   = stdenv.lib.platforms.all;
+    license     = lib.licenses.ncsa;
+    platforms   = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/8/lldb.nix b/nixpkgs/pkgs/development/compilers/llvm/8/lldb.nix
index 298ce737fc73..83c171d2a572 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/8/lldb.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/8/lldb.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetch
 , cmake
 , zlib
@@ -32,7 +32,7 @@ stdenv.mkDerivation {
 
   nativeBuildInputs = [ cmake python3 which swig ];
   buildInputs = [ ncurses zlib libedit libxml2 llvm ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ darwin.libobjc darwin.apple_sdk.libs.xpc darwin.apple_sdk.frameworks.Foundation darwin.bootstrap_cmds darwin.apple_sdk.frameworks.Carbon darwin.apple_sdk.frameworks.Cocoa ];
+    ++ lib.optionals stdenv.isDarwin [ darwin.libobjc darwin.apple_sdk.libs.xpc darwin.apple_sdk.frameworks.Foundation darwin.bootstrap_cmds darwin.apple_sdk.frameworks.Carbon darwin.apple_sdk.frameworks.Cocoa ];
 
   CXXFLAGS = "-fno-rtti";
   hardeningDisable = [ "format" ];
@@ -41,8 +41,6 @@ stdenv.mkDerivation {
     "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic
   ];
 
-  enableParallelBuilding = true;
-
   postInstall = ''
     mkdir -p $out/share/man/man1
     cp ../docs/lldb.1 $out/share/man/man1/
@@ -52,7 +50,7 @@ stdenv.mkDerivation {
     ln -s $out/bin/lldb-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A next-generation high-performance debugger";
     homepage    = "https://llvm.org/";
     license     = licenses.ncsa;
diff --git a/nixpkgs/pkgs/development/compilers/llvm/8/llvm.nix b/nixpkgs/pkgs/development/compilers/llvm/8/llvm.nix
index fb928b67ad54..9c2c3416aeab 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/8/llvm.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/8/llvm.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetch
 , fetchpatch
 , cmake
@@ -23,10 +23,10 @@
 }:
 
 let
-  inherit (stdenv.lib) optional optionals optionalString;
+  inherit (lib) optional optionals optionalString;
 
   # Used when creating a version-suffixed symlink of libLLVM.dylib
-  shortVersion = with stdenv.lib;
+  shortVersion = with lib;
     concatStringsSep "." (take 1 (splitVersion release_version));
 
 in stdenv.mkDerivation ({
@@ -151,17 +151,15 @@ in stdenv.mkDerivation ({
 
   checkTarget = "check-all";
 
-  enableParallelBuilding = true;
-
   requiredSystemFeatures = [ "big-parallel" ];
   meta = {
     description = "Collection of modular and reusable compiler and toolchain technologies";
     homepage    = "https://llvm.org/";
-    license     = stdenv.lib.licenses.ncsa;
-    maintainers = with stdenv.lib.maintainers; [ lovek323 raskin dtzWill ];
-    platforms   = stdenv.lib.platforms.all;
+    license     = lib.licenses.ncsa;
+    maintainers = with lib.maintainers; [ lovek323 raskin dtzWill ];
+    platforms   = lib.platforms.all;
   };
-} // stdenv.lib.optionalAttrs enableManpages {
+} // lib.optionalAttrs enableManpages {
   pname = "llvm-manpages";
 
   buildPhase = ''
diff --git a/nixpkgs/pkgs/development/compilers/llvm/8/openmp.nix b/nixpkgs/pkgs/development/compilers/llvm/8/openmp.nix
index 42cc7adf4f00..b5d75d9c8724 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/8/openmp.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/8/openmp.nix
@@ -1,4 +1,5 @@
-{ stdenv
+{ lib
+, stdenv
 , fetch
 , cmake
 , llvm
@@ -15,12 +16,10 @@ stdenv.mkDerivation {
   nativeBuildInputs = [ cmake perl ];
   buildInputs = [ llvm ];
 
-  enableParallelBuilding = true;
-
   meta = {
     description = "Components required to build an executable OpenMP program";
     homepage    = "https://openmp.llvm.org/";
-    license     = stdenv.lib.licenses.mit;
-    platforms   = stdenv.lib.platforms.all;
+    license     = lib.licenses.mit;
+    platforms   = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/9/clang/default.nix b/nixpkgs/pkgs/development/compilers/llvm/9/clang/default.nix
index cfaee05944ca..87b29163f43e 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/9/clang/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/9/clang/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python3, lld
+{ lib, stdenv, fetch, cmake, libxml2, llvm, version, clang-tools-extra_src, python3, lld
 , fixDarwinDylibNames
 , enableManpages ? false
 , enablePolly ? false # TODO: get this info from llvm (passthru?)
@@ -20,8 +20,8 @@ let
     '';
 
     nativeBuildInputs = [ cmake python3 ]
-      ++ stdenv.lib.optional enableManpages python3.pkgs.sphinx
-      ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+      ++ lib.optional enableManpages python3.pkgs.sphinx
+      ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
 
     buildInputs = [ libxml2 llvm lld ];
 
@@ -29,13 +29,13 @@ let
       "-DCMAKE_CXX_FLAGS=-std=c++11"
       "-DCLANGD_BUILD_XPC=OFF"
       "-DLLVM_ENABLE_RTTI=ON"
-    ] ++ stdenv.lib.optionals enableManpages [
+    ] ++ lib.optionals enableManpages [
       "-DCLANG_INCLUDE_DOCS=ON"
       "-DLLVM_ENABLE_SPHINX=ON"
       "-DSPHINX_OUTPUT_MAN=ON"
       "-DSPHINX_OUTPUT_HTML=OFF"
       "-DSPHINX_WARNINGS_AS_ERRORS=OFF"
-    ] ++ stdenv.lib.optionals enablePolly [
+    ] ++ lib.optionals enablePolly [
       "-DWITH_POLLY=ON"
       "-DLINK_POLLY_INTO_TOOLS=ON"
     ];
@@ -55,9 +55,9 @@ let
 
       # Patch for standalone doc building
       sed -i '1s,^,find_package(Sphinx REQUIRED)\n,' docs/CMakeLists.txt
-    '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+    '' + lib.optionalString stdenv.hostPlatform.isMusl ''
       sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp
-    '' + stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
+    '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
       substituteInPlace tools/extra/clangd/CMakeLists.txt \
         --replace "NOT HAVE_CXX_ATOMICS64_WITHOUT_LIB" FALSE
     '';
@@ -88,8 +88,6 @@ let
       rm $out/bin/c-index-test
     '';
 
-    enableParallelBuilding = true;
-
     passthru = {
       isClang = true;
       inherit llvm;
@@ -98,10 +96,10 @@ let
     meta = {
       description = "A c, c++, objective-c, and objective-c++ frontend for the llvm compiler";
       homepage    = "https://llvm.org/";
-      license     = stdenv.lib.licenses.ncsa;
-      platforms   = stdenv.lib.platforms.all;
+      license     = lib.licenses.ncsa;
+      platforms   = lib.platforms.all;
     };
-  } // stdenv.lib.optionalAttrs enableManpages {
+  } // lib.optionalAttrs enableManpages {
     pname = "clang-manpages";
 
     buildPhase = ''
diff --git a/nixpkgs/pkgs/development/compilers/llvm/9/compiler-rt.nix b/nixpkgs/pkgs/development/compilers/llvm/9/compiler-rt.nix
index 13b0b522771f..2ab9dc8ffa2e 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/9/compiler-rt.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/9/compiler-rt.nix
@@ -1,4 +1,4 @@
-{ stdenv, version, fetch, cmake, python3, llvm, libcxxabi }:
+{ lib, stdenv, version, fetch, cmake, python3, llvm, libcxxabi }:
 
 let
 
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   src = fetch pname "0xwh79g3zggdabxgnd0bphry75asm1qz7mv3hcqihqwqr6aspgy2";
 
   nativeBuildInputs = [ cmake python3 llvm ];
-  buildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
+  buildInputs = lib.optional stdenv.hostPlatform.isDarwin libcxxabi;
 
   NIX_CFLAGS_COMPILE = [
     "-DSCUDO_DEFAULT_OPTIONS=DeleteSizeMismatch=0:DeallocationTypeMismatch=0"
@@ -24,24 +24,24 @@ stdenv.mkDerivation rec {
     "-DCOMPILER_RT_DEFAULT_TARGET_ONLY=ON"
     "-DCMAKE_C_COMPILER_TARGET=${stdenv.hostPlatform.config}"
     "-DCMAKE_ASM_COMPILER_TARGET=${stdenv.hostPlatform.config}"
-  ] ++ stdenv.lib.optionals (useLLVM || bareMetal || isMusl) [
+  ] ++ lib.optionals (useLLVM || bareMetal || isMusl) [
     "-DCOMPILER_RT_BUILD_SANITIZERS=OFF"
     "-DCOMPILER_RT_BUILD_XRAY=OFF"
     "-DCOMPILER_RT_BUILD_LIBFUZZER=OFF"
     "-DCOMPILER_RT_BUILD_PROFILE=OFF"
-  ] ++ stdenv.lib.optionals (useLLVM || bareMetal) [
+  ] ++ lib.optionals (useLLVM || bareMetal) [
     "-DCMAKE_C_COMPILER_WORKS=ON"
     "-DCMAKE_CXX_COMPILER_WORKS=ON"
     "-DCOMPILER_RT_BAREMETAL_BUILD=ON"
     "-DCMAKE_SIZEOF_VOID_P=${toString (stdenv.hostPlatform.parsed.cpu.bits / 8)}"
-  ] ++ stdenv.lib.optionals (useLLVM) [
+  ] ++ lib.optionals (useLLVM) [
     "-DCOMPILER_RT_BUILD_BUILTINS=ON"
     "-DCMAKE_C_FLAGS=-nodefaultlibs"
     #https://stackoverflow.com/questions/53633705/cmake-the-c-compiler-is-not-able-to-compile-a-simple-test-program
     "-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY"
-  ] ++ stdenv.lib.optionals (bareMetal) [
+  ] ++ lib.optionals (bareMetal) [
     "-DCOMPILER_RT_OS_DIR=baremetal"
-  ] ++ stdenv.lib.optionals (stdenv.hostPlatform.isDarwin) [
+  ] ++ lib.optionals (stdenv.hostPlatform.isDarwin) [
     # The compiler-rt build infrastructure sniffs supported platforms on Darwin
     # and finds i386;x86_64;x86_64h. We only build for x86_64, so linking fails
     # when it tries to use libc++ and libc++api for i386.
@@ -53,21 +53,21 @@ stdenv.mkDerivation rec {
   patches = [
     ../7/compiler-rt-glibc.patch
     ./compiler-rt-codesign.patch # Revert compiler-rt commit that makes codesign mandatory
-  ]# ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
-    ++ stdenv.lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch;
+  ]# ++ lib.optional stdenv.hostPlatform.isMusl ./sanitizers-nongnu.patch
+    ++ lib.optional stdenv.hostPlatform.isAarch32 ./compiler-rt-armv7l.patch;
 
   # TSAN requires XPC on Darwin, which we have no public/free source files for. We can depend on the Apple frameworks
   # to get it, but they're unfree. Since LLVM is rather central to the stdenv, we patch out TSAN support so that Hydra
   # can build this. If we didn't do it, basically the entire nixpkgs on Darwin would have an unfree dependency and we'd
   # get no binary cache for the entire platform. If you really find yourself wanting the TSAN, make this controllable by
   # a flag and turn the flag off during the stdenv build.
-  postPatch = stdenv.lib.optionalString (!stdenv.isDarwin) ''
+  postPatch = lib.optionalString (!stdenv.isDarwin) ''
     substituteInPlace cmake/builtin-config-ix.cmake \
       --replace 'set(X86 i386)' 'set(X86 i386 i486 i586 i686)'
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     substituteInPlace cmake/config-ix.cmake \
       --replace 'set(COMPILER_RT_HAS_TSAN TRUE)' 'set(COMPILER_RT_HAS_TSAN FALSE)'
-  '' + stdenv.lib.optionalString (useLLVM) ''
+  '' + lib.optionalString (useLLVM) ''
     substituteInPlace lib/builtins/int_util.c \
       --replace "#include <stdlib.h>" ""
     substituteInPlace lib/builtins/clear_cache.c \
@@ -77,14 +77,12 @@ stdenv.mkDerivation rec {
   '';
 
   # Hack around weird upsream RPATH bug
-  postInstall = stdenv.lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) ''
+  postInstall = lib.optionalString (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isWasm) ''
     ln -s "$out/lib"/*/* "$out/lib"
-  '' + stdenv.lib.optionalString (useLLVM) ''
+  '' + lib.optionalString (useLLVM) ''
     ln -s $out/lib/*/clang_rt.crtbegin-*.o $out/lib/crtbegin.o
     ln -s $out/lib/*/clang_rt.crtend-*.o $out/lib/crtend.o
     ln -s $out/lib/*/clang_rt.crtbegin_shared-*.o $out/lib/crtbeginS.o
     ln -s $out/lib/*/clang_rt.crtend_shared-*.o $out/lib/crtendS.o
   '';
-
-  enableParallelBuilding = true;
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/9/default.nix b/nixpkgs/pkgs/development/compilers/llvm/9/default.nix
index 6f5bdb8e8cc1..dfb4981a5b75 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/9/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/9/default.nix
@@ -1,4 +1,4 @@
-{ lowPrio, newScope, pkgs, stdenv, cmake, gccForLibs
+{ lowPrio, newScope, pkgs, lib, stdenv, cmake, gccForLibs
 , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith
 , buildPackages
 , buildLlvmTools # tools, but from the previous stage, for cross
@@ -17,7 +17,7 @@ let
 
   clang-tools-extra_src = fetch "clang-tools-extra" "01vgzd4k1q93nfs8gyl83mjlc4x0qsgfqw32lacbjzdxg0mdfvxj";
 
-  tools = stdenv.lib.makeExtensible (tools: let
+  tools = lib.makeExtensible (tools: let
     callPackage = newScope (tools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
     mkExtraBuildCommands = cc: ''
       rsrc="$out/resource-root"
@@ -25,8 +25,6 @@ let
       ln -s "${cc}/lib/clang/${release_version}/include" "$rsrc"
       ln -s "${targetLlvmLibraries.compiler-rt.out}/lib" "$rsrc/lib"
       echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
-    '' + stdenv.lib.optionalString (stdenv.targetPlatform.isLinux && !(stdenv.targetPlatform.useLLVM or false)) ''
-      echo "--gcc-toolchain=${gccForLibs}" >> $out/nix-support/cc-cflags
     '';
   in {
 
@@ -100,15 +98,15 @@ let
       extraPackages = [
         targetLlvmLibraries.libcxxabi
         targetLlvmLibraries.compiler-rt
-      ] ++ stdenv.lib.optionals (!stdenv.targetPlatform.isWasm) [
+      ] ++ lib.optionals (!stdenv.targetPlatform.isWasm) [
         targetLlvmLibraries.libunwind
       ];
       extraBuildCommands = ''
         echo "-rtlib=compiler-rt -Wno-unused-command-line-argument" >> $out/nix-support/cc-cflags
         echo "-B${targetLlvmLibraries.compiler-rt}/lib" >> $out/nix-support/cc-cflags
-      '' + stdenv.lib.optionalString (!stdenv.targetPlatform.isWasm) ''
+      '' + lib.optionalString (!stdenv.targetPlatform.isWasm) ''
         echo "--unwindlib=libunwind" >> $out/nix-support/cc-cflags
-      '' + stdenv.lib.optionalString stdenv.targetPlatform.isWasm ''
+      '' + lib.optionalString stdenv.targetPlatform.isWasm ''
         echo "-fno-exceptions" >> $out/nix-support/cc-cflags
       '' + mkExtraBuildCommands cc;
     };
@@ -160,12 +158,12 @@ let
 
   });
 
-  libraries = stdenv.lib.makeExtensible (libraries: let
+  libraries = lib.makeExtensible (libraries: let
     callPackage = newScope (libraries // buildLlvmTools // { inherit stdenv cmake libxml2 python3 isl release_version version fetch; });
   in {
 
     compiler-rt = callPackage ./compiler-rt.nix ({} //
-      (stdenv.lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
+      (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoCompilerRt;
       }));
 
@@ -174,12 +172,12 @@ let
     libcxxStdenv = overrideCC stdenv buildLlvmTools.libcxxClang;
 
     libcxx = callPackage ./libc++ ({} //
-      (stdenv.lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
+      (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
       }));
 
     libcxxabi = callPackage ./libc++abi.nix ({} //
-      (stdenv.lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
+      (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
         libunwind = libraries.libunwind;
       }));
@@ -187,7 +185,7 @@ let
     openmp = callPackage ./openmp.nix {};
 
     libunwind = callPackage ./libunwind.nix ({} //
-      (stdenv.lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
+      (lib.optionalAttrs (stdenv.hostPlatform.useLLVM or false) {
         stdenv = overrideCC stdenv buildLlvmTools.lldClangNoLibcxx;
       }));
 
diff --git a/nixpkgs/pkgs/development/compilers/llvm/9/libc++/default.nix b/nixpkgs/pkgs/development/compilers/llvm/9/libc++/default.nix
index f5c3d21e7f1a..6ea1e28e7b4b 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/9/libc++/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/9/libc++/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
     export LIBCXXABI_INCLUDE_DIR="$PWD/$(ls -d libcxxabi-${version}*)/include"
   '';
 
-  patches = stdenv.lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch;
+  patches = lib.optional stdenv.hostPlatform.isMusl ../../libcxx-0001-musl-hacks.patch;
 
   preConfigure = ''
     # Get headers from the cxxabi source so we can see private headers not installed by the cxxabi package
@@ -22,8 +22,8 @@ stdenv.mkDerivation {
     patchShebangs utils/cat_files.py
   '';
   nativeBuildInputs = [ cmake ]
-    ++ stdenv.lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) python3
-    ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+    ++ lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) python3
+    ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
 
   buildInputs = [ libcxxabi ];
 
@@ -31,15 +31,13 @@ stdenv.mkDerivation {
     "-DLIBCXX_LIBCXXABI_LIB_PATH=${libcxxabi}/lib"
     "-DLIBCXX_LIBCPPABI_VERSION=2"
     "-DLIBCXX_CXX_ABI=libcxxabi"
-  ] ++ stdenv.lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) "-DLIBCXX_HAS_MUSL_LIBC=1"
-    ++ stdenv.lib.optional (stdenv.hostPlatform.useLLVM or false) "-DLIBCXX_USE_COMPILER_RT=ON"
-    ++ stdenv.lib.optional stdenv.hostPlatform.isWasm [
+  ] ++ lib.optional (stdenv.hostPlatform.isMusl || stdenv.hostPlatform.isWasi) "-DLIBCXX_HAS_MUSL_LIBC=1"
+    ++ lib.optional (stdenv.hostPlatform.useLLVM or false) "-DLIBCXX_USE_COMPILER_RT=ON"
+    ++ lib.optional stdenv.hostPlatform.isWasm [
       "-DLIBCXX_ENABLE_THREADS=OFF"
       "-DLIBCXX_ENABLE_FILESYSTEM=OFF"
       "-DLIBCXX_ENABLE_EXCEPTIONS=OFF"
-    ] ++ stdenv.lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF";
-
-  enableParallelBuilding = true;
+    ] ++ lib.optional (!enableShared) "-DLIBCXX_ENABLE_SHARED=OFF";
 
   passthru = {
     isLLVM = true;
@@ -48,7 +46,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = "https://libcxx.llvm.org/";
     description = "A new implementation of the C++ standard library, targeting C++11";
-    license = with stdenv.lib.licenses; [ ncsa mit ];
-    platforms = stdenv.lib.platforms.all;
+    license = with lib.licenses; [ ncsa mit ];
+    platforms = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/9/libc++abi.nix b/nixpkgs/pkgs/development/compilers/llvm/9/libc++abi.nix
index 13f033091be2..e8e08f848011 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/9/libc++abi.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/9/libc++abi.nix
@@ -1,4 +1,4 @@
-{ stdenv, cmake, fetch, libcxx, libunwind, llvm, version
+{ lib, stdenv, cmake, fetch, libcxx, libunwind, llvm, version
 , enableShared ? !stdenv.hostPlatform.isStatic
 }:
 
@@ -9,15 +9,15 @@ stdenv.mkDerivation {
   src = fetch "libcxxabi" "1b4aiaa8cirx52vk2p5kfk57qmbqf1ipb4nqnjhdgqps9jm7iyg8";
 
   nativeBuildInputs = [ cmake ];
-  buildInputs = stdenv.lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind;
+  buildInputs = lib.optional (!stdenv.isDarwin && !stdenv.isFreeBSD && !stdenv.hostPlatform.isWasm) libunwind;
 
-  cmakeFlags = stdenv.lib.optionals (stdenv.hostPlatform.useLLVM or false) [
+  cmakeFlags = lib.optionals (stdenv.hostPlatform.useLLVM or false) [
     "-DLLVM_ENABLE_LIBCXX=ON"
     "-DLIBCXXABI_USE_LLVM_UNWINDER=ON"
-  ] ++ stdenv.lib.optionals stdenv.hostPlatform.isWasm [
+  ] ++ lib.optionals stdenv.hostPlatform.isWasm [
     "-DLIBCXXABI_ENABLE_THREADS=OFF"
     "-DLIBCXXABI_ENABLE_EXCEPTIONS=OFF"
-  ] ++ stdenv.lib.optionals (!enableShared) [
+  ] ++ lib.optionals (!enableShared) [
     "-DLIBCXXABI_ENABLE_SHARED=OFF"
   ];
 
@@ -27,11 +27,11 @@ stdenv.mkDerivation {
     unpackFile ${libcxx.src}
     unpackFile ${llvm.src}
     cmakeFlags+=" -DLLVM_PATH=$PWD/$(ls -d llvm-*) -DLIBCXXABI_LIBCXX_PATH=$PWD/$(ls -d libcxx-*)"
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     export TRIPLE=x86_64-apple-darwin
-  '' + stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+  '' + lib.optionalString stdenv.hostPlatform.isMusl ''
     patch -p1 -d $(ls -d libcxx-*) -i ${../libcxx-0001-musl-hacks.patch}
-  '' + stdenv.lib.optionalString stdenv.hostPlatform.isWasm ''
+  '' + lib.optionalString stdenv.hostPlatform.isWasm ''
     patch -p1 -d $(ls -d llvm-*) -i ${./libcxxabi-wasm.patch}
   '';
 
@@ -52,7 +52,7 @@ stdenv.mkDerivation {
       install -d -m 755 $out/include $out/lib
       install -m 644 lib/libc++abi.a $out/lib
       install -m 644 ../include/cxxabi.h $out/include
-    '' + stdenv.lib.optionalString enableShared ''
+    '' + lib.optionalString enableShared ''
       install -m 644 lib/libc++abi.so.1.0 $out/lib
       ln -s libc++abi.so.1.0 $out/lib/libc++abi.so
       ln -s libc++abi.so.1.0 $out/lib/libc++abi.so.1
@@ -61,8 +61,8 @@ stdenv.mkDerivation {
   meta = {
     homepage = "https://libcxxabi.llvm.org/";
     description = "A new implementation of low level support for a standard C++ library";
-    license = with stdenv.lib.licenses; [ ncsa mit ];
-    maintainers = with stdenv.lib.maintainers; [ vlstill ];
-    platforms = stdenv.lib.platforms.all;
+    license = with lib.licenses; [ ncsa mit ];
+    maintainers = with lib.maintainers; [ vlstill ];
+    platforms = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/9/libunwind.nix b/nixpkgs/pkgs/development/compilers/llvm/9/libunwind.nix
index 98df98838f13..4c4c85512e3d 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/9/libunwind.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/9/libunwind.nix
@@ -1,4 +1,4 @@
-{ stdenv, version, fetch, cmake, fetchpatch
+{ lib, stdenv, version, fetch, cmake, fetchpatch
 , enableShared ? !stdenv.hostPlatform.isStatic
 }:
 
@@ -10,7 +10,5 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  enableParallelBuilding = true;
-
-  cmakeFlags = stdenv.lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF";
+  cmakeFlags = lib.optional (!enableShared) "-DLIBUNWIND_ENABLE_SHARED=OFF";
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/9/lld.nix b/nixpkgs/pkgs/development/compilers/llvm/9/lld.nix
index 488870e729a5..8b12642d2a70 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/9/lld.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/9/lld.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetch
 , cmake
 , libxml2
@@ -17,8 +17,6 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" ];
 
-  enableParallelBuilding = true;
-
   postInstall = ''
     moveToOutput include "$dev"
     moveToOutput lib "$dev"
@@ -27,7 +25,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "The LLVM Linker";
     homepage    = "https://lld.llvm.org/";
-    license     = stdenv.lib.licenses.ncsa;
-    platforms   = stdenv.lib.platforms.all;
+    license     = lib.licenses.ncsa;
+    platforms   = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/9/lldb.nix b/nixpkgs/pkgs/development/compilers/llvm/9/lldb.nix
index a8e193c27b17..8da5c0bef68a 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/9/lldb.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/9/lldb.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetch
 , cmake
 , zlib
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
     libxml2
     llvm
   ]
-  ++ stdenv.lib.optionals stdenv.isDarwin [
+  ++ lib.optionals stdenv.isDarwin [
     darwin.libobjc
     darwin.apple_sdk.libs.xpc
     darwin.apple_sdk.frameworks.Foundation
@@ -49,8 +49,6 @@ stdenv.mkDerivation rec {
     "-DLLVM_EXTERNAL_LIT=${lit}/bin/lit"
   ];
 
-  enableParallelBuilding = true;
-
   postInstall = ''
     # man page
     mkdir -p $out/share/man/man1
@@ -63,7 +61,7 @@ stdenv.mkDerivation rec {
     ln -s $out/bin/lldb-vscode $out/share/vscode/extensions/llvm-org.lldb-vscode-0.1.0/bin
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A next-generation high-performance debugger";
     homepage = "https://llvm.org/";
     license = licenses.ncsa;
diff --git a/nixpkgs/pkgs/development/compilers/llvm/9/llvm.nix b/nixpkgs/pkgs/development/compilers/llvm/9/llvm.nix
index 013e5bb36b94..207dc242b91e 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/9/llvm.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/9/llvm.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetch
 , cmake
 , python3
@@ -22,10 +22,10 @@
 }:
 
 let
-  inherit (stdenv.lib) optional optionals optionalString;
+  inherit (lib) optional optionals optionalString;
 
   # Used when creating a version-suffixed symlink of libLLVM.dylib
-  shortVersion = with stdenv.lib;
+  shortVersion = with lib;
     concatStringsSep "." (take 1 (splitString "." release_version));
 
 in stdenv.mkDerivation (rec {
@@ -159,17 +159,15 @@ in stdenv.mkDerivation (rec {
 
   checkTarget = "check-all";
 
-  enableParallelBuilding = true;
-
   requiredSystemFeatures = [ "big-parallel" ];
   meta = {
     description = "Collection of modular and reusable compiler and toolchain technologies";
     homepage    = "https://llvm.org/";
-    license     = stdenv.lib.licenses.ncsa;
-    maintainers = with stdenv.lib.maintainers; [ lovek323 raskin dtzWill ];
-    platforms   = stdenv.lib.platforms.all;
+    license     = lib.licenses.ncsa;
+    maintainers = with lib.maintainers; [ lovek323 raskin dtzWill ];
+    platforms   = lib.platforms.all;
   };
-} // stdenv.lib.optionalAttrs enableManpages {
+} // lib.optionalAttrs enableManpages {
   pname = "llvm-manpages";
 
   buildPhase = ''
diff --git a/nixpkgs/pkgs/development/compilers/llvm/9/openmp.nix b/nixpkgs/pkgs/development/compilers/llvm/9/openmp.nix
index 84f898ec06a1..416916f57ff2 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/9/openmp.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/9/openmp.nix
@@ -1,4 +1,5 @@
-{ stdenv
+{ lib
+, stdenv
 , fetch
 , cmake
 , llvm
@@ -15,12 +16,10 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake perl ];
   buildInputs = [ llvm ];
 
-  enableParallelBuilding = true;
-
   meta = {
     description = "Components required to build an executable OpenMP program";
     homepage    = "https://openmp.llvm.org/";
-    license     = stdenv.lib.licenses.mit;
-    platforms   = stdenv.lib.platforms.all;
+    license     = lib.licenses.mit;
+    platforms   = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/llvm/multi.nix b/nixpkgs/pkgs/development/compilers/llvm/multi.nix
index b4f2f8f9d6f6..60db622a73ab 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/multi.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/multi.nix
@@ -13,7 +13,12 @@ let
     chmod u+rw -R $out/lib
     cp -r ${basegcc.libc}/lib/* $(ls -d $out/lib/gcc/*/*)
   '';
-  gcc_multi_sysroot = runCommand "gcc-multi-sysroot" {} ''
+  gcc_multi_sysroot = runCommand "gcc-multi-sysroot" {
+    passthru = {
+      inherit (gcc64) version;
+      lib = gcc_multi_sysroot;
+    };
+  } ''
     mkdir -p $out/lib/gcc
 
     ln -s ${combine gcc64}/lib/gcc/* $out/lib/gcc/
@@ -32,17 +37,16 @@ let
   '';
 
   clangMulti = clang.override {
-    # Only used for providing expected structure re:dynamic linkers, AFAIK
-    # Most of the magic is done by setting the --gcc-toolchain option below
+    # Only used for providing expected structure re:dynamic linkers, AFAIK Most
+    # of the magic is done by setting the --gcc-toolchain option via
+    # `gccForLibs`.
     libc = gcc_multi_sysroot;
 
     bintools = clang.bintools.override {
       libc = gcc_multi_sysroot;
     };
 
-    extraBuildCommands = ''
-      sed -e '$a --gcc-toolchain=${gcc_multi_sysroot}' -i $out/nix-support/libc-cflags
-    '';
+    gccForLibs = gcc_multi_sysroot;
   };
 
 in clangMulti
diff --git a/nixpkgs/pkgs/development/compilers/llvm/rocm/clang.nix b/nixpkgs/pkgs/development/compilers/llvm/rocm/clang.nix
index 6bb23b77543a..789d4c055eb0 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/rocm/clang.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/rocm/clang.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 , python
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
     #undef CLANG_REPOSITORY
   '';
 
-  postUnpack = stdenv.lib.optionalString (!(isNull clang-tools-extra_src)) ''
+  postUnpack = lib.optionalString (!(isNull clang-tools-extra_src)) ''
     ln -s ${clang-tools-extra_src} $sourceRoot/tools/extra
   '';
 
@@ -56,7 +56,7 @@ stdenv.mkDerivation rec {
     echo "$VCSVersion" > lib/Basic/VCSVersion.inc
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "ROCm fork of the clang C/C++/Objective-C/Objective-C++ LLVM compiler frontend";
     homepage = "https://llvm.org/";
     license = with licenses; [ ncsa ];
diff --git a/nixpkgs/pkgs/development/compilers/llvm/rocm/default.nix b/nixpkgs/pkgs/development/compilers/llvm/rocm/default.nix
index 36b42cef3926..94b6ee71032a 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/rocm/default.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/rocm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, callPackage, wrapCCWith }:
+{ lib, stdenv, fetchFromGitHub, callPackage, wrapCCWith }:
 
 let
   version = "4.0.0";
@@ -17,7 +17,6 @@ in rec {
       mkdir "$rsrc"
       ln -s "${cc}/lib/clang/$clang_version/include" "$rsrc"
       echo "-resource-dir=$rsrc" >> $out/nix-support/cc-cflags
-      echo "--gcc-toolchain=${stdenv.cc.cc}" >> $out/nix-support/cc-cflags
       echo "-Wno-unused-command-line-argument" >> $out/nix-support/cc-cflags
       rm $out/nix-support/add-hardening.sh
       touch $out/nix-support/add-hardening.sh
diff --git a/nixpkgs/pkgs/development/compilers/llvm/rocm/lld.nix b/nixpkgs/pkgs/development/compilers/llvm/rocm/lld.nix
index 34a094bf379c..2a05331f7a0f 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/rocm/lld.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/rocm/lld.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , cmake
 , libxml2
 , llvm
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
       --replace "\''${_IMPORT_PREFIX}/bin/lld" "$out/bin/lld"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "ROCm fork of the LLVM Linker";
     homepage = "https://github.com/RadeonOpenCompute/llvm-project";
     license = licenses.ncsa;
diff --git a/nixpkgs/pkgs/development/compilers/llvm/rocm/llvm.nix b/nixpkgs/pkgs/development/compilers/llvm/rocm/llvm.nix
index 909284a3e919..d6fe211c4756 100644
--- a/nixpkgs/pkgs/development/compilers/llvm/rocm/llvm.nix
+++ b/nixpkgs/pkgs/development/compilers/llvm/rocm/llvm.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 , python3
@@ -26,7 +26,7 @@ in stdenv.mkDerivation rec {
   pname = "rocm-llvm";
 
   outputs = [ "out" "python" ]
-    ++ stdenv.lib.optional enableSharedLibraries "lib";
+    ++ lib.optional enableSharedLibraries "lib";
 
   nativeBuildInputs = [ cmake python3 ];
 
@@ -44,10 +44,10 @@ in stdenv.mkDerivation rec {
     "-DLLVM_TARGETS_TO_BUILD=AMDGPU;${llvmNativeTarget}"
   ]
   ++
-  stdenv.lib.optional
+  lib.optional
     enableSharedLibraries
     "-DLLVM_LINK_LLVM_DYLIB=ON"
-  ++ stdenv.lib.optionals enableManpages [
+  ++ lib.optionals enableManpages [
     "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include"
     "-DLLVM_BUILD_DOCS=ON"
     "-DLLVM_ENABLE_SPHINX=ON"
@@ -78,7 +78,7 @@ in stdenv.mkDerivation rec {
   postInstall = ''
     moveToOutput share/opt-viewer "$python"
   ''
-  + stdenv.lib.optionalString enableSharedLibraries ''
+  + lib.optionalString enableSharedLibraries ''
     moveToOutput "lib/libLLVM-*" "$lib"
     moveToOutput "lib/libLLVM${stdenv.hostPlatform.extensions.sharedLibrary}" "$lib"
     substituteInPlace "$out/lib/cmake/llvm/LLVMExports-${if debugVersion then "debug" else "release"}.cmake" \
@@ -87,7 +87,7 @@ in stdenv.mkDerivation rec {
 
   passthru.src = src;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "ROCm fork of the LLVM compiler infrastructure";
     homepage = "https://github.com/RadeonOpenCompute/llvm-project";
     license = with licenses; [ ncsa ];
diff --git a/nixpkgs/pkgs/development/compilers/lobster/default.nix b/nixpkgs/pkgs/development/compilers/lobster/default.nix
index b87bec7ea2d9..b65d640b4751 100644
--- a/nixpkgs/pkgs/development/compilers/lobster/default.nix
+++ b/nixpkgs/pkgs/development/compilers/lobster/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , unstableGitUpdater
 , cmake
@@ -45,14 +45,13 @@ stdenv.mkDerivation rec {
     ];
 
   preConfigure = "cd dev";
-  enableParallelBuilding = true;
 
   passthru = {
     tests.can-run-hello-world = callPackage ./test-can-run-hello-world.nix {};
     updateScript = unstableGitUpdater { };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://strlen.com/lobster";
     description = "The Lobster programming language";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/compilers/manticore/default.nix b/nixpkgs/pkgs/development/compilers/manticore/default.nix
index 8d2ad8e6bbc5..1919f9998058 100644
--- a/nixpkgs/pkgs/development/compilers/manticore/default.nix
+++ b/nixpkgs/pkgs/development/compilers/manticore/default.nix
@@ -5,7 +5,7 @@ let
 in stdenv.mkDerivation {
   pname = "manticore";
   version = "2019.12.03";
- 
+
   src = fetchFromGitHub {
     owner = "ManticoreProject";
     repo = "manticore";
@@ -14,9 +14,9 @@ in stdenv.mkDerivation {
   };
 
   enableParallelBuilding = false;
- 
+
   nativeBuildInputs = [ autoreconfHook ];
-  
+
   buildInputs = [ coreutils smlnj ];
 
   autoreconfFlags = "-Iconfig -vfi";
@@ -28,8 +28,8 @@ in stdenv.mkDerivation {
     mv source repo_checkout
     cd repo_checkout
     chmod u+w . -R
-  ''; 
-  
+  '';
+
   postPatch = ''
     patchShebangs .
     substituteInPlace configure.ac --replace 'MANTICORE_ROOT=`pwd`' 'MANTICORE_ROOT=$out/repo_checkout'
@@ -40,14 +40,14 @@ in stdenv.mkDerivation {
   meta = {
     description = "A parallel, pure variant of Standard ML";
 
-    longDescription = '' 
+    longDescription = ''
       Manticore is a high-level parallel programming language aimed at
       general-purpose applications running on multi-core
       processors. Manticore supports parallelism at multiple levels:
       explicit concurrency and coarse-grain parallelism via CML-style
       constructs and fine-grain parallelism via various light-weight
       notations, such as parallel tuple expressions and NESL/Nepal-style
-      parallel array comprehensions.  
+      parallel array comprehensions.
     '';
 
     homepage = "http://manticore.cs.uchicago.edu/";
diff --git a/nixpkgs/pkgs/development/compilers/matter-compiler/gemset.nix b/nixpkgs/pkgs/development/compilers/matter-compiler/gemset.nix
index 014fc226607a..2ef9e911b824 100644
--- a/nixpkgs/pkgs/development/compilers/matter-compiler/gemset.nix
+++ b/nixpkgs/pkgs/development/compilers/matter-compiler/gemset.nix
@@ -9,4 +9,4 @@
     };
     version = "0.5.1";
   };
-}
\ No newline at end of file
+}
diff --git a/nixpkgs/pkgs/development/compilers/mcpp/default.nix b/nixpkgs/pkgs/development/compilers/mcpp/default.nix
index 023bae48b3e9..efb5972e5421 100644
--- a/nixpkgs/pkgs/development/compilers/mcpp/default.nix
+++ b/nixpkgs/pkgs/development/compilers/mcpp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch }:
+{ lib, stdenv, fetchurl, fetchpatch }:
 
 stdenv.mkDerivation rec {
   pname = "mcpp";
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://mcpp.sourceforge.net/";
     description = "A portable c preprocessor";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/compilers/mercury/default.nix b/nixpkgs/pkgs/development/compilers/mercury/default.nix
index d7029733381d..e063c4c09217 100644
--- a/nixpkgs/pkgs/development/compilers/mercury/default.nix
+++ b/nixpkgs/pkgs/development/compilers/mercury/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gcc, flex, bison, texinfo, jdk, erlang, makeWrapper
+{ lib, stdenv, fetchurl, gcc, flex, bison, texinfo, jdk, erlang, makeWrapper
 , readline }:
 
 stdenv.mkDerivation rec {
@@ -55,8 +55,8 @@ stdenv.mkDerivation rec {
       trade-offs.
     '';
     homepage    = "http://mercurylang.org";
-    license     = stdenv.lib.licenses.gpl2;
-    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+    license     = lib.licenses.gpl2;
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
     maintainers = [ ];
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/meta-environment/meta-build-env/default.nix b/nixpkgs/pkgs/development/compilers/meta-environment/meta-build-env/default.nix
index a5c7054c3a61..34d8f98970e0 100644
--- a/nixpkgs/pkgs/development/compilers/meta-environment/meta-build-env/default.nix
+++ b/nixpkgs/pkgs/development/compilers/meta-environment/meta-build-env/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}: stdenv.mkDerivation {
+{lib, stdenv, fetchurl}: stdenv.mkDerivation {
   name = "meta-build-env-0.1";
   src = fetchurl {
     url = "http://www.meta-environment.org/releases/meta-build-env-0.1.tar.gz";
@@ -6,6 +6,6 @@
   };
 
   meta = {
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/mezzo/default.nix b/nixpkgs/pkgs/development/compilers/mezzo/default.nix
index a90076c9eccd..4c535be4d494 100644
--- a/nixpkgs/pkgs/development/compilers/mezzo/default.nix
+++ b/nixpkgs/pkgs/development/compilers/mezzo/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, menhir, yojson, ulex, pprint, fix, functory }:
+{ lib, stdenv, fetchFromGitHub, ocaml, findlib, ocamlbuild, menhir, yojson, ulex, pprint, fix, functory }:
 
-if stdenv.lib.versionAtLeast ocaml.version "4.06"
+if lib.versionAtLeast ocaml.version "4.06"
 then throw "mezzo is not available for OCaml ${ocaml.version}"
 else
 
 let
-  check-ocaml-version = with stdenv.lib; versionAtLeast (getVersion ocaml);
+  check-ocaml-version = with lib; versionAtLeast (getVersion ocaml);
 in
 
 assert check-ocaml-version "4";
@@ -24,7 +24,7 @@ stdenv.mkDerivation {
   buildInputs = [ ocaml findlib ocamlbuild yojson menhir ulex pprint fix functory ];
 
   # Sets warning 3 as non-fatal
-  prePatch = stdenv.lib.optionalString (check-ocaml-version "4.02") ''
+  prePatch = lib.optionalString (check-ocaml-version "4.02") ''
     substituteInPlace myocamlbuild.pre.ml \
     --replace '@1..3' '@1..2+3'
   '';
@@ -36,7 +36,7 @@ stdenv.mkDerivation {
     cp mezzo $out/bin/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://protz.github.io/mezzo/";
     description = "A programming language in the ML tradition, which places strong emphasis on the control of aliasing and access to mutable memory";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/compilers/microscheme/default.nix b/nixpkgs/pkgs/development/compilers/microscheme/default.nix
index ba3e388c3992..ee2de8518f36 100644
--- a/nixpkgs/pkgs/development/compilers/microscheme/default.nix
+++ b/nixpkgs/pkgs/development/compilers/microscheme/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchzip, vim, makeWrapper }:
+{ lib, stdenv, fetchzip, vim, makeWrapper }:
 
 stdenv.mkDerivation rec {
   pname = "microscheme";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
     make install PREFIX=$out
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://microscheme.org";
     description = "A Scheme subset for Atmel microcontrollers";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/compilers/miranda/default.nix b/nixpkgs/pkgs/development/compilers/miranda/default.nix
index 55d3976858b7..298cb5e21ead 100644
--- a/nixpkgs/pkgs/development/compilers/miranda/default.nix
+++ b/nixpkgs/pkgs/development/compilers/miranda/default.nix
@@ -64,7 +64,7 @@ stdenv.mkDerivation rec {
     patchShebangs quotehostinfo
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Compiler for Miranda -- a pure, non-strict, polymorphic, higher order functional programming language";
     homepage = "https://www.cs.kent.ac.uk/people/staff/dat/miranda/";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/compilers/mit-scheme/default.nix b/nixpkgs/pkgs/development/compilers/mit-scheme/default.nix
index a3b320c384f4..8cf709c10aea 100644
--- a/nixpkgs/pkgs/development/compilers/mit-scheme/default.nix
+++ b/nixpkgs/pkgs/development/compilers/mit-scheme/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, makeWrapper, gnum4, texinfo, texLive, automake,
+{ fetchurl, lib, stdenv, makeWrapper, gnum4, texinfo, texLive, automake,
   enableX11 ? false, xlibsWrapper ? null }:
 
 let
@@ -63,7 +63,7 @@ stdenv.mkDerivation {
   # XXX: The `check' target doesn't exist.
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "MIT/GNU Scheme, a native code Scheme compiler";
 
     longDescription =
diff --git a/nixpkgs/pkgs/development/compilers/mkcl/default.nix b/nixpkgs/pkgs/development/compilers/mkcl/default.nix
index baaf978d2984..3656f1e0dd82 100644
--- a/nixpkgs/pkgs/development/compilers/mkcl/default.nix
+++ b/nixpkgs/pkgs/development/compilers/mkcl/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchFromGitHub, makeWrapper, gmp, gcc }:
+{ lib, stdenv, fetchFromGitHub, makeWrapper, gmp, gcc }:
 
-with stdenv.lib; stdenv.mkDerivation rec {
+with lib; stdenv.mkDerivation rec {
   pname = "mkcl";
   version = "1.1.11";
 
diff --git a/nixpkgs/pkgs/development/compilers/mlkit/default.nix b/nixpkgs/pkgs/development/compilers/mlkit/default.nix
index 45cb09d5a2a1..5fc134f5ab26 100644
--- a/nixpkgs/pkgs/development/compilers/mlkit/default.nix
+++ b/nixpkgs/pkgs/development/compilers/mlkit/default.nix
@@ -1,21 +1,21 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, mlton }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, mlton }:
 
 stdenv.mkDerivation rec {
   pname = "mlkit";
-  version = "4.5.2";
+  version = "4.5.6";
 
   src = fetchFromGitHub {
     owner = "melsman";
     repo = "mlkit";
     rev = "v${version}";
-    sha256 = "1yk7phxnwkm94qs1gbxsr6sr11a0sgpcyjymmqwf0fsl5njgyb98";
+    sha256 = "sha256-aa6dRcGTXGakJsHCvHXRKs5BHtIZi6V2r8348epzpVc=";
   };
 
   nativeBuildInputs = [ autoreconfHook mlton ];
 
   buildFlags = ["mlkit" "mlkit_libs"];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Standard ML Compiler and Toolkit";
     homepage = "https://elsman.com/mlkit/";
     license = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/compilers/mlton/20130715.nix b/nixpkgs/pkgs/development/compilers/mlton/20130715.nix
index 52bb0a0775cf..98b4aeda5516 100644
--- a/nixpkgs/pkgs/development/compilers/mlton/20130715.nix
+++ b/nixpkgs/pkgs/development/compilers/mlton/20130715.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, patchelf, gmp }:
+{ lib, stdenv, fetchurl, patchelf, gmp }:
 
 let
   version = "20130715";
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
   sourceRoot = "${pname}-${version}";
 
   buildInputs = [ gmp ];
-  nativeBuildInputs = stdenv.lib.optional stdenv.isLinux patchelf;
+  nativeBuildInputs = lib.optional stdenv.isLinux patchelf;
 
   makeFlags = [ "all-no-docs" ];
 
@@ -61,9 +61,9 @@ stdenv.mkDerivation rec {
     done
 
     substituteInPlace $(pwd)/../${usr_prefix}/bin/mlton --replace '/${usr_prefix}/lib/mlton' $(pwd)/../${usr_prefix}/lib/mlton
-  '' + stdenv.lib.optionalString stdenv.cc.isClang ''
+  '' + lib.optionalString stdenv.cc.isClang ''
     sed -i "s_	patch -s -p0 <gdtoa.hide-public-fns.patch_	patch -s -p0 <gdtoa.hide-public-fns.patch\n\tsed -i 's|printf(emptyfmt|printf(\"\"|g' ./gdtoa/arithchk.c_" ./runtime/Makefile
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     sed -i 's|XCFLAGS += -I/usr/local/include -I/sw/include -I/opt/local/include||' ./runtime/Makefile
   '';
 
@@ -79,13 +79,13 @@ stdenv.mkDerivation rec {
     # So the builder runs the binary compiler with gmp.
     export LD_LIBRARY_PATH=${gmp.out}/lib''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
 
-  '' + stdenv.lib.optionalString stdenv.isLinux ''
+  '' + lib.optionalString stdenv.isLinux ''
     # Patch ELF interpreter.
     patchelf --set-interpreter ${dynamic_linker} $(pwd)/../${usr_prefix}/lib/mlton/mlton-compile
     for e in mllex mlyacc ; do
       patchelf --set-interpreter ${dynamic_linker} $(pwd)/../${usr_prefix}/bin/$e
     done
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     # Patch libgmp linking
     install_name_tool -change /opt/local/lib/libgmp.10.dylib ${gmp}/lib/libgmp.10.dylib $(pwd)/../${usr_prefix}/lib/mlton/mlton-compile
     install_name_tool -change /opt/local/lib/libgmp.10.dylib ${gmp}/lib/libgmp.10.dylib $(pwd)/../${usr_prefix}/bin/mlyacc
diff --git a/nixpkgs/pkgs/development/compilers/mlton/20180207-binary.nix b/nixpkgs/pkgs/development/compilers/mlton/20180207-binary.nix
index 2b4998f91c91..4846b58bf26b 100644
--- a/nixpkgs/pkgs/development/compilers/mlton/20180207-binary.nix
+++ b/nixpkgs/pkgs/development/compilers/mlton/20180207-binary.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, patchelf, gmp }:
+{ lib, stdenv, fetchurl, patchelf, gmp }:
 let
   dynamic-linker = stdenv.cc.bintools.dynamicLinker;
 in
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     throw "Architecture not supported";
 
   buildInputs = [ gmp ];
-  nativeBuildInputs = stdenv.lib.optional stdenv.isLinux patchelf;
+  nativeBuildInputs = lib.optional stdenv.isLinux patchelf;
 
   buildPhase = ''
     make update \
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
     make install PREFIX=$out
   '';
 
-  postFixup = stdenv.lib.optionalString stdenv.isLinux ''
+  postFixup = lib.optionalString stdenv.isLinux ''
     patchelf --set-interpreter ${dynamic-linker} $out/lib/mlton/mlton-compile
     patchelf --set-rpath ${gmp}/lib $out/lib/mlton/mlton-compile
 
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
       patchelf --set-interpreter ${dynamic-linker} $out/bin/$e
       patchelf --set-rpath ${gmp}/lib $out/bin/$e
     done
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     install_name_tool -change \
       /opt/local/lib/libgmp.10.dylib \
       ${gmp}/lib/libgmp.10.dylib \
diff --git a/nixpkgs/pkgs/development/compilers/mono/generic.nix b/nixpkgs/pkgs/development/compilers/mono/generic.nix
index ca3b31478070..901848c693a4 100644
--- a/nixpkgs/pkgs/development/compilers/mono/generic.nix
+++ b/nixpkgs/pkgs/development/compilers/mono/generic.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, bison, pkgconfig, glib, gettext, perl, libgdiplus, libX11, callPackage, ncurses, zlib, withLLVM ? false, cacert, Foundation, libobjc, python3, version, sha256, autoconf, libtool, automake, cmake, which
+{ lib, stdenv, fetchurl, bison, pkg-config, glib, gettext, perl, libgdiplus, libX11, callPackage, ncurses, zlib, withLLVM ? false, cacert, Foundation, libobjc, python3, version, sha256, autoconf, libtool, automake, cmake, which
 , gnumake42
 , enableParallelBuilding ? true
 , srcArchiveSuffix ? "tar.bz2"
@@ -17,18 +17,18 @@ stdenv.mkDerivation rec {
     url = "https://download.mono-project.com/sources/mono/${pname}-${version}.${srcArchiveSuffix}";
   };
 
-  nativeBuildInputs = [ gnumake42 ];
+  nativeBuildInputs = [ automake bison cmake pkg-config which gnumake42 ];
   buildInputs =
-    [ bison pkgconfig glib gettext perl libgdiplus libX11 ncurses zlib python3 autoconf libtool automake cmake which
+    [ glib gettext perl libgdiplus libX11 ncurses zlib python3 autoconf libtool
     ]
-    ++ (stdenv.lib.optionals stdenv.isDarwin [ Foundation libobjc ]);
+    ++ (lib.optionals stdenv.isDarwin [ Foundation libobjc ]);
 
   configureFlags = [
     "--x-includes=${libX11.dev}/include"
     "--x-libraries=${libX11.out}/lib"
     "--with-libgdiplus=${libgdiplus}/lib/libgdiplus.so"
   ]
-  ++ stdenv.lib.optionals withLLVM [
+  ++ lib.optionals withLLVM [
     "--enable-llvm"
     "--with-llvm=${llvm}"
   ];
@@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
   preBuild = ''
     makeFlagsArray=(INSTALL=`type -tp install`)
     substituteInPlace mcs/class/corlib/System/Environment.cs --replace /usr/share "$out/share"
-  '' + stdenv.lib.optionalString withLLVM ''
+  '' + lib.optionalString withLLVM ''
     substituteInPlace mono/mini/aot-compiler.c --replace "llvm_path = g_strdup (\"\")" "llvm_path = g_strdup (\"${llvm}/bin/\")"
   '';
 
@@ -75,7 +75,7 @@ stdenv.mkDerivation rec {
 
   inherit enableParallelBuilding;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://mono-project.com/";
     description = "Cross platform, open source .NET development framework";
     platforms = with platforms; darwin ++ linux;
diff --git a/nixpkgs/pkgs/development/compilers/mono/llvm.nix b/nixpkgs/pkgs/development/compilers/mono/llvm.nix
index d08a4ebef24d..c69a4021677e 100644
--- a/nixpkgs/pkgs/development/compilers/mono/llvm.nix
+++ b/nixpkgs/pkgs/development/compilers/mono/llvm.nix
@@ -24,7 +24,8 @@ stdenv.mkDerivation {
     sha256 = "07wd1cs3fdvzb1lv41b655z5zk34f47j8fgd9ljjimi5j9pj71f7";
   };
 
-  buildInputs = [ perl groff cmake libxml2 python2 libffi ] ++ lib.optional stdenv.isLinux valgrind;
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ perl groff libxml2 python2 libffi ] ++ lib.optional stdenv.isLinux valgrind;
 
   propagatedBuildInputs = [ ncurses zlib ];
 
@@ -38,15 +39,13 @@ stdenv.mkDerivation {
   cmakeFlags = with stdenv; [
     "-DLLVM_ENABLE_FFI=ON"
     "-DLLVM_BINUTILS_INCDIR=${libbfd.dev}/include"
-  ] ++ stdenv.lib.optional (!isDarwin) "-DBUILD_SHARED_LIBS=ON";
-
-  enableParallelBuilding = true;
+  ] ++ lib.optional (!isDarwin) "-DBUILD_SHARED_LIBS=ON";
 
   meta = {
     description = "Collection of modular and reusable compiler and toolchain technologies - Mono build";
     homepage    = "http://llvm.org/";
-    license     = stdenv.lib.licenses.bsd3;
-    maintainers = with stdenv.lib.maintainers; [ thoughtpolice ];
-    platforms   = stdenv.lib.platforms.all;
+    license     = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ thoughtpolice ];
+    platforms   = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/mosml/default.nix b/nixpkgs/pkgs/development/compilers/mosml/default.nix
index 3d94303cbaa5..ec8fa793cfd4 100644
--- a/nixpkgs/pkgs/development/compilers/mosml/default.nix
+++ b/nixpkgs/pkgs/development/compilers/mosml/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gmp, perl }:
+{ lib, stdenv, fetchurl, gmp, perl }:
 
 stdenv.mkDerivation rec {
   pname = "mosml";
@@ -6,7 +6,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ gmp perl ];
 
-  makeFlags = [ "PREFIX=$(out)" ] ++ stdenv.lib.optionals stdenv.isDarwin [ "CC=cc" ];
+  makeFlags = [ "PREFIX=$(out)" ] ++ lib.optionals stdenv.isDarwin [ "CC=cc" ];
 
   src = fetchurl {
     url = "https://github.com/kfl/mosml/archive/ver-${version}.tar.gz";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   setSourceRoot = ''export sourceRoot="$(echo */src)"'';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A light-weight implementation of Standard ML";
     longDescription = ''
       Moscow ML is a light-weight implementation of Standard ML (SML), a strict
diff --git a/nixpkgs/pkgs/development/compilers/mozart/binary.nix b/nixpkgs/pkgs/development/compilers/mozart/binary.nix
index 66d642dbbbd1..8366fd77a47a 100644
--- a/nixpkgs/pkgs/development/compilers/mozart/binary.nix
+++ b/nixpkgs/pkgs/development/compilers/mozart/binary.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper
+{ lib, stdenv, fetchurl, makeWrapper
 , boost, gmp
 , tcl-8_5, tk-8_5
 , emacs
@@ -23,7 +23,7 @@ stdenv.mkDerivation {
 
   src = binaries.${stdenv.hostPlatform.system} or (throw "unsupported system: ${stdenv.hostPlatform.system}");
 
-  libPath = stdenv.lib.makeLibraryPath
+  libPath = lib.makeLibraryPath
     [ stdenv.cc.cc
       boost
       gmp
@@ -51,8 +51,8 @@ stdenv.mkDerivation {
 
     wrapProgram $out/bin/ozemulator --set OZHOME $out
 
-    ${stdenv.lib.optionalString (emacs != null) ''
-      wrapProgram $out/bin/oz --suffix PATH ":" ${stdenv.lib.makeBinPath [ emacs ]}
+    ${lib.optionalString (emacs != null) ''
+      wrapProgram $out/bin/oz --suffix PATH ":" ${lib.makeBinPath [ emacs ]}
     ''}
 
     sed -i $out/share/applications/oz.desktop \
@@ -63,7 +63,7 @@ stdenv.mkDerivation {
     patchShebangs $out
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.mozart-oz.org/";
     description = "Multiplatform implementation of the Oz programming language";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/compilers/mruby/default.nix b/nixpkgs/pkgs/development/compilers/mruby/default.nix
index eee4f2c64eb7..25d35adff944 100644
--- a/nixpkgs/pkgs/development/compilers/mruby/default.nix
+++ b/nixpkgs/pkgs/development/compilers/mruby/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, ruby, bison, rake, fetchFromGitHub }:
+{ lib, stdenv, ruby, bison, rake, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "mruby";
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An embeddable implementation of the Ruby language";
     homepage = "https://mruby.org";
     maintainers = [ maintainers.nicknovitski ];
diff --git a/nixpkgs/pkgs/development/compilers/nasm/default.nix b/nixpkgs/pkgs/development/compilers/nasm/default.nix
index 89217db6818f..ce053e87130f 100644
--- a/nixpkgs/pkgs/development/compilers/nasm/default.nix
+++ b/nixpkgs/pkgs/development/compilers/nasm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl }:
+{ lib, stdenv, fetchurl, perl }:
 
 stdenv.mkDerivation rec {
   pname = "nasm";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
     make test
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.nasm.us/";
     description = "An 80x86 and x86-64 assembler designed for portability and modularity";
     platforms = platforms.unix;
diff --git a/nixpkgs/pkgs/development/compilers/neko/default.nix b/nixpkgs/pkgs/development/compilers/neko/default.nix
index 705b222a86cb..8b157fb4ca00 100644
--- a/nixpkgs/pkgs/development/compilers/neko/default.nix
+++ b/nixpkgs/pkgs/development/compilers/neko/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, boehmgc, zlib, sqlite, pcre, cmake, pkgconfig
+{ lib, stdenv, fetchurl, boehmgc, zlib, sqlite, pcre, cmake, pkg-config
 , git, apacheHttpd, apr, aprutil, libmysqlclient, mbedtls, openssl, pkgs, gtk2, libpthreadstubs
 }:
 
@@ -11,12 +11,12 @@ stdenv.mkDerivation rec {
     sha256 = "1qv47zaa0vzhjlq5wb71627n7dbsxpc1gqpg0hsngjxnbnh1q46g";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig git ];
+  nativeBuildInputs = [ cmake pkg-config git ];
   buildInputs =
     [ boehmgc zlib sqlite pcre apacheHttpd apr aprutil
       libmysqlclient mbedtls openssl libpthreadstubs ]
-      ++ stdenv.lib.optional stdenv.isLinux gtk2
-      ++ stdenv.lib.optionals stdenv.isDarwin [ pkgs.darwin.apple_sdk.frameworks.Security
+      ++ lib.optional stdenv.isLinux gtk2
+      ++ lib.optionals stdenv.isDarwin [ pkgs.darwin.apple_sdk.frameworks.Security
                                                 pkgs.darwin.apple_sdk.frameworks.Carbon];
   cmakeFlags = [ "-DRUN_LDCONFIG=OFF" ];
 
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
   dontPatchELF = true;
   dontStrip = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A high-level dynamically typed programming language";
     homepage = "https://nekovm.org";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/compilers/nextpnr/default.nix b/nixpkgs/pkgs/development/compilers/nextpnr/default.nix
index e50ac50dc57d..ebb6db31d5d1 100644
--- a/nixpkgs/pkgs/development/compilers/nextpnr/default.nix
+++ b/nixpkgs/pkgs/development/compilers/nextpnr/default.nix
@@ -43,7 +43,6 @@ with stdenv; mkDerivation rec {
     ++ (lib.optional enableGui qtbase)
     ++ (lib.optional stdenv.cc.isClang llvmPackages.openmp);
 
-  enableParallelBuilding = true;
   cmakeFlags =
     [ "-DCURRENT_GIT_VERSION=${lib.substring 0 7 (lib.elemAt srcs 0).rev}"
       "-DARCH=generic;ice40;ecp5"
diff --git a/nixpkgs/pkgs/development/compilers/obliv-c/default.nix b/nixpkgs/pkgs/development/compilers/obliv-c/default.nix
index 8fd6f33740e4..8a647a31c7cb 100644
--- a/nixpkgs/pkgs/development/compilers/obliv-c/default.nix
+++ b/nixpkgs/pkgs/development/compilers/obliv-c/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, libgcrypt, fetchFromGitHub, ocamlPackages, perl }:
+{ lib, stdenv, libgcrypt, fetchFromGitHub, ocamlPackages, perl }:
 stdenv.mkDerivation rec {
   pname = "obliv-c";
   version = "0.0pre20180624";
@@ -34,9 +34,9 @@ stdenv.mkDerivation rec {
 
   meta = {
     inherit version;
-    description = ''A GCC wrapper that makes it easy to embed secure computation protocols inside regular C programs'';
-    license = stdenv.lib.licenses.bsd3;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.linux;
+    description = "A GCC wrapper that makes it easy to embed secure computation protocols inside regular C programs";
+    license = lib.licenses.bsd3;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/ocaml/3.08.0.nix b/nixpkgs/pkgs/development/compilers/ocaml/3.08.0.nix
index cd621c131ffa..5762bed41a4a 100644
--- a/nixpkgs/pkgs/development/compilers/ocaml/3.08.0.nix
+++ b/nixpkgs/pkgs/development/compilers/ocaml/3.08.0.nix
@@ -16,6 +16,6 @@ stdenv.mkDerivation rec {
   checkTarget = ["opt.opt"];
 
   meta = {
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/ocaml/3.10.0.nix b/nixpkgs/pkgs/development/compilers/ocaml/3.10.0.nix
index 8f26790020c8..e3778457fd3f 100644
--- a/nixpkgs/pkgs/development/compilers/ocaml/3.10.0.nix
+++ b/nixpkgs/pkgs/development/compilers/ocaml/3.10.0.nix
@@ -26,9 +26,9 @@ stdenv.mkDerivation (rec {
 
   meta = {
     homepage = "http://caml.inria.fr/ocaml";
-    license = with stdenv.lib.licenses; [ qpl lgpl2 ];
+    license = with lib.licenses; [ qpl lgpl2 ];
     description = "Most popular variant of the Caml language";
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
   };
 
 })
diff --git a/nixpkgs/pkgs/development/compilers/ocaml/3.11.2.nix b/nixpkgs/pkgs/development/compilers/ocaml/3.11.2.nix
index 946013562c22..642b0d91b7f8 100644
--- a/nixpkgs/pkgs/development/compilers/ocaml/3.11.2.nix
+++ b/nixpkgs/pkgs/development/compilers/ocaml/3.11.2.nix
@@ -3,7 +3,7 @@
 let
    useX11 = stdenv.isi686 || stdenv.isx86_64;
    useNativeCompilers = stdenv.isi686 || stdenv.isx86_64 || stdenv.isMips;
-   inherit (stdenv.lib) optionals optionalString;
+   inherit (lib) optionals optionalString;
 in
 
 stdenv.mkDerivation rec {
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     [ (fetchurl {
         name = "0007-Fix-ocamlopt-w.r.t.-binutils-2.21.patch";
         url = "http://caml.inria.fr/mantis/file_download.php?file_id=418&type=bug";
-	sha256 = "612a9ac108bbfce2238aa5634123da162f0315dedb219958be705e0d92dcdd8e";
+        sha256 = "612a9ac108bbfce2238aa5634123da162f0315dedb219958be705e0d92dcdd8e";
       })
     ];
 
@@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
     ln -sv $out/lib/ocaml/caml $out/include/caml
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://caml.inria.fr/ocaml";
     license = with licenses; [
       qpl /* compiler */
diff --git a/nixpkgs/pkgs/development/compilers/ocaml/3.12.1.nix b/nixpkgs/pkgs/development/compilers/ocaml/3.12.1.nix
index f90d61744f56..781b5be09824 100644
--- a/nixpkgs/pkgs/development/compilers/ocaml/3.12.1.nix
+++ b/nixpkgs/pkgs/development/compilers/ocaml/3.12.1.nix
@@ -3,7 +3,7 @@
 let
    useX11 = !stdenv.isAarch32 && !stdenv.isMips;
    useNativeCompilers = !stdenv.isMips;
-   inherit (stdenv.lib) optionals optionalString;
+   inherit (lib) optionals optionalString;
 in
 
 stdenv.mkDerivation rec {
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
     nativeCompilers = useNativeCompilers;
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://caml.inria.fr/ocaml";
     branch = "3.12";
     license = with licenses; [
diff --git a/nixpkgs/pkgs/development/compilers/ocaml/4.00.1.nix b/nixpkgs/pkgs/development/compilers/ocaml/4.00.1.nix
index 81a8e0034feb..93e08740ddd8 100644
--- a/nixpkgs/pkgs/development/compilers/ocaml/4.00.1.nix
+++ b/nixpkgs/pkgs/development/compilers/ocaml/4.00.1.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchurl, ncurses, xlibsWrapper }:
+{ lib, stdenv, fetchurl, ncurses, xlibsWrapper }:
 
 let
    useX11 = !stdenv.isAarch32 && !stdenv.isMips;
    useNativeCompilers = !stdenv.isMips;
-   inherit (stdenv.lib) optional optionals optionalString;
+   inherit (lib) optional optionals optionalString;
 in
 
 stdenv.mkDerivation rec {
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
     nativeCompilers = useNativeCompilers;
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://caml.inria.fr/ocaml";
     branch = "4.00";
     license = with licenses; [
diff --git a/nixpkgs/pkgs/development/compilers/ocaml/4.12.nix b/nixpkgs/pkgs/development/compilers/ocaml/4.12.nix
index 16649f09869f..c422d2a15a3f 100644
--- a/nixpkgs/pkgs/development/compilers/ocaml/4.12.nix
+++ b/nixpkgs/pkgs/development/compilers/ocaml/4.12.nix
@@ -1,9 +1,9 @@
 import ./generic.nix {
   major_version = "4";
   minor_version = "12";
-  patch_version = "0-alpha3";
+  patch_version = "0-beta1";
   src = fetchTarball {
-    url = "http://caml.inria.fr/pub/distrib/ocaml-4.12/ocaml-4.12.0~alpha3.tar.xz";
-    sha256 = "1hqlf9fi5gmvb6r13z5819rg6k813bw9ihgbbji67hhh4q361wlw";
+    url = "http://caml.inria.fr/pub/distrib/ocaml-4.12/ocaml-4.12.0~beta1.tar.xz";
+    sha256 = "1rny74mi0knl8byqg2naw1mgvn22c2zihlwvzbkd56j97flqsxsm";
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/ocaml/ber-metaocaml.nix b/nixpkgs/pkgs/development/compilers/ocaml/ber-metaocaml.nix
index a6ddcd8ce8f4..d3ab0d6e1c60 100644
--- a/nixpkgs/pkgs/development/compilers/ocaml/ber-metaocaml.nix
+++ b/nixpkgs/pkgs/development/compilers/ocaml/ber-metaocaml.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl
+{ lib, stdenv, fetchurl
 , ncurses
 , libX11, xorgproto, buildEnv
 }:
@@ -6,7 +6,7 @@
 let
    useX11 = stdenv.isi686 || stdenv.isx86_64;
    x11deps = [ libX11 xorgproto ];
-   inherit (stdenv.lib) optionals;
+   inherit (lib) optionals;
 
    baseOcamlBranch  = "4.07";
    baseOcamlVersion = "${baseOcamlBranch}.1";
@@ -78,7 +78,7 @@ stdenv.mkDerivation rec {
     nativeCompilers = true;
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description     = "Multi-Stage Programming extension for OCaml";
     homepage        = "http://okmij.org/ftp/ML/MetaOCaml.html";
     license         = with licenses; [ /* compiler */ qpl /* library */ lgpl2 ];
diff --git a/nixpkgs/pkgs/development/compilers/ocaml/generic.nix b/nixpkgs/pkgs/development/compilers/ocaml/generic.nix
index 79aab1ffe831..d4a6b6250b52 100644
--- a/nixpkgs/pkgs/development/compilers/ocaml/generic.nix
+++ b/nixpkgs/pkgs/development/compilers/ocaml/generic.nix
@@ -6,17 +6,17 @@ let
   safeX11 = stdenv: !(stdenv.isAarch32 || stdenv.isMips);
 in
 
-{ stdenv, fetchurl, ncurses, buildEnv, libunwind
-, libX11, xorgproto, useX11 ? safeX11 stdenv && !stdenv.lib.versionAtLeast version "4.09"
+{ lib, stdenv, fetchurl, ncurses, buildEnv, libunwind
+, libX11, xorgproto, useX11 ? safeX11 stdenv && !lib.versionAtLeast version "4.09"
 , aflSupport ? false
 , flambdaSupport ? false
 , spaceTimeSupport ? false
 }:
 
 assert useX11 -> !stdenv.isAarch32 && !stdenv.isMips;
-assert aflSupport -> stdenv.lib.versionAtLeast version "4.05";
-assert flambdaSupport -> stdenv.lib.versionAtLeast version "4.03";
-assert spaceTimeSupport -> stdenv.lib.versionAtLeast version "4.04";
+assert aflSupport -> lib.versionAtLeast version "4.05";
+assert flambdaSupport -> lib.versionAtLeast version "4.03";
+assert spaceTimeSupport -> lib.versionAtLeast version "4.04";
 
 let
   src = args.src or (fetchurl {
@@ -27,7 +27,7 @@ in
 
 let
    useNativeCompilers = !stdenv.isMips;
-   inherit (stdenv.lib) optional optionals optionalString;
+   inherit (lib) optional optionals optionalString;
    name = "ocaml${optionalString aflSupport "+afl"}${optionalString spaceTimeSupport "+spacetime"}${optionalString flambdaSupport "+flambda"}-${version}";
 in
 
@@ -47,7 +47,7 @@ stdenv.mkDerivation (args // {
   prefixKey = "-prefix ";
   configureFlags =
     let flags = new: old:
-      if stdenv.lib.versionAtLeast version "4.08"
+      if lib.versionAtLeast version "4.08"
       then new else old
     ; in
     optionals useX11 (flags
@@ -59,11 +59,11 @@ stdenv.mkDerivation (args // {
   ;
 
   buildFlags = [ "world" ] ++ optionals useNativeCompilers [ "bootstrap" "world.opt" ];
-  buildInputs = optional (!stdenv.lib.versionAtLeast version "4.07") ncurses
+  buildInputs = optional (!lib.versionAtLeast version "4.07") ncurses
     ++ optionals useX11 [ libX11 xorgproto ];
   propagatedBuildInputs = optional spaceTimeSupport libunwind;
   installTargets = [ "install" ] ++ optional useNativeCompilers "installopt";
-  preConfigure = optionalString (!stdenv.lib.versionAtLeast version "4.04") ''
+  preConfigure = optionalString (!lib.versionAtLeast version "4.04") ''
     CAT=$(type -tp cat)
     sed -e "s@/bin/cat@$CAT@" -i config/auto-aux/sharpbang
   '';
@@ -76,7 +76,7 @@ stdenv.mkDerivation (args // {
     nativeCompilers = useNativeCompilers;
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://caml.inria.fr/ocaml";
     branch = versionNoPatch;
     license = with licenses; [
@@ -105,7 +105,7 @@ stdenv.mkDerivation (args // {
       '';
 
     platforms = with platforms; linux ++ darwin;
-    broken = stdenv.isAarch64 && !stdenv.lib.versionAtLeast version "4.06";
+    broken = stdenv.isAarch64 && !lib.versionAtLeast version "4.06";
   };
 
 })
diff --git a/nixpkgs/pkgs/development/compilers/ocaml/metaocaml-3.09.nix b/nixpkgs/pkgs/development/compilers/ocaml/metaocaml-3.09.nix
index 8459f26367e0..e13f3006be57 100644
--- a/nixpkgs/pkgs/development/compilers/ocaml/metaocaml-3.09.nix
+++ b/nixpkgs/pkgs/development/compilers/ocaml/metaocaml-3.09.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, xlibsWrapper, ncurses }:
+{ lib, stdenv, fetchurl, xlibsWrapper, ncurses }:
 
 stdenv.mkDerivation ({
 
@@ -26,7 +26,7 @@ stdenv.mkDerivation ({
 
   meta = {
     homepage = "http://www.metaocaml.org/";
-    license = with stdenv.lib.licenses; [ qpl lgpl2 ];
+    license = with lib.licenses; [ qpl lgpl2 ];
     description = "A compiled, type-safe, multi-stage programming language";
     broken = true;
   };
diff --git a/nixpkgs/pkgs/development/compilers/opa/default.nix b/nixpkgs/pkgs/development/compilers/opa/default.nix
index 864bb8e1b263..5e648c9de4ad 100644
--- a/nixpkgs/pkgs/development/compilers/opa/default.nix
+++ b/nixpkgs/pkgs/development/compilers/opa/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, which, perl, jdk
+{ lib, stdenv, fetchFromGitHub, which, perl, jdk
 , ocamlPackages, openssl
 , coreutils, zlib, ncurses, makeWrapper
 , gcc, binutils, gnumake, nodejs
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
 
   # Paths so the opa compiler code generation will use the same programs as were
   # used to build opa.
-  codeGeneratorPaths = stdenv.lib.makeBinPath [ ocamlPackages.ocaml gcc binutils gnumake nodejs ];
+  codeGeneratorPaths = lib.makeBinPath [ ocamlPackages.ocaml gcc binutils gnumake nodejs ];
 
   preConfigure = ''
     patchShebangs .
@@ -50,7 +50,7 @@ stdenv.mkDerivation rec {
     ocaml findlib ssl cryptokit camlzip ulex ocamlgraph camlp4
   ]);
 
-  NIX_LDFLAGS = stdenv.lib.optionalString (!stdenv.isDarwin) "-lgcc_s";
+  NIX_LDFLAGS = lib.optionalString (!stdenv.isDarwin) "-lgcc_s";
 
   postInstall = ''
     # Have compiler use same tools for code generation as used to build it.
@@ -71,8 +71,8 @@ stdenv.mkDerivation rec {
       Opa is concise, simple, concurrent, dynamically distributed, and secure.
     '';
     homepage = "http://opalang.org/";
-    license = stdenv.lib.licenses.gpl3;
-    maintainers = [ stdenv.lib.maintainers.kkallio ];
-    platforms = with stdenv.lib.platforms; unix;
+    license = lib.licenses.gpl3;
+    maintainers = [ lib.maintainers.kkallio ];
+    platforms = with lib.platforms; unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/opendylan/bin.nix b/nixpkgs/pkgs/development/compilers/opendylan/bin.nix
index dbe7e44b1d78..9687f1b1a662 100644
--- a/nixpkgs/pkgs/development/compilers/opendylan/bin.nix
+++ b/nixpkgs/pkgs/development/compilers/opendylan/bin.nix
@@ -1,6 +1,6 @@
 # Binaries provided by Open Dylan to be used to bootstrap from source.
 # The binaries can also be used as is.
-{stdenv, fetchurl, patchelf, boehmgc, gnused, gcc, makeWrapper}:
+{lib, stdenv, fetchurl, patchelf, boehmgc, gnused, gcc, makeWrapper}:
 
 stdenv.mkDerivation {
   name = "opendylan-2013.2";
@@ -22,11 +22,11 @@ stdenv.mkDerivation {
     tar --strip-components=1 -xjf "$src" -C "$out"
 
     interpreter="$(cat "$NIX_CC"/nix-support/dynamic-linker)"
-    for a in "$out"/bin/*; do 
+    for a in "$out"/bin/*; do
       patchelf --set-interpreter "$interpreter" "$a"
       patchelf --set-rpath "$out/lib:${boehmgc.out}/lib" "$a"
     done
-    for a in "$out"/lib/*.so; do 
+    for a in "$out"/lib/*.so; do
       patchelf --set-rpath "$out/lib:${boehmgc.out}/lib" "$a"
     done
     sed -i -e "s|\-lgc|\-L${boehmgc.out}\/lib -lgc|" $out/lib/config.jam
@@ -36,7 +36,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = "https://opendylan.org";
     description = "A multi-paradigm functional and object-oriented programming language";
-    license = stdenv.lib.licenses.mit;
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.mit;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/opendylan/default.nix b/nixpkgs/pkgs/development/compilers/opendylan/default.nix
index 5abc40cc3bb5..45b2454259f7 100644
--- a/nixpkgs/pkgs/development/compilers/opendylan/default.nix
+++ b/nixpkgs/pkgs/development/compilers/opendylan/default.nix
@@ -1,5 +1,5 @@
 # Build Open Dylan from source using the binary builds to bootstrap.
-{stdenv, fetchgit, boehmgc, mps, gnused, opendylan-bootstrap, autoconf, automake, perl, makeWrapper, gcc }:
+{lib, stdenv, fetchgit, boehmgc, mps, gnused, opendylan-bootstrap, autoconf, automake, perl, makeWrapper, gcc }:
 
 stdenv.mkDerivation {
   name = "opendylan-2016.1pre";
@@ -34,7 +34,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = "https://opendylan.org";
     description = "A multi-paradigm functional and object-oriented programming language";
-    license = stdenv.lib.licenses.mit;
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.mit;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/openjdk/11.nix b/nixpkgs/pkgs/development/compilers/openjdk/11.nix
index 326aef1a562c..18440a718d19 100644
--- a/nixpkgs/pkgs/development/compilers/openjdk/11.nix
+++ b/nixpkgs/pkgs/development/compilers/openjdk/11.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchFromGitHub, bash, pkgconfig, autoconf, cpio, file, which, unzip
+{ stdenv, lib, fetchFromGitHub, bash, pkg-config, autoconf, cpio, file, which, unzip
 , zip, perl, cups, freetype, alsaLib, libjpeg, giflib, libpng, zlib, lcms2
 , libX11, libICE, libXrender, libXext, libXt, libXtst, libXi, libXinerama
 , libXcursor, libXrandr, fontconfig, openjdk11-bootstrap
@@ -25,7 +25,7 @@ let
       sha256 = "11j2rqz9nag5y562g99py4p72f2kv4wwwyrnaspmrzax00wynyx7";
     };
 
-    nativeBuildInputs = [ pkgconfig autoconf ];
+    nativeBuildInputs = [ pkg-config autoconf ];
     buildInputs = [
       cpio file which unzip zip perl zlib cups freetype alsaLib libjpeg giflib
       libpng zlib lcms2 libX11 libICE libXrender libXext libXtst libXt libXtst
@@ -136,7 +136,7 @@ let
 
     disallowedReferences = [ openjdk11-bootstrap ];
 
-    meta = with stdenv.lib; {
+    meta = with lib; {
       homepage = "http://openjdk.java.net/";
       license = licenses.gpl2;
       description = "The open-source Java Development Kit";
diff --git a/nixpkgs/pkgs/development/compilers/openjdk/12.nix b/nixpkgs/pkgs/development/compilers/openjdk/12.nix
index 1de5d84a13be..0b3a4db6c48f 100644
--- a/nixpkgs/pkgs/development/compilers/openjdk/12.nix
+++ b/nixpkgs/pkgs/development/compilers/openjdk/12.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, bash, pkgconfig, autoconf, cpio, file, which, unzip
+{ stdenv, lib, fetchurl, bash, pkg-config, autoconf, cpio, file, which, unzip
 , zip, perl, cups, freetype, alsaLib, libjpeg, giflib, libpng, zlib, lcms2
 , libX11, libICE, libXrender, libXext, libXt, libXtst, libXi, libXinerama
 , libXcursor, libXrandr, fontconfig, openjdk11
@@ -22,7 +22,7 @@ let
       sha256 = "1ndlxmikyy298z7lqpr1bd0zxq7yx6xidj8y3c8mw9m9fy64h9c7";
     };
 
-    nativeBuildInputs = [ pkgconfig autoconf ];
+    nativeBuildInputs = [ pkg-config autoconf ];
     buildInputs = [
       cpio file which unzip zip perl zlib cups freetype alsaLib libjpeg giflib
       libpng zlib lcms2 libX11 libICE libXrender libXext libXtst libXt libXtst
@@ -140,7 +140,7 @@ let
 
     disallowedReferences = [ openjdk11 ];
 
-    meta = with stdenv.lib; {
+    meta = with lib; {
       homepage = "http://openjdk.java.net/";
       license = licenses.gpl2;
       description = "The open-source Java Development Kit";
diff --git a/nixpkgs/pkgs/development/compilers/openjdk/13.nix b/nixpkgs/pkgs/development/compilers/openjdk/13.nix
index 3c7ddfb8dd96..7c6fe633c49d 100644
--- a/nixpkgs/pkgs/development/compilers/openjdk/13.nix
+++ b/nixpkgs/pkgs/development/compilers/openjdk/13.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, bash, pkgconfig, autoconf, cpio, file, which, unzip
+{ stdenv, lib, fetchurl, bash, pkg-config, autoconf, cpio, file, which, unzip
 , zip, perl, cups, freetype, alsaLib, libjpeg, giflib, libpng, zlib, lcms2
 , libX11, libICE, libXrender, libXext, libXt, libXtst, libXi, libXinerama
 , libXcursor, libXrandr, fontconfig, openjdk13-bootstrap
@@ -22,7 +22,7 @@ let
       sha256 = "1871ziss7ny19rw8f7bay5vznmhpqbfi4ihn3yygs06wyxhm0zmv";
     };
 
-    nativeBuildInputs = [ pkgconfig autoconf ];
+    nativeBuildInputs = [ pkg-config autoconf ];
     buildInputs = [
       cpio file which unzip zip perl zlib cups freetype alsaLib libjpeg giflib
       libpng zlib lcms2 libX11 libICE libXrender libXext libXtst libXt libXtst
@@ -140,7 +140,7 @@ let
 
     disallowedReferences = [ openjdk13-bootstrap ];
 
-    meta = with stdenv.lib; {
+    meta = with lib; {
       homepage = "http://openjdk.java.net/";
       license = licenses.gpl2;
       description = "The open-source Java Development Kit";
diff --git a/nixpkgs/pkgs/development/compilers/openjdk/14.nix b/nixpkgs/pkgs/development/compilers/openjdk/14.nix
new file mode 100644
index 000000000000..bda6444a8f98
--- /dev/null
+++ b/nixpkgs/pkgs/development/compilers/openjdk/14.nix
@@ -0,0 +1,158 @@
+{ stdenv, lib, fetchurl, bash, pkg-config, autoconf, cpio, file, which, unzip
+, zip, perl, cups, freetype, alsaLib, libjpeg, giflib, libpng, zlib, lcms2
+, libX11, libICE, libXrender, libXext, libXt, libXtst, libXi, libXinerama
+, libXcursor, libXrandr, fontconfig, openjdk14-bootstrap
+, setJavaClassPath
+, headless ? false
+, enableJavaFX ? openjfx.meta.available, openjfx
+, enableGnome2 ? true, gtk3, gnome_vfs, glib, GConf
+}:
+
+let
+  major = "14";
+  update = ".0.2";
+  build = "-ga";
+
+  openjdk = stdenv.mkDerivation rec {
+    pname = "openjdk" + lib.optionalString headless "-headless";
+    version = "${major}${update}${build}";
+
+    src = fetchurl {
+      url = "https://hg.openjdk.java.net/jdk-updates/jdk${major}u/archive/jdk-${version}.tar.gz";
+      sha256 = "1s1pc6ihzf0awp4hbaqfxmbica0hnrg8nr7s0yd2hfn7nan8xmf3";
+    };
+
+    nativeBuildInputs = [ pkg-config autoconf ];
+    buildInputs = [
+      cpio file which unzip zip perl zlib cups freetype alsaLib libjpeg giflib
+      libpng zlib lcms2 libX11 libICE libXrender libXext libXtst libXt libXtst
+      libXi libXinerama libXcursor libXrandr fontconfig openjdk14-bootstrap
+    ] ++ lib.optionals (!headless && enableGnome2) [
+      gtk3 gnome_vfs GConf glib
+    ];
+
+    patches = [
+      ./fix-java-home-jdk10.patch
+      ./read-truststore-from-env-jdk10.patch
+      ./currency-date-range-jdk10.patch
+      ./increase-javadoc-heap-jdk13.patch
+      # -Wformat etc. are stricter in newer gccs, per
+      # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79677
+      # so grab the work-around from
+      # https://src.fedoraproject.org/rpms/java-openjdk/pull-request/24
+      (fetchurl {
+        url = "https://src.fedoraproject.org/rpms/java-openjdk/raw/06c001c7d87f2e9fe4fedeef2d993bcd5d7afa2a/f/rh1673833-remove_removal_of_wformat_during_test_compilation.patch";
+        sha256 = "082lmc30x64x583vqq00c8y0wqih3y4r0mp1c4bqq36l22qv6b6r";
+      })
+    ] ++ lib.optionals (!headless && enableGnome2) [
+      ./swing-use-gtk-jdk13.patch
+    ];
+
+    prePatch = ''
+      chmod +x configure
+      patchShebangs --build configure
+    '';
+
+    configureFlags = [
+      "--with-boot-jdk=${openjdk14-bootstrap.home}"
+      "--with-version-pre="
+      "--enable-unlimited-crypto"
+      "--with-native-debug-symbols=internal"
+      "--with-libjpeg=system"
+      "--with-giflib=system"
+      "--with-libpng=system"
+      "--with-zlib=system"
+      "--with-lcms=system"
+      "--with-stdc++lib=dynamic"
+    ] ++ lib.optional stdenv.isx86_64 "--with-jvm-features=zgc"
+      ++ lib.optional headless "--enable-headless-only"
+      ++ lib.optional (!headless && enableJavaFX) "--with-import-modules=${openjfx}";
+
+    separateDebugInfo = true;
+
+    NIX_CFLAGS_COMPILE = "-Wno-error";
+
+    NIX_LDFLAGS = toString (lib.optionals (!headless) [
+      "-lfontconfig" "-lcups" "-lXinerama" "-lXrandr" "-lmagic"
+    ] ++ lib.optionals (!headless && enableGnome2) [
+      "-lgtk-3" "-lgio-2.0" "-lgnomevfs-2" "-lgconf-2"
+    ]);
+
+    buildFlags = [ "all" ];
+
+    installPhase = ''
+      mkdir -p $out/lib
+
+      mv build/*/images/jdk $out/lib/openjdk
+
+      # Remove some broken manpages.
+      rm -rf $out/lib/openjdk/man/ja*
+
+      # Mirror some stuff in top-level.
+      mkdir -p $out/share
+      ln -s $out/lib/openjdk/include $out/include
+      ln -s $out/lib/openjdk/man $out/share/man
+      ln -s $out/lib/openjdk/lib/src.zip $out/lib/src.zip
+
+      # jni.h expects jni_md.h to be in the header search path.
+      ln -s $out/include/linux/*_md.h $out/include/
+
+      # Remove crap from the installation.
+      rm -rf $out/lib/openjdk/demo
+      ${lib.optionalString headless ''
+        rm $out/lib/openjdk/lib/{libjsound,libfontmanager}.so
+      ''}
+
+      ln -s $out/lib/openjdk/bin $out/bin
+    '';
+
+    preFixup = ''
+      # Propagate the setJavaClassPath setup hook so that any package
+      # that depends on the JDK has $CLASSPATH set up properly.
+      mkdir -p $out/nix-support
+      #TODO or printWords?  cf https://github.com/NixOS/nixpkgs/pull/27427#issuecomment-317293040
+      echo -n "${setJavaClassPath}" > $out/nix-support/propagated-build-inputs
+
+      # Set JAVA_HOME automatically.
+      mkdir -p $out/nix-support
+      cat <<EOF > $out/nix-support/setup-hook
+      if [ -z "\''${JAVA_HOME-}" ]; then export JAVA_HOME=$out/lib/openjdk; fi
+      EOF
+    '';
+
+    postFixup = ''
+      # Build the set of output library directories to rpath against
+      LIBDIRS=""
+      for output in $outputs; do
+        if [ "$output" = debug ]; then continue; fi
+        LIBDIRS="$(find $(eval echo \$$output) -name \*.so\* -exec dirname {} \+ | sort | uniq | tr '\n' ':'):$LIBDIRS"
+      done
+      # Add the local library paths to remove dependencies on the bootstrap
+      for output in $outputs; do
+        if [ "$output" = debug ]; then continue; fi
+        OUTPUTDIR=$(eval echo \$$output)
+        BINLIBS=$(find $OUTPUTDIR/bin/ -type f; find $OUTPUTDIR -name \*.so\*)
+        echo "$BINLIBS" | while read i; do
+          patchelf --set-rpath "$LIBDIRS:$(patchelf --print-rpath "$i")" "$i" || true
+          patchelf --shrink-rpath "$i" || true
+        done
+      done
+    '';
+
+    disallowedReferences = [ openjdk14-bootstrap ];
+
+    meta = with lib; {
+      homepage = "https://openjdk.java.net/";
+      license = licenses.gpl2;
+      description = "The open-source Java Development Kit";
+      maintainers = with maintainers; [ edwtjo ];
+      platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" "armv7l-linux" "armv6l-linux" ];
+    };
+
+    passthru = {
+      architecture = "";
+      home = "${openjdk}/lib/openjdk";
+      inherit gtk3;
+    };
+  };
+in openjdk
diff --git a/nixpkgs/pkgs/development/compilers/openjdk/8.nix b/nixpkgs/pkgs/development/compilers/openjdk/8.nix
index 050ca2a564a1..96a01b0cd925 100644
--- a/nixpkgs/pkgs/development/compilers/openjdk/8.nix
+++ b/nixpkgs/pkgs/development/compilers/openjdk/8.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, pkgconfig, lndir, bash, cpio, file, which, unzip, zip
+{ stdenv, lib, fetchurl, pkg-config, lndir, bash, cpio, file, which, unzip, zip
 , cups, freetype, alsaLib, cacert, perl, liberation_ttf, fontconfig, zlib
 , libX11, libICE, libXrender, libXext, libXt, libXtst, libXi, libXinerama, libXcursor, libXrandr
 , libjpeg, giflib
@@ -83,7 +83,7 @@ let
 
     outputs = [ "out" "jre" ];
 
-    nativeBuildInputs = [ pkgconfig lndir ];
+    nativeBuildInputs = [ pkg-config lndir ];
     buildInputs = [
       cpio file which unzip zip perl openjdk8-bootstrap zlib cups freetype alsaLib
       libjpeg giflib libX11 libICE libXext libXrender libXtst libXt libXtst
diff --git a/nixpkgs/pkgs/development/compilers/openjdk/darwin/11.nix b/nixpkgs/pkgs/development/compilers/openjdk/darwin/11.nix
index 0b659b95aa8b..64654351886f 100644
--- a/nixpkgs/pkgs/development/compilers/openjdk/darwin/11.nix
+++ b/nixpkgs/pkgs/development/compilers/openjdk/darwin/11.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip, setJavaClassPath, freetype }:
+{ lib, stdenv, fetchurl, unzip, setJavaClassPath, freetype }:
 let
   jce-policies = fetchurl {
     # Ugh, unversioned URLs... I hope this doesn't change often enough to cause pain before we move to a Darwin source build of OpenJDK!
@@ -52,7 +52,7 @@ let
       home = jdk;
     };
 
-    meta = with stdenv.lib; {
+    meta = with lib; {
       license = licenses.gpl2;
       platforms = platforms.darwin;
     };
diff --git a/nixpkgs/pkgs/development/compilers/openjdk/darwin/8.nix b/nixpkgs/pkgs/development/compilers/openjdk/darwin/8.nix
index 8afaf90f9437..4df180c1f5a7 100644
--- a/nixpkgs/pkgs/development/compilers/openjdk/darwin/8.nix
+++ b/nixpkgs/pkgs/development/compilers/openjdk/darwin/8.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip, setJavaClassPath, freetype }:
+{ lib, stdenv, fetchurl, unzip, setJavaClassPath, freetype }:
 let
   jce-policies = fetchurl {
     # Ugh, unversioned URLs... I hope this doesn't change often enough to cause pain before we move to a Darwin source build of OpenJDK!
@@ -56,7 +56,7 @@ let
       home = jdk;
     };
 
-    meta = with stdenv.lib; {
+    meta = with lib; {
       license = licenses.gpl2;
       platforms = platforms.darwin;
     };
diff --git a/nixpkgs/pkgs/development/compilers/openjdk/darwin/default.nix b/nixpkgs/pkgs/development/compilers/openjdk/darwin/default.nix
index c6498cb45302..8885db4115ea 100644
--- a/nixpkgs/pkgs/development/compilers/openjdk/darwin/default.nix
+++ b/nixpkgs/pkgs/development/compilers/openjdk/darwin/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip, setJavaClassPath, freetype }:
+{ lib, stdenv, fetchurl, unzip, setJavaClassPath, freetype }:
 let
   jce-policies = fetchurl {
     # Ugh, unversioned URLs... I hope this doesn't change often enough to cause pain before we move to a Darwin source build of OpenJDK!
@@ -7,11 +7,11 @@ let
   };
 
   jdk = stdenv.mkDerivation rec {
-    name = "zulu14.28.21-ca-jdk14.0.1";
+    name = "zulu15.28.51-ca-jdk15.0.1";
 
     src = fetchurl {
       url = "https://cdn.azul.com/zulu/bin/${name}-macosx_x64.tar.gz";
-      sha256 = "1pc0y3fxhlf42a51qbdha1fabci61yzq70kk5c1rzk0ai78d92q8";
+      sha256 = "0h738pbnwcn7pjp0qyryzazqj5nw5sy2f8l0ycl39crm9ia6akvh";
       curlOpts = "-H Referer:https://www.azul.com/downloads/zulu/";
     };
 
@@ -52,7 +52,7 @@ let
       home = jdk;
     };
 
-    meta = with stdenv.lib; {
+    meta = with lib; {
       license = licenses.gpl2;
       platforms = platforms.darwin;
     };
diff --git a/nixpkgs/pkgs/development/compilers/openjdk/default.nix b/nixpkgs/pkgs/development/compilers/openjdk/default.nix
index 1dcd3e23e6fa..ddd523ad7871 100644
--- a/nixpkgs/pkgs/development/compilers/openjdk/default.nix
+++ b/nixpkgs/pkgs/development/compilers/openjdk/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, lib, fetchurl, bash, pkgconfig, autoconf, cpio, file, which, unzip
+{ stdenv, lib, fetchurl, bash, pkg-config, autoconf, cpio, file, which, unzip
 , zip, perl, cups, freetype, alsaLib, libjpeg, giflib, libpng, zlib, lcms2
 , libX11, libICE, libXrender, libXext, libXt, libXtst, libXi, libXinerama
-, libXcursor, libXrandr, fontconfig, openjdk14-bootstrap
+, libXcursor, libXrandr, fontconfig, openjdk15-bootstrap
 , setJavaClassPath
 , headless ? false
 , enableJavaFX ? openjfx.meta.available, openjfx
@@ -9,8 +9,8 @@
 }:
 
 let
-  major = "14";
-  update = ".0.2";
+  major = "15";
+  update = ".0.1";
   build = "-ga";
 
   openjdk = stdenv.mkDerivation rec {
@@ -18,15 +18,15 @@ let
     version = "${major}${update}${build}";
 
     src = fetchurl {
-      url = "http://hg.openjdk.java.net/jdk-updates/jdk${major}u/archive/jdk-${version}.tar.gz";
-      sha256 = "1s1pc6ihzf0awp4hbaqfxmbica0hnrg8nr7s0yd2hfn7nan8xmf3";
+      url = "https://hg.openjdk.java.net/jdk-updates/jdk${major}u/archive/jdk-${version}.tar.gz";
+      sha256 = "1h8n5figc9q0k9p8b0qggyhvqagvxanfih1lj5j492c74cd1mx1l";
     };
 
-    nativeBuildInputs = [ pkgconfig autoconf ];
+    nativeBuildInputs = [ pkg-config autoconf ];
     buildInputs = [
       cpio file which unzip zip perl zlib cups freetype alsaLib libjpeg giflib
       libpng zlib lcms2 libX11 libICE libXrender libXext libXtst libXt libXtst
-      libXi libXinerama libXcursor libXrandr fontconfig openjdk14-bootstrap
+      libXi libXinerama libXcursor libXrandr fontconfig openjdk15-bootstrap
     ] ++ lib.optionals (!headless && enableGnome2) [
       gtk3 gnome_vfs GConf glib
     ];
@@ -54,7 +54,8 @@ let
     '';
 
     configureFlags = [
-      "--with-boot-jdk=${openjdk14-bootstrap.home}"
+      "--with-boot-jdk=${openjdk15-bootstrap.home}"
+      "--with-version-pre="
       "--enable-unlimited-crypto"
       "--with-native-debug-symbols=internal"
       "--with-libjpeg=system"
@@ -138,10 +139,10 @@ let
       done
     '';
 
-    disallowedReferences = [ openjdk14-bootstrap ];
+    disallowedReferences = [ openjdk15-bootstrap ];
 
-    meta = with stdenv.lib; {
-      homepage = "http://openjdk.java.net/";
+    meta = with lib; {
+      homepage = "https://openjdk.java.net/";
       license = licenses.gpl2;
       description = "The open-source Java Development Kit";
       maintainers = with maintainers; [ edwtjo ];
diff --git a/nixpkgs/pkgs/development/compilers/openjdk/openjfx/11.nix b/nixpkgs/pkgs/development/compilers/openjdk/openjfx/11.nix
index 513f4d968f6f..8688831cdaac 100644
--- a/nixpkgs/pkgs/development/compilers/openjdk/openjfx/11.nix
+++ b/nixpkgs/pkgs/development/compilers/openjdk/openjfx/11.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, writeText, gradleGen, pkgconfig, perl, cmake
+{ stdenv, lib, fetchurl, writeText, gradleGen, pkg-config, perl, cmake
 , gperf, gtk2, gtk3, libXtst, libXxf86vm, glib, alsaLib, ffmpeg_3, python, ruby
 , openjdk11-bootstrap }:
 
@@ -20,7 +20,7 @@ let
     };
 
     buildInputs = [ gtk2 gtk3 libXtst libXxf86vm glib alsaLib ffmpeg_3 ];
-    nativeBuildInputs = [ gradle_ perl pkgconfig cmake gperf python ruby ];
+    nativeBuildInputs = [ gradle_ perl pkg-config cmake gperf python ruby ];
 
     dontUseCmakeConfigure = true;
 
@@ -103,7 +103,7 @@ in makePackage {
 
   passthru.deps = deps;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://openjdk.java.net/projects/openjfx/";
     license = licenses.gpl2;
     description = "The next-generation Java client toolkit";
diff --git a/nixpkgs/pkgs/development/compilers/openjdk/openjfx/14.nix b/nixpkgs/pkgs/development/compilers/openjdk/openjfx/15.nix
index 51512c5afcaf..21801b8ba3a7 100644
--- a/nixpkgs/pkgs/development/compilers/openjdk/openjfx/14.nix
+++ b/nixpkgs/pkgs/development/compilers/openjdk/openjfx/15.nix
@@ -1,11 +1,11 @@
 { stdenv, lib, fetchFromGitHub, writeText, openjdk11_headless, gradleGen
-, pkgconfig, perl, cmake, gperf, gtk2, gtk3, libXtst, libXxf86vm, glib, alsaLib
+, pkg-config, perl, cmake, gperf, gtk2, gtk3, libXtst, libXxf86vm, glib, alsaLib
 , ffmpeg_3, python, ruby }:
 
 let
-  major = "14";
-  update = "";
-  build = "-ga";
+  major = "15";
+  update = ".0.1";
+  build = "+1";
   repover = "${major}${update}${build}";
   gradle_ = (gradleGen.override {
     java = openjdk11_headless;
@@ -18,11 +18,11 @@ let
       owner = "openjdk";
       repo = "jfx";
       rev = repover;
-      sha256 = "16aj15xksc266gv3y42m0g277pfvp71901lrngndcnpr7i2zshnr";
+      sha256 = "019glq8rhn6amy3n5jc17vi2wpf1pxpmmywvyz1ga8n09w7xscq1";
     };
 
     buildInputs = [ gtk2 gtk3 libXtst libXxf86vm glib alsaLib ffmpeg_3 ];
-    nativeBuildInputs = [ gradle_ perl pkgconfig cmake gperf python ruby ];
+    nativeBuildInputs = [ gradle_ perl pkg-config cmake gperf python ruby ];
 
     dontUseCmakeConfigure = true;
 
@@ -64,8 +64,10 @@ let
     outputHashMode = "recursive";
     # Downloaded AWT jars differ by platform.
     outputHash = {
-      x86_64-linux = "077zss95iq6iskx7ghz1c57ymydpzj0wm7r1pkznw99l9xwvdmqi";
-      i686-linux = "03gglr2sh77cyg16qw9g45ji33dg7i93s5s30hz3mh420g112qa0";
+      x86_64-linux = "0hmyr5nnjgwyw3fcwqf0crqg9lny27jfirycg3xmkzbcrwqd6qkw";
+      # The build-time dependencies don't currently build for i686, so no
+      # reason to fetch this one correctly either...
+      i686-linux = "0000000000000000000000000000000000000000000000000000";
     }.${stdenv.system} or (throw "Unsupported platform");
   };
 
@@ -105,7 +107,7 @@ in makePackage {
 
   passthru.deps = deps;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://openjdk.java.net/projects/openjfx/";
     license = licenses.gpl2;
     description = "The next-generation Java client toolkit";
diff --git a/nixpkgs/pkgs/development/compilers/openspin/default.nix b/nixpkgs/pkgs/development/compilers/openspin/default.nix
index fe10f43abd5e..abf5623b5821 100644
--- a/nixpkgs/pkgs/development/compilers/openspin/default.nix
+++ b/nixpkgs/pkgs/development/compilers/openspin/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation {
   pname = "openspin";
@@ -16,7 +16,7 @@ stdenv.mkDerivation {
     mv build/openspin $out/bin/openspin
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Compiler for SPIN/PASM languages for Parallax Propeller MCU";
     homepage = "https://github.com/parallaxinc/OpenSpin";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix b/nixpkgs/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix
index 78fff4a59fba..c44d7fc116fe 100644
--- a/nixpkgs/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix
+++ b/nixpkgs/pkgs/development/compilers/oraclejdk/jdk-linux-base.nix
@@ -6,7 +6,7 @@
 }:
 
 { swingSupport ? true
-, stdenv
+, lib, stdenv
 , requireFile
 , makeWrapper
 , unzip
@@ -76,7 +76,7 @@ let result = stdenv.mkDerivation rec {
         i686-linux    = "linux-i586";
         x86_64-linux  = "linux-x64";
         armv7l-linux  = "linux-arm32-vfp-hflt";
-        aarch64-linux = "linux-arm64-vfp-hflt";
+        aarch64-linux = "linux-aarch64";
       }.${stdenv.hostPlatform.system} or (throw "unsupported system ${stdenv.hostPlatform.system}");
     in requireFile {
       name = "jdk-${productVersion}u${patchVersion}-${platformName}.tar.gz";
@@ -85,7 +85,7 @@ let result = stdenv.mkDerivation rec {
     };
 
   nativeBuildInputs = [ file ]
-    ++ stdenv.lib.optional installjce unzip;
+    ++ lib.optional installjce unzip;
 
   buildInputs = [ makeWrapper ];
 
@@ -149,7 +149,7 @@ let result = stdenv.mkDerivation rec {
   '';
 
   postFixup = ''
-    rpath+="''${rpath:+:}${stdenv.lib.concatStringsSep ":" (map (a: "$jrePath/${a}") rSubPaths)}"
+    rpath+="''${rpath:+:}${lib.concatStringsSep ":" (map (a: "$jrePath/${a}") rSubPaths)}"
 
     # set all the dynamic linkers
     find $out -type f -perm -0100 \
@@ -174,7 +174,7 @@ let result = stdenv.mkDerivation rec {
     [stdenv.cc.libc glib libxml2 libav_0_8 ffmpeg_3 libxslt libGL xorg.libXxf86vm alsaLib fontconfig freetype pango gtk2 cairo gdk-pixbuf atk] ++
     (if swingSupport then [xorg.libX11 xorg.libXext xorg.libXtst xorg.libXi xorg.libXp xorg.libXt xorg.libXrender stdenv.cc.cc] else []);
 
-  rpath = stdenv.lib.strings.makeLibraryPath libraries;
+  rpath = lib.strings.makeLibraryPath libraries;
 
   passthru.mozillaPlugin = if installjdk then "/jre/lib/${architecture}/plugins" else "/lib/${architecture}/plugins";
 
@@ -184,7 +184,7 @@ let result = stdenv.mkDerivation rec {
 
   passthru.architecture = architecture;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     license = licenses.unfree;
     platforms = [ "i686-linux" "x86_64-linux" "armv7l-linux" "aarch64-linux" ]; # some inherit jre.meta.platforms
   };
diff --git a/nixpkgs/pkgs/development/compilers/oraclejdk/jdk11-linux.nix b/nixpkgs/pkgs/development/compilers/oraclejdk/jdk11-linux.nix
index b73270e8dd8c..7e0e5cae7ca5 100644
--- a/nixpkgs/pkgs/development/compilers/oraclejdk/jdk11-linux.nix
+++ b/nixpkgs/pkgs/development/compilers/oraclejdk/jdk11-linux.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , requireFile
 , xorg
 , zlib
@@ -30,7 +30,7 @@ let result = stdenv.mkDerivation rec {
   '';
 
   postFixup = ''
-    rpath="$out/lib/jli:$out/lib/server:$out/lib:${stdenv.lib.strings.makeLibraryPath [ zlib xorg.libX11 xorg.libXext xorg.libXtst xorg.libXi xorg.libXrender freetype alsaLib]}"
+    rpath="$out/lib/jli:$out/lib/server:$out/lib:${lib.strings.makeLibraryPath [ zlib xorg.libX11 xorg.libXext xorg.libXtst xorg.libXi xorg.libXrender freetype alsaLib]}"
 
     for f in $(find $out -name "*.so") $(find $out -type f -perm -0100); do
       patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$f" || true
@@ -47,7 +47,7 @@ let result = stdenv.mkDerivation rec {
 
   dontStrip = true; # See: https://github.com/NixOS/patchelf/issues/10
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     license = licenses.unfree;
     platforms = [ "x86_64-linux" ];
   };
diff --git a/nixpkgs/pkgs/development/compilers/oraclejdk/jdk14-linux.nix b/nixpkgs/pkgs/development/compilers/oraclejdk/jdk14-linux.nix
index 427c7cedad15..b1655cd8b8fe 100644
--- a/nixpkgs/pkgs/development/compilers/oraclejdk/jdk14-linux.nix
+++ b/nixpkgs/pkgs/development/compilers/oraclejdk/jdk14-linux.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , requireFile
 , xorg
 , zlib
@@ -30,7 +30,7 @@ let result = stdenv.mkDerivation rec {
   '';
 
   postFixup = ''
-    rpath="$out/lib/jli:$out/lib/server:$out/lib:${stdenv.lib.strings.makeLibraryPath [ stdenv.cc.cc zlib xorg.libX11 xorg.libXext xorg.libXtst xorg.libXi xorg.libXrender freetype alsaLib]}"
+    rpath="$out/lib/jli:$out/lib/server:$out/lib:${lib.strings.makeLibraryPath [ stdenv.cc.cc zlib xorg.libX11 xorg.libXext xorg.libXtst xorg.libXi xorg.libXrender freetype alsaLib]}"
 
     for f in $(find $out -name "*.so") $(find $out -type f -perm -0100); do
       patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$f" || true
@@ -47,7 +47,7 @@ let result = stdenv.mkDerivation rec {
 
   dontStrip = true; # See: https://github.com/NixOS/patchelf/issues/10
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     license = licenses.unfree;
     platforms = [ "x86_64-linux" ];
   };
diff --git a/nixpkgs/pkgs/development/compilers/oraclejdk/jdk8-linux.nix b/nixpkgs/pkgs/development/compilers/oraclejdk/jdk8-linux.nix
index fdea10dcd7e4..01d1ee8e980c 100644
--- a/nixpkgs/pkgs/development/compilers/oraclejdk/jdk8-linux.nix
+++ b/nixpkgs/pkgs/development/compilers/oraclejdk/jdk8-linux.nix
@@ -1,10 +1,10 @@
 import ./jdk-linux-base.nix {
   productVersion = "8";
-  patchVersion = "261";
-  sha256.i686-linux = "1bl12hd5i53m8d4j8rwkk3bavmzw0ndr88ch5lf5syi7vs5pfjpm";
-  sha256.x86_64-linux = "0d7a92csz8ws5h0pzqmrxq3sz286s57vw0dqq3ciwsqz14df012s";
-  sha256.armv7l-linux = "13dih7zyfgj90bkhnfxhpm88d9kqqrj6w5rzpidmxrjwrsnlndp9";
-  sha256.aarch64-linux = "0zzhs4pcnjss2561b8zrrnacpkb8p49ca0lpdw7hzgsjjj1y146n";
+  patchVersion = "271";
+  sha256.i686-linux = "nC1bRTDj0BPWqClLCfNIqdUn9HywUF8Z/pIV9Kq3LG0=";
+  sha256.x86_64-linux = "66eSamg7tlxvThxQLOYkNGxCsA+1Ux3ropbyVgtFLHg=";
+  sha256.armv7l-linux = "YZKX0iUf7yqUBUhlpHtVdYw6DBEu7E/pbfcVfK7HMxM=";
+  sha256.aarch64-linux = "bFRGnfmYIdXz5b/I8wlA/YiGXhCm/cVoOAU+Hlu4F0I=";
   jceName = "jce_policy-8.zip";
   sha256JCE = "19n5wadargg3v8x76r7ayag6p2xz1bwhrgdzjs9f4i6fvxz9jr4w";
 }
diff --git a/nixpkgs/pkgs/development/compilers/orc/default.nix b/nixpkgs/pkgs/development/compilers/orc/default.nix
index 210aa786cddf..40c89d0cc59b 100644
--- a/nixpkgs/pkgs/development/compilers/orc/default.nix
+++ b/nixpkgs/pkgs/development/compilers/orc/default.nix
@@ -1,8 +1,8 @@
-{ stdenv, fetchurl, meson, ninja
+{ lib, stdenv, fetchurl, meson, ninja
 , gtk-doc ? null, file, docbook_xsl
 , buildDevDoc ? gtk-doc != null
 }: let
-  inherit (stdenv.lib) optional optionals;
+  inherit (lib) optional optionals;
 in stdenv.mkDerivation rec {
   pname = "orc";
   version = "0.4.32";
@@ -27,7 +27,7 @@ in stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "The Oil Runtime Compiler";
     homepage = "https://gstreamer.freedesktop.org/projects/orc.html";
     # The source code implementing the Marsenne Twister algorithm is licensed
diff --git a/nixpkgs/pkgs/development/compilers/osl/default.nix b/nixpkgs/pkgs/development/compilers/osl/default.nix
index 2c00420c3626..d3de5cad2f69 100644
--- a/nixpkgs/pkgs/development/compilers/osl/default.nix
+++ b/nixpkgs/pkgs/development/compilers/osl/default.nix
@@ -1,4 +1,4 @@
-{ clangStdenv, stdenv, fetchFromGitHub, cmake, zlib, openexr,
+{ clangStdenv, lib, stdenv, fetchFromGitHub, cmake, zlib, openexr,
 openimageio, llvm, boost165, flex, bison, partio, pugixml,
 util-linux, python
 }:
@@ -18,18 +18,18 @@ in clangStdenv.mkDerivation rec {
   };
 
   cmakeFlags = [ "-DUSE_BOOST_WAVE=ON" "-DENABLERTTI=ON" ];
-  enableParallelBuilding = true;
 
-  preConfigure = '' patchShebangs src/liboslexec/serialize-bc.bash '';
-  
+  preConfigure = "patchShebangs src/liboslexec/serialize-bc.bash ";
+
+  nativeBuildInputs = [ cmake boost_static flex bison];
   buildInputs = [
-     cmake zlib openexr openimageio llvm
-     boost_static flex bison partio pugixml
+     zlib openexr openimageio llvm
+     partio pugixml
      util-linux # needed just for hexdump
      python # CMake doesn't check this?
   ];
   # TODO: How important is partio? CMake doesn't seem to find it
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Advanced shading language for production GI renderers";
     homepage = "http://opensource.imageworks.com/?p=osl";
     maintainers = with maintainers; [ hodapp ];
diff --git a/nixpkgs/pkgs/development/compilers/owl-lisp/default.nix b/nixpkgs/pkgs/development/compilers/owl-lisp/default.nix
index 93713af99b46..1d8ba03e72fc 100644
--- a/nixpkgs/pkgs/development/compilers/owl-lisp/default.nix
+++ b/nixpkgs/pkgs/development/compilers/owl-lisp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitLab, coreutils, which }:
+{ lib, stdenv, fetchFromGitLab, coreutils, which }:
 
 stdenv.mkDerivation rec {
   pname = "owl-lisp";
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   # tests are run as part of the compilation process
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A functional Scheme for world domination";
     homepage    = "https://gitlab.com/owl-lisp/owl";
     license     = licenses.mit;
diff --git a/nixpkgs/pkgs/development/compilers/pakcs/curry-base.nix b/nixpkgs/pkgs/development/compilers/pakcs/curry-base.nix
index b34a2146383c..660a4f2de40b 100644
--- a/nixpkgs/pkgs/development/compilers/pakcs/curry-base.nix
+++ b/nixpkgs/pkgs/development/compilers/pakcs/curry-base.nix
@@ -1,5 +1,5 @@
 { mkDerivation, base, Cabal, containers, directory, extra, filepath
-, mtl, parsec, pretty, stdenv, time, transformers
+, mtl, parsec, pretty, lib, stdenv, time, transformers
 }:
 mkDerivation {
   pname = "curry-base";
@@ -12,5 +12,5 @@ mkDerivation {
   testHaskellDepends = [ base Cabal filepath mtl ];
   homepage = "http://curry-language.org";
   description = "Functions for manipulating Curry programs";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/nixpkgs/pkgs/development/compilers/pakcs/curry-frontend.nix b/nixpkgs/pkgs/development/compilers/pakcs/curry-frontend.nix
index b169578c7c38..8fd1645ee704 100644
--- a/nixpkgs/pkgs/development/compilers/pakcs/curry-frontend.nix
+++ b/nixpkgs/pkgs/development/compilers/pakcs/curry-frontend.nix
@@ -1,6 +1,6 @@
 { mkDerivation, base, bytestring, Cabal, containers, curry-base
 , directory, extra, file-embed, filepath, mtl, network-uri, pretty
-, process, set-extra, stdenv, template-haskell, transformers
+, process, set-extra, lib, stdenv, template-haskell, transformers
 }:
 mkDerivation {
   pname = "curry-frontend";
@@ -22,5 +22,5 @@ mkDerivation {
   testHaskellDepends = [ base Cabal curry-base filepath ];
   homepage = "http://curry-language.org";
   description = "Compile the functional logic language Curry to several intermediate formats";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/nixpkgs/pkgs/development/compilers/pakcs/default.nix b/nixpkgs/pkgs/development/compilers/pakcs/default.nix
index 9f876ea914af..98fab9eb210b 100644
--- a/nixpkgs/pkgs/development/compilers/pakcs/default.nix
+++ b/nixpkgs/pkgs/development/compilers/pakcs/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper
+{ lib, stdenv, fetchurl, makeWrapper
 , haskellPackages, haskell
 , which, swiProlog, rlwrap, tk
 , curl, git, unzip, gnutar, coreutils, sqlite }:
@@ -74,10 +74,10 @@ in stdenv.mkDerivation {
 
     # List of dependencies from currytools/cpm/src/CPM/Main.curry
     wrapProgram $out/pakcs/bin/cypm \
-      --prefix PATH ":" "${stdenv.lib.makeBinPath [ curl git unzip gnutar coreutils sqlite ]}"
+      --prefix PATH ":" "${lib.makeBinPath [ curl git unzip gnutar coreutils sqlite ]}"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.informatik.uni-kiel.de/~pakcs/";
     description = "An implementation of the multi-paradigm declarative language Curry";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/compilers/pforth/default.nix b/nixpkgs/pkgs/development/compilers/pforth/default.nix
index ce228c2f1cb5..44c6ea0a16a2 100644
--- a/nixpkgs/pkgs/development/compilers/pforth/default.nix
+++ b/nixpkgs/pkgs/development/compilers/pforth/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fetchpatch }:
+{ lib, stdenv, fetchFromGitHub, fetchpatch }:
 
 stdenv.mkDerivation {
   version = "28";
@@ -29,8 +29,8 @@ stdenv.mkDerivation {
   meta = {
     description = "Portable ANSI style Forth written in ANSI C";
     homepage = "http://www.softsynth.com/pforth/";
-    license = stdenv.lib.licenses.publicDomain;
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ yrashk ];
+    license = lib.licenses.publicDomain;
+    platforms = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ yrashk ];
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/picat/default.nix b/nixpkgs/pkgs/development/compilers/picat/default.nix
index 4898f991079c..159dec05e293 100644
--- a/nixpkgs/pkgs/development/compilers/picat/default.nix
+++ b/nixpkgs/pkgs/development/compilers/picat/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, zlib }:
+{ lib, stdenv, fetchurl, zlib }:
 
 let
   ARCH = {
@@ -9,11 +9,11 @@ let
 in
 stdenv.mkDerivation {
   pname = "picat";
-  version = "3.0p3";
+  version = "3.0p4";
 
   src = fetchurl {
-    url    = "http://picat-lang.org/download/picat30_3_src.tar.gz";
-    sha256 = "052w0vk2xfmky5nv280ysb8in6vaph7i79yvbddqmahzszarq5hw";
+    url    = "http://picat-lang.org/download/picat30_4_src.tar.gz";
+    sha256 = "1rwin44m7ni2h2v51sh2r8gj2k6wm6f86zgaylrria9jr57inpqj";
   };
 
   buildInputs = [ zlib ];
@@ -26,7 +26,7 @@ stdenv.mkDerivation {
   buildPhase = "cd emu && make -j $NIX_BUILD_CORES -f Makefile.$ARCH";
   installPhase = "mkdir -p $out/bin && cp picat $out/bin/picat";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Logic-based programming langage";
     homepage    = "http://picat-lang.org/";
     license     = licenses.mpl20;
diff --git a/nixpkgs/pkgs/development/compilers/polyml/5.6.nix b/nixpkgs/pkgs/development/compilers/polyml/5.6.nix
index 714adfb0e4cb..7858e3f6dc11 100644
--- a/nixpkgs/pkgs/development/compilers/polyml/5.6.nix
+++ b/nixpkgs/pkgs/development/compilers/polyml/5.6.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, autoreconfHook}:
+{lib, stdenv, fetchurl, autoreconfHook}:
 
 let
   version = "5.6";
@@ -8,11 +8,11 @@ stdenv.mkDerivation {
   pname = "polyml";
   inherit version;
 
-  prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
+  prePatch = lib.optionalString stdenv.isDarwin ''
     substituteInPlace configure.ac --replace stdc++ c++
   '';
 
-  buildInputs = stdenv.lib.optional stdenv.isDarwin autoreconfHook;
+  buildInputs = lib.optional stdenv.isDarwin autoreconfHook;
 
   src = fetchurl {
     url = "mirror://sourceforge/polyml/polyml.${version}.tar.gz";
@@ -25,10 +25,10 @@ stdenv.mkDerivation {
       Poly/ML is a full implementation of Standard ML.
     '';
     homepage = "https://www.polyml.org/";
-    license = stdenv.lib.licenses.lgpl21;
-    platforms = with stdenv.lib.platforms; linux;
+    license = lib.licenses.lgpl21;
+    platforms = with lib.platforms; linux;
     maintainers = [ #Add your name here!
-      stdenv.lib.maintainers.maggesi
+      lib.maintainers.maggesi
     ];
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/polyml/5.7.nix b/nixpkgs/pkgs/development/compilers/polyml/5.7.nix
index ce8c033e4bed..5ac6990383cc 100644
--- a/nixpkgs/pkgs/development/compilers/polyml/5.7.nix
+++ b/nixpkgs/pkgs/development/compilers/polyml/5.7.nix
@@ -1,10 +1,10 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, gmp, libffi }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, gmp, libffi }:
 
 stdenv.mkDerivation rec {
   pname = "polyml";
   version = "5.7.1";
 
-  prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
+  prePatch = lib.optionalString stdenv.isDarwin ''
     substituteInPlace configure.ac --replace stdc++ c++
   '';
 
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libffi gmp ];
 
-  nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin autoreconfHook;
+  nativeBuildInputs = lib.optional stdenv.isDarwin autoreconfHook;
 
   configureFlags = [
     "--enable-shared"
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
     sha256 = "0j0wv3ijfrjkfngy7dswm4k1dchk3jak9chl5735dl8yrl8mq755";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Standard ML compiler and interpreter";
     longDescription = ''
       Poly/ML is a full implementation of Standard ML.
diff --git a/nixpkgs/pkgs/development/compilers/polyml/default.nix b/nixpkgs/pkgs/development/compilers/polyml/default.nix
index 7b15a988e38a..d2a150334228 100644
--- a/nixpkgs/pkgs/development/compilers/polyml/default.nix
+++ b/nixpkgs/pkgs/development/compilers/polyml/default.nix
@@ -1,16 +1,16 @@
-{ stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, gmp, libffi }:
+{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, gmp, libffi }:
 
 stdenv.mkDerivation rec {
   pname = "polyml";
   version = "5.8.1";
 
-  prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
+  prePatch = lib.optionalString stdenv.isDarwin ''
     substituteInPlace configure.ac --replace stdc++ c++
   '';
 
   buildInputs = [ libffi gmp ];
 
-  nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin autoreconfHook;
+  nativeBuildInputs = lib.optional stdenv.isDarwin autoreconfHook;
 
   configureFlags = [
     "--enable-shared"
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
     sha256 = "0gcx2fjiwsiazlyfhm7zlrd563blc4fy9w2mspib9divbavaxin6";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Standard ML compiler and interpreter";
     longDescription = ''
       Poly/ML is a full implementation of Standard ML.
diff --git a/nixpkgs/pkgs/development/compilers/ponyc/default.nix b/nixpkgs/pkgs/development/compilers/ponyc/default.nix
index 0bfaba914a7b..3a2e3c4b944c 100644
--- a/nixpkgs/pkgs/development/compilers/ponyc/default.nix
+++ b/nixpkgs/pkgs/development/compilers/ponyc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fetchurl, makeWrapper, pcre2, coreutils, which, libressl, libxml2, cmake, z3, substituteAll,
+{ lib, stdenv, fetchFromGitHub, fetchurl, makeWrapper, pcre2, coreutils, which, libressl, libxml2, cmake, z3, substituteAll,
   cc ? stdenv.cc, lto ? !stdenv.isDarwin }:
 
 stdenv.mkDerivation (rec {
@@ -29,7 +29,8 @@ stdenv.mkDerivation (rec {
     name = "v1.5.0.tar.gz";
   };
 
-  buildInputs = [ makeWrapper which libxml2 cmake z3 ];
+  nativeBuildInputs = [ cmake makeWrapper which ];
+  buildInputs = [ libxml2 z3 ];
   propagatedBuildInputs = [ cc ];
 
   # Sandbox disallows network access, so disabling problematic networking tests
@@ -79,31 +80,28 @@ stdenv.mkDerivation (rec {
     "PONYC_VERSION=${version}"
     "prefix=${placeholder "out"}"
   ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ "bits=64" ]
-    ++ stdenv.lib.optionals (stdenv.isDarwin && (!lto)) [ "lto=no" ];
-
-  enableParallelBuilding = true;
+    ++ lib.optionals stdenv.isDarwin [ "bits=64" ]
+    ++ lib.optionals (stdenv.isDarwin && (!lto)) [ "lto=no" ];
 
   doCheck = true;
 
   NIX_CFLAGS_COMPILE = [ "-Wno-error=redundant-move" "-Wno-error=implicit-fallthrough" ];
 
-  installPhase = ''
-    make config=release prefix=$out ''
-    + stdenv.lib.optionalString stdenv.isDarwin '' bits=64 ''
-    + stdenv.lib.optionalString (stdenv.isDarwin && (!lto)) '' lto=no ''
+  installPhase = "make config=release prefix=$out "
+    + lib.optionalString stdenv.isDarwin "bits=64 "
+    + lib.optionalString (stdenv.isDarwin && (!lto)) "lto=no "
     + '' install
 
     wrapProgram $out/bin/ponyc \
       --prefix PATH ":" "${stdenv.cc}/bin" \
       --set-default CC "$CC" \
-      --prefix PONYPATH : "${stdenv.lib.makeLibraryPath [ pcre2 libressl (placeholder "out") ]}"
+      --prefix PONYPATH : "${lib.makeLibraryPath [ pcre2 libressl (placeholder "out") ]}"
   '';
 
   # Stripping breaks linking for ponyc
   dontStrip = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Pony is an Object-oriented, actor-model, capabilities-secure, high performance programming language";
     homepage = "https://www.ponylang.org";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/compilers/ponyc/pony-corral.nix b/nixpkgs/pkgs/development/compilers/ponyc/pony-corral.nix
index 7cf3000e9db1..5da1ec77016c 100644
--- a/nixpkgs/pkgs/development/compilers/ponyc/pony-corral.nix
+++ b/nixpkgs/pkgs/development/compilers/ponyc/pony-corral.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, ponyc }:
+{ lib, stdenv, fetchFromGitHub, ponyc }:
 
 stdenv.mkDerivation ( rec {
   pname = "corral";
@@ -15,7 +15,7 @@ stdenv.mkDerivation ( rec {
 
   installFlags = [ "prefix=${placeholder "out"}" "install" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Corral is a dependency management tool for ponylang (ponyc)";
     homepage = "https://www.ponylang.io";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/compilers/ponyc/pony-stable.nix b/nixpkgs/pkgs/development/compilers/ponyc/pony-stable.nix
index 3c1b2a0f91b4..8e5810508971 100644
--- a/nixpkgs/pkgs/development/compilers/ponyc/pony-stable.nix
+++ b/nixpkgs/pkgs/development/compilers/ponyc/pony-stable.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchFromGitHub, ponyc }:
+{lib, stdenv, fetchFromGitHub, ponyc }:
 
 stdenv.mkDerivation rec {
   pname = "pony-stable";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A simple dependency manager for the Pony language";
     homepage = "https://www.ponylang.org";
-    license = stdenv.lib.licenses.bsd2;
-    maintainers = with stdenv.lib.maintainers; [ dipinhora kamilchm patternspandemic ];
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.bsd2;
+    maintainers = with lib.maintainers; [ dipinhora kamilchm patternspandemic ];
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/purescript/purescript/default.nix b/nixpkgs/pkgs/development/compilers/purescript/purescript/default.nix
index 8dd19ecf8586..741d0ec7d1c3 100644
--- a/nixpkgs/pkgs/development/compilers/purescript/purescript/default.nix
+++ b/nixpkgs/pkgs/development/compilers/purescript/purescript/default.nix
@@ -55,7 +55,7 @@ in stdenv.mkDerivation rec {
     minimal-module = pkgs.callPackage ./test-minimal-module {};
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A strongly-typed functional programming language that compiles to JavaScript";
     homepage = "https://www.purescript.org/";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/compilers/qbe/default.nix b/nixpkgs/pkgs/development/compilers/qbe/default.nix
index 436b03e499c3..9ebcb2242ddb 100644
--- a/nixpkgs/pkgs/development/compilers/qbe/default.nix
+++ b/nixpkgs/pkgs/development/compilers/qbe/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchgit
 , unstableGitUpdater
 }:
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   passthru.updateScript = unstableGitUpdater { };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://c9x.me/compile/";
     description = "A small compiler backend written in C";
     maintainers = with maintainers; [ fgaz ];
diff --git a/nixpkgs/pkgs/development/compilers/rasm/default.nix b/nixpkgs/pkgs/development/compilers/rasm/default.nix
index 37e07a230aec..c2415899f6b4 100644
--- a/nixpkgs/pkgs/development/compilers/rasm/default.nix
+++ b/nixpkgs/pkgs/development/compilers/rasm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip }:
+{ lib, stdenv, fetchurl, unzip }:
 
 stdenv.mkDerivation rec {
   pname = "rasm";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     install -Dt $out/bin rasm
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.roudoudou.com/rasm/";
     description = "Z80 assembler";
     # use -n option to display all licenses
diff --git a/nixpkgs/pkgs/development/compilers/reason/default.nix b/nixpkgs/pkgs/development/compilers/reason/default.nix
index 4c0e9c298519..2807ddb6b5fd 100644
--- a/nixpkgs/pkgs/development/compilers/reason/default.nix
+++ b/nixpkgs/pkgs/development/compilers/reason/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, makeWrapper, fetchFromGitHub, ocaml, findlib, dune
+{ lib, stdenv, makeWrapper, fetchFromGitHub, ocaml, findlib, dune_2
 , fix, menhir, merlin-extend, ppx_tools_versioned, utop, cppo
 }:
 
@@ -17,20 +17,19 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ menhir merlin-extend ppx_tools_versioned ];
 
-  buildInputs = [ ocaml findlib dune cppo fix utop menhir ];
+  buildInputs = [ ocaml findlib dune_2 cppo fix utop menhir ];
 
   buildFlags = [ "build" ]; # do not "make tests" before reason lib is installed
 
-  inherit (dune) installPhase;
-
-  postInstall = ''
+  installPhase = ''
+    dune install --prefix=$out --libdir=$OCAMLFIND_DESTDIR
     wrapProgram $out/bin/rtop \
       --prefix PATH : "${utop}/bin" \
       --prefix CAML_LD_LIBRARY_PATH : "$CAML_LD_LIBRARY_PATH" \
       --prefix OCAMLPATH : "$OCAMLPATH:$OCAMLFIND_DESTDIR"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://reasonml.github.io/";
     description = "Facebook's friendly syntax to OCaml";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/compilers/rgbds/default.nix b/nixpkgs/pkgs/development/compilers/rgbds/default.nix
index 4c8a4cfd4efa..6bc74971c4e9 100644
--- a/nixpkgs/pkgs/development/compilers/rgbds/default.nix
+++ b/nixpkgs/pkgs/development/compilers/rgbds/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchFromGitHub, bison, flex, pkg-config, libpng}:
+{lib, stdenv, fetchFromGitHub, bison, flex, pkg-config, libpng}:
 
 # TODO: byacc is the recommended parser generator but due to https://github.com/rednex/rgbds/issues/333
 # it does not work for the moment. We should switch back to byacc as soon as the fix is integrated
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ bison flex pkg-config libpng ];
   installFlags = [ "PREFIX=\${out}" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://rednex.github.io/rgbds/";
     description = "A free assembler/linker package for the Game Boy and Game Boy Color";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/compilers/rust/1_45.nix b/nixpkgs/pkgs/development/compilers/rust/1_45.nix
index b4d887f2e964..13b1b3ef488c 100644
--- a/nixpkgs/pkgs/development/compilers/rust/1_45.nix
+++ b/nixpkgs/pkgs/development/compilers/rust/1_45.nix
@@ -33,10 +33,11 @@ import ./default.nix {
   # building
   bootstrapVersion = "1.44.1";
 
-  # fetch hashes by running `print-hashes.sh 1.45.0`
+  # fetch hashes by running `print-hashes.sh ${bootstrapVersion}`
   bootstrapHashes = {
     i686-unknown-linux-gnu = "e69689b0a1b66599cf83e7dd54f839419007e44376195e93e301a3175da3d854";
     x86_64-unknown-linux-gnu = "a41df89a461a580536aeb42755e43037556fba2e527dd13a1e1bb0749de28202";
+    x86_64-unknown-linux-musl = "7eeef2b7488ee96015db10bc52c43f6e023debc9a955ccb8efb382522bf35be9";
     arm-unknown-linux-gnueabihf = "ea18ccdfb62a153c2d43d013fdec56993cc9267f1cdc6f3834df8a2b9b468f08";
     armv7-unknown-linux-gnueabihf = "d44294732cf268ea84908f1135f574ab9489132a332eaa9d5bda547374b15d54";
     aarch64-unknown-linux-gnu = "a2d74ebeec0b6778026b6c37814cdc91d14db3b0d8b6d69d036216f4d9cf7e49";
diff --git a/nixpkgs/pkgs/development/compilers/rust/1_48.nix b/nixpkgs/pkgs/development/compilers/rust/1_49.nix
index 6b4b10f12d3e..3e76cdfe9690 100644
--- a/nixpkgs/pkgs/development/compilers/rust/1_48.nix
+++ b/nixpkgs/pkgs/development/compilers/rust/1_49.nix
@@ -19,8 +19,8 @@
 } @ args:
 
 import ./default.nix {
-  rustcVersion = "1.48.0";
-  rustcSha256 = "0fz4gbb5hp5qalrl9lcl8yw4kk7ai7wx511jb28nypbxninkwxhf";
+  rustcVersion = "1.49.0";
+  rustcSha256 = "0yf7kll517398dgqsr7m3gldzj0iwsp3ggzxrayckpqzvylfy2mm";
 
   llvmSharedForBuild = pkgsBuildBuild.llvm_11.override { enableSharedLibraries = true; };
   llvmSharedForHost = pkgsBuildHost.llvm_11.override { enableSharedLibraries = true; };
@@ -33,20 +33,22 @@ import ./default.nix {
 
   # Note: the version MUST be one version prior to the version we're
   # building
-  bootstrapVersion = "1.47.0";
+  bootstrapVersion = "1.48.0";
 
-  # fetch hashes by running `print-hashes.sh 1.45.2`
+  # fetch hashes by running `print-hashes.sh ${bootstrapVersion}`
   bootstrapHashes = {
-    i686-unknown-linux-gnu = "84bf092130ea5216fc701871e633563fc1c01b6528f60cb0767e96cd8eec30bf";
-    x86_64-unknown-linux-gnu = "d0e11e1756a072e8e246b05d54593402813d047d12e44df281fbabda91035d96";
-    arm-unknown-linux-gnueabihf = "82e12affb47596b68d0ca64045f4eb698c10ff15406afca604e12cdd07e17b26";
-    armv7-unknown-linux-gnueabihf = "19d0fe3892a8e98f99c5aa84f4d6f260853147650cb71f2bae985c91de6c29af";
-    aarch64-unknown-linux-gnu = "753c905e89a714ab9bce6fe1397b721f29c0760c32f09d2f328af3d39919c8e6";
-    x86_64-apple-darwin = "84e5be6c5c78734deba911dcf80316be1e4c7da2c59413124d039ad96620612f";
-    powerpc64le-unknown-linux-gnu = "5760c3b1897ea70791320c2565f3eef700a3d54059027b84bbe6b8d6157f81c8";
+    i686-unknown-linux-gnu = "7fdb8836a1f0427d5b47e6a2d496f67ebff04350407411f57cf20c9b3544e26f";
+    x86_64-unknown-linux-gnu = "950420a35b2dd9091f1b93a9ccd5abc026ca7112e667f246b1deb79204e2038b";
+    x86_64-unknown-linux-musl = "4ed9627f57b4e0b9807fc5e7513d9731f4791668b7f875b9e44e65e21072c56f";
+    arm-unknown-linux-gnueabihf = "e68a81eebd4570343a0fc35cb8ee24cad911d6cee2e374f284b76546ca6636d5";
+    armv7-unknown-linux-gnueabihf = "3aed4a63ebdd57690a31d11afbe95e6407edc224a6769be5694a1ed43bf899cb";
+    aarch64-unknown-linux-gnu = "c4769418d8d89f432e4a3a21ad60f99629e4b13bbfc29aef7d9d51c4e8ee8a8a";
+    aarch64-unknown-linux-musl = "ac4de580a28e45a9773b389b296d13bfeeb08263cb1f8343859577a54940dae9";
+    x86_64-apple-darwin = "20e727cad10f43e3abcedb2a80979ae26923038e0e8a855e8a783da255054113";
+    powerpc64le-unknown-linux-gnu = "e6457a0214f3b1b04bd5b2618bba7e3826e254216420dede2971b571a1c13bb1";
   };
 
-  selectRustPackage = pkgs: pkgs.rust_1_48;
+  selectRustPackage = pkgs: pkgs.rust_1_49;
 
   rustcPatches = [
   ];
diff --git a/nixpkgs/pkgs/development/compilers/rust/binary.nix b/nixpkgs/pkgs/development/compilers/rust/binary.nix
index b84e390e0b0d..770cc3415f2c 100644
--- a/nixpkgs/pkgs/development/compilers/rust/binary.nix
+++ b/nixpkgs/pkgs/development/compilers/rust/binary.nix
@@ -1,4 +1,4 @@
-{ stdenv, makeWrapper, bash, curl, darwin, zlib
+{ lib, stdenv, makeWrapper, bash, curl, darwin, zlib
 , version
 , src
 , platform
@@ -6,7 +6,7 @@
 }:
 
 let
-  inherit (stdenv.lib) optionalString;
+  inherit (lib) optionalString;
   inherit (darwin.apple_sdk.frameworks) Security;
 
   bootstrapping = versionType == "bootstrap";
@@ -24,7 +24,7 @@ rec {
     inherit version;
     inherit src;
 
-    meta = with stdenv.lib; {
+    meta = with lib; {
       homepage = "http://www.rust-lang.org/";
       description = "A safe, concurrent, practical language";
       maintainers = with maintainers; [ qknight ];
@@ -32,7 +32,7 @@ rec {
     };
 
     buildInputs = [ bash ]
-      ++ stdenv.lib.optional stdenv.isDarwin Security;
+      ++ lib.optional stdenv.isDarwin Security;
 
     postPatch = ''
       patchShebangs .
@@ -46,7 +46,7 @@ rec {
         patchelf \
           --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
           "$out/bin/rustc"
-        '' + optionalString (stdenv.lib.versionAtLeast version "1.46")
+        '' + optionalString (lib.versionAtLeast version "1.46")
         # rustc bootstrap needs libz starting from 1.46
         ''
           ln -s ${zlib}/lib/libz.so.1 $out/lib/libz.so.1
@@ -76,7 +76,7 @@ rec {
     inherit version;
     inherit src;
 
-    meta = with stdenv.lib; {
+    meta = with lib; {
       homepage = "http://www.rust-lang.org/";
       description = "A safe, concurrent, practical language";
       maintainers = with maintainers; [ qknight ];
@@ -84,7 +84,7 @@ rec {
     };
 
     buildInputs = [ makeWrapper bash ]
-      ++ stdenv.lib.optional stdenv.isDarwin Security;
+      ++ lib.optional stdenv.isDarwin Security;
 
     postPatch = ''
       patchShebangs .
diff --git a/nixpkgs/pkgs/development/compilers/rust/cargo.nix b/nixpkgs/pkgs/development/compilers/rust/cargo.nix
index e820b982620a..3a7f29e32293 100644
--- a/nixpkgs/pkgs/development/compilers/rust/cargo.nix
+++ b/nixpkgs/pkgs/development/compilers/rust/cargo.nix
@@ -1,4 +1,4 @@
-{ stdenv, file, curl, pkgconfig, python3, openssl, cmake, zlib
+{ lib, stdenv, file, curl, pkg-config, python3, openssl, cmake, zlib
 , installShellFiles, makeWrapper, libiconv, cacert, rustPlatform, rustc
 , CoreFoundation, Security
 }:
@@ -16,9 +16,9 @@ rustPlatform.buildRustPackage {
   # changes hash of vendor directory otherwise
   dontUpdateAutotoolsGnuConfigScripts = true;
 
-  nativeBuildInputs = [ pkgconfig cmake installShellFiles makeWrapper ];
+  nativeBuildInputs = [ pkg-config cmake installShellFiles makeWrapper ];
   buildInputs = [ cacert file curl python3 openssl zlib ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ CoreFoundation Security libiconv ];
+    ++ lib.optionals stdenv.isDarwin [ CoreFoundation Security libiconv ];
 
   # cargo uses git-rs which is made for a version of libgit2 from recent master that
   # is not compatible with the current version in nixpkgs.
@@ -54,7 +54,7 @@ rustPlatform.buildRustPackage {
   # Disable check phase as there are failures (4 tests fail)
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://crates.io";
     description = "Downloads your Rust project's dependencies and builds your project";
     maintainers = with maintainers; [ retrry ];
diff --git a/nixpkgs/pkgs/development/compilers/rust/clippy.nix b/nixpkgs/pkgs/development/compilers/rust/clippy.nix
index 0546ad9bac1a..a3597e9febf7 100644
--- a/nixpkgs/pkgs/development/compilers/rust/clippy.nix
+++ b/nixpkgs/pkgs/development/compilers/rust/clippy.nix
@@ -10,7 +10,7 @@ rustPlatform.buildRustPackage {
   # changes hash of vendor directory otherwise
   dontUpdateAutotoolsGnuConfigScripts = true;
 
-  buildInputs = [ rustc rustc.llvm ] ++ stdenv.lib.optionals stdenv.isDarwin [ Security ];
+  buildInputs = [ rustc rustc.llvm ] ++ lib.optionals stdenv.isDarwin [ Security ];
 
   # fixes: error: the option `Z` is only accepted on the nightly compiler
   RUSTC_BOOTSTRAP = 1;
@@ -20,11 +20,11 @@ rustPlatform.buildRustPackage {
   #   (/private/tmp/nix-build-clippy-1.36.0.drv-0/rustc-1.36.0-src/src/librustc_llvm)
   doCheck = false;
 
-  preFixup = stdenv.lib.optionalString stdenv.isDarwin ''
+  preFixup = lib.optionalString stdenv.isDarwin ''
     install_name_tool -add_rpath "${rustc}/lib" $out/bin/clippy-driver
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://rust-lang.github.io/rust-clippy/";
     description = "A bunch of lints to catch common mistakes and improve your Rust code";
     maintainers = with maintainers; [ basvandijk ];
diff --git a/nixpkgs/pkgs/development/compilers/rust/print-hashes.sh b/nixpkgs/pkgs/development/compilers/rust/print-hashes.sh
index 9180ccb67d91..0639726f48d7 100755
--- a/nixpkgs/pkgs/development/compilers/rust/print-hashes.sh
+++ b/nixpkgs/pkgs/development/compilers/rust/print-hashes.sh
@@ -10,9 +10,11 @@ set -euo pipefail
 PLATFORMS=(
   i686-unknown-linux-gnu
   x86_64-unknown-linux-gnu
+  x86_64-unknown-linux-musl
   arm-unknown-linux-gnueabihf
   armv7-unknown-linux-gnueabihf
   aarch64-unknown-linux-gnu
+  aarch64-unknown-linux-musl
   x86_64-apple-darwin
   powerpc64le-unknown-linux-gnu
 )
diff --git a/nixpkgs/pkgs/development/compilers/rust/rls/default.nix b/nixpkgs/pkgs/development/compilers/rust/rls/default.nix
index 06b1b9b1e648..ee860d782580 100644
--- a/nixpkgs/pkgs/development/compilers/rust/rls/default.nix
+++ b/nixpkgs/pkgs/development/compilers/rust/rls/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, makeWrapper, fetchFromGitHub, rustPlatform
-, openssh, openssl, pkgconfig, cmake, zlib, curl, libiconv
+{ lib, stdenv, makeWrapper, fetchFromGitHub, rustPlatform
+, openssh, openssl, pkg-config, cmake, zlib, curl, libiconv
 , CoreFoundation, Security }:
 
 rustPlatform.buildRustPackage {
@@ -28,9 +28,9 @@ rustPlatform.buildRustPackage {
   # rls-rustc links to rustc_private crates
   CARGO_BUILD_RUSTFLAGS = if stdenv.isDarwin then "-C rpath" else null;
 
-  nativeBuildInputs = [ pkgconfig cmake ];
+  nativeBuildInputs = [ pkg-config cmake ];
   buildInputs = [ openssh openssl curl zlib libiconv makeWrapper rustPlatform.rust.rustc.llvm ]
-    ++ (stdenv.lib.optionals stdenv.isDarwin [ CoreFoundation Security ]);
+    ++ (lib.optionals stdenv.isDarwin [ CoreFoundation Security ]);
 
   doCheck = true;
 
@@ -39,12 +39,12 @@ rustPlatform.buildRustPackage {
     $out/bin/rls --version
   '';
 
-  RUST_SRC_PATH = rustPlatform.rustcSrc;
+  RUST_SRC_PATH = rustPlatform.rustLibSrc;
   postInstall = ''
-    wrapProgram $out/bin/rls --set-default RUST_SRC_PATH ${rustPlatform.rustcSrc}
+    wrapProgram $out/bin/rls --set-default RUST_SRC_PATH ${rustPlatform.rustLibSrc}
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Rust Language Server - provides information about Rust programs to IDEs and other tools";
     homepage = "https://github.com/rust-lang/rls/";
     license = with licenses; [ asl20 /* or */ mit ];
diff --git a/nixpkgs/pkgs/development/compilers/rust/rustc.nix b/nixpkgs/pkgs/development/compilers/rust/rustc.nix
index 570cd8b796fd..315fe7c0c6d1 100644
--- a/nixpkgs/pkgs/development/compilers/rust/rustc.nix
+++ b/nixpkgs/pkgs/development/compilers/rust/rustc.nix
@@ -1,8 +1,8 @@
-{ stdenv, removeReferencesTo, pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget
+{ lib, stdenv, removeReferencesTo, pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget
 , llvmShared, llvmSharedForBuild, llvmSharedForHost, llvmSharedForTarget
 , fetchurl, file, python3
 , darwin, cmake, rust, rustPlatform
-, pkgconfig, openssl
+, pkg-config, openssl
 , which, libffi
 , withBundledLLVM ? false
 , enableRustcDev ? true
@@ -12,7 +12,7 @@
 }:
 
 let
-  inherit (stdenv.lib) optionals optional optionalString concatStringsSep;
+  inherit (lib) optionals optional optionalString concatStringsSep;
   inherit (darwin.apple_sdk.frameworks) Security;
 in stdenv.mkDerivation rec {
   pname = "rustc";
@@ -117,7 +117,7 @@ in stdenv.mkDerivation rec {
   postPatch = ''
     patchShebangs src/etc
 
-    ${optionalString (!withBundledLLVM) ''rm -rf src/llvm''}
+    ${optionalString (!withBundledLLVM) "rm -rf src/llvm"}
 
     # Fix the configure script to not require curl as we won't use it
     sed -i configure \
@@ -133,7 +133,7 @@ in stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     file python3 rustPlatform.rust.rustc cmake
-    which libffi removeReferencesTo pkgconfig
+    which libffi removeReferencesTo pkg-config
   ];
 
   buildInputs = [ openssl ]
@@ -143,7 +143,7 @@ in stdenv.mkDerivation rec {
   outputs = [ "out" "man" "doc" ];
   setOutputFlags = false;
 
-  postInstall = stdenv.lib.optionalString enableRustcDev ''
+  postInstall = lib.optionalString enableRustcDev ''
     # install rustc-dev components. Necessary to build rls, clippy...
     python x.py dist rustc-dev
     tar xf build/dist/rustc-dev*tar.gz
@@ -172,7 +172,7 @@ in stdenv.mkDerivation rec {
 
   passthru.llvm = llvmShared;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.rust-lang.org/";
     description = "A safe, concurrent, practical language";
     maintainers = with maintainers; [ madjar cstrahan globin havvy ];
diff --git a/nixpkgs/pkgs/development/compilers/rust/rustfmt.nix b/nixpkgs/pkgs/development/compilers/rust/rustfmt.nix
index 6215c936c6d0..b3191c242fea 100644
--- a/nixpkgs/pkgs/development/compilers/rust/rustfmt.nix
+++ b/nixpkgs/pkgs/development/compilers/rust/rustfmt.nix
@@ -1,4 +1,4 @@
-{ stdenv, rustPlatform, Security }:
+{ lib, stdenv, rustPlatform, Security }:
 
 rustPlatform.buildRustPackage rec {
   pname = "rustfmt";
@@ -11,7 +11,7 @@ rustPlatform.buildRustPackage rec {
   # changes hash of vendor directory otherwise
   dontUpdateAutotoolsGnuConfigScripts = true;
 
-  buildInputs = stdenv.lib.optional stdenv.isDarwin Security;
+  buildInputs = lib.optional stdenv.isDarwin Security;
 
   # As of 1.0.0 and rustc 1.30 rustfmt requires a nightly compiler
   RUSTC_BOOTSTRAP = 1;
@@ -21,7 +21,7 @@ rustPlatform.buildRustPackage rec {
   CFG_RELEASE = "${rustPlatform.rust.rustc.version}-nightly";
   CFG_RELEASE_CHANNEL = "nightly";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A tool for formatting Rust code according to style guidelines";
     homepage = "https://github.com/rust-lang-nursery/rustfmt";
     license = with licenses; [ mit asl20 ];
diff --git a/nixpkgs/pkgs/development/compilers/sagittarius-scheme/default.nix b/nixpkgs/pkgs/development/compilers/sagittarius-scheme/default.nix
index dcc3457fe112..b421fe5d2eff 100644
--- a/nixpkgs/pkgs/development/compilers/sagittarius-scheme/default.nix
+++ b/nixpkgs/pkgs/development/compilers/sagittarius-scheme/default.nix
@@ -1,7 +1,7 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , cmake
-, pkgconfig
+, pkg-config
 , libffi
 , boehmgc
 , openssl
@@ -27,11 +27,11 @@ stdenv.mkDerivation rec {
            # build extensions
            export ${platformLdLibraryPath}="$(pwd)/build"
            '';
-  nativeBuildInputs = [ pkgconfig cmake ];
+  nativeBuildInputs = [ pkg-config cmake ];
 
-  buildInputs = [ libffi boehmgc openssl zlib ] ++ stdenv.lib.optional odbcSupport libiodbc;
+  buildInputs = [ libffi boehmgc openssl zlib ] ++ lib.optional odbcSupport libiodbc;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An R6RS/R7RS Scheme system";
     longDescription = ''
       Sagittarius Scheme is a free Scheme implementation supporting
diff --git a/nixpkgs/pkgs/development/compilers/sbcl/2.0.9.nix b/nixpkgs/pkgs/development/compilers/sbcl/2.0.9.nix
index 148ecccf1316..ada098ec1829 100644
--- a/nixpkgs/pkgs/development/compilers/sbcl/2.0.9.nix
+++ b/nixpkgs/pkgs/development/compilers/sbcl/2.0.9.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, writeText, sbclBootstrap
+{ lib, stdenv, fetchurl, writeText, sbclBootstrap
 , sbclBootstrapHost ? "${sbclBootstrap}/bin/sbcl --disable-debugger --no-userinit --no-sysinit"
 , threadSupport ? (stdenv.isi686 || stdenv.isx86_64 || "aarch64-linux" == stdenv.hostPlatform.system)
 , disableImmobileSpace ? false
@@ -70,17 +70,17 @@ stdenv.mkDerivation rec {
     export HOME=$PWD/test-home
   '';
 
-  enableFeatures = with stdenv.lib;
+  enableFeatures = with lib;
     optional threadSupport "sb-thread" ++
     optional stdenv.isAarch32 "arm";
 
-  disableFeatures = with stdenv.lib;
+  disableFeatures = with lib;
     optional (!threadSupport) "sb-thread" ++
     optionals disableImmobileSpace [ "immobile-space" "immobile-code" "compact-instance-header" ];
 
   buildPhase = ''
     sh make.sh --prefix=$out --xc-host="${sbclBootstrapHost}" ${
-                  stdenv.lib.concatStringsSep " "
+                  lib.concatStringsSep " "
                     (builtins.map (x: "--with-${x}") enableFeatures ++
                      builtins.map (x: "--without-${x}") disableFeatures)
                 }
@@ -90,7 +90,7 @@ stdenv.mkDerivation rec {
   installPhase = ''
     INSTALL_ROOT=$out sh install.sh
   ''
-  + stdenv.lib.optionalString (!purgeNixReferences) ''
+  + lib.optionalString (!purgeNixReferences) ''
     cp -r src $out/lib/sbcl
     cp -r contrib $out/lib/sbcl
     cat >$out/lib/sbcl/sbclrc <<EOF
@@ -100,7 +100,7 @@ stdenv.mkDerivation rec {
     EOF
   '';
 
-  setupHook = stdenv.lib.optional purgeNixReferences (writeText "setupHook.sh" ''
+  setupHook = lib.optional purgeNixReferences (writeText "setupHook.sh" ''
     addEnvHooks "$targetOffset" _setSbclHome
     _setSbclHome() {
       export SBCL_HOME='@out@/lib/sbcl/'
diff --git a/nixpkgs/pkgs/development/compilers/sbcl/bootstrap.nix b/nixpkgs/pkgs/development/compilers/sbcl/bootstrap.nix
index 81afe64ed537..cb42235bc8e2 100644
--- a/nixpkgs/pkgs/development/compilers/sbcl/bootstrap.nix
+++ b/nixpkgs/pkgs/development/compilers/sbcl/bootstrap.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper }:
+{ lib, stdenv, fetchurl, makeWrapper }:
 
 let
   options = rec {
@@ -65,11 +65,11 @@ stdenv.mkDerivation rec {
       --add-flags "--core $out/share/sbcl/sbcl.core"
   '';
 
-  postFixup = stdenv.lib.optionalString (!stdenv.isAarch32 && stdenv.isLinux) ''
+  postFixup = lib.optionalString (!stdenv.isAarch32 && stdenv.isLinux) ''
     patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) $out/share/sbcl/sbcl
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Lisp compiler";
     homepage = "http://www.sbcl.org";
     license = licenses.publicDomain; # and FreeBSD
diff --git a/nixpkgs/pkgs/development/compilers/sbcl/default.nix b/nixpkgs/pkgs/development/compilers/sbcl/default.nix
index 3c7fca3c4b03..df80bb8af1d7 100644
--- a/nixpkgs/pkgs/development/compilers/sbcl/default.nix
+++ b/nixpkgs/pkgs/development/compilers/sbcl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, writeText, sbclBootstrap
+{ lib, stdenv, fetchurl, writeText, sbclBootstrap
 , sbclBootstrapHost ? "${sbclBootstrap}/bin/sbcl --disable-debugger --no-userinit --no-sysinit"
 , threadSupport ? (stdenv.isi686 || stdenv.isx86_64 || "aarch64-linux" == stdenv.hostPlatform.system)
 , disableImmobileSpace ? false
@@ -70,17 +70,17 @@ stdenv.mkDerivation rec {
     export HOME=$PWD/test-home
   '';
 
-  enableFeatures = with stdenv.lib;
+  enableFeatures = with lib;
     optional threadSupport "sb-thread" ++
     optional stdenv.isAarch32 "arm";
 
-  disableFeatures = with stdenv.lib;
+  disableFeatures = with lib;
     optional (!threadSupport) "sb-thread" ++
     optionals disableImmobileSpace [ "immobile-space" "immobile-code" "compact-instance-header" ];
 
   buildPhase = ''
     sh make.sh --prefix=$out --xc-host="${sbclBootstrapHost}" ${
-                  stdenv.lib.concatStringsSep " "
+                  lib.concatStringsSep " "
                     (builtins.map (x: "--with-${x}") enableFeatures ++
                      builtins.map (x: "--without-${x}") disableFeatures)
                 }
@@ -90,7 +90,7 @@ stdenv.mkDerivation rec {
   installPhase = ''
     INSTALL_ROOT=$out sh install.sh
   ''
-  + stdenv.lib.optionalString (!purgeNixReferences) ''
+  + lib.optionalString (!purgeNixReferences) ''
     cp -r src $out/lib/sbcl
     cp -r contrib $out/lib/sbcl
     cat >$out/lib/sbcl/sbclrc <<EOF
@@ -100,7 +100,7 @@ stdenv.mkDerivation rec {
     EOF
   '';
 
-  setupHook = stdenv.lib.optional purgeNixReferences (writeText "setupHook.sh" ''
+  setupHook = lib.optional purgeNixReferences (writeText "setupHook.sh" ''
     addEnvHooks "$targetOffset" _setSbclHome
     _setSbclHome() {
       export SBCL_HOME='@out@/lib/sbcl/'
diff --git a/nixpkgs/pkgs/development/compilers/scala/2.x.nix b/nixpkgs/pkgs/development/compilers/scala/2.x.nix
index 15c73f814007..a747206dff8d 100644
--- a/nixpkgs/pkgs/development/compilers/scala/2.x.nix
+++ b/nixpkgs/pkgs/development/compilers/scala/2.x.nix
@@ -22,8 +22,8 @@ let
     };
 
     "2.12" = {
-      version = "2.12.12";
-      sha256 = "NSDNHzye//YrrudfMuUtHl3BIL4szzQGSeRw5I9Sfis=";
+      version = "2.12.13";
+      sha256 = "17548sx7liskkadqiqaajmwp2w7bh9m2d8hp2mwyg8yslmjx4pcc";
       tests = [ nixosTests.scala.scala_2_12 ];
       pname = "scala_2_12";
     };
@@ -75,7 +75,7 @@ stdenv.mkDerivation rec {
       #!${stdenv.shell}
       set -o errexit
       PATH=${
-        stdenv.lib.makeBinPath [
+        lib.makeBinPath [
           common-updater-scripts
           coreutils
           git
diff --git a/nixpkgs/pkgs/development/compilers/scala/dotty-bare.nix b/nixpkgs/pkgs/development/compilers/scala/dotty-bare.nix
index cefa4537c361..b173de58049b 100644
--- a/nixpkgs/pkgs/development/compilers/scala/dotty-bare.nix
+++ b/nixpkgs/pkgs/development/compilers/scala/dotty-bare.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper, jre, ncurses }:
+{ lib, stdenv, fetchurl, makeWrapper, jre, ncurses }:
 
 stdenv.mkDerivation rec {
   version = "0.26.0-RC1";
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
         done
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Research platform for new language concepts and compiler technologies for Scala";
     longDescription = ''
        Dotty is a platform to try out new language concepts and compiler technologies for Scala.
diff --git a/nixpkgs/pkgs/development/compilers/sdcc/default.nix b/nixpkgs/pkgs/development/compilers/sdcc/default.nix
index 3d3d43a55e50..500c0b4d3951 100644
--- a/nixpkgs/pkgs/development/compilers/sdcc/default.nix
+++ b/nixpkgs/pkgs/development/compilers/sdcc/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchurl, autoconf, bison, boost, flex, texinfo, zlib, gputils ? null
+{ lib, stdenv, fetchurl, autoconf, bison, boost, flex, texinfo, zlib, gputils ? null
 , excludePorts ? [] }:
 
-with stdenv.lib;
+with lib;
 
 let
   # choices: mcs51 z80 z180 r2k r3ka gbz80 tlcs90 ds390 ds400 pic14 pic16 hc08 s08 stm8
diff --git a/nixpkgs/pkgs/development/compilers/seexpr/default.nix b/nixpkgs/pkgs/development/compilers/seexpr/default.nix
index 580fc3b761db..7fc1fc7b1b6d 100644
--- a/nixpkgs/pkgs/development/compilers/seexpr/default.nix
+++ b/nixpkgs/pkgs/development/compilers/seexpr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, libpng, zlib, qt4,
+{ lib, stdenv, fetchFromGitHub, cmake, libpng, zlib, qt4,
 bison, flex, libGLU, pythonPackages
 }:
 
@@ -12,8 +12,9 @@ stdenv.mkDerivation {
     sha256 = "0a44k56jf6dl36fwgg4zpc252wq5lf9cblg74mp73k82hxw439l4";
   };
 
-  buildInputs = [ cmake libGLU libpng zlib qt4 pythonPackages.pyqt4 bison flex ];
-  meta = with stdenv.lib; {
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ libGLU libpng zlib qt4 pythonPackages.pyqt4 bison flex ];
+  meta = with lib; {
     description = "Embeddable expression evaluation engine from Disney Animation";
     homepage = "https://www.disneyanimation.com/technology/seexpr.html";
     maintainers = with maintainers; [ hodapp ];
diff --git a/nixpkgs/pkgs/development/compilers/serpent/default.nix b/nixpkgs/pkgs/development/compilers/serpent/default.nix
index 2459127f425a..775a78a97341 100644
--- a/nixpkgs/pkgs/development/compilers/serpent/default.nix
+++ b/nixpkgs/pkgs/development/compilers/serpent/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, ... }:
+{ lib, stdenv, fetchFromGitHub, ... }:
 
 stdenv.mkDerivation {
   pname = "serpent";
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
     mv serpent $out/bin
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Compiler for the Serpent language for Ethereum";
     longDescription = ''
       Serpent is one of the high-level programming languages used to
diff --git a/nixpkgs/pkgs/development/compilers/shaderc/default.nix b/nixpkgs/pkgs/development/compilers/shaderc/default.nix
index 23532cc84466..678ab3adb06c 100644
--- a/nixpkgs/pkgs/development/compilers/shaderc/default.nix
+++ b/nixpkgs/pkgs/development/compilers/shaderc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, python3 }:
+{ lib, stdenv, fetchFromGitHub, cmake, python3 }:
 # Like many google projects, shaderc doesn't gracefully support separately compiled dependencies, so we can't easily use
 # the versions of glslang and spirv-tools used by vulkan-loader. Exact revisions are taken from
 # https://github.com/google/shaderc/blob/known-good/known_good.json
@@ -50,7 +50,7 @@ in stdenv.mkDerivation rec {
 
   cmakeFlags = [ "-DSHADERC_SKIP_TESTS=ON" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit (src.meta) homepage;
     description = "A collection of tools, libraries and tests for shader compilation";
     license = [ licenses.asl20 ];
diff --git a/nixpkgs/pkgs/development/compilers/smlnj/bootstrap.nix b/nixpkgs/pkgs/development/compilers/smlnj/bootstrap.nix
index 55d96266ac97..113b22768d9f 100644
--- a/nixpkgs/pkgs/development/compilers/smlnj/bootstrap.nix
+++ b/nixpkgs/pkgs/development/compilers/smlnj/bootstrap.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cpio, rsync, xar, makeWrapper }:
+{ lib, stdenv, fetchurl, cpio, rsync, xar, makeWrapper }:
 
 stdenv.mkDerivation rec {
   pname = "smlnj-bootstrap";
@@ -36,8 +36,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Compiler for the Standard ML '97 programming language";
     homepage    = "http://www.smlnj.org";
-    license     = stdenv.lib.licenses.free;
-    platforms   = stdenv.lib.platforms.darwin;
-    maintainers = [ stdenv.lib.maintainers.jwiegley ];
+    license     = lib.licenses.free;
+    platforms   = lib.platforms.darwin;
+    maintainers = [ lib.maintainers.jwiegley ];
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/smlnj/default.nix b/nixpkgs/pkgs/development/compilers/smlnj/default.nix
index 18562bc487aa..3e987e8ccdaf 100644
--- a/nixpkgs/pkgs/development/compilers/smlnj/default.nix
+++ b/nixpkgs/pkgs/development/compilers/smlnj/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 let
   version = "110.95";
   baseurl = "http://smlnj.cs.uchicago.edu/dist/working/${version}";
@@ -79,7 +79,7 @@ in stdenv.mkDerivation {
     done
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Standard ML of New Jersey, a compiler";
     homepage    = "http://smlnj.org";
     license     = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/compilers/solc/default.nix b/nixpkgs/pkgs/development/compilers/solc/default.nix
index 0f0af33e7001..546697d8efec 100644
--- a/nixpkgs/pkgs/development/compilers/solc/default.nix
+++ b/nixpkgs/pkgs/development/compilers/solc/default.nix
@@ -1,13 +1,12 @@
-{ gccStdenv, fetchzip, boost, cmake, ncurses, python3, coreutils
+{ lib, gccStdenv, fetchzip, boost, cmake, ncurses, python3, coreutils
 , z3Support ? true, z3 ? null, cvc4Support ? true, cvc4 ? null
 , cln ? null, gmp ? null
 }:
 
 # compiling source/libsmtutil/CVC4Interface.cpp breaks on clang on Darwin,
 # general commandline tests fail at abiencoderv2_no_warning/ on clang on NixOS
-let stdenv = gccStdenv; in
 
-assert z3Support -> z3 != null && stdenv.lib.versionAtLeast z3.version "4.6.0";
+assert z3Support -> z3 != null && lib.versionAtLeast z3.version "4.6.0";
 assert cvc4Support -> cvc4 != null && cln != null && gmp != null;
 
 let
@@ -18,7 +17,7 @@ let
     sha256 = "0qnx5y6c90fphl9mj9d20j2dfgy6s5yr5l0xnzid0vh71zrp6jwv";
   };
 in
-stdenv.mkDerivation rec {
+gccStdenv.mkDerivation rec {
 
   pname = "solc";
   version = "0.7.4";
@@ -36,20 +35,20 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = [
     "-DBoost_USE_STATIC_LIBS=OFF"
-  ] ++ stdenv.lib.optionals (!z3Support) [
+  ] ++ lib.optionals (!z3Support) [
     "-DUSE_Z3=OFF"
-  ] ++ stdenv.lib.optionals (!cvc4Support) [
+  ] ++ lib.optionals (!cvc4Support) [
     "-DUSE_CVC4=OFF"
   ];
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ boost ]
-    ++ stdenv.lib.optionals z3Support [ z3 ]
-    ++ stdenv.lib.optionals cvc4Support [ cvc4 cln gmp ];
+    ++ lib.optionals z3Support [ z3 ]
+    ++ lib.optionals cvc4Support [ cvc4 cln gmp ];
   checkInputs = [ ncurses python3 ];
 
   # Test fails on darwin for unclear reason
-  doCheck = stdenv.hostPlatform.isLinux;
+  doCheck = gccStdenv.hostPlatform.isLinux;
 
   checkPhase = ''
     while IFS= read -r -d ''' dir
@@ -68,7 +67,7 @@ stdenv.mkDerivation rec {
     popd
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Compiler for Ethereum smart contract language Solidity";
     homepage = "https://github.com/ethereum/solidity";
     license = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/compilers/souffle/default.nix b/nixpkgs/pkgs/development/compilers/souffle/default.nix
index ba13cd7b4b27..e57062642ba4 100644
--- a/nixpkgs/pkgs/development/compilers/souffle/default.nix
+++ b/nixpkgs/pkgs/development/compilers/souffle/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub
+{ lib, stdenv, fetchFromGitHub
 , perl, ncurses, zlib, sqlite, libffi
 , autoreconfHook, mcpp, bison, flex, doxygen, graphviz
 , makeWrapper
@@ -6,7 +6,7 @@
 
 
 let
-  toolsPath = stdenv.lib.makeBinPath [ mcpp ];
+  toolsPath = lib.makeBinPath [ mcpp ];
 in
 stdenv.mkDerivation rec {
   pname = "souffle";
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A translator of declarative Datalog programs into the C++ language";
     homepage    = "https://souffle-lang.github.io/";
     platforms   = platforms.unix;
diff --git a/nixpkgs/pkgs/development/compilers/spasm-ng/default.nix b/nixpkgs/pkgs/development/compilers/spasm-ng/default.nix
index 8eb0ddb59ef7..bd31719731e9 100644
--- a/nixpkgs/pkgs/development/compilers/spasm-ng/default.nix
+++ b/nixpkgs/pkgs/development/compilers/spasm-ng/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, gcc, gmp, openssl, zlib }:
+{ lib, stdenv, fetchFromGitHub, gcc, gmp, openssl, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "spasm-ng";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     install -Dm755 spasm -t $out/bin
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage    = "https://github.com/alberthdev/spasm-ng";
     description = "Z80 assembler with extra features to support development for TI calculators";
     license     = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/compilers/spirv-llvm-translator/default.nix b/nixpkgs/pkgs/development/compilers/spirv-llvm-translator/default.nix
index 73af5f0c9852..324e0b07ad87 100644
--- a/nixpkgs/pkgs/development/compilers/spirv-llvm-translator/default.nix
+++ b/nixpkgs/pkgs/development/compilers/spirv-llvm-translator/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
   # FIXME: CMake tries to run "/llvm-lit" which of course doesn't exist
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage    = "https://github.com/KhronosGroup/SPIRV-LLVM-Translator";
     description = "A tool and a library for bi-directional translation between SPIR-V and LLVM IR";
     license     = licenses.ncsa;
diff --git a/nixpkgs/pkgs/development/compilers/squeak/default.nix b/nixpkgs/pkgs/development/compilers/squeak/default.nix
index 4687ce86a90a..7d531181d1d0 100644
--- a/nixpkgs/pkgs/development/compilers/squeak/default.nix
+++ b/nixpkgs/pkgs/development/compilers/squeak/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, cmake, coreutils, dbus, freetype, glib, gnused
-, libpthreadstubs, pango, pkgconfig, libpulseaudio, which }:
+{ lib, stdenv, fetchurl, cmake, coreutils, dbus, freetype, glib, gnused
+, libpthreadstubs, pango, pkg-config, libpulseaudio, which }:
 
 stdenv.mkDerivation rec {
   pname = "squeak";
@@ -12,12 +12,12 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ coreutils dbus freetype glib gnused libpthreadstubs
     pango libpulseaudio which ];
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
   postPatch = ''
     for i in squeak.in squeak.sh.in; do
       substituteInPlace unix/cmake/$i --replace "PATH=" \
-        "PATH=${stdenv.lib.makeBinPath [ coreutils gnused which ]} #"
+        "PATH=${lib.makeBinPath [ coreutils gnused which ]} #"
     done
   '';
 
@@ -25,11 +25,9 @@ stdenv.mkDerivation rec {
     unix/cmake/configure --prefix=$out --enable-mpg-{mmx,pthreads}
   '';
 
-  enableParallelBuilding = true;
-
   hardeningDisable = [ "format" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Smalltalk programming language and environment";
     longDescription = ''
       Squeak is a full-featured implementation of the Smalltalk programming
diff --git a/nixpkgs/pkgs/development/compilers/stalin/default.nix b/nixpkgs/pkgs/development/compilers/stalin/default.nix
index e37b207b4f2e..f47086b1ca25 100644
--- a/nixpkgs/pkgs/development/compilers/stalin/default.nix
+++ b/nixpkgs/pkgs/development/compilers/stalin/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, ncompress, libX11 }:
+{ fetchurl, lib, stdenv, ncompress, libX11 }:
 
 stdenv.mkDerivation rec {
   name = "stalin-0.11";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ ncompress libX11 ];
 
-  buildPhase = '' ./build '';
+  buildPhase = "./build ";
 
   installPhase = ''
     mkdir -p "$out/bin"
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = "http://www.ece.purdue.edu/~qobi/software.html";
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
     description = "An optimizing Scheme compiler";
 
     maintainers = [ ];
diff --git a/nixpkgs/pkgs/development/compilers/swi-prolog/default.nix b/nixpkgs/pkgs/development/compilers/swi-prolog/default.nix
index dadf374d5b67..ce666852e38a 100644
--- a/nixpkgs/pkgs/development/compilers/swi-prolog/default.nix
+++ b/nixpkgs/pkgs/development/compilers/swi-prolog/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchFromGitHub, jdk, gmp, readline, openssl, unixODBC, zlib
+{ lib, stdenv, fetchFromGitHub, jdk, gmp, readline, openssl, unixODBC, zlib
 , libarchive, db, pcre, libedit, libossp_uuid, libXpm
-, libSM, libXt, freetype, pkgconfig, fontconfig
+, libSM, libXt, freetype, pkg-config, fontconfig
 , cmake, libyaml, Security
 , libjpeg, libX11, libXext, libXft, libXinerama
 , extraLibraries ? [ jdk unixODBC libXpm libSM libXt freetype fontconfig ]
@@ -26,14 +26,14 @@ stdenv.mkDerivation {
     fetchSubmodules = true;
   };
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
   buildInputs = [ gmp readline openssl
     libarchive libyaml db pcre libedit libossp_uuid
     zlib ]
-  ++ stdenv.lib.optionals (withGui && !stdenv.isDarwin) [ libXpm libX11 libXext libXft libXinerama libjpeg ]
+  ++ lib.optionals (withGui && !stdenv.isDarwin) [ libXpm libX11 libXext libXft libXinerama libjpeg ]
   ++ extraLibraries
-  ++ stdenv.lib.optional stdenv.isDarwin Security;
+  ++ lib.optional stdenv.isDarwin Security;
 
   hardeningDisable = [ "format" ];
 
@@ -46,9 +46,9 @@ stdenv.mkDerivation {
   meta = {
     homepage = "https://www.swi-prolog.org";
     description = "A Prolog compiler and interpreter";
-    license = stdenv.lib.licenses.bsd2;
+    license = lib.licenses.bsd2;
 
-    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.optionals (!withGui) stdenv.lib.platforms.darwin;
-    maintainers = [ stdenv.lib.maintainers.meditans ];
+    platforms = lib.platforms.linux ++ lib.optionals (!withGui) lib.platforms.darwin;
+    maintainers = [ lib.maintainers.meditans ];
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/swift/default.nix b/nixpkgs/pkgs/development/compilers/swift/default.nix
index 2cabacadd756..26e9f2b87e1a 100644
--- a/nixpkgs/pkgs/development/compilers/swift/default.nix
+++ b/nixpkgs/pkgs/development/compilers/swift/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , cmake
 , coreutils
 , glibc
@@ -7,7 +7,7 @@
 , perl
 , libedit
 , ninja
-, pkgconfig
+, pkg-config
 , sqlite
 , swig
 , bash
@@ -121,7 +121,7 @@ let
 
   cmakeFlags = [
     "-DGLIBC_INCLUDE_PATH=${stdenv.cc.libc.dev}/include"
-    "-DC_INCLUDE_DIRS=${stdenv.lib.makeSearchPathOutput "dev" "include" devInputs}:${libxml2.dev}/include/libxml2"
+    "-DC_INCLUDE_DIRS=${lib.makeSearchPathOutput "dev" "include" devInputs}:${libxml2.dev}/include/libxml2"
     "-DGCC_INSTALL_PREFIX=${gccForLibs}"
   ];
 
@@ -141,7 +141,7 @@ stdenv.mkDerivation {
     makeWrapper
     ninja
     perl
-    pkgconfig
+    pkg-config
     python
     rsync
     which
@@ -155,7 +155,7 @@ stdenv.mkDerivation {
     libgit2
     python
   ];
-  propagatedUserEnvPkgs = [ git pkgconfig ];
+  propagatedUserEnvPkgs = [ git pkg-config ];
 
   hardeningDisable = [ "format" ]; # for LLDB
 
@@ -282,7 +282,7 @@ stdenv.mkDerivation {
       installable_package=$INSTALLABLE_PACKAGE \
       install_prefix=$out \
       install_destdir=$SWIFT_INSTALL_DIR \
-      extra_cmake_options="${stdenv.lib.concatStringsSep "," cmakeFlags}"
+      extra_cmake_options="${lib.concatStringsSep "," cmakeFlags}"
   '';
 
   doCheck = true;
@@ -321,9 +321,9 @@ stdenv.mkDerivation {
   '';
 
   # Hack to avoid build and install directories in RPATHs.
-  preFixup = ''rm -rf $SWIFT_BUILD_ROOT $SWIFT_INSTALL_DIR'';
+  preFixup = "rm -rf $SWIFT_BUILD_ROOT $SWIFT_INSTALL_DIR";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "The Swift Programming Language";
     homepage = "https://github.com/apple/swift";
     maintainers = with maintainers; [ dtzWill ];
diff --git a/nixpkgs/pkgs/development/compilers/terra/default.nix b/nixpkgs/pkgs/development/compilers/terra/default.nix
index e8478828c1b0..bd50ea9caaaf 100644
--- a/nixpkgs/pkgs/development/compilers/terra/default.nix
+++ b/nixpkgs/pkgs/development/compilers/terra/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchFromGitHub
+{ lib, stdenv, fetchurl, fetchFromGitHub
 , llvmPackages, ncurses, lua
 }:
 
@@ -34,13 +34,13 @@ stdenv.mkDerivation rec {
       --replace '-lcurses' '-lncurses'
 
     substituteInPlace src/terralib.lua \
-      --subst-var-by NIX_LIBC_INCLUDE ${stdenv.lib.getDev stdenv.cc.libc}/include
+      --subst-var-by NIX_LIBC_INCLUDE ${lib.getDev stdenv.cc.libc}/include
   '';
 
   preBuild = ''
     cat >Makefile.inc<<EOF
-    CLANG = ${stdenv.lib.getBin llvmPackages.clang-unwrapped}/bin/clang
-    LLVM_CONFIG = ${stdenv.lib.getBin llvmPackages.llvm}/bin/llvm-config
+    CLANG = ${lib.getBin llvmPackages.clang-unwrapped}/bin/clang
+    LLVM_CONFIG = ${lib.getBin llvmPackages.llvm}/bin/llvm-config
     EOF
 
     mkdir -p build
@@ -58,7 +58,7 @@ stdenv.mkDerivation rec {
     cp -rv release/include/terra $dev/include
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A low-level counterpart to Lua";
     homepage    = "http://terralang.org/";
     platforms   = platforms.x86_64;
diff --git a/nixpkgs/pkgs/development/compilers/teyjus/default.nix b/nixpkgs/pkgs/development/compilers/teyjus/default.nix
index 6768d0c1cbed..74ba1866b555 100644
--- a/nixpkgs/pkgs/development/compilers/teyjus/default.nix
+++ b/nixpkgs/pkgs/development/compilers/teyjus/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, omake, ocaml, flex, bison }:
+{ lib, stdenv, fetchurl, omake, ocaml, flex, bison }:
 
 let
   version = "2.1";
@@ -25,10 +25,10 @@ stdenv.mkDerivation {
 
   installPhase = "mkdir -p $out/bin && cp tj* $out/bin";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An efficient implementation of the Lambda Prolog language";
     homepage = "https://github.com/teyjus/teyjus";
-    license = stdenv.lib.licenses.gpl3;
+    license = lib.licenses.gpl3;
     maintainers = [ maintainers.bcdarwin ];
     platforms = platforms.linux;
   };
diff --git a/nixpkgs/pkgs/development/compilers/tvm/default.nix b/nixpkgs/pkgs/development/compilers/tvm/default.nix
index 01c44718f11a..2bb8b9d5be30 100644
--- a/nixpkgs/pkgs/development/compilers/tvm/default.nix
+++ b/nixpkgs/pkgs/development/compilers/tvm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "tvm";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
   # not mangle the legitimate use of the opt/ folder.
   dontFixCmake = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://tvm.apache.org/";
     description = "An End to End Deep Learning Compiler Stack for CPUs, GPUs and accelerators";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/compilers/unison/default.nix b/nixpkgs/pkgs/development/compilers/unison/default.nix
index 7ae16a77a26f..433e07c68b07 100644
--- a/nixpkgs/pkgs/development/compilers/unison/default.nix
+++ b/nixpkgs/pkgs/development/compilers/unison/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoPatchelfHook
+{ lib, stdenv, fetchurl, autoPatchelfHook
 , ncurses5, zlib, gmp
 , makeWrapper
 , less
@@ -25,16 +25,16 @@ stdenv.mkDerivation rec {
   dontBuild = true;
   dontConfigure = true;
 
-  nativeBuildInputs = [ makeWrapper ] ++ (stdenv.lib.optional (!stdenv.isDarwin) autoPatchelfHook);
-  buildInputs = stdenv.lib.optionals (!stdenv.isDarwin) [ ncurses5 zlib gmp ];
+  nativeBuildInputs = [ makeWrapper ] ++ (lib.optional (!stdenv.isDarwin) autoPatchelfHook);
+  buildInputs = lib.optionals (!stdenv.isDarwin) [ ncurses5 zlib gmp ];
 
   installPhase = ''
     mkdir -p $out/bin
     mv ucm $out/bin
-    wrapProgram $out/bin/ucm --prefix PATH ":" "${stdenv.lib.makeBinPath [ less ]}";
+    wrapProgram $out/bin/ucm --prefix PATH ":" "${lib.makeBinPath [ less ]}";
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Modern, statically-typed purely functional language";
     homepage = "https://unisonweb.org/";
     license = with licenses; [ mit bsd3 ];
diff --git a/nixpkgs/pkgs/development/compilers/urn/default.nix b/nixpkgs/pkgs/development/compilers/urn/default.nix
index 812792a125ea..f7e338cf43ff 100644
--- a/nixpkgs/pkgs/development/compilers/urn/default.nix
+++ b/nixpkgs/pkgs/development/compilers/urn/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitLab, buildEnv, makeWrapper, lua, luajit, readline
+{ lib, stdenv, fetchFromGitLab, buildEnv, makeWrapper, lua, luajit, readline
 , useLuaJit ? false
 , extraLibraries ? []
 }:
@@ -17,7 +17,7 @@ let
               [ lua ];
   };
 
-  inherit (stdenv.lib) optionalString concatMapStringsSep;
+  inherit (lib) optionalString concatMapStringsSep;
 in
 
 stdenv.mkDerivation {
@@ -48,7 +48,7 @@ stdenv.mkDerivation {
       --prefix LD_LIBRARY_PATH : ${urn-rt}/lib/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://urn-lang.com";
     description = "Yet another Lisp variant which compiles to Lua";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/compilers/urweb/default.nix b/nixpkgs/pkgs/development/compilers/urweb/default.nix
index ac324167f97b..e2d9d1f226e7 100644
--- a/nixpkgs/pkgs/development/compilers/urweb/default.nix
+++ b/nixpkgs/pkgs/development/compilers/urweb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, file, openssl, mlton
+{ lib, stdenv, fetchurl, file, openssl, mlton
 , libmysqlclient, postgresql, sqlite, gcc, icu
 }:
 
@@ -39,8 +39,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Advanced purely-functional web programming language";
     homepage    = "http://www.impredicative.com/ur/";
-    license     = stdenv.lib.licenses.bsd3;
-    platforms   = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
-    maintainers = [ stdenv.lib.maintainers.thoughtpolice stdenv.lib.maintainers.sheganinans ];
+    license     = lib.licenses.bsd3;
+    platforms   = lib.platforms.linux ++ lib.platforms.darwin;
+    maintainers = [ lib.maintainers.thoughtpolice lib.maintainers.sheganinans ];
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/vala/default.nix b/nixpkgs/pkgs/development/compilers/vala/default.nix
index 1964d74cf3af..222ad903ec14 100644
--- a/nixpkgs/pkgs/development/compilers/vala/default.nix
+++ b/nixpkgs/pkgs/development/compilers/vala/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, fetchpatch, pkgconfig, flex, bison, libxslt, autoconf, autoreconfHook
+{ stdenv, lib, fetchurl, fetchpatch, pkg-config, flex, bison, libxslt, autoconf, autoreconfHook
 , graphviz, glib, libiconv, libintl, libtool, expat, substituteAll
 }:
 
@@ -70,7 +70,7 @@ let
     outputs = [ "out" "devdoc" ];
 
     nativeBuildInputs = [
-      pkgconfig flex bison libxslt
+      pkg-config flex bison libxslt
     ] ++ lib.optional (stdenv.isDarwin && (lib.versionAtLeast version "0.38")) expat
       ++ lib.optional disableGraphviz autoreconfHook # if we changed our ./configure script, need to reconfigure
       ++ extraNativeBuildInputs;
@@ -92,7 +92,7 @@ let
     #  };
     # };
 
-    meta = with stdenv.lib; {
+    meta = with lib; {
       description = "Compiler for GObject type system";
       homepage = "https://wiki.gnome.org/Projects/Vala";
       license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/compilers/vlang/default.nix b/nixpkgs/pkgs/development/compilers/vlang/default.nix
index fba11a06a6e9..f53d6d4c3825 100644
--- a/nixpkgs/pkgs/development/compilers/vlang/default.nix
+++ b/nixpkgs/pkgs/development/compilers/vlang/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, glfw, freetype, openssl, upx ? null }:
+{ lib, stdenv, fetchFromGitHub, glfw, freetype, openssl, upx ? null }:
 
 assert stdenv.hostPlatform.isUnix -> upx != null;
 
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
   propagatedBuildInputs = [ glfw freetype openssl ]
-    ++ stdenv.lib.optional stdenv.hostPlatform.isUnix upx;
+    ++ lib.optional stdenv.hostPlatform.isUnix upx;
 
   buildPhase = ''
     runHook preBuild
@@ -45,7 +45,7 @@ stdenv.mkDerivation rec {
     runHook postInstall
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://vlang.io/";
     description = "Simple, fast, safe, compiled language for developing maintainable software";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/compilers/vyper/default.nix b/nixpkgs/pkgs/development/compilers/vyper/default.nix
new file mode 100644
index 000000000000..79702c01bee3
--- /dev/null
+++ b/nixpkgs/pkgs/development/compilers/vyper/default.nix
@@ -0,0 +1,54 @@
+{ stdenv, lib, buildPythonPackage, fetchPypi, writeText, asttokens
+, pycryptodome, pytest_xdist, pytestcov, recommonmark, semantic-version, sphinx
+, sphinx_rtd_theme, pytestrunner }:
+
+let
+  sample-contract = writeText "example.vy" ''
+    count: int128
+
+    @external
+    def __init__(foo: address):
+        self.count = 1
+  '';
+in
+
+buildPythonPackage rec {
+  pname = "vyper";
+  version = "0.2.8";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0d9fv630ayd1989qnklldh08vksa2lf0r06lm914qy5r5cvbl1v2";
+  };
+
+  nativeBuildInputs = [ pytestrunner ];
+
+  postPatch = ''
+    substituteInPlace setup.py \
+      --replace 'asttokens==' 'asttokens>=' \
+      --replace 'subprocess.check_output("git rev-parse HEAD".split())' "' '" \
+      --replace 'commithash.decode("utf-8").strip()' "'069936fa3fee8646ff362145593128d7ef07da38'"
+  '';
+
+  propagatedBuildInputs = [
+    asttokens
+    pycryptodome
+    semantic-version
+
+    # docs
+    recommonmark
+    sphinx
+    sphinx_rtd_theme
+  ];
+
+  checkPhase = ''
+    $out/bin/vyper "${sample-contract}"
+  '';
+
+  meta = with lib; {
+    description = "Pythonic Smart Contract Language for the EVM";
+    homepage = "https://github.com/vyperlang/vyper";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ siraben ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/compilers/wcc/default.nix b/nixpkgs/pkgs/development/compilers/wcc/default.nix
index b6030da49d3f..644e9ad646a8 100644
--- a/nixpkgs/pkgs/development/compilers/wcc/default.nix
+++ b/nixpkgs/pkgs/development/compilers/wcc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, capstone, libbfd, libelf, libiberty, readline }:
+{ lib, stdenv, fetchFromGitHub, capstone, libbfd, libelf, libiberty, readline }:
 
 stdenv.mkDerivation {
   pname = "wcc-unstable";
@@ -41,7 +41,7 @@ stdenv.mkDerivation {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/endrazine/wcc";
     description = "Witchcraft compiler collection: tools to convert and script ELF files";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/compilers/wla-dx/default.nix b/nixpkgs/pkgs/development/compilers/wla-dx/default.nix
index 0cebbfa520f0..b80b460d4def 100644
--- a/nixpkgs/pkgs/development/compilers/wla-dx/default.nix
+++ b/nixpkgs/pkgs/development/compilers/wla-dx/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchFromGitHub, cmake}:
+{lib, stdenv, fetchFromGitHub, cmake}:
 
 stdenv.mkDerivation rec {
   pname = "wla-dx";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.villehelin.com/wla.html";
     description = "Yet Another GB-Z80/Z80/6502/65C02/6510/65816/HUC6280/SPC-700 Multi Platform Cross Assembler Package";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/compilers/x11basic/default.nix b/nixpkgs/pkgs/development/compilers/x11basic/default.nix
index 9bf6b3d28749..e48bbc90d61f 100644
--- a/nixpkgs/pkgs/development/compilers/x11basic/default.nix
+++ b/nixpkgs/pkgs/development/compilers/x11basic/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub
+{ lib, stdenv, fetchFromGitHub
 , automake, autoconf, readline
 , libX11, bluez, SDL2
 }:
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
     cp -r ../examples $out/share/.
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://x11-basic.sourceforge.net/";
     description = "A Basic interpreter and compiler with graphics capabilities";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/compilers/yap/default.nix b/nixpkgs/pkgs/development/compilers/yap/default.nix
index 100fb236c838..da10125c2433 100644
--- a/nixpkgs/pkgs/development/compilers/yap/default.nix
+++ b/nixpkgs/pkgs/development/compilers/yap/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, readline, gmp, zlib }:
+{ lib, stdenv, fetchurl, readline, gmp, zlib }:
 
 stdenv.mkDerivation rec {
   version = "6.3.3";
@@ -18,10 +18,10 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://www.dcc.fc.up.pt/~vsc/Yap/";
     description = "A ISO-compatible high-performance Prolog compiler";
-    license = stdenv.lib.licenses.artistic2;
+    license = lib.licenses.artistic2;
 
-    maintainers = [ stdenv.lib.maintainers.peti ];
-    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ lib.maintainers.peti ];
+    platforms = lib.platforms.linux;
     broken = !stdenv.is64bit;   # the linux 32 bit build fails.
   };
 }
diff --git a/nixpkgs/pkgs/development/compilers/yasm/default.nix b/nixpkgs/pkgs/development/compilers/yasm/default.nix
index 923a11c1466a..48c251d828a2 100644
--- a/nixpkgs/pkgs/development/compilers/yasm/default.nix
+++ b/nixpkgs/pkgs/development/compilers/yasm/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
   name = "yasm-1.3.0";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0gv0slmm0qpq91za3v2v9glff3il594x5xsrbgab7xcmnh0ndkix";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.tortall.net/projects/yasm/";
     description = "Complete rewrite of the NASM assembler";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/compilers/yosys/default.nix b/nixpkgs/pkgs/development/compilers/yosys/default.nix
index 51f0b7ed45aa..7d2191f8f456 100644
--- a/nixpkgs/pkgs/development/compilers/yosys/default.nix
+++ b/nixpkgs/pkgs/development/compilers/yosys/default.nix
@@ -1,11 +1,11 @@
-{ stdenv
+{ stdenv, lib
 , abc-verifier
 , bash
 , bison
 , fetchFromGitHub
 , flex
 , libffi
-, pkgconfig
+, pkg-config
 , protobuf
 , python3
 , readline
@@ -43,22 +43,21 @@ stdenv.mkDerivation rec {
   };
 
   enableParallelBuilding = true;
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ tcl readline libffi python3 bison flex protobuf zlib ];
+  nativeBuildInputs = [ pkg-config bison flex ];
+  buildInputs = [ tcl readline libffi python3 protobuf zlib ];
 
   makeFlags = [ "ENABLE_PROTOBUF=1" "PREFIX=${placeholder "out"}"];
 
-  patchPhase = ''
+  patches = [
+    ./plugin-search-dirs.patch
+  ];
+
+  postPatch = ''
     substituteInPlace ./Makefile \
-      --replace 'CXX = clang' "" \
-      --replace 'LD = clang++' 'LD = $(CXX)' \
-      --replace 'CXX = gcc' "" \
-      --replace 'LD = gcc' 'LD = $(CXX)' \
-      --replace 'ABCMKARGS = CC="$(CXX)" CXX="$(CXX)"' 'ABCMKARGS =' \
       --replace 'echo UNKNOWN' 'echo ${builtins.substring 0 10 src.rev}'
-    substituteInPlace ./misc/yosys-config.in \
-      --replace '/bin/bash' '${bash}/bin/bash'
-    patchShebangs tests
+
+    chmod +x ./misc/yosys-config.in
+    patchShebangs tests ./misc/yosys-config.in
   '';
 
   preBuild = let
@@ -76,7 +75,7 @@ stdenv.mkDerivation rec {
       exit 1
     fi
 
-    if ! grep -q "YOSYS_VER := ${version}" Makefile; then
+    if ! grep -q "YOSYS_VER := $version" Makefile; then
       echo "ERROR: yosys version in Makefile isn't equivalent to version of the nix package (${version}), failing."
       exit 1
     fi
@@ -96,7 +95,9 @@ stdenv.mkDerivation rec {
   postBuild   = "ln -sfv ${abc-verifier}/bin/abc ./yosys-abc";
   postInstall = "ln -sfv ${abc-verifier}/bin/abc $out/bin/yosys-abc";
 
-  meta = with stdenv.lib; {
+  setupHook = ./setup-hook.sh;
+
+  meta = with lib; {
     description = "Open RTL synthesis framework and tools";
     homepage    = "http://www.clifford.at/yosys/";
     license     = licenses.isc;
diff --git a/nixpkgs/pkgs/development/compilers/yosys/plugin-search-dirs.patch b/nixpkgs/pkgs/development/compilers/yosys/plugin-search-dirs.patch
new file mode 100644
index 000000000000..0cb0aee9c7ed
--- /dev/null
+++ b/nixpkgs/pkgs/development/compilers/yosys/plugin-search-dirs.patch
@@ -0,0 +1,34 @@
+diff --git a/passes/cmds/plugin.cc b/passes/cmds/plugin.cc
+index 3ed19497..f9534bd0 100644
+--- a/passes/cmds/plugin.cc
++++ b/passes/cmds/plugin.cc
+@@ -75,8 +75,27 @@ void load_plugin(std::string filename, std::vector<std::string> aliases)
+ 		#endif
+ 
+ 		void *hdl = dlopen(filename.c_str(), RTLD_LAZY|RTLD_LOCAL);
+-		if (hdl == NULL && orig_filename.find('/') == std::string::npos)
+-			hdl = dlopen((proc_share_dirname() + "plugins/" + orig_filename + ".so").c_str(), RTLD_LAZY|RTLD_LOCAL);
++		if (hdl == NULL && orig_filename.find('/') == std::string::npos) {
++			std::string install_dir = proc_share_dirname() + "plugins";
++
++			vector<string> all_dirs;
++			all_dirs.push_back(install_dir);
++
++			char* plugin_dirs = getenv("NIX_YOSYS_PLUGIN_DIRS");
++			if (plugin_dirs != NULL) {
++				std::string p(plugin_dirs), t;
++				std::stringstream ss(p);
++
++				while(std::getline(ss, t, ':')) {
++					all_dirs.push_back(t);
++				}
++			}
++
++			for (auto dir : all_dirs) {
++				hdl = dlopen((dir + "/" + orig_filename + ".so").c_str(), RTLD_LAZY|RTLD_LOCAL);
++				if (hdl != NULL) break;
++			}
++		}
+ 		if (hdl == NULL)
+ 			log_cmd_error("Can't load module `%s': %s\n", filename.c_str(), dlerror());
+ 		loaded_plugins[orig_filename] = hdl;
diff --git a/nixpkgs/pkgs/development/compilers/yosys/plugins/bluespec.nix b/nixpkgs/pkgs/development/compilers/yosys/plugins/bluespec.nix
new file mode 100644
index 000000000000..58fef968e46d
--- /dev/null
+++ b/nixpkgs/pkgs/development/compilers/yosys/plugins/bluespec.nix
@@ -0,0 +1,32 @@
+{ stdenv, lib, fetchFromGitHub, pkg-config
+, yosys, readline, zlib, bluespec
+}:
+
+stdenv.mkDerivation {
+  pname = "yosys-bluespec";
+  version = "2021.01.17";
+
+  src = fetchFromGitHub {
+    owner  = "thoughtpolice";
+    repo   = "yosys-bluespec";
+    rev    = "3cfa22c2810b840f406610efe3d7657477c1b0ed";
+    sha256 = "1r48128yisw5lpziaj3hq88acghwi94pvm4735xajx8dl79jkcng";
+  };
+
+  buildInputs = [ yosys readline zlib bluespec ];
+  nativeBuildInputs = [ pkg-config ];
+
+  doCheck = true;
+  makeFlags = [
+    "PREFIX=$(out)/share/yosys/plugins"
+    "STATIC_BSC_PATH=${bluespec}/bin/bsc"
+    "STATIC_BSC_LIBDIR=${bluespec}/lib"
+  ];
+
+  meta = with lib; {
+    description = "Bluespec plugin for Yosys";
+    license     = licenses.isc;
+    platforms   = platforms.all;
+    maintainers = with maintainers; [ thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/compilers/yosys/plugins/ghdl.nix b/nixpkgs/pkgs/development/compilers/yosys/plugins/ghdl.nix
new file mode 100644
index 000000000000..ccf8efc7c805
--- /dev/null
+++ b/nixpkgs/pkgs/development/compilers/yosys/plugins/ghdl.nix
@@ -0,0 +1,31 @@
+{ stdenv, lib, fetchFromGitHub, pkg-config
+, yosys, readline, zlib, ghdl
+}:
+
+stdenv.mkDerivation {
+  pname = "yosys-ghdl";
+  version = "2021.01.01";
+
+  src = fetchFromGitHub {
+    owner  = "ghdl";
+    repo   = "ghdl-yosys-plugin";
+    rev    = "8b3e740fef9a653a20a838f1ade475960e1d379b";
+    sha256 = "13kpcp37r11xgqd8aksddi40a5vpzqi7p8qgyjbs99lyscyli75x";
+  };
+
+  buildInputs = [ yosys readline zlib ghdl ];
+  nativeBuildInputs = [ pkg-config ];
+
+  doCheck = true;
+  installPhase = ''
+    mkdir -p $out/share/yosys/plugins
+    cp ghdl.so $out/share/yosys/plugins/ghdl.so
+  '';
+
+  meta = with lib; {
+    description = "GHDL plugin for Yosys";
+    license     = licenses.isc;
+    platforms   = platforms.all;
+    maintainers = with maintainers; [ thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/compilers/yosys/setup-hook.sh b/nixpkgs/pkgs/development/compilers/yosys/setup-hook.sh
new file mode 100644
index 000000000000..d01bbdd1a8c1
--- /dev/null
+++ b/nixpkgs/pkgs/development/compilers/yosys/setup-hook.sh
@@ -0,0 +1,5 @@
+addYosysPluginPath() {
+  addToSearchPath NIX_YOSYS_PLUGIN_DIRS "$1/share/yosys/plugins"
+}
+
+addEnvHooks "$targetOffset" addYosysPluginPath
diff --git a/nixpkgs/pkgs/development/compilers/z88dk/default.nix b/nixpkgs/pkgs/development/compilers/z88dk/default.nix
index 0fb73d42b7e2..026a205cd26d 100644
--- a/nixpkgs/pkgs/development/compilers/z88dk/default.nix
+++ b/nixpkgs/pkgs/development/compilers/z88dk/default.nix
@@ -1,4 +1,4 @@
-{ fetchFromGitHub, stdenv, makeWrapper, unzip, libxml2, m4, uthash, which }:
+{ fetchFromGitHub, lib, stdenv, makeWrapper, unzip, libxml2, m4, uthash, which }:
 
 stdenv.mkDerivation rec {
   pname = "z88dk";
@@ -49,7 +49,7 @@ stdenv.mkDerivation rec {
 
   installTargets = [ "libs" "install" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.z88dk.org";
     description = "z80 Development Kit";
     license = licenses.clArtistic;
diff --git a/nixpkgs/pkgs/development/compilers/zasm/default.nix b/nixpkgs/pkgs/development/compilers/zasm/default.nix
index 174092496bab..97c7aa3c2acf 100644
--- a/nixpkgs/pkgs/development/compilers/zasm/default.nix
+++ b/nixpkgs/pkgs/development/compilers/zasm/default.nix
@@ -1,4 +1,4 @@
-{ fetchFromGitHub, zlib, stdenv }:
+{ fetchFromGitHub, zlib, lib, stdenv }:
 let
   libs-src = fetchFromGitHub {
     owner = "megatokio";
@@ -33,7 +33,7 @@ stdenv.mkDerivation {
     mv zasm $out/bin
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Z80 / 8080 assembler (for unix-style OS)";
     homepage = "https://k1.spdns.de/Develop/Projects/zasm/Distributions/";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/compilers/zig/default.nix b/nixpkgs/pkgs/development/compilers/zig/default.nix
index 1a5cba37d477..bd96010e8bfb 100644
--- a/nixpkgs/pkgs/development/compilers/zig/default.nix
+++ b/nixpkgs/pkgs/development/compilers/zig/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, llvmPackages, libxml2, zlib, substituteAll }:
+{ lib, stdenv, fetchFromGitHub, cmake, llvmPackages, libxml2, zlib, substituteAll }:
 
 llvmPackages.stdenv.mkDerivation rec {
   version = "0.7.1";
@@ -32,7 +32,7 @@ llvmPackages.stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description =
       "General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software";
     homepage = "https://ziglang.org/";
diff --git a/nixpkgs/pkgs/development/compilers/zulu/8.nix b/nixpkgs/pkgs/development/compilers/zulu/8.nix
index bea32475f9a8..e81cc4124287 100644
--- a/nixpkgs/pkgs/development/compilers/zulu/8.nix
+++ b/nixpkgs/pkgs/development/compilers/zulu/8.nix
@@ -62,13 +62,13 @@ in stdenv.mkDerivation {
     EOF
   '';
 
-  rpath = stdenv.lib.strings.makeLibraryPath libraries;
+  rpath = lib.strings.makeLibraryPath libraries;
 
   passthru = {
     home = zulu;
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.azul.com/products/zulu/";
     license = licenses.gpl2;
     description = "Certified builds of OpenJDK";
diff --git a/nixpkgs/pkgs/development/compilers/zulu/default.nix b/nixpkgs/pkgs/development/compilers/zulu/default.nix
index 73e7bd7d338a..63b95465c273 100644
--- a/nixpkgs/pkgs/development/compilers/zulu/default.nix
+++ b/nixpkgs/pkgs/development/compilers/zulu/default.nix
@@ -59,13 +59,13 @@ in stdenv.mkDerivation {
     EOF
   '';
 
-  rpath = stdenv.lib.strings.makeLibraryPath libraries;
+  rpath = lib.strings.makeLibraryPath libraries;
 
   passthru = {
     home = zulu;
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.azul.com/products/zulu/";
     license = licenses.gpl2;
     description = "Certified builds of OpenJDK";