diff --git a/README.md b/README.md
--- a/README.md
+++ b/README.md
@@ -10,7 +10,7 @@
 For example:
 
     $ cabal2nix cabal://mtl
-    { mkDerivation, base, stdenv, transformers }:
+    { mkDerivation, base, lib, transformers }:
     mkDerivation {
       pname = "mtl";
       version = "2.2.1";
@@ -18,7 +18,7 @@
       libraryHaskellDepends = [ base transformers ];
       homepage = "http://github.com/ekmett/mtl";
       description = "Monad classes, using functional dependencies";
-      license = stdenv.lib.licenses.bsd3;
+      license = lib.licenses.bsd3;
     }
 
 Cabal files can be referred to using the magic URL `cabal://NAME-VERSION`,
@@ -40,7 +40,7 @@
 
     $ cabal get mtl-2.2.1 && cd mtl-2.2.1
     $ cabal2nix .
-    { mkDerivation, base, stdenv, transformers }:
+    { mkDerivation, base, lib, transformers }:
     mkDerivation {
       pname = "mtl";
       version = "2.2.1";
@@ -48,7 +48,7 @@
       libraryHaskellDepends = [ base transformers ];
       homepage = "http://github.com/ekmett/mtl";
       description = "Monad classes, using functional dependencies";
-      license = stdenv.lib.licenses.bsd3;
+      license = lib.licenses.bsd3;
     }
 
 This derivation will not fetch from hackage, but instead use the directory which
diff --git a/cabal2nix.cabal b/cabal2nix.cabal
--- a/cabal2nix.cabal
+++ b/cabal2nix.cabal
@@ -1,5 +1,5 @@
 name:               cabal2nix
-version:            2.15.6
+version:            2.16.0
 synopsis:           Convert Cabal files into Nix build instructions.
 description:
   Convert Cabal files into Nix build instructions. Users of Nix can install the latest
@@ -27,7 +27,7 @@
                     gebbert, laMudri, Александр Цамутали
 maintainer:         Peter Simons <simons@cryp.to>
 stability:          stable
-tested-with:        GHC == 8.8.3, GHC == 8.10.1
+tested-with:        GHC == 8.10.3
 category:           Distribution, Nix
 homepage:           https://github.com/nixos/cabal2nix#readme
 bug-reports:        https://github.com/nixos/cabal2nix/issues
@@ -70,7 +70,7 @@
                     , containers           >= 0.5.9
                     , deepseq              >= 1.4
                     , directory
-                    , distribution-nixpkgs >= 1.3.1
+                    , distribution-nixpkgs >= 1.4.0
                     , filepath
                     , hackage-db           >= 2.0.1
                     , hopenssl             >= 2
diff --git a/hackage2nix/Main.hs b/hackage2nix/Main.hs
--- a/hackage2nix/Main.hs
+++ b/hackage2nix/Main.hs
@@ -175,7 +175,7 @@
   withFile hackagePackagesFile WriteMode $ \h -> do
     hPutStrLn h "/* hackage-packages.nix is an auto-generated file -- DO NOT EDIT! */"
     hPutStrLn h ""
-    hPutStrLn h "{ pkgs, stdenv, callPackage }:"
+    hPutStrLn h "{ pkgs, lib, callPackage }:"
     hPutStrLn h ""
     hPutStrLn h "self: {"
     hPutStrLn h ""
diff --git a/src/Cabal2nix.hs b/src/Cabal2nix.hs
--- a/src/Cabal2nix.hs
+++ b/src/Cabal2nix.hs
@@ -238,7 +238,7 @@
 --            & metaSection.platforms .~ Set.fromList optPlatform
               & doCheck &&~ optDoCheck
               & doBenchmark ||~ optDoBenchmark
-              & extraFunctionArgs %~ Set.union (Set.fromList ("inherit stdenv":map (fromString . ("inherit " ++)) optExtraArgs))
+              & extraFunctionArgs %~ Set.union (Set.fromList ("inherit lib":map (fromString . ("inherit " ++)) optExtraArgs))
 
       shell :: Doc
       shell = vcat
diff --git a/src/Distribution/Nixpkgs/Haskell/FromCabal/License.hs b/src/Distribution/Nixpkgs/Haskell/FromCabal/License.hs
--- a/src/Distribution/Nixpkgs/Haskell/FromCabal/License.hs
+++ b/src/Distribution/Nixpkgs/Haskell/FromCabal/License.hs
@@ -18,31 +18,31 @@
 
 fromCabalLicense :: Distribution.License.License -> Distribution.Nixpkgs.License.License
 fromCabalLicense (GPL Nothing)                             = Unknown (Just "GPL")
-fromCabalLicense (GPL (Just (versionNumbers -> [2])))      = Known "stdenv.lib.licenses.gpl2"
-fromCabalLicense (GPL (Just (versionNumbers -> [3])))      = Known "stdenv.lib.licenses.gpl3"
-fromCabalLicense (GPL (Just (versionNumbers -> [3,0])))    = Known "stdenv.lib.licenses.gpl3"
+fromCabalLicense (GPL (Just (versionNumbers -> [2])))      = Known "lib.licenses.gpl2"
+fromCabalLicense (GPL (Just (versionNumbers -> [3])))      = Known "lib.licenses.gpl3"
+fromCabalLicense (GPL (Just (versionNumbers -> [3,0])))    = Known "lib.licenses.gpl3"
 fromCabalLicense (LGPL Nothing)                            = Unknown (Just "LGPL")
-fromCabalLicense (LGPL (Just (versionNumbers -> [2,1])))   = Known "stdenv.lib.licenses.lgpl21"
-fromCabalLicense (LGPL (Just (versionNumbers -> [2])))     = Known "stdenv.lib.licenses.lgpl2"
-fromCabalLicense (LGPL (Just (versionNumbers -> [3])))     = Known "stdenv.lib.licenses.lgpl3"
-fromCabalLicense (LGPL (Just (versionNumbers -> [3,0])))   = Known "stdenv.lib.licenses.lgpl3"
+fromCabalLicense (LGPL (Just (versionNumbers -> [2,1])))   = Known "lib.licenses.lgpl21"
+fromCabalLicense (LGPL (Just (versionNumbers -> [2])))     = Known "lib.licenses.lgpl2"
+fromCabalLicense (LGPL (Just (versionNumbers -> [3])))     = Known "lib.licenses.lgpl3"
+fromCabalLicense (LGPL (Just (versionNumbers -> [3,0])))   = Known "lib.licenses.lgpl3"
 fromCabalLicense (AGPL Nothing)                            = Unknown (Just "AGPL")
-fromCabalLicense (AGPL (Just (versionNumbers -> [3])))     = Known "stdenv.lib.licenses.agpl3"
-fromCabalLicense (AGPL (Just (versionNumbers -> [3,0])))   = Known "stdenv.lib.licenses.agpl3"
-fromCabalLicense (MPL (versionNumbers ->  [2,0]))          = Known "stdenv.lib.licenses.mpl20"
-fromCabalLicense BSD2                                      = Known "stdenv.lib.licenses.bsd2"
-fromCabalLicense BSD3                                      = Known "stdenv.lib.licenses.bsd3"
-fromCabalLicense BSD4                                      = Known "stdenv.lib.licenses.bsdOriginal"
-fromCabalLicense MIT                                       = Known "stdenv.lib.licenses.mit"
-fromCabalLicense PublicDomain                              = Known "stdenv.lib.licenses.publicDomain"
-fromCabalLicense UnspecifiedLicense                        = Known "stdenv.lib.licenses.unfree"
-fromCabalLicense AllRightsReserved                         = Known "stdenv.lib.licenses.unfree"
-fromCabalLicense (Apache Nothing)                          = Known "stdenv.lib.licenses.asl20"
-fromCabalLicense (Apache (Just (versionNumbers -> [2,0]))) = Known "stdenv.lib.licenses.asl20"
-fromCabalLicense ISC                                       = Known "stdenv.lib.licenses.isc"
+fromCabalLicense (AGPL (Just (versionNumbers -> [3])))     = Known "lib.licenses.agpl3"
+fromCabalLicense (AGPL (Just (versionNumbers -> [3,0])))   = Known "lib.licenses.agpl3"
+fromCabalLicense (MPL (versionNumbers ->  [2,0]))          = Known "lib.licenses.mpl20"
+fromCabalLicense BSD2                                      = Known "lib.licenses.bsd2"
+fromCabalLicense BSD3                                      = Known "lib.licenses.bsd3"
+fromCabalLicense BSD4                                      = Known "lib.licenses.bsdOriginal"
+fromCabalLicense MIT                                       = Known "lib.licenses.mit"
+fromCabalLicense PublicDomain                              = Known "lib.licenses.publicDomain"
+fromCabalLicense UnspecifiedLicense                        = Known "lib.licenses.unfree"
+fromCabalLicense AllRightsReserved                         = Known "lib.licenses.unfree"
+fromCabalLicense (Apache Nothing)                          = Known "lib.licenses.asl20"
+fromCabalLicense (Apache (Just (versionNumbers -> [2,0]))) = Known "lib.licenses.asl20"
+fromCabalLicense ISC                                       = Known "lib.licenses.isc"
 fromCabalLicense OtherLicense                              = Unknown Nothing
-fromCabalLicense (UnknownLicense "CC0-1.0")                = Known "stdenv.lib.licenses.cc0"
-fromCabalLicense (UnknownLicense "BSD3ClauseORApache20")   = Known "stdenv.lib.licenses.bsd3"
+fromCabalLicense (UnknownLicense "CC0-1.0")                = Known "lib.licenses.cc0"
+fromCabalLicense (UnknownLicense "BSD3ClauseORApache20")   = Known "lib.licenses.bsd3"
 fromCabalLicense l                                         = error $ "Distribution.Nixpkgs.Haskell.FromCabal.License.fromCabalLicense: unknown license"
                                                                   ++ show l ++"\nChoose one of: " ++ intercalate ", " (map display knownLicenses)
 
@@ -55,101 +55,101 @@
       case simpl of
         SPDX.ELicenseId lid ->
           case lid of
-            SPDX.AFL_2_1 -> Known "stdenv.lib.licenses.afl21"
-            SPDX.AFL_3_0 -> Known "stdenv.lib.licenses.afl3"
-            SPDX.AGPL_3_0_only -> Known "stdenv.lib.licenses.agpl3"
-            SPDX.AGPL_3_0_or_later -> Known "stdenv.lib.licenses.agpl3Plus"
-            SPDX.APSL_2_0 -> Known "stdenv.lib.licenses.apsl20"
-            SPDX.Artistic_1_0 -> Known "stdenv.lib.licenses.artistic1"
-            SPDX.Artistic_2_0 -> Known "stdenv.lib.licenses.artistic2"
-            SPDX.Apache_2_0 -> Known "stdenv.lib.licenses.asl20"
-            SPDX.BSL_1_0 -> Known "stdenv.lib.licenses.boost"
-            SPDX.Beerware -> Known "stdenv.lib.licenses.beerware"
-            SPDX.NullBSD -> Known "stdenv.lib.licenses.bsd0"
-            SPDX.BSD_2_Clause -> Known "stdenv.lib.licenses.bsd2"
-            SPDX.BSD_3_Clause -> Known "stdenv.lib.licenses.bsd3"
-            SPDX.BSD_4_Clause -> Known "stdenv.lib.licenses.bsdOriginal"
-            SPDX.ClArtistic -> Known "stdenv.lib.licenses.clArtistic"
-            SPDX.CC0_1_0 -> Known "stdenv.lib.licenses.cc0"
-            SPDX.CC_BY_NC_SA_2_0 -> Known "stdenv.lib.licenses.cc-by-nc-sa-20"
-            SPDX.CC_BY_NC_SA_2_5 -> Known "stdenv.lib.licenses.cc-by-nc-sa-25"
-            SPDX.CC_BY_NC_SA_3_0 -> Known "stdenv.lib.licenses.cc-by-nc-sa-30"
-            SPDX.CC_BY_NC_SA_4_0 -> Known "stdenv.lib.licenses.cc-by-nc-sa-40"
-            SPDX.CC_BY_NC_4_0 -> Known "stdenv.lib.licenses.cc-by-nc-40"
-            SPDX.CC_BY_ND_3_0 -> Known "stdenv.lib.licenses.cc-by-nd-30"
-            SPDX.CC_BY_SA_2_5 -> Known "stdenv.lib.licenses.cc-by-sa-25"
-            SPDX.CC_BY_3_0 -> Known "stdenv.lib.licenses.cc-by-30"
-            SPDX.CC_BY_SA_3_0 -> Known "stdenv.lib.licenses.cc-by-sa-30"
-            SPDX.CC_BY_4_0 -> Known "stdenv.lib.licenses.cc-by-40"
-            SPDX.CC_BY_SA_4_0 -> Known "stdenv.lib.licenses.cc-by-sa-40"
-            SPDX.CDDL_1_0 -> Known "stdenv.lib.licenses.cddl"
-            SPDX.CECILL_2_0 -> Known "stdenv.lib.licenses.cecill20"
-            SPDX.CECILL_B -> Known "stdenv.lib.licenses.cecill-b"
-            SPDX.CECILL_C -> Known "stdenv.lib.licenses.cecill-c"
-            SPDX.CPAL_1_0 -> Known "stdenv.lib.licenses.cpal10"
-            SPDX.CPL_1_0 -> Known "stdenv.lib.licenses.cpl10"
-            SPDX.Curl -> Known "stdenv.lib.licenses.curl"
-            SPDX.DOC -> Known "stdenv.lib.licenses.doc"
-            SPDX.EFL_1_0 -> Known "stdenv.lib.licenses.efl10"
-            SPDX.EFL_2_0 -> Known "stdenv.lib.licenses.efl20"
-            SPDX.EPL_1_0 -> Known "stdenv.lib.licenses.epl10"
-            SPDX.EPL_2_0 -> Known "stdenv.lib.licenses.epl20"
-            SPDX.EUPL_1_1 -> Known "stdenv.lib.licenses.eupl11"
-            SPDX.GFDL_1_2_only -> Known "stdenv.lib.licenses.fdl12"
-            SPDX.GFDL_1_3_only -> Known "stdenv.lib.licenses.fdl13"
-            SPDX.GPL_1_0_only -> Known "stdenv.lib.licenses.gpl1"
-            SPDX.GPL_1_0_or_later -> Known "stdenv.lib.licenses.gpl1Plus"
-            SPDX.GPL_2_0_only -> Known "stdenv.lib.licenses.gpl2"
-            SPDX.GPL_2_0_or_later -> Known "stdenv.lib.licenses.gpl2Plus"
-            SPDX.GPL_3_0_only -> Known "stdenv.lib.licenses.gpl3"
-            SPDX.GPL_3_0_or_later -> Known "stdenv.lib.licenses.gpl3Plus"
-            SPDX.HPND -> Known "stdenv.lib.licenses.hpnd"
-            SPDX.IJG -> Known "stdenv.lib.licenses.ijg"
-            SPDX.ImageMagick -> Known "stdenv.lib.licenses.imagemagick"
-            SPDX.IPA -> Known "stdenv.lib.licenses.ipa"
-            SPDX.IPL_1_0 -> Known "stdenv.lib.licenses.ipl10"
-            SPDX.ISC -> Known "stdenv.lib.licenses.isc"
-            SPDX.LGPL_2_0_only -> Known "stdenv.lib.licenses.lgpl2"
-            SPDX.LGPL_2_0_or_later -> Known "stdenv.lib.licenses.lgpl2Plus"
-            SPDX.LGPL_2_1_only -> Known "stdenv.lib.licenses.lgpl21"
-            SPDX.LGPL_2_1_or_later -> Known "stdenv.lib.licenses.lgpl21Plus"
-            SPDX.LGPL_3_0_only -> Known "stdenv.lib.licenses.lgpl3"
-            SPDX.LGPL_3_0_or_later -> Known "stdenv.lib.licenses.lgpl3Plus"
-            SPDX.Libpng -> Known "stdenv.lib.licenses.libpng"
-            SPDX.Libtiff -> Known "stdenv.lib.licenses.libtiff"
-            SPDX.LPPL_1_2 -> Known "stdenv.lib.licenses.lppl12"
-            SPDX.LPPL_1_3c -> Known "stdenv.lib.licenses.lppl13c"
-            SPDX.LPL_1_02 -> Known "stdenv.lib.licenses.lpl-102"
-            SPDX.MIT -> Known "stdenv.lib.licenses.mit"
-            SPDX.MPL_1_0 -> Known "stdenv.lib.licenses.mpl10"
-            SPDX.MPL_1_1 -> Known "stdenv.lib.licenses.mpl11"
-            SPDX.MPL_2_0 -> Known "stdenv.lib.licenses.mpl20"
-            SPDX.MS_PL -> Known "stdenv.lib.licenses.mspl"
-            SPDX.NCSA -> Known "stdenv.lib.licenses.ncsa"
-            SPDX.NPOSL_3_0 -> Known "stdenv.lib.licenses.nposl3"
-            SPDX.OFL_1_1 -> Known "stdenv.lib.licenses.ofl"
-            SPDX.OLDAP_2_8 -> Known "stdenv.lib.licenses.openldap"
-            SPDX.OpenSSL -> Known "stdenv.lib.licenses.openssl"
-            SPDX.OSL_2_1 -> Known "stdenv.lib.licenses.osl21"
-            SPDX.OSL_3_0 -> Known "stdenv.lib.licenses.osl3"
-            SPDX.PHP_3_01 -> Known "stdenv.lib.licenses.php201"
-            SPDX.PostgreSQL -> Known "stdenv.lib.licenses.postgresql"
-            SPDX.Python_2_0 -> Known "stdenv.lib.licenses.psfl"
-            SPDX.QPL_1_0 -> Known "stdenv.lib.licenses.qpl"
-            SPDX.Ruby -> Known "stdenv.lib.licenses.ruby"
-            SPDX.Sendmail -> Known "stdenv.lib.licenses.sendmail"
-            SPDX.SGI_B_2_0 -> Known "stdenv.lib.licenses.sgi-b-0"
-            SPDX.Sleepycat -> Known "stdenv.lib.licenses.sleepycat"
-            SPDX.TCL -> Known "stdenv.lib.licenses.tcltx"
-            SPDX.Unlicense -> Known "stdenv.lib.licenses.unlicense"
-            SPDX.Vim -> Known "stdenv.lib.licenses.vim"
-            SPDX.VSL_1_0 -> Known "stdenv.lib.licenses.vsl10"
-            SPDX.Watcom_1_0 -> Known "stdenv.lib.licenses.watcom"
-            SPDX.W3C -> Known "stdenv.lib.licenses.w3c"
-            SPDX.WTFPL -> Known "stdenv.lib.licenses.wtfpl"
-            SPDX.Zlib -> Known "stdenv.lib.licenses.zlib"
-            SPDX.ZPL_2_0 -> Known "stdenv.lib.licenses.zpl20"
-            SPDX.ZPL_2_1 -> Known "stdenv.lib.licenses.zpl21"
+            SPDX.AFL_2_1 -> Known "lib.licenses.afl21"
+            SPDX.AFL_3_0 -> Known "lib.licenses.afl3"
+            SPDX.AGPL_3_0_only -> Known "lib.licenses.agpl3"
+            SPDX.AGPL_3_0_or_later -> Known "lib.licenses.agpl3Plus"
+            SPDX.APSL_2_0 -> Known "lib.licenses.apsl20"
+            SPDX.Artistic_1_0 -> Known "lib.licenses.artistic1"
+            SPDX.Artistic_2_0 -> Known "lib.licenses.artistic2"
+            SPDX.Apache_2_0 -> Known "lib.licenses.asl20"
+            SPDX.BSL_1_0 -> Known "lib.licenses.boost"
+            SPDX.Beerware -> Known "lib.licenses.beerware"
+            SPDX.NullBSD -> Known "lib.licenses.bsd0"
+            SPDX.BSD_2_Clause -> Known "lib.licenses.bsd2"
+            SPDX.BSD_3_Clause -> Known "lib.licenses.bsd3"
+            SPDX.BSD_4_Clause -> Known "lib.licenses.bsdOriginal"
+            SPDX.ClArtistic -> Known "lib.licenses.clArtistic"
+            SPDX.CC0_1_0 -> Known "lib.licenses.cc0"
+            SPDX.CC_BY_NC_SA_2_0 -> Known "lib.licenses.cc-by-nc-sa-20"
+            SPDX.CC_BY_NC_SA_2_5 -> Known "lib.licenses.cc-by-nc-sa-25"
+            SPDX.CC_BY_NC_SA_3_0 -> Known "lib.licenses.cc-by-nc-sa-30"
+            SPDX.CC_BY_NC_SA_4_0 -> Known "lib.licenses.cc-by-nc-sa-40"
+            SPDX.CC_BY_NC_4_0 -> Known "lib.licenses.cc-by-nc-40"
+            SPDX.CC_BY_ND_3_0 -> Known "lib.licenses.cc-by-nd-30"
+            SPDX.CC_BY_SA_2_5 -> Known "lib.licenses.cc-by-sa-25"
+            SPDX.CC_BY_3_0 -> Known "lib.licenses.cc-by-30"
+            SPDX.CC_BY_SA_3_0 -> Known "lib.licenses.cc-by-sa-30"
+            SPDX.CC_BY_4_0 -> Known "lib.licenses.cc-by-40"
+            SPDX.CC_BY_SA_4_0 -> Known "lib.licenses.cc-by-sa-40"
+            SPDX.CDDL_1_0 -> Known "lib.licenses.cddl"
+            SPDX.CECILL_2_0 -> Known "lib.licenses.cecill20"
+            SPDX.CECILL_B -> Known "lib.licenses.cecill-b"
+            SPDX.CECILL_C -> Known "lib.licenses.cecill-c"
+            SPDX.CPAL_1_0 -> Known "lib.licenses.cpal10"
+            SPDX.CPL_1_0 -> Known "lib.licenses.cpl10"
+            SPDX.Curl -> Known "lib.licenses.curl"
+            SPDX.DOC -> Known "lib.licenses.doc"
+            SPDX.EFL_1_0 -> Known "lib.licenses.efl10"
+            SPDX.EFL_2_0 -> Known "lib.licenses.efl20"
+            SPDX.EPL_1_0 -> Known "lib.licenses.epl10"
+            SPDX.EPL_2_0 -> Known "lib.licenses.epl20"
+            SPDX.EUPL_1_1 -> Known "lib.licenses.eupl11"
+            SPDX.GFDL_1_2_only -> Known "lib.licenses.fdl12"
+            SPDX.GFDL_1_3_only -> Known "lib.licenses.fdl13"
+            SPDX.GPL_1_0_only -> Known "lib.licenses.gpl1"
+            SPDX.GPL_1_0_or_later -> Known "lib.licenses.gpl1Plus"
+            SPDX.GPL_2_0_only -> Known "lib.licenses.gpl2"
+            SPDX.GPL_2_0_or_later -> Known "lib.licenses.gpl2Plus"
+            SPDX.GPL_3_0_only -> Known "lib.licenses.gpl3"
+            SPDX.GPL_3_0_or_later -> Known "lib.licenses.gpl3Plus"
+            SPDX.HPND -> Known "lib.licenses.hpnd"
+            SPDX.IJG -> Known "lib.licenses.ijg"
+            SPDX.ImageMagick -> Known "lib.licenses.imagemagick"
+            SPDX.IPA -> Known "lib.licenses.ipa"
+            SPDX.IPL_1_0 -> Known "lib.licenses.ipl10"
+            SPDX.ISC -> Known "lib.licenses.isc"
+            SPDX.LGPL_2_0_only -> Known "lib.licenses.lgpl2"
+            SPDX.LGPL_2_0_or_later -> Known "lib.licenses.lgpl2Plus"
+            SPDX.LGPL_2_1_only -> Known "lib.licenses.lgpl21"
+            SPDX.LGPL_2_1_or_later -> Known "lib.licenses.lgpl21Plus"
+            SPDX.LGPL_3_0_only -> Known "lib.licenses.lgpl3"
+            SPDX.LGPL_3_0_or_later -> Known "lib.licenses.lgpl3Plus"
+            SPDX.Libpng -> Known "lib.licenses.libpng"
+            SPDX.Libtiff -> Known "lib.licenses.libtiff"
+            SPDX.LPPL_1_2 -> Known "lib.licenses.lppl12"
+            SPDX.LPPL_1_3c -> Known "lib.licenses.lppl13c"
+            SPDX.LPL_1_02 -> Known "lib.licenses.lpl-102"
+            SPDX.MIT -> Known "lib.licenses.mit"
+            SPDX.MPL_1_0 -> Known "lib.licenses.mpl10"
+            SPDX.MPL_1_1 -> Known "lib.licenses.mpl11"
+            SPDX.MPL_2_0 -> Known "lib.licenses.mpl20"
+            SPDX.MS_PL -> Known "lib.licenses.mspl"
+            SPDX.NCSA -> Known "lib.licenses.ncsa"
+            SPDX.NPOSL_3_0 -> Known "lib.licenses.nposl3"
+            SPDX.OFL_1_1 -> Known "lib.licenses.ofl"
+            SPDX.OLDAP_2_8 -> Known "lib.licenses.openldap"
+            SPDX.OpenSSL -> Known "lib.licenses.openssl"
+            SPDX.OSL_2_1 -> Known "lib.licenses.osl21"
+            SPDX.OSL_3_0 -> Known "lib.licenses.osl3"
+            SPDX.PHP_3_01 -> Known "lib.licenses.php201"
+            SPDX.PostgreSQL -> Known "lib.licenses.postgresql"
+            SPDX.Python_2_0 -> Known "lib.licenses.psfl"
+            SPDX.QPL_1_0 -> Known "lib.licenses.qpl"
+            SPDX.Ruby -> Known "lib.licenses.ruby"
+            SPDX.Sendmail -> Known "lib.licenses.sendmail"
+            SPDX.SGI_B_2_0 -> Known "lib.licenses.sgi-b-0"
+            SPDX.Sleepycat -> Known "lib.licenses.sleepycat"
+            SPDX.TCL -> Known "lib.licenses.tcltx"
+            SPDX.Unlicense -> Known "lib.licenses.unlicense"
+            SPDX.Vim -> Known "lib.licenses.vim"
+            SPDX.VSL_1_0 -> Known "lib.licenses.vsl10"
+            SPDX.Watcom_1_0 -> Known "lib.licenses.watcom"
+            SPDX.W3C -> Known "lib.licenses.w3c"
+            SPDX.WTFPL -> Known "lib.licenses.wtfpl"
+            SPDX.Zlib -> Known "lib.licenses.zlib"
+            SPDX.ZPL_2_0 -> Known "lib.licenses.zpl20"
+            SPDX.ZPL_2_1 -> Known "lib.licenses.zpl21"
             _ ->
               -- Licence is not in Nixpkgs.
               -- Use the SPDX expression as a free-form license string.
@@ -164,6 +164,6 @@
       Unknown (Just $ prettyShow expr)
 
 isFreeLicense :: Distribution.Nixpkgs.License.License -> Bool
-isFreeLicense (Known "stdenv.lib.licenses.unfree") = False
-isFreeLicense (Unknown Nothing)                    = False
-isFreeLicense _                                    = True
+isFreeLicense (Known "lib.licenses.unfree") = False
+isFreeLicense (Unknown Nothing)             = False
+isFreeLicense _                             = True
diff --git a/src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs b/src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs
--- a/src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs
+++ b/src/Distribution/Nixpkgs/Haskell/FromCabal/PostProcess.hs
@@ -407,7 +407,7 @@
 bustleOverrides :: Derivation -> Derivation
 bustleOverrides = set (libraryDepends . pkgconfig . contains "system-glib = pkgs.glib") True
                 . set (executableDepends . pkgconfig . contains "gio-unix = null") False
-                . set (metaSection . license) (Known "stdenv.lib.licenses.lgpl21Plus")
+                . set (metaSection . license) (Known "lib.licenses.lgpl21Plus")
                 . set (metaSection . hydraPlatforms) allKnownPlatforms
 
 nullBinding :: Identifier -> Binding
diff --git a/test/Main.hs b/test/Main.hs
--- a/test/Main.hs
+++ b/test/Main.hs
@@ -59,7 +59,7 @@
                                   , derivHash     = "deadbeef"
                                   , derivSubmodule = Nothing
                                   }
-                       & extraFunctionArgs %~ Set.union (Set.singleton "inherit stdenv")
+                       & extraFunctionArgs %~ Set.union (Set.singleton "inherit lib")
   goldenVsFileDiff
     nixFile
     (\ref new -> ["diff", "-u", ref, new])
diff --git a/test/golden-test-cases/BioHMM.nix.golden b/test/golden-test-cases/BioHMM.nix.golden
--- a/test/golden-test-cases/BioHMM.nix.golden
+++ b/test/golden-test-cases/BioHMM.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, base, colour, diagrams-cairo, diagrams-lib
-, directory, either-unwrap, filepath, parsec, ParsecTools, stdenv
+, directory, either-unwrap, filepath, lib, parsec, ParsecTools
 , StockholmAlignment, SVGFonts, text, vector
 }:
 mkDerivation {
@@ -11,5 +11,5 @@
     filepath parsec ParsecTools StockholmAlignment SVGFonts text vector
   ];
   description = "Libary for Hidden Markov Models in HMMER3 format";
-  license = stdenv.lib.licenses.gpl3;
+  license = lib.licenses.gpl3;
 }
diff --git a/test/golden-test-cases/ChasingBottoms.nix.golden b/test/golden-test-cases/ChasingBottoms.nix.golden
--- a/test/golden-test-cases/ChasingBottoms.nix.golden
+++ b/test/golden-test-cases/ChasingBottoms.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, array, base, containers, mtl, QuickCheck, random
-, stdenv, syb
+{ mkDerivation, array, base, containers, lib, mtl, QuickCheck
+, random, syb
 }:
 mkDerivation {
   pname = "ChasingBottoms";
@@ -12,5 +12,5 @@
     array base containers mtl QuickCheck random syb
   ];
   description = "For testing partial and infinite values";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/Clipboard.nix.golden b/test/golden-test-cases/Clipboard.nix.golden
--- a/test/golden-test-cases/Clipboard.nix.golden
+++ b/test/golden-test-cases/Clipboard.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, directory, stdenv, unix, utf8-string, X11 }:
+{ mkDerivation, base, directory, lib, unix, utf8-string, X11 }:
 mkDerivation {
   pname = "Clipboard";
   version = "2.3.2.0";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base directory unix utf8-string X11 ];
   homepage = "http://haskell.org/haskellwiki/Clipboard";
   description = "System clipboard interface";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/FenwickTree.nix.golden b/test/golden-test-cases/FenwickTree.nix.golden
--- a/test/golden-test-cases/FenwickTree.nix.golden
+++ b/test/golden-test-cases/FenwickTree.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, QuickCheck, stdenv, template-haskell }:
+{ mkDerivation, base, lib, QuickCheck, template-haskell }:
 mkDerivation {
   pname = "FenwickTree";
   version = "0.1.2.1";
@@ -8,5 +8,5 @@
   testHaskellDepends = [ base QuickCheck template-haskell ];
   homepage = "https://github.com/mgajda/FenwickTree";
   description = "Data structure for fast query and update of cumulative sums";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/GPipe-GLFW.nix.golden b/test/golden-test-cases/GPipe-GLFW.nix.golden
--- a/test/golden-test-cases/GPipe-GLFW.nix.golden
+++ b/test/golden-test-cases/GPipe-GLFW.nix.golden
@@ -1,5 +1,4 @@
-{ mkDerivation, async, base, containers, GLFW-b, GPipe, stdenv, stm
-}:
+{ mkDerivation, async, base, containers, GLFW-b, GPipe, lib, stm }:
 mkDerivation {
   pname = "GPipe-GLFW";
   version = "1.4.1.1";
@@ -8,5 +7,5 @@
   libraryHaskellDepends = [ async base containers GLFW-b GPipe stm ];
   homepage = "https://github.com/plredmond/GPipe-GLFW";
   description = "GLFW OpenGL context creation for GPipe";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/GenericPretty.nix.golden b/test/golden-test-cases/GenericPretty.nix.golden
--- a/test/golden-test-cases/GenericPretty.nix.golden
+++ b/test/golden-test-cases/GenericPretty.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, ghc-prim, pretty, stdenv }:
+{ mkDerivation, base, ghc-prim, lib, pretty }:
 mkDerivation {
   pname = "GenericPretty";
   version = "1.2.1";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base ghc-prim pretty ];
   homepage = "https://github.com/RazvanRanca/GenericPretty";
   description = "A generic, derivable, haskell pretty printer";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/HPDF.nix.golden b/test/golden-test-cases/HPDF.nix.golden
--- a/test/golden-test-cases/HPDF.nix.golden
+++ b/test/golden-test-cases/HPDF.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, array, base, base64-bytestring, binary, bytestring
-, containers, errors, HTF, mtl, random, stdenv, vector, zlib
+, containers, errors, HTF, lib, mtl, random, vector, zlib
 }:
 mkDerivation {
   pname = "HPDF";
@@ -12,5 +12,5 @@
   testHaskellDepends = [ base HTF ];
   homepage = "http://www.alpheccar.org";
   description = "Generation of PDF documents";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/HTF.nix.golden b/test/golden-test-cases/HTF.nix.golden
--- a/test/golden-test-cases/HTF.nix.golden
+++ b/test/golden-test-cases/HTF.nix.golden
@@ -1,7 +1,7 @@
 { mkDerivation, aeson, aeson-pretty, array, base, base64-bytestring
 , bytestring, containers, cpphs, Diff, directory, filepath
-, haskell-src, HUnit, lifted-base, monad-control, mtl, old-time
-, pretty, process, QuickCheck, random, regex-compat, stdenv
+, haskell-src, HUnit, lib, lifted-base, monad-control, mtl
+, old-time, pretty, process, QuickCheck, random, regex-compat
 , template-haskell, temporary, text, time, unix
 , unordered-containers, vector, xmlgen
 }:
diff --git a/test/golden-test-cases/HTTP.nix.golden b/test/golden-test-cases/HTTP.nix.golden
--- a/test/golden-test-cases/HTTP.nix.golden
+++ b/test/golden-test-cases/HTTP.nix.golden
@@ -1,7 +1,7 @@
 { mkDerivation, array, base, bytestring, case-insensitive, conduit
-, conduit-extra, deepseq, http-types, httpd-shed, HUnit, mtl
-, network, network-uri, parsec, pureMD5, split, stdenv
-, test-framework, test-framework-hunit, time, wai, warp
+, conduit-extra, deepseq, http-types, httpd-shed, HUnit, lib, mtl
+, network, network-uri, parsec, pureMD5, split, test-framework
+, test-framework-hunit, time, wai, warp
 }:
 mkDerivation {
   pname = "HTTP";
@@ -17,5 +17,5 @@
   ];
   homepage = "https://github.com/haskell/HTTP";
   description = "A library for client-side HTTP";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/Hclip.nix.golden b/test/golden-test-cases/Hclip.nix.golden
--- a/test/golden-test-cases/Hclip.nix.golden
+++ b/test/golden-test-cases/Hclip.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, mtl, process, stdenv, strict }:
+{ mkDerivation, base, lib, mtl, process, strict }:
 mkDerivation {
   pname = "Hclip";
   version = "3.0.0.4";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base mtl process strict ];
   homepage = "https://github.com/jetho/Hclip";
   description = "A small cross-platform library for reading and modifying the system clipboard";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/MissingH.nix.golden b/test/golden-test-cases/MissingH.nix.golden
--- a/test/golden-test-cases/MissingH.nix.golden
+++ b/test/golden-test-cases/MissingH.nix.golden
@@ -1,7 +1,7 @@
 { mkDerivation, array, base, containers, directory
-, errorcall-eq-instance, filepath, hslogger, HUnit, mtl, network
-, old-locale, old-time, parsec, process, QuickCheck, random
-, regex-compat, stdenv, testpack, time, unix
+, errorcall-eq-instance, filepath, hslogger, HUnit, lib, mtl
+, network, old-locale, old-time, parsec, process, QuickCheck
+, random, regex-compat, testpack, time, unix
 }:
 mkDerivation {
   pname = "MissingH";
@@ -18,5 +18,5 @@
   ];
   homepage = "http://software.complete.org/missingh";
   description = "Large utility library";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/ObjectName.nix.golden b/test/golden-test-cases/ObjectName.nix.golden
--- a/test/golden-test-cases/ObjectName.nix.golden
+++ b/test/golden-test-cases/ObjectName.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, stdenv, transformers }:
+{ mkDerivation, base, lib, transformers }:
 mkDerivation {
   pname = "ObjectName";
   version = "1.1.0.1";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base transformers ];
   homepage = "https://github.com/svenpanne/ObjectName";
   description = "Explicitly handled object names";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/Only.nix.golden b/test/golden-test-cases/Only.nix.golden
--- a/test/golden-test-cases/Only.nix.golden
+++ b/test/golden-test-cases/Only.nix.golden
@@ -1,9 +1,9 @@
-{ mkDerivation, base, deepseq, stdenv }:
+{ mkDerivation, base, deepseq, lib }:
 mkDerivation {
   pname = "Only";
   version = "0.1";
   sha256 = "deadbeef";
   libraryHaskellDepends = [ base deepseq ];
   description = "The 1-tuple type or single-value \"collection\"";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/QuasiText.nix.golden b/test/golden-test-cases/QuasiText.nix.golden
--- a/test/golden-test-cases/QuasiText.nix.golden
+++ b/test/golden-test-cases/QuasiText.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, attoparsec, base, haskell-src-meta, stdenv
+{ mkDerivation, attoparsec, base, haskell-src-meta, lib
 , template-haskell, text, th-lift-instances
 }:
 mkDerivation {
@@ -11,5 +11,5 @@
   ];
   homepage = "https://github.com/mikeplus64/QuasiText";
   description = "A QuasiQuoter for Text";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/QuickCheck.nix.golden b/test/golden-test-cases/QuickCheck.nix.golden
--- a/test/golden-test-cases/QuickCheck.nix.golden
+++ b/test/golden-test-cases/QuickCheck.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, containers, deepseq, random, stdenv
+{ mkDerivation, base, containers, deepseq, lib, random
 , template-haskell, tf-random, transformers
 }:
 mkDerivation {
@@ -12,5 +12,5 @@
   testHaskellDepends = [ base ];
   homepage = "https://github.com/nick8325/quickcheck";
   description = "Automatic testing of Haskell programs";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/ReadArgs.nix.golden b/test/golden-test-cases/ReadArgs.nix.golden
--- a/test/golden-test-cases/ReadArgs.nix.golden
+++ b/test/golden-test-cases/ReadArgs.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, hspec, stdenv, system-filepath, text }:
+{ mkDerivation, base, hspec, lib, system-filepath, text }:
 mkDerivation {
   pname = "ReadArgs";
   version = "1.2.3";
@@ -10,5 +10,5 @@
   testHaskellDepends = [ base hspec system-filepath text ];
   homepage = "http://github.com/rampion/ReadArgs";
   description = "Simple command line argument parsing";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/SHA.nix.golden b/test/golden-test-cases/SHA.nix.golden
--- a/test/golden-test-cases/SHA.nix.golden
+++ b/test/golden-test-cases/SHA.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, array, base, binary, bytestring, QuickCheck, stdenv
+{ mkDerivation, array, base, binary, bytestring, lib, QuickCheck
 , test-framework, test-framework-quickcheck2
 }:
 mkDerivation {
@@ -13,5 +13,5 @@
     test-framework-quickcheck2
   ];
   description = "Implementations of the SHA suite of message digest functions";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/Strafunski-StrategyLib.nix.golden b/test/golden-test-cases/Strafunski-StrategyLib.nix.golden
--- a/test/golden-test-cases/Strafunski-StrategyLib.nix.golden
+++ b/test/golden-test-cases/Strafunski-StrategyLib.nix.golden
@@ -1,9 +1,9 @@
-{ mkDerivation, base, directory, mtl, stdenv, syb, transformers }:
+{ mkDerivation, base, directory, lib, mtl, syb, transformers }:
 mkDerivation {
   pname = "Strafunski-StrategyLib";
   version = "5.0.0.10";
   sha256 = "deadbeef";
   libraryHaskellDepends = [ base directory mtl syb transformers ];
   description = "Library for strategic programming";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/accelerate-fftw.nix.golden b/test/golden-test-cases/accelerate-fftw.nix.golden
--- a/test/golden-test-cases/accelerate-fftw.nix.golden
+++ b/test/golden-test-cases/accelerate-fftw.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, accelerate, accelerate-io, base, carray, fft
-, stdenv, storable-complex
+{ mkDerivation, accelerate, accelerate-io, base, carray, fft, lib
+, storable-complex
 }:
 mkDerivation {
   pname = "accelerate-fftw";
@@ -10,5 +10,5 @@
   ];
   homepage = "http://hub.darcs.net/thielema/accelerate-fftw/";
   description = "Accelerate frontend to the FFTW library (Fourier transform)";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/accelerate.nix.golden b/test/golden-test-cases/accelerate.nix.golden
--- a/test/golden-test-cases/accelerate.nix.golden
+++ b/test/golden-test-cases/accelerate.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, ansi-wl-pprint, base, base-orphans, containers
 , deepseq, directory, exceptions, fclabels, filepath, ghc-prim
-, hashable, hashtables, mtl, stdenv, template-haskell, time
+, hashable, hashtables, lib, mtl, template-haskell, time
 , transformers, unique, unix, unordered-containers
 }:
 mkDerivation {
@@ -14,5 +14,5 @@
   ];
   homepage = "https://github.com/AccelerateHS/accelerate/";
   description = "An embedded language for accelerated array processing";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/active.nix.golden b/test/golden-test-cases/active.nix.golden
--- a/test/golden-test-cases/active.nix.golden
+++ b/test/golden-test-cases/active.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, lens, linear, QuickCheck, semigroupoids
-, semigroups, stdenv, vector
+{ mkDerivation, base, lens, lib, linear, QuickCheck, semigroupoids
+, semigroups, vector
 }:
 mkDerivation {
   pname = "active";
@@ -12,5 +12,5 @@
     base lens linear QuickCheck semigroupoids semigroups vector
   ];
   description = "Abstractions for animation";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/adjunctions.nix.golden b/test/golden-test-cases/adjunctions.nix.golden
--- a/test/golden-test-cases/adjunctions.nix.golden
+++ b/test/golden-test-cases/adjunctions.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, array, base, comonad, containers, contravariant
-, distributive, free, mtl, profunctors, semigroupoids, semigroups
-, stdenv, tagged, transformers, transformers-compat, void
+, distributive, free, lib, mtl, profunctors, semigroupoids
+, semigroups, tagged, transformers, transformers-compat, void
 }:
 mkDerivation {
   pname = "adjunctions";
@@ -13,5 +13,5 @@
   ];
   homepage = "http://github.com/ekmett/adjunctions/";
   description = "Adjunctions and representable functors";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/aeson-diff.nix.golden b/test/golden-test-cases/aeson-diff.nix.golden
--- a/test/golden-test-cases/aeson-diff.nix.golden
+++ b/test/golden-test-cases/aeson-diff.nix.golden
@@ -1,7 +1,7 @@
 { mkDerivation, aeson, base, bytestring, directory, doctest
-, edit-distance-vector, filepath, Glob, hashable, hlint, mtl
+, edit-distance-vector, filepath, Glob, hashable, hlint, lib, mtl
 , optparse-applicative, QuickCheck, quickcheck-instances
-, scientific, stdenv, text, unordered-containers, vector
+, scientific, text, unordered-containers, vector
 }:
 mkDerivation {
   pname = "aeson-diff";
@@ -22,5 +22,5 @@
   ];
   homepage = "https://github.com/thsutton/aeson-diff";
   description = "Extract and apply patches to JSON documents";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/aeson-pretty.nix.golden b/test/golden-test-cases/aeson-pretty.nix.golden
--- a/test/golden-test-cases/aeson-pretty.nix.golden
+++ b/test/golden-test-cases/aeson-pretty.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, aeson, attoparsec, base, base-compat, bytestring
-, cmdargs, scientific, stdenv, text, unordered-containers, vector
+, cmdargs, lib, scientific, text, unordered-containers, vector
 }:
 mkDerivation {
   pname = "aeson-pretty";
@@ -16,5 +16,5 @@
   ];
   homepage = "http://github.com/informatikr/aeson-pretty";
   description = "JSON pretty-printing library and command-line tool";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/algebraic-graphs.nix.golden b/test/golden-test-cases/algebraic-graphs.nix.golden
--- a/test/golden-test-cases/algebraic-graphs.nix.golden
+++ b/test/golden-test-cases/algebraic-graphs.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, array, base, containers, criterion, extra
-, QuickCheck, stdenv
+{ mkDerivation, array, base, containers, criterion, extra, lib
+, QuickCheck
 }:
 mkDerivation {
   pname = "algebraic-graphs";
@@ -10,5 +10,5 @@
   benchmarkHaskellDepends = [ base containers criterion ];
   homepage = "https://github.com/snowleopard/alga";
   description = "A library for algebraic graph construction and transformation";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/amazonka-cloudtrail.nix.golden b/test/golden-test-cases/amazonka-cloudtrail.nix.golden
--- a/test/golden-test-cases/amazonka-cloudtrail.nix.golden
+++ b/test/golden-test-cases/amazonka-cloudtrail.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, amazonka-core, amazonka-test, base, bytestring
-, stdenv, tasty, tasty-hunit, text, time, unordered-containers
+{ mkDerivation, amazonka-core, amazonka-test, base, bytestring, lib
+, tasty, tasty-hunit, text, time, unordered-containers
 }:
 mkDerivation {
   pname = "amazonka-cloudtrail";
@@ -12,5 +12,5 @@
   ];
   homepage = "https://github.com/brendanhay/amazonka";
   description = "Amazon CloudTrail SDK";
-  license = stdenv.lib.licenses.mpl20;
+  license = lib.licenses.mpl20;
 }
diff --git a/test/golden-test-cases/amazonka-cloudwatch-logs.nix.golden b/test/golden-test-cases/amazonka-cloudwatch-logs.nix.golden
--- a/test/golden-test-cases/amazonka-cloudwatch-logs.nix.golden
+++ b/test/golden-test-cases/amazonka-cloudwatch-logs.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, amazonka-core, amazonka-test, base, bytestring
-, stdenv, tasty, tasty-hunit, text, time, unordered-containers
+{ mkDerivation, amazonka-core, amazonka-test, base, bytestring, lib
+, tasty, tasty-hunit, text, time, unordered-containers
 }:
 mkDerivation {
   pname = "amazonka-cloudwatch-logs";
@@ -12,5 +12,5 @@
   ];
   homepage = "https://github.com/brendanhay/amazonka";
   description = "Amazon CloudWatch Logs SDK";
-  license = stdenv.lib.licenses.mpl20;
+  license = lib.licenses.mpl20;
 }
diff --git a/test/golden-test-cases/amazonka-codedeploy.nix.golden b/test/golden-test-cases/amazonka-codedeploy.nix.golden
--- a/test/golden-test-cases/amazonka-codedeploy.nix.golden
+++ b/test/golden-test-cases/amazonka-codedeploy.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, amazonka-core, amazonka-test, base, bytestring
-, stdenv, tasty, tasty-hunit, text, time, unordered-containers
+{ mkDerivation, amazonka-core, amazonka-test, base, bytestring, lib
+, tasty, tasty-hunit, text, time, unordered-containers
 }:
 mkDerivation {
   pname = "amazonka-codedeploy";
@@ -12,5 +12,5 @@
   ];
   homepage = "https://github.com/brendanhay/amazonka";
   description = "Amazon CodeDeploy SDK";
-  license = stdenv.lib.licenses.mpl20;
+  license = lib.licenses.mpl20;
 }
diff --git a/test/golden-test-cases/amazonka-cognito-idp.nix.golden b/test/golden-test-cases/amazonka-cognito-idp.nix.golden
--- a/test/golden-test-cases/amazonka-cognito-idp.nix.golden
+++ b/test/golden-test-cases/amazonka-cognito-idp.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, amazonka-core, amazonka-test, base, bytestring
-, stdenv, tasty, tasty-hunit, text, time, unordered-containers
+{ mkDerivation, amazonka-core, amazonka-test, base, bytestring, lib
+, tasty, tasty-hunit, text, time, unordered-containers
 }:
 mkDerivation {
   pname = "amazonka-cognito-idp";
@@ -12,5 +12,5 @@
   ];
   homepage = "https://github.com/brendanhay/amazonka";
   description = "Amazon Cognito Identity Provider SDK";
-  license = stdenv.lib.licenses.mpl20;
+  license = lib.licenses.mpl20;
 }
diff --git a/test/golden-test-cases/amazonka-ecs.nix.golden b/test/golden-test-cases/amazonka-ecs.nix.golden
--- a/test/golden-test-cases/amazonka-ecs.nix.golden
+++ b/test/golden-test-cases/amazonka-ecs.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, amazonka-core, amazonka-test, base, bytestring
-, stdenv, tasty, tasty-hunit, text, time, unordered-containers
+{ mkDerivation, amazonka-core, amazonka-test, base, bytestring, lib
+, tasty, tasty-hunit, text, time, unordered-containers
 }:
 mkDerivation {
   pname = "amazonka-ecs";
@@ -12,5 +12,5 @@
   ];
   homepage = "https://github.com/brendanhay/amazonka";
   description = "Amazon EC2 Container Service SDK";
-  license = stdenv.lib.licenses.mpl20;
+  license = lib.licenses.mpl20;
 }
diff --git a/test/golden-test-cases/amazonka-kms.nix.golden b/test/golden-test-cases/amazonka-kms.nix.golden
--- a/test/golden-test-cases/amazonka-kms.nix.golden
+++ b/test/golden-test-cases/amazonka-kms.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, amazonka-core, amazonka-test, base, bytestring
-, stdenv, tasty, tasty-hunit, text, time, unordered-containers
+{ mkDerivation, amazonka-core, amazonka-test, base, bytestring, lib
+, tasty, tasty-hunit, text, time, unordered-containers
 }:
 mkDerivation {
   pname = "amazonka-kms";
@@ -12,5 +12,5 @@
   ];
   homepage = "https://github.com/brendanhay/amazonka";
   description = "Amazon Key Management Service SDK";
-  license = stdenv.lib.licenses.mpl20;
+  license = lib.licenses.mpl20;
 }
diff --git a/test/golden-test-cases/amazonka-lightsail.nix.golden b/test/golden-test-cases/amazonka-lightsail.nix.golden
--- a/test/golden-test-cases/amazonka-lightsail.nix.golden
+++ b/test/golden-test-cases/amazonka-lightsail.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, amazonka-core, amazonka-test, base, bytestring
-, stdenv, tasty, tasty-hunit, text, time, unordered-containers
+{ mkDerivation, amazonka-core, amazonka-test, base, bytestring, lib
+, tasty, tasty-hunit, text, time, unordered-containers
 }:
 mkDerivation {
   pname = "amazonka-lightsail";
@@ -12,5 +12,5 @@
   ];
   homepage = "https://github.com/brendanhay/amazonka";
   description = "Amazon Lightsail SDK";
-  license = stdenv.lib.licenses.mpl20;
+  license = lib.licenses.mpl20;
 }
diff --git a/test/golden-test-cases/amazonka-route53-domains.nix.golden b/test/golden-test-cases/amazonka-route53-domains.nix.golden
--- a/test/golden-test-cases/amazonka-route53-domains.nix.golden
+++ b/test/golden-test-cases/amazonka-route53-domains.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, amazonka-core, amazonka-test, base, bytestring
-, stdenv, tasty, tasty-hunit, text, time, unordered-containers
+{ mkDerivation, amazonka-core, amazonka-test, base, bytestring, lib
+, tasty, tasty-hunit, text, time, unordered-containers
 }:
 mkDerivation {
   pname = "amazonka-route53-domains";
@@ -12,5 +12,5 @@
   ];
   homepage = "https://github.com/brendanhay/amazonka";
   description = "Amazon Route 53 Domains SDK";
-  license = stdenv.lib.licenses.mpl20;
+  license = lib.licenses.mpl20;
 }
diff --git a/test/golden-test-cases/amazonka-waf.nix.golden b/test/golden-test-cases/amazonka-waf.nix.golden
--- a/test/golden-test-cases/amazonka-waf.nix.golden
+++ b/test/golden-test-cases/amazonka-waf.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, amazonka-core, amazonka-test, base, bytestring
-, stdenv, tasty, tasty-hunit, text, time, unordered-containers
+{ mkDerivation, amazonka-core, amazonka-test, base, bytestring, lib
+, tasty, tasty-hunit, text, time, unordered-containers
 }:
 mkDerivation {
   pname = "amazonka-waf";
@@ -12,5 +12,5 @@
   ];
   homepage = "https://github.com/brendanhay/amazonka";
   description = "Amazon WAF SDK";
-  license = stdenv.lib.licenses.mpl20;
+  license = lib.licenses.mpl20;
 }
diff --git a/test/golden-test-cases/api-field-json-th.nix.golden b/test/golden-test-cases/api-field-json-th.nix.golden
--- a/test/golden-test-cases/api-field-json-th.nix.golden
+++ b/test/golden-test-cases/api-field-json-th.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, aeson, base, HUnit, lens, split, stdenv
+{ mkDerivation, aeson, base, HUnit, lens, lib, split
 , template-haskell, text
 }:
 mkDerivation {
@@ -11,5 +11,5 @@
   testHaskellDepends = [ aeson base HUnit lens ];
   homepage = "https://github.com/nakaji-dayo/api-field-json-th";
   description = "option of aeson's deriveJSON";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/app-settings.nix.golden b/test/golden-test-cases/app-settings.nix.golden
--- a/test/golden-test-cases/app-settings.nix.golden
+++ b/test/golden-test-cases/app-settings.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, containers, directory, hspec, HUnit, mtl
-, parsec, stdenv, text
+{ mkDerivation, base, containers, directory, hspec, HUnit, lib, mtl
+, parsec, text
 }:
 mkDerivation {
   pname = "app-settings";
@@ -13,5 +13,5 @@
   ];
   homepage = "https://github.com/emmanueltouzery/app-settings";
   description = "A library to manage application settings (INI file-like)";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/apply-refact.nix.golden b/test/golden-test-cases/apply-refact.nix.golden
--- a/test/golden-test-cases/apply-refact.nix.golden
+++ b/test/golden-test-cases/apply-refact.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, base, containers, directory, filemanip, filepath
-, ghc, ghc-exactprint, mtl, optparse-applicative, process, refact
-, silently, stdenv, syb, tasty, tasty-expected-failure
+, ghc, ghc-exactprint, lib, mtl, optparse-applicative, process
+, refact, silently, syb, tasty, tasty-expected-failure
 , tasty-golden, temporary, transformers, unix-compat
 }:
 mkDerivation {
@@ -25,5 +25,5 @@
     unix-compat
   ];
   description = "Perform refactorings specified by the refact library";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/async.nix.golden b/test/golden-test-cases/async.nix.golden
--- a/test/golden-test-cases/async.nix.golden
+++ b/test/golden-test-cases/async.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, HUnit, stdenv, stm, test-framework
+{ mkDerivation, base, HUnit, lib, stm, test-framework
 , test-framework-hunit
 }:
 mkDerivation {
@@ -11,5 +11,5 @@
   ];
   homepage = "https://github.com/simonmar/async";
   description = "Run IO operations asynchronously and wait for their results";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/attoparsec-expr.nix.golden b/test/golden-test-cases/attoparsec-expr.nix.golden
--- a/test/golden-test-cases/attoparsec-expr.nix.golden
+++ b/test/golden-test-cases/attoparsec-expr.nix.golden
@@ -1,9 +1,9 @@
-{ mkDerivation, attoparsec, base, stdenv }:
+{ mkDerivation, attoparsec, base, lib }:
 mkDerivation {
   pname = "attoparsec-expr";
   version = "0.1.1.2";
   sha256 = "deadbeef";
   libraryHaskellDepends = [ attoparsec base ];
   description = "Port of parsec's expression parser to attoparsec";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/attoparsec-time.nix.golden b/test/golden-test-cases/attoparsec-time.nix.golden
--- a/test/golden-test-cases/attoparsec-time.nix.golden
+++ b/test/golden-test-cases/attoparsec-time.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, attoparsec, base, base-prelude, bytestring, Cabal
-, cabal-doctest, directory, doctest, filepath, scientific, stdenv
+, cabal-doctest, directory, doctest, filepath, lib, scientific
 , text, time
 }:
 mkDerivation {
@@ -15,5 +15,5 @@
   ];
   homepage = "https://github.com/nikita-volkov/attoparsec-time";
   description = "Attoparsec parsers of time";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/avers-server.nix.golden b/test/golden-test-cases/avers-server.nix.golden
--- a/test/golden-test-cases/avers-server.nix.golden
+++ b/test/golden-test-cases/avers-server.nix.golden
@@ -1,8 +1,8 @@
 { mkDerivation, aeson, avers, avers-api, base, base64-bytestring
 , bytestring, bytestring-conversion, containers, cookie, cryptonite
-, http-types, memory, mtl, resource-pool, rethinkdb-client-driver
-, servant, servant-server, stdenv, stm, text, time, transformers
-, wai, wai-websockets, websockets
+, http-types, lib, memory, mtl, resource-pool
+, rethinkdb-client-driver, servant, servant-server, stm, text, time
+, transformers, wai, wai-websockets, websockets
 }:
 mkDerivation {
   pname = "avers-server";
@@ -17,5 +17,5 @@
   ];
   homepage = "http://github.com/wereHamster/avers-server";
   description = "Server implementation of the Avers API";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/aws.nix.golden b/test/golden-test-cases/aws.nix.golden
--- a/test/golden-test-cases/aws.nix.golden
+++ b/test/golden-test-cases/aws.nix.golden
@@ -3,10 +3,10 @@
 , case-insensitive, cereal, conduit, conduit-combinators
 , conduit-extra, containers, cryptonite, data-default, directory
 , errors, filepath, http-client, http-client-tls, http-conduit
-, http-types, lifted-base, memory, monad-control, mtl, network
+, http-types, lib, lifted-base, memory, monad-control, mtl, network
 , old-locale, QuickCheck, quickcheck-instances, resourcet, safe
-, scientific, stdenv, tagged, tasty, tasty-hunit, tasty-quickcheck
-, text, time, transformers, transformers-base, unordered-containers
+, scientific, tagged, tasty, tasty-hunit, tasty-quickcheck, text
+, time, transformers, transformers-base, unordered-containers
 , utf8-string, vector, xml-conduit
 }:
 mkDerivation {
@@ -31,5 +31,5 @@
   ];
   homepage = "http://github.com/aristidb/aws";
   description = "Amazon Web Services (AWS) for Haskell";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/bbdb.nix.golden b/test/golden-test-cases/bbdb.nix.golden
--- a/test/golden-test-cases/bbdb.nix.golden
+++ b/test/golden-test-cases/bbdb.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, hspec, parsec, stdenv }:
+{ mkDerivation, base, hspec, lib, parsec }:
 mkDerivation {
   pname = "bbdb";
   version = "0.8";
@@ -7,5 +7,5 @@
   testHaskellDepends = [ base hspec parsec ];
   homepage = "https://github.com/henrylaxen/bbdb";
   description = "Ability to read, write, and modify BBDB files";
-  license = stdenv.lib.licenses.gpl3;
+  license = lib.licenses.gpl3;
 }
diff --git a/test/golden-test-cases/benchpress.nix.golden b/test/golden-test-cases/benchpress.nix.golden
--- a/test/golden-test-cases/benchpress.nix.golden
+++ b/test/golden-test-cases/benchpress.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, bytestring, mtl, stdenv, time }:
+{ mkDerivation, base, bytestring, lib, mtl, time }:
 mkDerivation {
   pname = "benchpress";
   version = "0.2.2.10";
@@ -9,5 +9,5 @@
   executableHaskellDepends = [ base bytestring ];
   homepage = "https://github.com/WillSewell/benchpress";
   description = "Micro-benchmarking with detailed statistics";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/binary-bits.nix.golden b/test/golden-test-cases/binary-bits.nix.golden
--- a/test/golden-test-cases/binary-bits.nix.golden
+++ b/test/golden-test-cases/binary-bits.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, binary, bytestring, QuickCheck, random
-, stdenv, test-framework, test-framework-quickcheck2
+{ mkDerivation, base, binary, bytestring, lib, QuickCheck, random
+, test-framework, test-framework-quickcheck2
 }:
 mkDerivation {
   pname = "binary-bits";
@@ -11,5 +11,5 @@
     test-framework-quickcheck2
   ];
   description = "Bit parsing/writing on top of binary";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/binary-tagged.nix.golden b/test/golden-test-cases/binary-tagged.nix.golden
--- a/test/golden-test-cases/binary-tagged.nix.golden
+++ b/test/golden-test-cases/binary-tagged.nix.golden
@@ -1,8 +1,8 @@
 { mkDerivation, aeson, array, base, base16-bytestring, bifunctors
 , binary, binary-orphans, bytestring, containers, criterion
-, deepseq, generics-sop, hashable, nats, quickcheck-instances
-, scientific, semigroups, SHA, stdenv, tagged, tasty
-, tasty-quickcheck, text, time, unordered-containers, vector
+, deepseq, generics-sop, hashable, lib, nats, quickcheck-instances
+, scientific, semigroups, SHA, tagged, tasty, tasty-quickcheck
+, text, time, unordered-containers, vector
 }:
 mkDerivation {
   pname = "binary-tagged";
@@ -26,5 +26,5 @@
   ];
   homepage = "https://github.com/phadej/binary-tagged#readme";
   description = "Tagged binary serialisation";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/bindings-uname.nix.golden b/test/golden-test-cases/bindings-uname.nix.golden
--- a/test/golden-test-cases/bindings-uname.nix.golden
+++ b/test/golden-test-cases/bindings-uname.nix.golden
@@ -1,9 +1,9 @@
-{ mkDerivation, base, stdenv }:
+{ mkDerivation, base, lib }:
 mkDerivation {
   pname = "bindings-uname";
   version = "0.1";
   sha256 = "deadbeef";
   libraryHaskellDepends = [ base ];
   description = "Low-level binding to POSIX uname(3)";
-  license = stdenv.lib.licenses.publicDomain;
+  license = lib.licenses.publicDomain;
 }
diff --git a/test/golden-test-cases/bioalign.nix.golden b/test/golden-test-cases/bioalign.nix.golden
--- a/test/golden-test-cases/bioalign.nix.golden
+++ b/test/golden-test-cases/bioalign.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, biocore, bytestring, stdenv }:
+{ mkDerivation, base, biocore, bytestring, lib }:
 mkDerivation {
   pname = "bioalign";
   version = "0.0.5";
diff --git a/test/golden-test-cases/bits.nix.golden b/test/golden-test-cases/bits.nix.golden
--- a/test/golden-test-cases/bits.nix.golden
+++ b/test/golden-test-cases/bits.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, bytes, Cabal, cabal-doctest, doctest, mtl
-, stdenv, transformers
+{ mkDerivation, base, bytes, Cabal, cabal-doctest, doctest, lib
+, mtl, transformers
 }:
 mkDerivation {
   pname = "bits";
@@ -10,5 +10,5 @@
   testHaskellDepends = [ base doctest ];
   homepage = "http://github.com/ekmett/bits";
   description = "Various bit twiddling and bitwise serialization primitives";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/blank-canvas.nix.golden b/test/golden-test-cases/blank-canvas.nix.golden
--- a/test/golden-test-cases/blank-canvas.nix.golden
+++ b/test/golden-test-cases/blank-canvas.nix.golden
@@ -1,8 +1,8 @@
 { mkDerivation, aeson, base, base-compat, base64-bytestring
 , bytestring, colour, containers, data-default-class, directory
-, http-types, kansas-comet, mime-types, process, scotty, shake
-, stdenv, stm, text, text-show, time, transformers, unix, vector
-, wai, wai-extra, warp
+, http-types, kansas-comet, lib, mime-types, process, scotty, shake
+, stm, text, text-show, time, transformers, unix, vector, wai
+, wai-extra, warp
 }:
 mkDerivation {
   pname = "blank-canvas";
@@ -19,5 +19,5 @@
   ];
   homepage = "https://github.com/ku-fpg/blank-canvas/wiki";
   description = "HTML5 Canvas Graphics Library";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/blaze-html.nix.golden b/test/golden-test-cases/blaze-html.nix.golden
--- a/test/golden-test-cases/blaze-html.nix.golden
+++ b/test/golden-test-cases/blaze-html.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, base, blaze-builder, blaze-markup, bytestring
-, containers, HUnit, QuickCheck, stdenv, test-framework
+, containers, HUnit, lib, QuickCheck, test-framework
 , test-framework-hunit, test-framework-quickcheck2, text
 }:
 mkDerivation {
@@ -16,5 +16,5 @@
   ];
   homepage = "http://jaspervdj.be/blaze";
   description = "A blazingly fast HTML combinator library for Haskell";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/blaze-markup.nix.golden b/test/golden-test-cases/blaze-markup.nix.golden
--- a/test/golden-test-cases/blaze-markup.nix.golden
+++ b/test/golden-test-cases/blaze-markup.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, base, blaze-builder, bytestring, containers, HUnit
-, QuickCheck, stdenv, test-framework, test-framework-hunit
+, lib, QuickCheck, test-framework, test-framework-hunit
 , test-framework-quickcheck2, text
 }:
 mkDerivation {
@@ -13,5 +13,5 @@
   ];
   homepage = "http://jaspervdj.be/blaze";
   description = "A blazingly fast markup combinator library for Haskell";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/blaze-svg.nix.golden b/test/golden-test-cases/blaze-svg.nix.golden
--- a/test/golden-test-cases/blaze-svg.nix.golden
+++ b/test/golden-test-cases/blaze-svg.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, blaze-markup, mtl, stdenv }:
+{ mkDerivation, base, blaze-markup, lib, mtl }:
 mkDerivation {
   pname = "blaze-svg";
   version = "0.3.6.1";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base blaze-markup mtl ];
   homepage = "https://github.com/deepakjois/blaze-svg";
   description = "SVG combinator library";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/blosum.nix.golden b/test/golden-test-cases/blosum.nix.golden
--- a/test/golden-test-cases/blosum.nix.golden
+++ b/test/golden-test-cases/blosum.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, containers, fasta, lens, optparse-applicative
-, pipes, pipes-text, split, stdenv, text, text-show
+{ mkDerivation, base, containers, fasta, lens, lib
+, optparse-applicative, pipes, pipes-text, split, text, text-show
 }:
 mkDerivation {
   pname = "blosum";
@@ -16,5 +16,5 @@
   ];
   homepage = "http://github.com/GregorySchwartz/blosum#readme";
   description = "BLOSUM generator";
-  license = stdenv.lib.licenses.gpl2;
+  license = lib.licenses.gpl2;
 }
diff --git a/test/golden-test-cases/boomerang.nix.golden b/test/golden-test-cases/boomerang.nix.golden
--- a/test/golden-test-cases/boomerang.nix.golden
+++ b/test/golden-test-cases/boomerang.nix.golden
@@ -1,9 +1,9 @@
-{ mkDerivation, base, mtl, stdenv, template-haskell, text }:
+{ mkDerivation, base, lib, mtl, template-haskell, text }:
 mkDerivation {
   pname = "boomerang";
   version = "1.4.5.3";
   sha256 = "deadbeef";
   libraryHaskellDepends = [ base mtl template-haskell text ];
   description = "Library for invertible parsing and printing";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/boxes.nix.golden b/test/golden-test-cases/boxes.nix.golden
--- a/test/golden-test-cases/boxes.nix.golden
+++ b/test/golden-test-cases/boxes.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, QuickCheck, split, stdenv }:
+{ mkDerivation, base, lib, QuickCheck, split }:
 mkDerivation {
   pname = "boxes";
   version = "0.1.4";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base split ];
   testHaskellDepends = [ base QuickCheck split ];
   description = "2D text pretty-printing library";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/brittany.nix.golden b/test/golden-test-cases/brittany.nix.golden
--- a/test/golden-test-cases/brittany.nix.golden
+++ b/test/golden-test-cases/brittany.nix.golden
@@ -1,9 +1,9 @@
 { mkDerivation, aeson, base, butcher, bytestring, cmdargs
 , containers, czipwith, data-tree-print, deepseq, directory, extra
-, filepath, ghc, ghc-boot-th, ghc-exactprint, ghc-paths, hspec
+, filepath, ghc, ghc-boot-th, ghc-exactprint, ghc-paths, hspec, lib
 , monad-memo, mtl, multistate, neat-interpolation, parsec, pretty
-, safe, semigroups, stdenv, strict, syb, text, transformers
-, uniplate, unsafe, yaml
+, safe, semigroups, strict, syb, text, transformers, uniplate
+, unsafe, yaml
 }:
 mkDerivation {
   pname = "brittany";
@@ -34,5 +34,5 @@
   ];
   homepage = "https://github.com/lspitzner/brittany/";
   description = "Haskell source code formatter";
-  license = stdenv.lib.licenses.agpl3;
+  license = lib.licenses.agpl3;
 }
diff --git a/test/golden-test-cases/broadcast-chan.nix.golden b/test/golden-test-cases/broadcast-chan.nix.golden
--- a/test/golden-test-cases/broadcast-chan.nix.golden
+++ b/test/golden-test-cases/broadcast-chan.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, stdenv }:
+{ mkDerivation, base, lib }:
 mkDerivation {
   pname = "broadcast-chan";
   version = "0.1.1";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base ];
   homepage = "https://github.com/merijn/broadcast-chan";
   description = "Broadcast channel type that avoids 0 reader space leaks";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/butcher.nix.golden b/test/golden-test-cases/butcher.nix.golden
--- a/test/golden-test-cases/butcher.nix.golden
+++ b/test/golden-test-cases/butcher.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, base, bifunctors, containers, deque, either, extra
-, free, microlens, microlens-th, mtl, multistate, pretty, stdenv
+, free, lib, microlens, microlens-th, mtl, multistate, pretty
 , transformers, unsafe, void
 }:
 mkDerivation {
@@ -12,5 +12,5 @@
   ];
   homepage = "https://github.com/lspitzner/butcher/";
   description = "Chops a command or program invocation into digestable pieces";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/bzlib.nix.golden b/test/golden-test-cases/bzlib.nix.golden
--- a/test/golden-test-cases/bzlib.nix.golden
+++ b/test/golden-test-cases/bzlib.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, bytestring, bzip2, stdenv }:
+{ mkDerivation, base, bytestring, bzip2, lib }:
 mkDerivation {
   pname = "bzlib";
   version = "0.5.0.5";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base bytestring ];
   librarySystemDepends = [ bzip2 ];
   description = "Compression and decompression in the bzip2 format";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/case-insensitive.nix.golden b/test/golden-test-cases/case-insensitive.nix.golden
--- a/test/golden-test-cases/case-insensitive.nix.golden
+++ b/test/golden-test-cases/case-insensitive.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, base, bytestring, criterion, deepseq, hashable
-, HUnit, stdenv, test-framework, test-framework-hunit, text
+, HUnit, lib, test-framework, test-framework-hunit, text
 }:
 mkDerivation {
   pname = "case-insensitive";
@@ -12,5 +12,5 @@
   benchmarkHaskellDepends = [ base bytestring criterion deepseq ];
   homepage = "https://github.com/basvandijk/case-insensitive";
   description = "Case insensitive string comparison";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/cassava-conduit.nix.golden b/test/golden-test-cases/cassava-conduit.nix.golden
--- a/test/golden-test-cases/cassava-conduit.nix.golden
+++ b/test/golden-test-cases/cassava-conduit.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, array, base, bifunctors, bytestring, cassava
-, conduit, conduit-extra, containers, criterion, mtl, QuickCheck
-, stdenv, text
+, conduit, conduit-extra, containers, criterion, lib, mtl
+, QuickCheck, text
 }:
 mkDerivation {
   pname = "cassava-conduit";
@@ -16,5 +16,5 @@
   benchmarkHaskellDepends = [ base criterion ];
   homepage = "https://github.com/domdere/cassava-conduit";
   description = "Conduit interface for cassava package";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/cassette.nix.golden b/test/golden-test-cases/cassette.nix.golden
--- a/test/golden-test-cases/cassette.nix.golden
+++ b/test/golden-test-cases/cassette.nix.golden
@@ -1,9 +1,9 @@
-{ mkDerivation, base, stdenv }:
+{ mkDerivation, base, lib }:
 mkDerivation {
   pname = "cassette";
   version = "0.1.0";
   sha256 = "deadbeef";
   libraryHaskellDepends = [ base ];
   description = "A combinator library for simultaneously defining parsers and pretty printers";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/cereal-text.nix.golden b/test/golden-test-cases/cereal-text.nix.golden
--- a/test/golden-test-cases/cereal-text.nix.golden
+++ b/test/golden-test-cases/cereal-text.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, cereal, stdenv, text }:
+{ mkDerivation, base, cereal, lib, text }:
 mkDerivation {
   pname = "cereal-text";
   version = "0.1.0.2";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base cereal text ];
   homepage = "https://github.com/ulikoehler/cereal-text";
   description = "Data.Text instances for the cereal serialization library";
-  license = stdenv.lib.licenses.asl20;
+  license = lib.licenses.asl20;
 }
diff --git a/test/golden-test-cases/cheapskate.nix.golden b/test/golden-test-cases/cheapskate.nix.golden
--- a/test/golden-test-cases/cheapskate.nix.golden
+++ b/test/golden-test-cases/cheapskate.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, base, blaze-html, bytestring, containers
-, data-default, deepseq, mtl, stdenv, syb, text, uniplate
+, data-default, deepseq, lib, mtl, syb, text, uniplate
 , xss-sanitize
 }:
 mkDerivation {
@@ -15,5 +15,5 @@
   executableHaskellDepends = [ base blaze-html bytestring text ];
   homepage = "http://github.com/jgm/cheapskate";
   description = "Experimental markdown processor";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/chell.nix.golden b/test/golden-test-cases/chell.nix.golden
--- a/test/golden-test-cases/chell.nix.golden
+++ b/test/golden-test-cases/chell.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, ansi-terminal, base, bytestring, options, patience
-, random, stdenv, template-haskell, text, transformers
+{ mkDerivation, ansi-terminal, base, bytestring, lib, options
+, patience, random, template-haskell, text, transformers
 }:
 mkDerivation {
   pname = "chell";
@@ -11,5 +11,5 @@
   ];
   homepage = "https://john-millikin.com/software/chell/";
   description = "A simple and intuitive library for automated testing";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/clumpiness.nix.golden b/test/golden-test-cases/clumpiness.nix.golden
--- a/test/golden-test-cases/clumpiness.nix.golden
+++ b/test/golden-test-cases/clumpiness.nix.golden
@@ -1,9 +1,9 @@
-{ mkDerivation, base, containers, stdenv, tree-fun }:
+{ mkDerivation, base, containers, lib, tree-fun }:
 mkDerivation {
   pname = "clumpiness";
   version = "0.17.0.0";
   sha256 = "deadbeef";
   libraryHaskellDepends = [ base containers tree-fun ];
   description = "Calculate the clumpiness of leaf properties in a tree";
-  license = stdenv.lib.licenses.gpl3;
+  license = lib.licenses.gpl3;
 }
diff --git a/test/golden-test-cases/code-page.nix.golden b/test/golden-test-cases/code-page.nix.golden
--- a/test/golden-test-cases/code-page.nix.golden
+++ b/test/golden-test-cases/code-page.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, stdenv }:
+{ mkDerivation, base, lib }:
 mkDerivation {
   pname = "code-page";
   version = "0.1.3";
@@ -7,5 +7,5 @@
   testHaskellDepends = [ base ];
   homepage = "https://github.com/RyanGlScott/code-page";
   description = "Windows code page library for Haskell";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/colorize-haskell.nix.golden b/test/golden-test-cases/colorize-haskell.nix.golden
--- a/test/golden-test-cases/colorize-haskell.nix.golden
+++ b/test/golden-test-cases/colorize-haskell.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, ansi-terminal, base, haskell-lexer, stdenv }:
+{ mkDerivation, ansi-terminal, base, haskell-lexer, lib }:
 mkDerivation {
   pname = "colorize-haskell";
   version = "1.0.1";
@@ -9,5 +9,5 @@
   executableHaskellDepends = [ ansi-terminal base haskell-lexer ];
   homepage = "http://github.com/yav/colorize-haskell";
   description = "Highligt Haskell source";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/countable.nix.golden b/test/golden-test-cases/countable.nix.golden
--- a/test/golden-test-cases/countable.nix.golden
+++ b/test/golden-test-cases/countable.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, bytestring, silently, stdenv, tasty
+{ mkDerivation, base, bytestring, lib, silently, tasty
 , tasty-golden, tasty-hunit
 }:
 mkDerivation {
@@ -11,5 +11,5 @@
   ];
   homepage = "https://github.com/AshleyYakeley/countable";
   description = "Countable, Searchable, Finite, Empty classes";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/cpu.nix.golden b/test/golden-test-cases/cpu.nix.golden
--- a/test/golden-test-cases/cpu.nix.golden
+++ b/test/golden-test-cases/cpu.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, stdenv }:
+{ mkDerivation, base, lib }:
 mkDerivation {
   pname = "cpu";
   version = "0.1.2";
@@ -9,5 +9,5 @@
   libraryHaskellDepends = [ base ];
   homepage = "http://github.com/vincenthz/hs-cpu";
   description = "Cpu information and properties helpers";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/criterion.nix.golden b/test/golden-test-cases/criterion.nix.golden
--- a/test/golden-test-cases/criterion.nix.golden
+++ b/test/golden-test-cases/criterion.nix.golden
@@ -1,8 +1,8 @@
 { mkDerivation, aeson, ansi-wl-pprint, base, base-compat, binary
 , bytestring, cassava, code-page, containers, deepseq, directory
-, exceptions, filepath, Glob, HUnit, js-flot, js-jquery
+, exceptions, filepath, Glob, HUnit, js-flot, js-jquery, lib
 , microstache, mtl, mwc-random, optparse-applicative, parsec
-, QuickCheck, semigroups, statistics, stdenv, tasty, tasty-hunit
+, QuickCheck, semigroups, statistics, tasty, tasty-hunit
 , tasty-quickcheck, text, time, transformers, transformers-compat
 , vector, vector-algorithms
 }:
@@ -27,5 +27,5 @@
   ];
   homepage = "http://www.serpentine.com/criterion";
   description = "Robust, reliable performance measurement and analysis";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/crypt-sha512.nix.golden b/test/golden-test-cases/crypt-sha512.nix.golden
--- a/test/golden-test-cases/crypt-sha512.nix.golden
+++ b/test/golden-test-cases/crypt-sha512.nix.golden
@@ -1,6 +1,5 @@
 { mkDerivation, attoparsec, base, bytestring, cryptohash-sha512
-, quickcheck-instances, stdenv, tasty, tasty-hunit
-, tasty-quickcheck
+, lib, quickcheck-instances, tasty, tasty-hunit, tasty-quickcheck
 }:
 mkDerivation {
   pname = "crypt-sha512";
@@ -15,5 +14,5 @@
   ];
   homepage = "https://github.com/phadej/crypt-sha512";
   description = "Pure Haskell implelementation for GNU SHA512 crypt algorithm";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/crypto-random-api.nix.golden b/test/golden-test-cases/crypto-random-api.nix.golden
--- a/test/golden-test-cases/crypto-random-api.nix.golden
+++ b/test/golden-test-cases/crypto-random-api.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, bytestring, entropy, stdenv }:
+{ mkDerivation, base, bytestring, entropy, lib }:
 mkDerivation {
   pname = "crypto-random-api";
   version = "0.2.0";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base bytestring entropy ];
   homepage = "http://github.com/vincenthz/hs-crypto-random-api";
   description = "Simple random generators API for cryptography related code";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/csv.nix.golden b/test/golden-test-cases/csv.nix.golden
--- a/test/golden-test-cases/csv.nix.golden
+++ b/test/golden-test-cases/csv.nix.golden
@@ -1,9 +1,9 @@
-{ mkDerivation, base, filepath, parsec, stdenv }:
+{ mkDerivation, base, filepath, lib, parsec }:
 mkDerivation {
   pname = "csv";
   version = "0.1.2";
   sha256 = "deadbeef";
   libraryHaskellDepends = [ base filepath parsec ];
   description = "CSV loader and dumper";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/data-accessor.nix.golden b/test/golden-test-cases/data-accessor.nix.golden
--- a/test/golden-test-cases/data-accessor.nix.golden
+++ b/test/golden-test-cases/data-accessor.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, array, base, containers, stdenv, transformers }:
+{ mkDerivation, array, base, containers, lib, transformers }:
 mkDerivation {
   pname = "data-accessor";
   version = "0.2.2.7";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ array base containers transformers ];
   homepage = "http://www.haskell.org/haskellwiki/Record_access";
   description = "Utilities for accessing and manipulating fields of records";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/data-default-instances-containers.nix.golden b/test/golden-test-cases/data-default-instances-containers.nix.golden
--- a/test/golden-test-cases/data-default-instances-containers.nix.golden
+++ b/test/golden-test-cases/data-default-instances-containers.nix.golden
@@ -1,9 +1,9 @@
-{ mkDerivation, base, containers, data-default-class, stdenv }:
+{ mkDerivation, base, containers, data-default-class, lib }:
 mkDerivation {
   pname = "data-default-instances-containers";
   version = "0.0.1";
   sha256 = "deadbeef";
   libraryHaskellDepends = [ base containers data-default-class ];
   description = "Default instances for types in containers";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/data-endian.nix.golden b/test/golden-test-cases/data-endian.nix.golden
--- a/test/golden-test-cases/data-endian.nix.golden
+++ b/test/golden-test-cases/data-endian.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, stdenv }:
+{ mkDerivation, base, lib }:
 mkDerivation {
   pname = "data-endian";
   version = "0.1.1";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base ];
   homepage = "https://github.com/mvv/data-endian";
   description = "Endian-sensitive data";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/data-msgpack.nix.golden b/test/golden-test-cases/data-msgpack.nix.golden
--- a/test/golden-test-cases/data-msgpack.nix.golden
+++ b/test/golden-test-cases/data-msgpack.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, base, binary, bytestring, containers, criterion
-, data-binary-ieee754, deepseq, groom, hashable, hspec, QuickCheck
-, stdenv, text, unordered-containers, vector, void
+, data-binary-ieee754, deepseq, groom, hashable, hspec, lib
+, QuickCheck, text, unordered-containers, vector, void
 }:
 mkDerivation {
   pname = "data-msgpack";
@@ -22,5 +22,5 @@
   ];
   homepage = "http://msgpack.org/";
   description = "A Haskell implementation of MessagePack";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/data-serializer.nix.golden b/test/golden-test-cases/data-serializer.nix.golden
--- a/test/golden-test-cases/data-serializer.nix.golden
+++ b/test/golden-test-cases/data-serializer.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, binary, bytestring, cereal, data-endian
-, parsers, semigroups, split, stdenv, tasty, tasty-quickcheck
+{ mkDerivation, base, binary, bytestring, cereal, data-endian, lib
+, parsers, semigroups, split, tasty, tasty-quickcheck
 }:
 mkDerivation {
   pname = "data-serializer";
@@ -13,5 +13,5 @@
   ];
   homepage = "https://github.com/mvv/data-serializer";
   description = "Common API for serialization libraries";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/deque.nix.golden b/test/golden-test-cases/deque.nix.golden
--- a/test/golden-test-cases/deque.nix.golden
+++ b/test/golden-test-cases/deque.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, stdenv }:
+{ mkDerivation, base, lib }:
 mkDerivation {
   pname = "deque";
   version = "0.2";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base ];
   homepage = "https://github.com/nikita-volkov/deque";
   description = "Double-ended queue";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/dhall-bash.nix.golden b/test/golden-test-cases/dhall-bash.nix.golden
--- a/test/golden-test-cases/dhall-bash.nix.golden
+++ b/test/golden-test-cases/dhall-bash.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, bytestring, containers, dhall
-, neat-interpolation, optparse-generic, shell-escape, stdenv, text
+{ mkDerivation, base, bytestring, containers, dhall, lib
+, neat-interpolation, optparse-generic, shell-escape, text
 , text-format, trifecta, vector
 }:
 mkDerivation {
@@ -16,5 +16,5 @@
     base bytestring dhall optparse-generic text trifecta
   ];
   description = "Compile Dhall to Bash";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/diagrams-solve.nix.golden b/test/golden-test-cases/diagrams-solve.nix.golden
--- a/test/golden-test-cases/diagrams-solve.nix.golden
+++ b/test/golden-test-cases/diagrams-solve.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, deepseq, stdenv, tasty, tasty-hunit
+{ mkDerivation, base, deepseq, lib, tasty, tasty-hunit
 , tasty-quickcheck
 }:
 mkDerivation {
@@ -11,5 +11,5 @@
   ];
   homepage = "http://projects.haskell.org/diagrams";
   description = "Pure Haskell solver routines used by diagrams";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/discrimination.nix.golden b/test/golden-test-cases/discrimination.nix.golden
--- a/test/golden-test-cases/discrimination.nix.golden
+++ b/test/golden-test-cases/discrimination.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, array, base, containers, contravariant, criterion
-, deepseq, ghc-prim, hashable, primitive, profunctors, promises
-, semigroups, stdenv, transformers, transformers-compat
+, deepseq, ghc-prim, hashable, lib, primitive, profunctors
+, promises, semigroups, transformers, transformers-compat
 , unordered-containers, vector, void
 }:
 mkDerivation {
@@ -18,5 +18,5 @@
   ];
   homepage = "http://github.com/ekmett/discrimination/";
   description = "Fast generic linear-time sorting, joins and container construction";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/dotenv.nix.golden b/test/golden-test-cases/dotenv.nix.golden
--- a/test/golden-test-cases/dotenv.nix.golden
+++ b/test/golden-test-cases/dotenv.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, base, base-compat, directory, exceptions, hspec
-, hspec-megaparsec, megaparsec, optparse-applicative, process
-, stdenv, text, transformers, yaml
+, hspec-megaparsec, lib, megaparsec, optparse-applicative, process
+, text, transformers, yaml
 }:
 mkDerivation {
   pname = "dotenv";
@@ -23,5 +23,5 @@
   ];
   homepage = "https://github.com/stackbuilders/dotenv-hs";
   description = "Loads environment variables from dotenv files";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/dotnet-timespan.nix.golden b/test/golden-test-cases/dotnet-timespan.nix.golden
--- a/test/golden-test-cases/dotnet-timespan.nix.golden
+++ b/test/golden-test-cases/dotnet-timespan.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, stdenv }:
+{ mkDerivation, base, lib }:
 mkDerivation {
   pname = "dotnet-timespan";
   version = "0.0.1.0";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base ];
   homepage = "http://github.com/YoEight/dotnet-timespan";
   description = ".NET TimeSpan";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/dpor.nix.golden b/test/golden-test-cases/dpor.nix.golden
--- a/test/golden-test-cases/dpor.nix.golden
+++ b/test/golden-test-cases/dpor.nix.golden
@@ -1,5 +1,4 @@
-{ mkDerivation, base, containers, deepseq, random, semigroups
-, stdenv
+{ mkDerivation, base, containers, deepseq, lib, random, semigroups
 }:
 mkDerivation {
   pname = "dpor";
@@ -10,5 +9,5 @@
   ];
   homepage = "https://github.com/barrucadu/dejafu";
   description = "A generic implementation of dynamic partial-order reduction (DPOR) for testing arbitrary models of concurrency";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/drawille.nix.golden b/test/golden-test-cases/drawille.nix.golden
--- a/test/golden-test-cases/drawille.nix.golden
+++ b/test/golden-test-cases/drawille.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, containers, hspec, QuickCheck, stdenv }:
+{ mkDerivation, base, containers, hspec, lib, QuickCheck }:
 mkDerivation {
   pname = "drawille";
   version = "0.1.2.0";
@@ -9,5 +9,5 @@
   testHaskellDepends = [ base containers hspec QuickCheck ];
   homepage = "https://github.com/yamadapc/haskell-drawille#readme";
   description = "A port of asciimoo's drawille to haskell";
-  license = stdenv.lib.licenses.gpl3;
+  license = lib.licenses.gpl3;
 }
diff --git a/test/golden-test-cases/drifter-postgresql.nix.golden b/test/golden-test-cases/drifter-postgresql.nix.golden
--- a/test/golden-test-cases/drifter-postgresql.nix.golden
+++ b/test/golden-test-cases/drifter-postgresql.nix.golden
@@ -1,6 +1,6 @@
-{ mkDerivation, base, containers, drifter, either, mtl
-, postgresql-simple, stdenv, tasty, tasty-hunit, text, time
-, transformers, transformers-compat
+{ mkDerivation, base, containers, drifter, either, lib, mtl
+, postgresql-simple, tasty, tasty-hunit, text, time, transformers
+, transformers-compat
 }:
 mkDerivation {
   pname = "drifter-postgresql";
@@ -15,5 +15,5 @@
   ];
   homepage = "http://github.com/michaelxavier/drifter-postgresql";
   description = "PostgreSQL support for the drifter schema migration tool";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/ede.nix.golden b/test/golden-test-cases/ede.nix.golden
--- a/test/golden-test-cases/ede.nix.golden
+++ b/test/golden-test-cases/ede.nix.golden
@@ -1,8 +1,8 @@
 { mkDerivation, aeson, ansi-wl-pprint, base, bifunctors, bytestring
-, comonad, directory, double-conversion, filepath, free, lens, mtl
-, parsers, scientific, semigroups, stdenv, tasty, tasty-golden
-, text, text-format, text-manipulate, trifecta
-, unordered-containers, vector
+, comonad, directory, double-conversion, filepath, free, lens, lib
+, mtl, parsers, scientific, semigroups, tasty, tasty-golden, text
+, text-format, text-manipulate, trifecta, unordered-containers
+, vector
 }:
 mkDerivation {
   pname = "ede";
@@ -21,5 +21,5 @@
   homepage = "http://github.com/brendanhay/ede";
   description = "Templating language with similar syntax and features to Liquid or Jinja2";
   license = "unknown";
-  hydraPlatforms = stdenv.lib.platforms.none;
+  hydraPlatforms = lib.platforms.none;
 }
diff --git a/test/golden-test-cases/ekg-cloudwatch.nix.golden b/test/golden-test-cases/ekg-cloudwatch.nix.golden
--- a/test/golden-test-cases/ekg-cloudwatch.nix.golden
+++ b/test/golden-test-cases/ekg-cloudwatch.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, amazonka, amazonka-cloudwatch, amazonka-core, base
-, bytestring, ekg-core, lens, resourcet, semigroups, stdenv, text
+, bytestring, ekg-core, lens, lib, resourcet, semigroups, text
 , time, unordered-containers
 }:
 mkDerivation {
@@ -12,5 +12,5 @@
   ];
   homepage = "https://github.com/sellerlabs/ekg-cloudwatch#readme";
   description = "An ekg backend for Amazon Cloudwatch";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/emailaddress.nix.golden b/test/golden-test-cases/emailaddress.nix.golden
--- a/test/golden-test-cases/emailaddress.nix.golden
+++ b/test/golden-test-cases/emailaddress.nix.golden
@@ -1,7 +1,7 @@
 { mkDerivation, aeson, base, bifunctors, bytestring, doctest
-, email-validate, Glob, http-api-data, opaleye, path-pieces
+, email-validate, Glob, http-api-data, lib, opaleye, path-pieces
 , persistent, postgresql-simple, product-profunctors, profunctors
-, stdenv, text
+, text
 }:
 mkDerivation {
   pname = "emailaddress";
@@ -15,5 +15,5 @@
   testHaskellDepends = [ base doctest Glob ];
   homepage = "https://github.com/cdepillabout/emailaddress#readme";
   description = "Wrapper around email-validate library adding instances for common type classes";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/envelope.nix.golden b/test/golden-test-cases/envelope.nix.golden
--- a/test/golden-test-cases/envelope.nix.golden
+++ b/test/golden-test-cases/envelope.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, aeson, base, doctest, Glob, http-api-data, mtl
-, stdenv, text
+{ mkDerivation, aeson, base, doctest, Glob, http-api-data, lib, mtl
+, text
 }:
 mkDerivation {
   pname = "envelope";
@@ -9,5 +9,5 @@
   testHaskellDepends = [ base doctest Glob ];
   homepage = "https://github.com/cdepillabout/envelope#readme";
   description = "Defines generic 'Envelope' type to wrap reponses from a JSON API";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/eventful-sqlite.nix.golden b/test/golden-test-cases/eventful-sqlite.nix.golden
--- a/test/golden-test-cases/eventful-sqlite.nix.golden
+++ b/test/golden-test-cases/eventful-sqlite.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, aeson, base, bytestring, eventful-core
-, eventful-sql-common, eventful-test-helpers, hspec, HUnit, mtl
-, persistent, persistent-sqlite, stdenv, text, uuid
+, eventful-sql-common, eventful-test-helpers, hspec, HUnit, lib
+, mtl, persistent, persistent-sqlite, text, uuid
 }:
 mkDerivation {
   pname = "eventful-sqlite";
@@ -17,5 +17,5 @@
   ];
   homepage = "https://github.com/jdreaver/eventful#readme";
   description = "SQLite implementations for eventful";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/exact-pi.nix.golden b/test/golden-test-cases/exact-pi.nix.golden
--- a/test/golden-test-cases/exact-pi.nix.golden
+++ b/test/golden-test-cases/exact-pi.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, numtype-dk, stdenv }:
+{ mkDerivation, base, lib, numtype-dk }:
 mkDerivation {
   pname = "exact-pi";
   version = "0.4.1.2";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base numtype-dk ];
   homepage = "https://github.com/dmcclean/exact-pi/";
   description = "Exact rational multiples of pi (and integer powers of pi)";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/expiring-cache-map.nix.golden b/test/golden-test-cases/expiring-cache-map.nix.golden
--- a/test/golden-test-cases/expiring-cache-map.nix.golden
+++ b/test/golden-test-cases/expiring-cache-map.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, bytestring, containers, hashable, stdenv
-, time, unordered-containers
+{ mkDerivation, base, bytestring, containers, hashable, lib, time
+, unordered-containers
 }:
 mkDerivation {
   pname = "expiring-cache-map";
@@ -13,5 +13,5 @@
   ];
   homepage = "https://github.com/elblake/expiring-cache-map";
   description = "General purpose simple caching";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/explicit-exception.nix.golden b/test/golden-test-cases/explicit-exception.nix.golden
--- a/test/golden-test-cases/explicit-exception.nix.golden
+++ b/test/golden-test-cases/explicit-exception.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, deepseq, stdenv, transformers }:
+{ mkDerivation, base, deepseq, lib, transformers }:
 mkDerivation {
   pname = "explicit-exception";
   version = "0.1.9";
@@ -8,5 +8,5 @@
   libraryHaskellDepends = [ base deepseq transformers ];
   homepage = "http://www.haskell.org/haskellwiki/Exception";
   description = "Exceptions which are explicit in the type signature";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/fdo-notify.nix.golden b/test/golden-test-cases/fdo-notify.nix.golden
--- a/test/golden-test-cases/fdo-notify.nix.golden
+++ b/test/golden-test-cases/fdo-notify.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, containers, dbus, stdenv }:
+{ mkDerivation, base, containers, dbus, lib }:
 mkDerivation {
   pname = "fdo-notify";
   version = "0.3.1";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base containers dbus ];
   homepage = "http://bitbucket.org/taejo/fdo-notify/";
   description = "Desktop Notifications client";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/fgl.nix.golden b/test/golden-test-cases/fgl.nix.golden
--- a/test/golden-test-cases/fgl.nix.golden
+++ b/test/golden-test-cases/fgl.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, array, base, containers, deepseq, hspec, microbench
-, QuickCheck, stdenv, transformers
+{ mkDerivation, array, base, containers, deepseq, hspec, lib
+, microbench, QuickCheck, transformers
 }:
 mkDerivation {
   pname = "fgl";
@@ -11,5 +11,5 @@
   testHaskellDepends = [ base containers hspec QuickCheck ];
   benchmarkHaskellDepends = [ base deepseq microbench ];
   description = "Martin Erwig's Functional Graph Library";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/file-modules.nix.golden b/test/golden-test-cases/file-modules.nix.golden
--- a/test/golden-test-cases/file-modules.nix.golden
+++ b/test/golden-test-cases/file-modules.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, async, base, directory, filepath, haskell-src-exts
-, MissingH, regex-compat, regex-pcre, stdenv
+, lib, MissingH, regex-compat, regex-pcre
 }:
 mkDerivation {
   pname = "file-modules";
@@ -17,5 +17,5 @@
   ];
   homepage = "https://github.com/yamadapc/stack-run-auto";
   description = "Takes a Haskell source-code file and outputs its modules";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/fingertree.nix.golden b/test/golden-test-cases/fingertree.nix.golden
--- a/test/golden-test-cases/fingertree.nix.golden
+++ b/test/golden-test-cases/fingertree.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, HUnit, QuickCheck, stdenv, test-framework
+{ mkDerivation, base, HUnit, lib, QuickCheck, test-framework
 , test-framework-hunit, test-framework-quickcheck2
 }:
 mkDerivation {
@@ -11,5 +11,5 @@
     test-framework-quickcheck2
   ];
   description = "Generic finger-tree structure, with example instances";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/fixed-vector.nix.golden b/test/golden-test-cases/fixed-vector.nix.golden
--- a/test/golden-test-cases/fixed-vector.nix.golden
+++ b/test/golden-test-cases/fixed-vector.nix.golden
@@ -1,5 +1,4 @@
-{ mkDerivation, base, deepseq, doctest, filemanip, primitive
-, stdenv
+{ mkDerivation, base, deepseq, doctest, filemanip, lib, primitive
 }:
 mkDerivation {
   pname = "fixed-vector";
@@ -8,5 +7,5 @@
   libraryHaskellDepends = [ base deepseq primitive ];
   testHaskellDepends = [ base doctest filemanip primitive ];
   description = "Generic vectors with statically known size";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/fixed.nix.golden b/test/golden-test-cases/fixed.nix.golden
--- a/test/golden-test-cases/fixed.nix.golden
+++ b/test/golden-test-cases/fixed.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, stdenv }:
+{ mkDerivation, base, lib }:
 mkDerivation {
   pname = "fixed";
   version = "0.2.1.1";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base ];
   homepage = "http://github.com/ekmett/fixed";
   description = "Signed 15.16 precision fixed point arithmetic";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/foundation.nix.golden b/test/golden-test-cases/foundation.nix.golden
--- a/test/golden-test-cases/foundation.nix.golden
+++ b/test/golden-test-cases/foundation.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, basement, gauge, ghc-prim, stdenv }:
+{ mkDerivation, base, basement, gauge, ghc-prim, lib }:
 mkDerivation {
   pname = "foundation";
   version = "0.0.17";
@@ -8,5 +8,5 @@
   benchmarkHaskellDepends = [ base basement gauge ];
   homepage = "https://github.com/haskell-foundation/foundation";
   description = "Alternative prelude with batteries and no dependencies";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/frisby.nix.golden b/test/golden-test-cases/frisby.nix.golden
--- a/test/golden-test-cases/frisby.nix.golden
+++ b/test/golden-test-cases/frisby.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, array, base, containers, mtl, semigroups, stdenv }:
+{ mkDerivation, array, base, containers, lib, mtl, semigroups }:
 mkDerivation {
   pname = "frisby";
   version = "0.2.2";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ array base containers mtl semigroups ];
   homepage = "http://repetae.net/computer/frisby/";
   description = "Linear time composable parser for PEG grammars";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/funcmp.nix.golden b/test/golden-test-cases/funcmp.nix.golden
--- a/test/golden-test-cases/funcmp.nix.golden
+++ b/test/golden-test-cases/funcmp.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, filepath, process, stdenv }:
+{ mkDerivation, base, filepath, lib, process }:
 mkDerivation {
   pname = "funcmp";
   version = "1.8";
@@ -7,5 +7,5 @@
   libraryHaskellDepends = [ base filepath process ];
   homepage = "http://savannah.nongnu.org/projects/funcmp/";
   description = "Functional MetaPost";
-  license = stdenv.lib.licenses.gpl3;
+  license = lib.licenses.gpl3;
 }
diff --git a/test/golden-test-cases/functor-classes-compat.nix.golden b/test/golden-test-cases/functor-classes-compat.nix.golden
--- a/test/golden-test-cases/functor-classes-compat.nix.golden
+++ b/test/golden-test-cases/functor-classes-compat.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, containers, hashable, stdenv
+{ mkDerivation, base, containers, hashable, lib
 , unordered-containers, vector
 }:
 mkDerivation {
@@ -10,5 +10,5 @@
   ];
   homepage = "https://github.com/phadej/functor-classes-compat#readme";
   description = "Data.Functor.Classes instances for core packages";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/general-games.nix.golden b/test/golden-test-cases/general-games.nix.golden
--- a/test/golden-test-cases/general-games.nix.golden
+++ b/test/golden-test-cases/general-games.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, hspec, HUnit, monad-loops, MonadRandom
-, random, random-shuffle, stdenv
+{ mkDerivation, base, hspec, HUnit, lib, monad-loops, MonadRandom
+, random, random-shuffle
 }:
 mkDerivation {
   pname = "general-games";
@@ -11,5 +11,5 @@
   testHaskellDepends = [ base hspec HUnit MonadRandom ];
   homepage = "https://github.com/cgorski/general-games";
   description = "Library supporting simulation of a number of games";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/generic-lens.nix.golden b/test/golden-test-cases/generic-lens.nix.golden
--- a/test/golden-test-cases/generic-lens.nix.golden
+++ b/test/golden-test-cases/generic-lens.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, base, criterion, deepseq, doctest
-, inspection-testing, lens, profunctors, QuickCheck, stdenv, tagged
+, inspection-testing, lens, lib, profunctors, QuickCheck, tagged
 }:
 mkDerivation {
   pname = "generic-lens";
@@ -12,5 +12,5 @@
   ];
   homepage = "https://github.com/kcsongor/generic-lens";
   description = "Generic data-structure operations exposed as lenses";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/genvalidity-aeson.nix.golden b/test/golden-test-cases/genvalidity-aeson.nix.golden
--- a/test/golden-test-cases/genvalidity-aeson.nix.golden
+++ b/test/golden-test-cases/genvalidity-aeson.nix.golden
@@ -1,7 +1,7 @@
 { mkDerivation, aeson, base, genvalidity, genvalidity-hspec
 , genvalidity-scientific, genvalidity-text
-, genvalidity-unordered-containers, genvalidity-vector, hspec
-, QuickCheck, stdenv, validity, validity-aeson
+, genvalidity-unordered-containers, genvalidity-vector, hspec, lib
+, QuickCheck, validity, validity-aeson
 }:
 mkDerivation {
   pname = "genvalidity-aeson";
@@ -17,5 +17,5 @@
   ];
   homepage = "https://github.com/NorfairKing/validity#readme";
   description = "GenValidity support for aeson";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/genvalidity-hspec-aeson.nix.golden b/test/golden-test-cases/genvalidity-hspec-aeson.nix.golden
--- a/test/golden-test-cases/genvalidity-hspec-aeson.nix.golden
+++ b/test/golden-test-cases/genvalidity-hspec-aeson.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, aeson, base, bytestring, deepseq, doctest
 , genvalidity, genvalidity-aeson, genvalidity-hspec
-, genvalidity-text, hspec, QuickCheck, stdenv, text
+, genvalidity-text, hspec, lib, QuickCheck, text
 }:
 mkDerivation {
   pname = "genvalidity-hspec-aeson";
@@ -16,5 +16,5 @@
   ];
   homepage = "http://cs-syd.eu";
   description = "Standard spec's for aeson-related instances";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/genvalidity-hspec-binary.nix.golden b/test/golden-test-cases/genvalidity-hspec-binary.nix.golden
--- a/test/golden-test-cases/genvalidity-hspec-binary.nix.golden
+++ b/test/golden-test-cases/genvalidity-hspec-binary.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, base, binary, deepseq, doctest, genvalidity
-, genvalidity-hspec, hspec, QuickCheck, stdenv
+, genvalidity-hspec, hspec, lib, QuickCheck
 }:
 mkDerivation {
   pname = "genvalidity-hspec-binary";
@@ -11,5 +11,5 @@
   testHaskellDepends = [ base doctest genvalidity hspec ];
   homepage = "https://github.com/NorfairKing/validity#readme";
   description = "Standard spec's for binary-related Instances";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/genvalidity-scientific.nix.golden b/test/golden-test-cases/genvalidity-scientific.nix.golden
--- a/test/golden-test-cases/genvalidity-scientific.nix.golden
+++ b/test/golden-test-cases/genvalidity-scientific.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, genvalidity, genvalidity-hspec, hspec
-, QuickCheck, scientific, stdenv, validity, validity-scientific
+{ mkDerivation, base, genvalidity, genvalidity-hspec, hspec, lib
+, QuickCheck, scientific, validity, validity-scientific
 }:
 mkDerivation {
   pname = "genvalidity-scientific";
@@ -13,5 +13,5 @@
   ];
   homepage = "https://github.com/NorfairKing/validity#readme";
   description = "GenValidity support for Scientific";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/genvalidity-uuid.nix.golden b/test/golden-test-cases/genvalidity-uuid.nix.golden
--- a/test/golden-test-cases/genvalidity-uuid.nix.golden
+++ b/test/golden-test-cases/genvalidity-uuid.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, genvalidity, genvalidity-hspec, hspec
-, QuickCheck, stdenv, uuid, validity, validity-uuid
+{ mkDerivation, base, genvalidity, genvalidity-hspec, hspec, lib
+, QuickCheck, uuid, validity, validity-uuid
 }:
 mkDerivation {
   pname = "genvalidity-uuid";
@@ -13,5 +13,5 @@
   ];
   homepage = "https://github.com/NorfairKing/validity#readme";
   description = "GenValidity support for UUID";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/ghc-syb-utils.nix.golden b/test/golden-test-cases/ghc-syb-utils.nix.golden
--- a/test/golden-test-cases/ghc-syb-utils.nix.golden
+++ b/test/golden-test-cases/ghc-syb-utils.nix.golden
@@ -1,5 +1,4 @@
-{ mkDerivation, base, directory, filepath, ghc, ghc-paths, stdenv
-, syb
+{ mkDerivation, base, directory, filepath, ghc, ghc-paths, lib, syb
 }:
 mkDerivation {
   pname = "ghc-syb-utils";
@@ -9,5 +8,5 @@
   testHaskellDepends = [ base directory filepath ghc ghc-paths ];
   homepage = "http://github.com/nominolo/ghc-syb";
   description = "Scrap Your Boilerplate utilities for the GHC API";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/ghcid.nix.golden b/test/golden-test-cases/ghcid.nix.golden
--- a/test/golden-test-cases/ghcid.nix.golden
+++ b/test/golden-test-cases/ghcid.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, ansi-terminal, base, cmdargs, containers, directory
-, extra, filepath, fsnotify, process, stdenv, tasty, tasty-hunit
+, extra, filepath, fsnotify, lib, process, tasty, tasty-hunit
 , terminal-size, time, unix
 }:
 mkDerivation {
@@ -21,5 +21,5 @@
   ];
   homepage = "https://github.com/ndmitchell/ghcid#readme";
   description = "GHCi based bare bones IDE";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/giphy-api.nix.golden b/test/golden-test-cases/giphy-api.nix.golden
--- a/test/golden-test-cases/giphy-api.nix.golden
+++ b/test/golden-test-cases/giphy-api.nix.golden
@@ -1,7 +1,7 @@
 { mkDerivation, aeson, base, basic-prelude, bytestring, containers
 , directory, hspec, http-api-data, http-client, http-client-tls
-, lens, microlens, microlens-th, mtl, network-uri, servant
-, servant-client, stdenv, text, transformers
+, lens, lib, microlens, microlens-th, mtl, network-uri, servant
+, servant-client, text, transformers
 }:
 mkDerivation {
   pname = "giphy-api";
@@ -20,5 +20,5 @@
   ];
   homepage = "http://github.com/passy/giphy-api#readme";
   description = "Giphy HTTP API wrapper and CLI search tool";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/github.nix.golden b/test/golden-test-cases/github.nix.golden
--- a/test/golden-test-cases/github.nix.golden
+++ b/test/golden-test-cases/github.nix.golden
@@ -2,8 +2,8 @@
 , base16-bytestring, binary, binary-orphans, byteable, bytestring
 , containers, cryptohash, deepseq, deepseq-generics, exceptions
 , file-embed, hashable, hspec, hspec-discover, http-client
-, http-client-tls, http-link-header, http-types, iso8601-time, mtl
-, network-uri, semigroups, stdenv, text, time, tls, transformers
+, http-client-tls, http-link-header, http-types, iso8601-time, lib
+, mtl, network-uri, semigroups, text, time, tls, transformers
 , transformers-compat, unordered-containers, vector
 , vector-instances
 }:
@@ -26,5 +26,5 @@
   testToolDepends = [ hspec-discover ];
   homepage = "https://github.com/phadej/github";
   description = "Access to the GitHub API, v3";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/gl.nix.golden b/test/golden-test-cases/gl.nix.golden
--- a/test/golden-test-cases/gl.nix.golden
+++ b/test/golden-test-cases/gl.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, base, Cabal, containers, directory, filepath, fixed
-, half, hxt, libGL, stdenv, transformers
+, half, hxt, lib, libGL, transformers
 }:
 mkDerivation {
   pname = "gl";
@@ -13,5 +13,5 @@
   ];
   librarySystemDepends = [ libGL ];
   description = "Complete OpenGL raw bindings";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/gogol-adexchange-buyer.nix.golden b/test/golden-test-cases/gogol-adexchange-buyer.nix.golden
--- a/test/golden-test-cases/gogol-adexchange-buyer.nix.golden
+++ b/test/golden-test-cases/gogol-adexchange-buyer.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, gogol-core, stdenv }:
+{ mkDerivation, base, gogol-core, lib }:
 mkDerivation {
   pname = "gogol-adexchange-buyer";
   version = "0.3.0";
@@ -7,5 +7,5 @@
   homepage = "https://github.com/brendanhay/gogol";
   description = "Google Ad Exchange Buyer SDK";
   license = "unknown";
-  hydraPlatforms = stdenv.lib.platforms.none;
+  hydraPlatforms = lib.platforms.none;
 }
diff --git a/test/golden-test-cases/gogol-admin-emailmigration.nix.golden b/test/golden-test-cases/gogol-admin-emailmigration.nix.golden
--- a/test/golden-test-cases/gogol-admin-emailmigration.nix.golden
+++ b/test/golden-test-cases/gogol-admin-emailmigration.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, gogol-core, stdenv }:
+{ mkDerivation, base, gogol-core, lib }:
 mkDerivation {
   pname = "gogol-admin-emailmigration";
   version = "0.3.0";
@@ -7,5 +7,5 @@
   homepage = "https://github.com/brendanhay/gogol";
   description = "Google Email Migration API v2 SDK";
   license = "unknown";
-  hydraPlatforms = stdenv.lib.platforms.none;
+  hydraPlatforms = lib.platforms.none;
 }
diff --git a/test/golden-test-cases/gogol-affiliates.nix.golden b/test/golden-test-cases/gogol-affiliates.nix.golden
--- a/test/golden-test-cases/gogol-affiliates.nix.golden
+++ b/test/golden-test-cases/gogol-affiliates.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, gogol-core, stdenv }:
+{ mkDerivation, base, gogol-core, lib }:
 mkDerivation {
   pname = "gogol-affiliates";
   version = "0.3.0";
@@ -7,5 +7,5 @@
   homepage = "https://github.com/brendanhay/gogol";
   description = "Google Affiliate Network SDK";
   license = "unknown";
-  hydraPlatforms = stdenv.lib.platforms.none;
+  hydraPlatforms = lib.platforms.none;
 }
diff --git a/test/golden-test-cases/gogol-apps-tasks.nix.golden b/test/golden-test-cases/gogol-apps-tasks.nix.golden
--- a/test/golden-test-cases/gogol-apps-tasks.nix.golden
+++ b/test/golden-test-cases/gogol-apps-tasks.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, gogol-core, stdenv }:
+{ mkDerivation, base, gogol-core, lib }:
 mkDerivation {
   pname = "gogol-apps-tasks";
   version = "0.3.0";
@@ -7,5 +7,5 @@
   homepage = "https://github.com/brendanhay/gogol";
   description = "Google Tasks SDK";
   license = "unknown";
-  hydraPlatforms = stdenv.lib.platforms.none;
+  hydraPlatforms = lib.platforms.none;
 }
diff --git a/test/golden-test-cases/gogol-appstate.nix.golden b/test/golden-test-cases/gogol-appstate.nix.golden
--- a/test/golden-test-cases/gogol-appstate.nix.golden
+++ b/test/golden-test-cases/gogol-appstate.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, gogol-core, stdenv }:
+{ mkDerivation, base, gogol-core, lib }:
 mkDerivation {
   pname = "gogol-appstate";
   version = "0.3.0";
@@ -7,5 +7,5 @@
   homepage = "https://github.com/brendanhay/gogol";
   description = "Google App State SDK";
   license = "unknown";
-  hydraPlatforms = stdenv.lib.platforms.none;
+  hydraPlatforms = lib.platforms.none;
 }
diff --git a/test/golden-test-cases/gogol-blogger.nix.golden b/test/golden-test-cases/gogol-blogger.nix.golden
--- a/test/golden-test-cases/gogol-blogger.nix.golden
+++ b/test/golden-test-cases/gogol-blogger.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, gogol-core, stdenv }:
+{ mkDerivation, base, gogol-core, lib }:
 mkDerivation {
   pname = "gogol-blogger";
   version = "0.3.0";
@@ -7,5 +7,5 @@
   homepage = "https://github.com/brendanhay/gogol";
   description = "Google Blogger SDK";
   license = "unknown";
-  hydraPlatforms = stdenv.lib.platforms.none;
+  hydraPlatforms = lib.platforms.none;
 }
diff --git a/test/golden-test-cases/gogol-datastore.nix.golden b/test/golden-test-cases/gogol-datastore.nix.golden
--- a/test/golden-test-cases/gogol-datastore.nix.golden
+++ b/test/golden-test-cases/gogol-datastore.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, gogol-core, stdenv }:
+{ mkDerivation, base, gogol-core, lib }:
 mkDerivation {
   pname = "gogol-datastore";
   version = "0.3.0";
@@ -7,5 +7,5 @@
   homepage = "https://github.com/brendanhay/gogol";
   description = "Google Cloud Datastore SDK";
   license = "unknown";
-  hydraPlatforms = stdenv.lib.platforms.none;
+  hydraPlatforms = lib.platforms.none;
 }
diff --git a/test/golden-test-cases/gogol-dfareporting.nix.golden b/test/golden-test-cases/gogol-dfareporting.nix.golden
--- a/test/golden-test-cases/gogol-dfareporting.nix.golden
+++ b/test/golden-test-cases/gogol-dfareporting.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, gogol-core, stdenv }:
+{ mkDerivation, base, gogol-core, lib }:
 mkDerivation {
   pname = "gogol-dfareporting";
   version = "0.3.0";
@@ -7,5 +7,5 @@
   homepage = "https://github.com/brendanhay/gogol";
   description = "Google DCM/DFA Reporting And Trafficking SDK";
   license = "unknown";
-  hydraPlatforms = stdenv.lib.platforms.none;
+  hydraPlatforms = lib.platforms.none;
 }
diff --git a/test/golden-test-cases/gogol-firebase-rules.nix.golden b/test/golden-test-cases/gogol-firebase-rules.nix.golden
--- a/test/golden-test-cases/gogol-firebase-rules.nix.golden
+++ b/test/golden-test-cases/gogol-firebase-rules.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, gogol-core, stdenv }:
+{ mkDerivation, base, gogol-core, lib }:
 mkDerivation {
   pname = "gogol-firebase-rules";
   version = "0.3.0";
@@ -7,5 +7,5 @@
   homepage = "https://github.com/brendanhay/gogol";
   description = "Google Firebase Rules SDK";
   license = "unknown";
-  hydraPlatforms = stdenv.lib.platforms.none;
+  hydraPlatforms = lib.platforms.none;
 }
diff --git a/test/golden-test-cases/gogol-gmail.nix.golden b/test/golden-test-cases/gogol-gmail.nix.golden
--- a/test/golden-test-cases/gogol-gmail.nix.golden
+++ b/test/golden-test-cases/gogol-gmail.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, gogol-core, stdenv }:
+{ mkDerivation, base, gogol-core, lib }:
 mkDerivation {
   pname = "gogol-gmail";
   version = "0.3.0";
@@ -7,5 +7,5 @@
   homepage = "https://github.com/brendanhay/gogol";
   description = "Google Gmail SDK";
   license = "unknown";
-  hydraPlatforms = stdenv.lib.platforms.none;
+  hydraPlatforms = lib.platforms.none;
 }
diff --git a/test/golden-test-cases/gogol-kgsearch.nix.golden b/test/golden-test-cases/gogol-kgsearch.nix.golden
--- a/test/golden-test-cases/gogol-kgsearch.nix.golden
+++ b/test/golden-test-cases/gogol-kgsearch.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, gogol-core, stdenv }:
+{ mkDerivation, base, gogol-core, lib }:
 mkDerivation {
   pname = "gogol-kgsearch";
   version = "0.3.0";
@@ -7,5 +7,5 @@
   homepage = "https://github.com/brendanhay/gogol";
   description = "Google Knowledge Graph Search SDK";
   license = "unknown";
-  hydraPlatforms = stdenv.lib.platforms.none;
+  hydraPlatforms = lib.platforms.none;
 }
diff --git a/test/golden-test-cases/gogol-maps-engine.nix.golden b/test/golden-test-cases/gogol-maps-engine.nix.golden
--- a/test/golden-test-cases/gogol-maps-engine.nix.golden
+++ b/test/golden-test-cases/gogol-maps-engine.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, gogol-core, stdenv }:
+{ mkDerivation, base, gogol-core, lib }:
 mkDerivation {
   pname = "gogol-maps-engine";
   version = "0.3.0";
@@ -7,5 +7,5 @@
   homepage = "https://github.com/brendanhay/gogol";
   description = "Google Maps Engine SDK";
   license = "unknown";
-  hydraPlatforms = stdenv.lib.platforms.none;
+  hydraPlatforms = lib.platforms.none;
 }
diff --git a/test/golden-test-cases/gogol-plus.nix.golden b/test/golden-test-cases/gogol-plus.nix.golden
--- a/test/golden-test-cases/gogol-plus.nix.golden
+++ b/test/golden-test-cases/gogol-plus.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, gogol-core, stdenv }:
+{ mkDerivation, base, gogol-core, lib }:
 mkDerivation {
   pname = "gogol-plus";
   version = "0.3.0";
@@ -7,5 +7,5 @@
   homepage = "https://github.com/brendanhay/gogol";
   description = "Google + SDK";
   license = "unknown";
-  hydraPlatforms = stdenv.lib.platforms.none;
+  hydraPlatforms = lib.platforms.none;
 }
diff --git a/test/golden-test-cases/gogol-resourceviews.nix.golden b/test/golden-test-cases/gogol-resourceviews.nix.golden
--- a/test/golden-test-cases/gogol-resourceviews.nix.golden
+++ b/test/golden-test-cases/gogol-resourceviews.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, gogol-core, stdenv }:
+{ mkDerivation, base, gogol-core, lib }:
 mkDerivation {
   pname = "gogol-resourceviews";
   version = "0.3.0";
@@ -7,5 +7,5 @@
   homepage = "https://github.com/brendanhay/gogol";
   description = "Google Compute Engine Instance Groups SDK";
   license = "unknown";
-  hydraPlatforms = stdenv.lib.platforms.none;
+  hydraPlatforms = lib.platforms.none;
 }
diff --git a/test/golden-test-cases/gogol-translate.nix.golden b/test/golden-test-cases/gogol-translate.nix.golden
--- a/test/golden-test-cases/gogol-translate.nix.golden
+++ b/test/golden-test-cases/gogol-translate.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, gogol-core, stdenv }:
+{ mkDerivation, base, gogol-core, lib }:
 mkDerivation {
   pname = "gogol-translate";
   version = "0.3.0";
@@ -7,5 +7,5 @@
   homepage = "https://github.com/brendanhay/gogol";
   description = "Google Translate SDK";
   license = "unknown";
-  hydraPlatforms = stdenv.lib.platforms.none;
+  hydraPlatforms = lib.platforms.none;
 }
diff --git a/test/golden-test-cases/gogol-webmaster-tools.nix.golden b/test/golden-test-cases/gogol-webmaster-tools.nix.golden
--- a/test/golden-test-cases/gogol-webmaster-tools.nix.golden
+++ b/test/golden-test-cases/gogol-webmaster-tools.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, gogol-core, stdenv }:
+{ mkDerivation, base, gogol-core, lib }:
 mkDerivation {
   pname = "gogol-webmaster-tools";
   version = "0.3.0";
@@ -7,5 +7,5 @@
   homepage = "https://github.com/brendanhay/gogol";
   description = "Google Search Console SDK";
   license = "unknown";
-  hydraPlatforms = stdenv.lib.platforms.none;
+  hydraPlatforms = lib.platforms.none;
 }
diff --git a/test/golden-test-cases/gogol-youtube.nix.golden b/test/golden-test-cases/gogol-youtube.nix.golden
--- a/test/golden-test-cases/gogol-youtube.nix.golden
+++ b/test/golden-test-cases/gogol-youtube.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, gogol-core, stdenv }:
+{ mkDerivation, base, gogol-core, lib }:
 mkDerivation {
   pname = "gogol-youtube";
   version = "0.3.0";
@@ -7,5 +7,5 @@
   homepage = "https://github.com/brendanhay/gogol";
   description = "Google YouTube Data SDK";
   license = "unknown";
-  hydraPlatforms = stdenv.lib.platforms.none;
+  hydraPlatforms = lib.platforms.none;
 }
diff --git a/test/golden-test-cases/groundhog-mysql.nix.golden b/test/golden-test-cases/groundhog-mysql.nix.golden
--- a/test/golden-test-cases/groundhog-mysql.nix.golden
+++ b/test/golden-test-cases/groundhog-mysql.nix.golden
@@ -1,6 +1,6 @@
-{ mkDerivation, base, bytestring, containers, groundhog
+{ mkDerivation, base, bytestring, containers, groundhog, lib
 , monad-control, monad-logger, mysql, mysql-simple, resource-pool
-, resourcet, stdenv, text, time, transformers
+, resourcet, text, time, transformers
 }:
 mkDerivation {
   pname = "groundhog-mysql";
@@ -11,5 +11,5 @@
     mysql mysql-simple resource-pool resourcet text time transformers
   ];
   description = "MySQL backend for the groundhog library";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/gsasl.nix.golden b/test/golden-test-cases/gsasl.nix.golden
--- a/test/golden-test-cases/gsasl.nix.golden
+++ b/test/golden-test-cases/gsasl.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, bytestring, gsasl, stdenv, transformers }:
+{ mkDerivation, base, bytestring, gsasl, lib, transformers }:
 mkDerivation {
   pname = "gsasl";
   version = "0.3.6";
@@ -7,5 +7,5 @@
   libraryPkgconfigDepends = [ gsasl ];
   homepage = "https://john-millikin.com/software/haskell-gsasl/";
   description = "Bindings for GNU libgsasl";
-  license = stdenv.lib.licenses.gpl3;
+  license = lib.licenses.gpl3;
 }
diff --git a/test/golden-test-cases/hOpenPGP.nix.golden b/test/golden-test-cases/hOpenPGP.nix.golden
--- a/test/golden-test-cases/hOpenPGP.nix.golden
+++ b/test/golden-test-cases/hOpenPGP.nix.golden
@@ -2,10 +2,10 @@
 , base64-bytestring, bifunctors, binary, binary-conduit, byteable
 , bytestring, bzlib, conduit, conduit-extra, containers, criterion
 , crypto-cipher-types, cryptonite, data-default-class, errors
-, hashable, incremental-parser, ixset-typed, lens, memory
+, hashable, incremental-parser, ixset-typed, lens, lib, memory
 , monad-loops, nettle, network, network-uri, newtype
 , openpgp-asciiarmor, QuickCheck, quickcheck-instances, resourcet
-, securemem, semigroups, split, stdenv, tasty, tasty-hunit
+, securemem, semigroups, split, tasty, tasty-hunit
 , tasty-quickcheck, text, time, time-locale-compat, transformers
 , unordered-containers, wl-pprint-extras, zlib
 }:
@@ -45,5 +45,5 @@
   ];
   homepage = "http://floss.scru.org/hOpenPGP/";
   description = "native Haskell implementation of OpenPGP (RFC4880)";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/hPDB-examples.nix.golden b/test/golden-test-cases/hPDB-examples.nix.golden
--- a/test/golden-test-cases/hPDB-examples.nix.golden
+++ b/test/golden-test-cases/hPDB-examples.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, AC-Vector, base, bytestring, containers, deepseq
-, directory, ghc-prim, GLUT, hPDB, IfElse, iterable, mtl, Octree
-, OpenGL, process, QuickCheck, stdenv, template-haskell, text
+, directory, ghc-prim, GLUT, hPDB, IfElse, iterable, lib, mtl
+, Octree, OpenGL, process, QuickCheck, template-haskell, text
 , text-format, time, vector
 }:
 mkDerivation {
@@ -20,5 +20,5 @@
   ];
   homepage = "https://github.com/BioHaskell/hPDB-examples";
   description = "Examples for hPDB library";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/haddock-library.nix.golden b/test/golden-test-cases/haddock-library.nix.golden
--- a/test/golden-test-cases/haddock-library.nix.golden
+++ b/test/golden-test-cases/haddock-library.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, base, base-compat, bytestring, deepseq, hspec
-, hspec-discover, QuickCheck, stdenv, transformers
+, hspec-discover, lib, QuickCheck, transformers
 }:
 mkDerivation {
   pname = "haddock-library";
@@ -13,5 +13,5 @@
   doHaddock = false;
   homepage = "http://www.haskell.org/haddock/";
   description = "Library exposing some functionality of Haddock";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/hakyll.nix.golden b/test/golden-test-cases/hakyll.nix.golden
--- a/test/golden-test-cases/hakyll.nix.golden
+++ b/test/golden-test-cases/hakyll.nix.golden
@@ -1,10 +1,10 @@
 { mkDerivation, base, binary, blaze-html, blaze-markup, bytestring
 , containers, cryptohash, data-default, deepseq, directory
-, filepath, fsnotify, http-conduit, http-types, lrucache, mtl
+, filepath, fsnotify, http-conduit, http-types, lib, lrucache, mtl
 , network, network-uri, optparse-applicative, pandoc
 , pandoc-citeproc, parsec, process, QuickCheck, random, regex-base
-, regex-tdfa, resourcet, scientific, stdenv, system-filepath
-, tagsoup, tasty, tasty-hunit, tasty-quickcheck, text, time
+, regex-tdfa, resourcet, scientific, system-filepath, tagsoup
+, tasty, tasty-hunit, tasty-quickcheck, text, time
 , time-locale-compat, unordered-containers, utillinux, vector, wai
 , wai-app-static, warp, yaml
 }:
@@ -38,5 +38,5 @@
   testToolDepends = [ utillinux ];
   homepage = "http://jaspervdj.be/hakyll";
   description = "A static website compiler library";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/happstack-hsp.nix.golden b/test/golden-test-cases/happstack-hsp.nix.golden
--- a/test/golden-test-cases/happstack-hsp.nix.golden
+++ b/test/golden-test-cases/happstack-hsp.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, base, bytestring, happstack-server, harp, hsp
-, hsx2hs, mtl, stdenv, syb, text, utf8-string
+, hsx2hs, lib, mtl, syb, text, utf8-string
 }:
 mkDerivation {
   pname = "happstack-hsp";
@@ -11,5 +11,5 @@
   ];
   homepage = "http://www.happstack.com/";
   description = "Support for using HSP templates in Happstack";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/happy.nix.golden b/test/golden-test-cases/happy.nix.golden
--- a/test/golden-test-cases/happy.nix.golden
+++ b/test/golden-test-cases/happy.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, array, base, Cabal, containers, directory, filepath
-, mtl, process, stdenv
+, lib, mtl, process
 }:
 mkDerivation {
   pname = "happy";
@@ -12,5 +12,5 @@
   testHaskellDepends = [ base process ];
   homepage = "https://www.haskell.org/happy/";
   description = "Happy is a parser generator for Haskell";
-  license = stdenv.lib.licenses.bsd2;
+  license = lib.licenses.bsd2;
 }
diff --git a/test/golden-test-cases/harp.nix.golden b/test/golden-test-cases/harp.nix.golden
--- a/test/golden-test-cases/harp.nix.golden
+++ b/test/golden-test-cases/harp.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, stdenv }:
+{ mkDerivation, base, lib }:
 mkDerivation {
   pname = "harp";
   version = "0.4.3";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base ];
   homepage = "https://github.com/seereason/harp";
   description = "HaRP allows pattern-matching with regular expressions";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/hashtables.nix.golden b/test/golden-test-cases/hashtables.nix.golden
--- a/test/golden-test-cases/hashtables.nix.golden
+++ b/test/golden-test-cases/hashtables.nix.golden
@@ -1,5 +1,4 @@
-{ mkDerivation, base, ghc-prim, hashable, primitive, stdenv, vector
-}:
+{ mkDerivation, base, ghc-prim, hashable, lib, primitive, vector }:
 mkDerivation {
   pname = "hashtables";
   version = "1.2.2.1";
@@ -9,5 +8,5 @@
   ];
   homepage = "http://github.com/gregorycollins/hashtables";
   description = "Mutable hash tables in the ST monad";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/haskell-tools-debug.nix.golden b/test/golden-test-cases/haskell-tools-debug.nix.golden
--- a/test/golden-test-cases/haskell-tools-debug.nix.golden
+++ b/test/golden-test-cases/haskell-tools-debug.nix.golden
@@ -1,7 +1,7 @@
 { mkDerivation, base, filepath, ghc, ghc-paths, haskell-tools-ast
 , haskell-tools-backend-ghc, haskell-tools-builtin-refactorings
-, haskell-tools-prettyprint, haskell-tools-refactor, references
-, split, stdenv, template-haskell
+, haskell-tools-prettyprint, haskell-tools-refactor, lib
+, references, split, template-haskell
 }:
 mkDerivation {
   pname = "haskell-tools-debug";
@@ -18,5 +18,5 @@
   executableHaskellDepends = [ base ];
   homepage = "https://github.com/haskell-tools/haskell-tools";
   description = "Debugging Tools for Haskell-tools";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/haskell-tools-rewrite.nix.golden b/test/golden-test-cases/haskell-tools-rewrite.nix.golden
--- a/test/golden-test-cases/haskell-tools-rewrite.nix.golden
+++ b/test/golden-test-cases/haskell-tools-rewrite.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, base, containers, directory, filepath, ghc
-, haskell-tools-ast, haskell-tools-prettyprint, mtl, references
-, stdenv, tasty, tasty-hunit
+, haskell-tools-ast, haskell-tools-prettyprint, lib, mtl
+, references, tasty, tasty-hunit
 }:
 mkDerivation {
   pname = "haskell-tools-rewrite";
@@ -16,5 +16,5 @@
   ];
   homepage = "https://github.com/haskell-tools/haskell-tools";
   description = "Facilities for generating new parts of the Haskell-Tools AST";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/hasql.nix.golden b/test/golden-test-cases/hasql.nix.golden
--- a/test/golden-test-cases/hasql.nix.golden
+++ b/test/golden-test-cases/hasql.nix.golden
@@ -1,9 +1,9 @@
 { mkDerivation, attoparsec, base, base-prelude, bug, bytestring
 , bytestring-strict-builder, contravariant, contravariant-extras
-, criterion, data-default-class, dlist, hashable, hashtables
+, criterion, data-default-class, dlist, hashable, hashtables, lib
 , loch-th, mtl, placeholders, postgresql-binary, postgresql-libpq
 , profunctors, QuickCheck, quickcheck-instances, rebase, rerebase
-, semigroups, stdenv, tasty, tasty-hunit, tasty-quickcheck, text
+, semigroups, tasty, tasty-hunit, tasty-quickcheck, text
 , transformers, vector
 }:
 mkDerivation {
@@ -23,5 +23,5 @@
   benchmarkHaskellDepends = [ bug criterion rerebase ];
   homepage = "https://github.com/nikita-volkov/hasql";
   description = "An efficient PostgreSQL driver and a flexible mapping API";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/hformat.nix.golden b/test/golden-test-cases/hformat.nix.golden
--- a/test/golden-test-cases/hformat.nix.golden
+++ b/test/golden-test-cases/hformat.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, ansi-terminal, base, base-unicode-symbols, hspec
-, stdenv, text
+, lib, text
 }:
 mkDerivation {
   pname = "hformat";
@@ -11,5 +11,5 @@
   testHaskellDepends = [ base base-unicode-symbols hspec text ];
   homepage = "http://github.com/mvoidex/hformat";
   description = "Simple Haskell formatting";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/highlighting-kate.nix.golden b/test/golden-test-cases/highlighting-kate.nix.golden
--- a/test/golden-test-cases/highlighting-kate.nix.golden
+++ b/test/golden-test-cases/highlighting-kate.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, base, blaze-html, bytestring, containers, Diff
-, directory, filepath, mtl, parsec, pcre-light, process, stdenv
+, directory, filepath, lib, mtl, parsec, pcre-light, process
 , utf8-string
 }:
 mkDerivation {
diff --git a/test/golden-test-cases/hit.nix.golden b/test/golden-test-cases/hit.nix.golden
--- a/test/golden-test-cases/hit.nix.golden
+++ b/test/golden-test-cases/hit.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, attoparsec, base, byteable, bytedump, bytestring
-, containers, cryptohash, hourglass, mtl, parsec, patience, random
-, stdenv, system-fileio, system-filepath, tasty, tasty-quickcheck
+, containers, cryptohash, hourglass, lib, mtl, parsec, patience
+, random, system-fileio, system-filepath, tasty, tasty-quickcheck
 , unix-compat, utf8-string, vector, zlib, zlib-bindings
 }:
 mkDerivation {
@@ -20,5 +20,5 @@
   ];
   homepage = "http://github.com/vincenthz/hit";
   description = "Git operations in haskell";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/hjson.nix.golden b/test/golden-test-cases/hjson.nix.golden
--- a/test/golden-test-cases/hjson.nix.golden
+++ b/test/golden-test-cases/hjson.nix.golden
@@ -1,9 +1,9 @@
-{ mkDerivation, base, containers, parsec, stdenv }:
+{ mkDerivation, base, containers, lib, parsec }:
 mkDerivation {
   pname = "hjson";
   version = "1.3.2";
   sha256 = "deadbeef";
   libraryHaskellDepends = [ base containers parsec ];
   description = "JSON parsing library";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/hmpfr.nix.golden b/test/golden-test-cases/hmpfr.nix.golden
--- a/test/golden-test-cases/hmpfr.nix.golden
+++ b/test/golden-test-cases/hmpfr.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, integer-gmp, mpfr, stdenv }:
+{ mkDerivation, base, integer-gmp, lib, mpfr }:
 mkDerivation {
   pname = "hmpfr";
   version = "0.4.3";
@@ -8,5 +8,5 @@
   librarySystemDepends = [ mpfr ];
   homepage = "https://github.com/michalkonecny/hmpfr";
   description = "Haskell binding to the MPFR library";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/hoogle.nix.golden b/test/golden-test-cases/hoogle.nix.golden
--- a/test/golden-test-cases/hoogle.nix.golden
+++ b/test/golden-test-cases/hoogle.nix.golden
@@ -1,10 +1,10 @@
 { mkDerivation, aeson, base, binary, bytestring, cmdargs, conduit
 , conduit-extra, connection, containers, deepseq, directory, extra
 , filepath, haskell-src-exts, http-conduit, http-types, js-flot
-, js-jquery, mmap, network, network-uri, old-locale, process
-, process-extras, QuickCheck, resourcet, stdenv, storable-tuple
-, tar, template-haskell, text, time, transformers, uniplate
-, utf8-string, vector, wai, wai-logger, warp, warp-tls, zlib
+, js-jquery, lib, mmap, network, network-uri, old-locale, process
+, process-extras, QuickCheck, resourcet, storable-tuple, tar
+, template-haskell, text, time, transformers, uniplate, utf8-string
+, vector, wai, wai-logger, warp, warp-tls, zlib
 }:
 mkDerivation {
   pname = "hoogle";
@@ -26,5 +26,5 @@
   testTarget = "--test-option=--no-net";
   homepage = "http://hoogle.haskell.org/";
   description = "Haskell API Search";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/hostname-validate.nix.golden b/test/golden-test-cases/hostname-validate.nix.golden
--- a/test/golden-test-cases/hostname-validate.nix.golden
+++ b/test/golden-test-cases/hostname-validate.nix.golden
@@ -1,9 +1,9 @@
-{ mkDerivation, attoparsec, base, bytestring, stdenv }:
+{ mkDerivation, attoparsec, base, bytestring, lib }:
 mkDerivation {
   pname = "hostname-validate";
   version = "1.0.0";
   sha256 = "deadbeef";
   libraryHaskellDepends = [ attoparsec base bytestring ];
   description = "Validate hostnames e.g. localhost or foo.co.uk.";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/hsinstall.nix.golden b/test/golden-test-cases/hsinstall.nix.golden
--- a/test/golden-test-cases/hsinstall.nix.golden
+++ b/test/golden-test-cases/hsinstall.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, directory, filepath, stdenv }:
+{ mkDerivation, base, directory, filepath, lib }:
 mkDerivation {
   pname = "hsinstall";
   version = "1.6";
@@ -9,5 +9,5 @@
   libraryHaskellDepends = [ base directory filepath ];
   executableHaskellDepends = [ base directory filepath ];
   description = "Install Haskell software";
-  license = stdenv.lib.licenses.isc;
+  license = lib.licenses.isc;
 }
diff --git a/test/golden-test-cases/hstatsd.nix.golden b/test/golden-test-cases/hstatsd.nix.golden
--- a/test/golden-test-cases/hstatsd.nix.golden
+++ b/test/golden-test-cases/hstatsd.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, bytestring, mtl, network, stdenv, text }:
+{ mkDerivation, base, bytestring, lib, mtl, network, text }:
 mkDerivation {
   pname = "hstatsd";
   version = "0.1";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base bytestring mtl network text ];
   homepage = "https://github.com/mokus0/hstatsd";
   description = "Quick and dirty statsd interface";
-  license = stdenv.lib.licenses.publicDomain;
+  license = lib.licenses.publicDomain;
 }
diff --git a/test/golden-test-cases/hsx-jmacro.nix.golden b/test/golden-test-cases/hsx-jmacro.nix.golden
--- a/test/golden-test-cases/hsx-jmacro.nix.golden
+++ b/test/golden-test-cases/hsx-jmacro.nix.golden
@@ -1,5 +1,4 @@
-{ mkDerivation, base, hsp, jmacro, mtl, stdenv, text
-, wl-pprint-text
+{ mkDerivation, base, hsp, jmacro, lib, mtl, text, wl-pprint-text
 }:
 mkDerivation {
   pname = "hsx-jmacro";
@@ -10,5 +9,5 @@
   ];
   homepage = "http://www.happstack.com/";
   description = "hsp+jmacro support";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/hsyslog.nix.golden b/test/golden-test-cases/hsyslog.nix.golden
--- a/test/golden-test-cases/hsyslog.nix.golden
+++ b/test/golden-test-cases/hsyslog.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, Cabal, cabal-doctest, doctest, stdenv }:
+{ mkDerivation, base, Cabal, cabal-doctest, doctest, lib }:
 mkDerivation {
   pname = "hsyslog";
   version = "5.0.1";
@@ -10,5 +10,5 @@
   testHaskellDepends = [ base doctest ];
   homepage = "http://github.com/peti/hsyslog";
   description = "FFI interface to syslog(3) from POSIX.1-2001";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/htoml.nix.golden b/test/golden-test-cases/htoml.nix.golden
--- a/test/golden-test-cases/htoml.nix.golden
+++ b/test/golden-test-cases/htoml.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, aeson, base, bytestring, containers, criterion
-, file-embed, old-locale, parsec, stdenv, tasty, tasty-hspec
+, file-embed, lib, old-locale, parsec, tasty, tasty-hspec
 , tasty-hunit, text, time, unordered-containers, vector
 }:
 mkDerivation {
@@ -20,5 +20,5 @@
   ];
   homepage = "https://github.com/cies/htoml";
   description = "Parser for TOML files";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/http-conduit.nix.golden b/test/golden-test-cases/http-conduit.nix.golden
--- a/test/golden-test-cases/http-conduit.nix.golden
+++ b/test/golden-test-cases/http-conduit.nix.golden
@@ -1,10 +1,10 @@
 { mkDerivation, aeson, base, blaze-builder, bytestring
 , case-insensitive, conduit, conduit-extra, connection, cookie
 , data-default-class, exceptions, hspec, http-client
-, http-client-tls, http-types, HUnit, lifted-base, monad-control
-, mtl, network, resourcet, stdenv, streaming-commons, temporary
-, text, time, transformers, utf8-string, wai, wai-conduit, warp
-, warp-tls
+, http-client-tls, http-types, HUnit, lib, lifted-base
+, monad-control, mtl, network, resourcet, streaming-commons
+, temporary, text, time, transformers, utf8-string, wai
+, wai-conduit, warp, warp-tls
 }:
 mkDerivation {
   pname = "http-conduit";
@@ -25,5 +25,5 @@
   doCheck = false;
   homepage = "http://www.yesodweb.com/book/http-conduit";
   description = "HTTP client package with conduit interface and HTTPS support";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/http-link-header.nix.golden b/test/golden-test-cases/http-link-header.nix.golden
--- a/test/golden-test-cases/http-link-header.nix.golden
+++ b/test/golden-test-cases/http-link-header.nix.golden
@@ -1,7 +1,6 @@
 { mkDerivation, attoparsec, base, bytestring, bytestring-conversion
 , criterion, directory, errors, hspec, hspec-attoparsec
-, http-api-data, network-uri, QuickCheck, stdenv, text
-, transformers
+, http-api-data, lib, network-uri, QuickCheck, text, transformers
 }:
 mkDerivation {
   pname = "http-link-header";
@@ -19,5 +18,5 @@
   ];
   homepage = "https://github.com/myfreeweb/http-link-header";
   description = "A parser and writer for the HTTP Link header as specified in RFC 5988 \"Web Linking\"";
-  license = stdenv.lib.licenses.publicDomain;
+  license = lib.licenses.publicDomain;
 }
diff --git a/test/golden-test-cases/http-media.nix.golden b/test/golden-test-cases/http-media.nix.golden
--- a/test/golden-test-cases/http-media.nix.golden
+++ b/test/golden-test-cases/http-media.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, bytestring, case-insensitive, containers
-, QuickCheck, stdenv, test-framework, test-framework-quickcheck2
+{ mkDerivation, base, bytestring, case-insensitive, containers, lib
+, QuickCheck, test-framework, test-framework-quickcheck2
 , utf8-string
 }:
 mkDerivation {
@@ -15,5 +15,5 @@
   ];
   homepage = "https://github.com/zmthy/http-media";
   description = "Processing HTTP Content-Type and Accept headers";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/hxt-charproperties.nix.golden b/test/golden-test-cases/hxt-charproperties.nix.golden
--- a/test/golden-test-cases/hxt-charproperties.nix.golden
+++ b/test/golden-test-cases/hxt-charproperties.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, stdenv }:
+{ mkDerivation, base, lib }:
 mkDerivation {
   pname = "hxt-charproperties";
   version = "9.2.0.1";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base ];
   homepage = "https://github.com/UweSchmidt/hxt";
   description = "Character properties and classes for XML and Unicode";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/hxt-expat.nix.golden b/test/golden-test-cases/hxt-expat.nix.golden
--- a/test/golden-test-cases/hxt-expat.nix.golden
+++ b/test/golden-test-cases/hxt-expat.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, bytestring, hexpat, hxt, stdenv }:
+{ mkDerivation, base, bytestring, hexpat, hxt, lib }:
 mkDerivation {
   pname = "hxt-expat";
   version = "9.1.1";
@@ -7,5 +7,5 @@
   homepage = "http://www.fh-wedel.de/~si/HXmlToolbox/index.html";
   description = "Expat parser for HXT";
   license = "unknown";
-  hydraPlatforms = stdenv.lib.platforms.none;
+  hydraPlatforms = lib.platforms.none;
 }
diff --git a/test/golden-test-cases/hxt-tagsoup.nix.golden b/test/golden-test-cases/hxt-tagsoup.nix.golden
--- a/test/golden-test-cases/hxt-tagsoup.nix.golden
+++ b/test/golden-test-cases/hxt-tagsoup.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, hxt, hxt-charproperties, hxt-unicode, stdenv
+{ mkDerivation, base, hxt, hxt-charproperties, hxt-unicode, lib
 , tagsoup
 }:
 mkDerivation {
@@ -11,5 +11,5 @@
   homepage = "https://github.com/UweSchmidt/hxt";
   description = "TagSoup parser for HXT";
   license = "unknown";
-  hydraPlatforms = stdenv.lib.platforms.none;
+  hydraPlatforms = lib.platforms.none;
 }
diff --git a/test/golden-test-cases/iconv.nix.golden b/test/golden-test-cases/iconv.nix.golden
--- a/test/golden-test-cases/iconv.nix.golden
+++ b/test/golden-test-cases/iconv.nix.golden
@@ -1,9 +1,9 @@
-{ mkDerivation, base, bytestring, stdenv }:
+{ mkDerivation, base, bytestring, lib }:
 mkDerivation {
   pname = "iconv";
   version = "0.4.1.3";
   sha256 = "deadbeef";
   libraryHaskellDepends = [ base bytestring ];
   description = "String encoding conversion";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/incremental-parser.nix.golden b/test/golden-test-cases/incremental-parser.nix.golden
--- a/test/golden-test-cases/incremental-parser.nix.golden
+++ b/test/golden-test-cases/incremental-parser.nix.golden
@@ -1,6 +1,5 @@
-{ mkDerivation, base, bytestring, checkers, criterion, deepseq
-, monoid-subclasses, QuickCheck, stdenv, tasty, tasty-quickcheck
-, text
+{ mkDerivation, base, bytestring, checkers, criterion, deepseq, lib
+, monoid-subclasses, QuickCheck, tasty, tasty-quickcheck, text
 }:
 mkDerivation {
   pname = "incremental-parser";
diff --git a/test/golden-test-cases/indentation-core.nix.golden b/test/golden-test-cases/indentation-core.nix.golden
--- a/test/golden-test-cases/indentation-core.nix.golden
+++ b/test/golden-test-cases/indentation-core.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, mtl, stdenv }:
+{ mkDerivation, base, lib, mtl }:
 mkDerivation {
   pname = "indentation-core";
   version = "0.0.0.1";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base mtl ];
   homepage = "https://bitbucket.org/adamsmd/indentation";
   description = "Indentation sensitive parsing combinators core library";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/indentation-parsec.nix.golden b/test/golden-test-cases/indentation-parsec.nix.golden
--- a/test/golden-test-cases/indentation-parsec.nix.golden
+++ b/test/golden-test-cases/indentation-parsec.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, indentation-core, mtl, parsec, stdenv, tasty
+{ mkDerivation, base, indentation-core, lib, mtl, parsec, tasty
 , tasty-hunit
 }:
 mkDerivation {
@@ -9,5 +9,5 @@
   testHaskellDepends = [ base parsec tasty tasty-hunit ];
   homepage = "https://bitbucket.org/adamsmd/indentation";
   description = "Indentation sensitive parsing combinators for Parsec";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/inline-c-cpp.nix.golden b/test/golden-test-cases/inline-c-cpp.nix.golden
--- a/test/golden-test-cases/inline-c-cpp.nix.golden
+++ b/test/golden-test-cases/inline-c-cpp.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, hspec, inline-c, safe-exceptions, stdenv
+{ mkDerivation, base, hspec, inline-c, lib, safe-exceptions
 , template-haskell
 }:
 mkDerivation {
@@ -10,5 +10,5 @@
   ];
   testHaskellDepends = [ base hspec inline-c safe-exceptions ];
   description = "Lets you embed C++ code into Haskell";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/integer-logarithms.nix.golden b/test/golden-test-cases/integer-logarithms.nix.golden
--- a/test/golden-test-cases/integer-logarithms.nix.golden
+++ b/test/golden-test-cases/integer-logarithms.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, array, base, ghc-prim, integer-gmp, QuickCheck
-, smallcheck, stdenv, tasty, tasty-hunit, tasty-quickcheck
+{ mkDerivation, array, base, ghc-prim, integer-gmp, lib, QuickCheck
+, smallcheck, tasty, tasty-hunit, tasty-quickcheck
 , tasty-smallcheck
 }:
 mkDerivation {
@@ -13,5 +13,5 @@
   ];
   homepage = "https://github.com/phadej/integer-logarithms";
   description = "Integer logarithms";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/intero.nix.golden b/test/golden-test-cases/intero.nix.golden
--- a/test/golden-test-cases/intero.nix.golden
+++ b/test/golden-test-cases/intero.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, array, base, bytestring, containers, directory
 , filepath, ghc, ghc-boot-th, ghc-paths, ghci, haskeline, hspec
-, process, regex-compat, stdenv, syb, temporary, time, transformers
+, lib, process, regex-compat, syb, temporary, time, transformers
 , unix
 }:
 mkDerivation {
@@ -20,5 +20,5 @@
   ];
   homepage = "https://github.com/commercialhaskell/intero";
   description = "Complete interactive development program for Haskell";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/invariant.nix.golden b/test/golden-test-cases/invariant.nix.golden
--- a/test/golden-test-cases/invariant.nix.golden
+++ b/test/golden-test-cases/invariant.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, array, base, bifunctors, comonad, containers
-, contravariant, ghc-prim, hspec, profunctors, QuickCheck
-, semigroups, StateVar, stdenv, stm, tagged, template-haskell
+, contravariant, ghc-prim, hspec, lib, profunctors, QuickCheck
+, semigroups, StateVar, stm, tagged, template-haskell
 , th-abstraction, transformers, transformers-compat
 , unordered-containers
 }:
@@ -17,5 +17,5 @@
   testHaskellDepends = [ base hspec QuickCheck template-haskell ];
   homepage = "https://github.com/nfrisby/invariant-functors";
   description = "Haskell98 invariant functors";
-  license = stdenv.lib.licenses.bsd2;
+  license = lib.licenses.bsd2;
 }
diff --git a/test/golden-test-cases/io-machine.nix.golden b/test/golden-test-cases/io-machine.nix.golden
--- a/test/golden-test-cases/io-machine.nix.golden
+++ b/test/golden-test-cases/io-machine.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, stdenv, time }:
+{ mkDerivation, base, lib, time }:
 mkDerivation {
   pname = "io-machine";
   version = "0.2.0.0";
@@ -7,5 +7,5 @@
   testHaskellDepends = [ base ];
   homepage = "https://github.com/YoshikuniJujo/io-machine#readme";
   description = "Easy I/O model to learn IO monad";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/io-streams-haproxy.nix.golden b/test/golden-test-cases/io-streams-haproxy.nix.golden
--- a/test/golden-test-cases/io-streams-haproxy.nix.golden
+++ b/test/golden-test-cases/io-streams-haproxy.nix.golden
@@ -1,6 +1,5 @@
 { mkDerivation, attoparsec, base, bytestring, HUnit, io-streams
-, network, stdenv, test-framework, test-framework-hunit
-, transformers
+, lib, network, test-framework, test-framework-hunit, transformers
 }:
 mkDerivation {
   pname = "io-streams-haproxy";
@@ -15,5 +14,5 @@
   ];
   homepage = "http://snapframework.com/";
   description = "HAProxy protocol 1.5 support for io-streams";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/ip.nix.golden b/test/golden-test-cases/ip.nix.golden
--- a/test/golden-test-cases/ip.nix.golden
+++ b/test/golden-test-cases/ip.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, aeson, attoparsec, base, bytestring, criterion
-, doctest, hashable, HUnit, primitive, QuickCheck
-, quickcheck-classes, stdenv, test-framework, test-framework-hunit
+, doctest, hashable, HUnit, lib, primitive, QuickCheck
+, quickcheck-classes, test-framework, test-framework-hunit
 , test-framework-quickcheck2, text, vector
 }:
 mkDerivation {
@@ -20,5 +20,5 @@
   ];
   homepage = "https://github.com/andrewthad/haskell-ip#readme";
   description = "Library for IP and MAC addresses";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/iso639.nix.golden b/test/golden-test-cases/iso639.nix.golden
--- a/test/golden-test-cases/iso639.nix.golden
+++ b/test/golden-test-cases/iso639.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, stdenv }:
+{ mkDerivation, base, lib }:
 mkDerivation {
   pname = "iso639";
   version = "0.1.0.3";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base ];
   homepage = "https://github.com/HugoDaniel/iso639";
   description = "ISO-639-1 language codes";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/iso8601-time.nix.golden b/test/golden-test-cases/iso8601-time.nix.golden
--- a/test/golden-test-cases/iso8601-time.nix.golden
+++ b/test/golden-test-cases/iso8601-time.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, hspec, HUnit, stdenv, time }:
+{ mkDerivation, base, hspec, HUnit, lib, time }:
 mkDerivation {
   pname = "iso8601-time";
   version = "0.1.4";
@@ -7,5 +7,5 @@
   testHaskellDepends = [ base hspec HUnit time ];
   homepage = "https://github.com/nh2/iso8601-time";
   description = "Convert to/from the ISO 8601 time format";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/jmacro-rpc-happstack.nix.golden b/test/golden-test-cases/jmacro-rpc-happstack.nix.golden
--- a/test/golden-test-cases/jmacro-rpc-happstack.nix.golden
+++ b/test/golden-test-cases/jmacro-rpc-happstack.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, aeson, base, blaze-html, bytestring, containers
-, happstack-server, jmacro, jmacro-rpc, mtl, stdenv
+, happstack-server, jmacro, jmacro-rpc, lib, mtl
 }:
 mkDerivation {
   pname = "jmacro-rpc-happstack";
@@ -11,5 +11,5 @@
   ];
   homepage = "http://hub.darcs.net/gershomb/jmacro-rpc";
   description = "Happstack backend for jmacro-rpc";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/jmacro-rpc.nix.golden b/test/golden-test-cases/jmacro-rpc.nix.golden
--- a/test/golden-test-cases/jmacro-rpc.nix.golden
+++ b/test/golden-test-cases/jmacro-rpc.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, aeson, attoparsec, base, blaze-html, bytestring
-, containers, contravariant, jmacro, mtl, scientific, split, stdenv
+, containers, contravariant, jmacro, lib, mtl, scientific, split
 , text, unordered-containers, vector
 }:
 mkDerivation {
@@ -13,5 +13,5 @@
   ];
   homepage = "http://hub.darcs.net/gershomb/jmacro";
   description = "JSON-RPC clients and servers using JMacro, and evented client-server Reactive Programming";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/jose.nix.golden b/test/golden-test-cases/jose.nix.golden
--- a/test/golden-test-cases/jose.nix.golden
+++ b/test/golden-test-cases/jose.nix.golden
@@ -1,8 +1,9 @@
 { mkDerivation, aeson, attoparsec, base, base64-bytestring
-, bytestring, concise, containers, cryptonite, hspec, lens, memory
-, monad-time, mtl, network-uri, QuickCheck, quickcheck-instances
-, safe, semigroups, stdenv, tasty, tasty-hspec, tasty-quickcheck
-, template-haskell, text, time, unordered-containers, vector, x509
+, bytestring, concise, containers, cryptonite, hspec, lens, lib
+, memory, monad-time, mtl, network-uri, QuickCheck
+, quickcheck-instances, safe, semigroups, tasty, tasty-hspec
+, tasty-quickcheck, template-haskell, text, time
+, unordered-containers, vector, x509
 }:
 mkDerivation {
   pname = "jose";
@@ -26,5 +27,5 @@
   ];
   homepage = "https://github.com/frasertweedale/hs-jose";
   description = "Javascript Object Signing and Encryption and JSON Web Token library";
-  license = stdenv.lib.licenses.asl20;
+  license = lib.licenses.asl20;
 }
diff --git a/test/golden-test-cases/katip-elasticsearch.nix.golden b/test/golden-test-cases/katip-elasticsearch.nix.golden
--- a/test/golden-test-cases/katip-elasticsearch.nix.golden
+++ b/test/golden-test-cases/katip-elasticsearch.nix.golden
@@ -1,9 +1,9 @@
 { mkDerivation, aeson, async, base, bloodhound, bytestring
 , containers, criterion, deepseq, enclosed-exceptions, exceptions
-, http-client, http-types, katip, lens, lens-aeson
-, quickcheck-instances, random, retry, scientific, stdenv, stm
-, stm-chans, tagged, tasty, tasty-hunit, tasty-quickcheck, text
-, time, transformers, unordered-containers, uuid, vector
+, http-client, http-types, katip, lens, lens-aeson, lib
+, quickcheck-instances, random, retry, scientific, stm, stm-chans
+, tagged, tasty, tasty-hunit, tasty-quickcheck, text, time
+, transformers, unordered-containers, uuid, vector
 }:
 mkDerivation {
   pname = "katip-elasticsearch";
@@ -26,5 +26,5 @@
   ];
   homepage = "https://github.com/Soostone/katip";
   description = "ElasticSearch scribe for the Katip logging framework";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/katip.nix.golden b/test/golden-test-cases/katip.nix.golden
--- a/test/golden-test-cases/katip.nix.golden
+++ b/test/golden-test-cases/katip.nix.golden
@@ -1,12 +1,11 @@
 { mkDerivation, aeson, async, auto-update, base, blaze-builder
 , bytestring, containers, criterion, deepseq, directory, either
-, filepath, hostname, microlens, microlens-th, monad-control, mtl
-, old-locale, quickcheck-instances, regex-tdfa, resourcet
-, safe-exceptions, scientific, semigroups, stdenv, stm, string-conv
-, tasty, tasty-golden, tasty-hunit, tasty-quickcheck
-, template-haskell, text, time, time-locale-compat, transformers
-, transformers-base, transformers-compat, unix
-, unordered-containers
+, filepath, hostname, lib, microlens, microlens-th, monad-control
+, mtl, old-locale, quickcheck-instances, regex-tdfa, resourcet
+, safe-exceptions, scientific, semigroups, stm, string-conv, tasty
+, tasty-golden, tasty-hunit, tasty-quickcheck, template-haskell
+, text, time, time-locale-compat, transformers, transformers-base
+, transformers-compat, unix, unordered-containers
 }:
 mkDerivation {
   pname = "katip";
@@ -31,5 +30,5 @@
   ];
   homepage = "https://github.com/Soostone/katip";
   description = "A structured logging framework";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/katydid.nix.golden b/test/golden-test-cases/katydid.nix.golden
--- a/test/golden-test-cases/katydid.nix.golden
+++ b/test/golden-test-cases/katydid.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, base, containers, directory, filepath, HUnit, hxt
-, json, mtl, parsec, regex-tdfa, stdenv, tasty, tasty-hunit
+, json, lib, mtl, parsec, regex-tdfa, tasty, tasty-hunit
 }:
 mkDerivation {
   pname = "katydid";
@@ -17,5 +17,5 @@
   ];
   homepage = "https://github.com/katydid/katydid-haskell";
   description = "A haskell implementation of Katydid";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/kawhi.nix.golden b/test/golden-test-cases/kawhi.nix.golden
--- a/test/golden-test-cases/kawhi.nix.golden
+++ b/test/golden-test-cases/kawhi.nix.golden
@@ -1,7 +1,6 @@
 { mkDerivation, aeson, base, bytestring, exceptions, http-client
-, http-conduit, http-types, mtl, safe, scientific, smallcheck
-, stdenv, tasty, tasty-hunit, tasty-quickcheck, tasty-smallcheck
-, text
+, http-conduit, http-types, lib, mtl, safe, scientific, smallcheck
+, tasty, tasty-hunit, tasty-quickcheck, tasty-smallcheck, text
 }:
 mkDerivation {
   pname = "kawhi";
@@ -18,5 +17,5 @@
   ];
   homepage = "https://github.com/thunky-monk/kawhi";
   description = "stats.NBA.com library";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/kraken.nix.golden b/test/golden-test-cases/kraken.nix.golden
--- a/test/golden-test-cases/kraken.nix.golden
+++ b/test/golden-test-cases/kraken.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, aeson, base, bytestring, http-client
-, http-client-tls, mtl, stdenv
+, http-client-tls, lib, mtl
 }:
 mkDerivation {
   pname = "kraken";
@@ -9,5 +9,5 @@
     aeson base bytestring http-client http-client-tls mtl
   ];
   description = "Kraken.io API client";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/l10n.nix.golden b/test/golden-test-cases/l10n.nix.golden
--- a/test/golden-test-cases/l10n.nix.golden
+++ b/test/golden-test-cases/l10n.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, stdenv, text, time }:
+{ mkDerivation, base, lib, text, time }:
 mkDerivation {
   pname = "l10n";
   version = "0.1.0.1";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base text time ];
   homepage = "https://github.com/louispan/l10n#readme";
   description = "Enables providing localization as typeclass instances in separate files";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/lambdabot-social-plugins.nix.golden b/test/golden-test-cases/lambdabot-social-plugins.nix.golden
--- a/test/golden-test-cases/lambdabot-social-plugins.nix.golden
+++ b/test/golden-test-cases/lambdabot-social-plugins.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, base, binary, bytestring, containers
-, lambdabot-core, mtl, split, stdenv, time
+, lambdabot-core, lib, mtl, split, time
 }:
 mkDerivation {
   pname = "lambdabot-social-plugins";
diff --git a/test/golden-test-cases/lazy-csv.nix.golden b/test/golden-test-cases/lazy-csv.nix.golden
--- a/test/golden-test-cases/lazy-csv.nix.golden
+++ b/test/golden-test-cases/lazy-csv.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, bytestring, stdenv }:
+{ mkDerivation, base, bytestring, lib }:
 mkDerivation {
   pname = "lazy-csv";
   version = "0.5.1";
@@ -9,5 +9,5 @@
   executableHaskellDepends = [ base bytestring ];
   homepage = "http://code.haskell.org/lazy-csv";
   description = "Efficient lazy parsers for CSV (comma-separated values)";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/lens-aeson.nix.golden b/test/golden-test-cases/lens-aeson.nix.golden
--- a/test/golden-test-cases/lens-aeson.nix.golden
+++ b/test/golden-test-cases/lens-aeson.nix.golden
@@ -1,7 +1,6 @@
 { mkDerivation, aeson, attoparsec, base, bytestring, Cabal
-, cabal-doctest, doctest, generic-deriving, lens, scientific
-, semigroups, simple-reflect, stdenv, text, unordered-containers
-, vector
+, cabal-doctest, doctest, generic-deriving, lens, lib, scientific
+, semigroups, simple-reflect, text, unordered-containers, vector
 }:
 mkDerivation {
   pname = "lens-aeson";
@@ -17,5 +16,5 @@
   ];
   homepage = "http://github.com/lens/lens-aeson/";
   description = "Law-abiding lenses for aeson";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/lens.nix.golden b/test/golden-test-cases/lens.nix.golden
--- a/test/golden-test-cases/lens.nix.golden
+++ b/test/golden-test-cases/lens.nix.golden
@@ -2,9 +2,9 @@
 , Cabal, cabal-doctest, call-stack, comonad, containers
 , contravariant, criterion, deepseq, directory, distributive
 , doctest, exceptions, filepath, free, generic-deriving, ghc-prim
-, hashable, HUnit, kan-extensions, mtl, nats, parallel, profunctors
-, QuickCheck, reflection, semigroupoids, semigroups, simple-reflect
-, stdenv, tagged, template-haskell, test-framework
+, hashable, HUnit, kan-extensions, lib, mtl, nats, parallel
+, profunctors, QuickCheck, reflection, semigroupoids, semigroups
+, simple-reflect, tagged, template-haskell, test-framework
 , test-framework-hunit, test-framework-quickcheck2
 , test-framework-th, text, th-abstraction, transformers
 , transformers-compat, unordered-containers, vector, void
@@ -35,5 +35,5 @@
   ];
   homepage = "http://github.com/ekmett/lens/";
   description = "Lenses, Folds and Traversals";
-  license = stdenv.lib.licenses.bsd2;
+  license = lib.licenses.bsd2;
 }
diff --git a/test/golden-test-cases/libgit.nix.golden b/test/golden-test-cases/libgit.nix.golden
--- a/test/golden-test-cases/libgit.nix.golden
+++ b/test/golden-test-cases/libgit.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, mtl, process, stdenv }:
+{ mkDerivation, base, lib, mtl, process }:
 mkDerivation {
   pname = "libgit";
   version = "0.3.1";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base mtl process ];
   homepage = "https://github.com/vincenthz/hs-libgit";
   description = "Simple Git Wrapper";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/librato.nix.golden b/test/golden-test-cases/librato.nix.golden
--- a/test/golden-test-cases/librato.nix.golden
+++ b/test/golden-test-cases/librato.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, aeson, attoparsec, base, bytestring, either
-, http-client, http-conduit, http-types, mtl, resourcet, stdenv
-, text, unordered-containers, uri-templater, vector
+, http-client, http-conduit, http-types, lib, mtl, resourcet, text
+, unordered-containers, uri-templater, vector
 }:
 mkDerivation {
   pname = "librato";
@@ -13,5 +13,5 @@
   ];
   homepage = "https://github.com/SaneTracker/librato";
   description = "Bindings to the Librato API";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/lifted-async.nix.golden b/test/golden-test-cases/lifted-async.nix.golden
--- a/test/golden-test-cases/lifted-async.nix.golden
+++ b/test/golden-test-cases/lifted-async.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, async, base, constraints, criterion, deepseq, HUnit
-, lifted-base, monad-control, mtl, stdenv, tasty, tasty-hunit
+, lib, lifted-base, monad-control, mtl, tasty, tasty-hunit
 , tasty-th, transformers-base
 }:
 mkDerivation {
@@ -16,5 +16,5 @@
   benchmarkHaskellDepends = [ async base criterion deepseq ];
   homepage = "https://github.com/maoe/lifted-async";
   description = "Run lifted IO operations asynchronously and wait for their results";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/lmdb.nix.golden b/test/golden-test-cases/lmdb.nix.golden
--- a/test/golden-test-cases/lmdb.nix.golden
+++ b/test/golden-test-cases/lmdb.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, array, base, lmdb, stdenv }:
+{ mkDerivation, array, base, lib, lmdb }:
 mkDerivation {
   pname = "lmdb";
   version = "0.2.5";
@@ -7,5 +7,5 @@
   librarySystemDepends = [ lmdb ];
   homepage = "http://github.com/dmbarbour/haskell-lmdb";
   description = "Lightning MDB bindings";
-  license = stdenv.lib.licenses.bsd2;
+  license = lib.licenses.bsd2;
 }
diff --git a/test/golden-test-cases/logging-effect-extra-file.nix.golden b/test/golden-test-cases/logging-effect-extra-file.nix.golden
--- a/test/golden-test-cases/logging-effect-extra-file.nix.golden
+++ b/test/golden-test-cases/logging-effect-extra-file.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, logging-effect, stdenv, template-haskell
+{ mkDerivation, base, lib, logging-effect, template-haskell
 , wl-pprint-text
 }:
 mkDerivation {
@@ -13,5 +13,5 @@
   executableHaskellDepends = [ base logging-effect wl-pprint-text ];
   homepage = "https://github.com/jship/logging-effect-extra#readme";
   description = "TH splices to augment log messages with file info";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/lucid.nix.golden b/test/golden-test-cases/lucid.nix.golden
--- a/test/golden-test-cases/lucid.nix.golden
+++ b/test/golden-test-cases/lucid.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, base, bifunctors, blaze-builder, bytestring
-, containers, criterion, deepseq, hashable, hspec, HUnit, mmorph
-, mtl, parsec, stdenv, text, transformers, unordered-containers
+, containers, criterion, deepseq, hashable, hspec, HUnit, lib
+, mmorph, mtl, parsec, text, transformers, unordered-containers
 }:
 mkDerivation {
   pname = "lucid";
@@ -18,5 +18,5 @@
   ];
   homepage = "https://github.com/chrisdone/lucid";
   description = "Clear to write, read and edit DSL for HTML";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/mainland-pretty.nix.golden b/test/golden-test-cases/mainland-pretty.nix.golden
--- a/test/golden-test-cases/mainland-pretty.nix.golden
+++ b/test/golden-test-cases/mainland-pretty.nix.golden
@@ -1,5 +1,4 @@
-{ mkDerivation, base, containers, srcloc, stdenv, text
-, transformers
+{ mkDerivation, base, containers, lib, srcloc, text, transformers
 }:
 mkDerivation {
   pname = "mainland-pretty";
@@ -10,5 +9,5 @@
   ];
   homepage = "https://github.com/mainland/mainland-pretty";
   description = "Pretty printing designed for printing source code";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/matrices.nix.golden b/test/golden-test-cases/matrices.nix.golden
--- a/test/golden-test-cases/matrices.nix.golden
+++ b/test/golden-test-cases/matrices.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, criterion, deepseq, primitive, stdenv, tasty
+{ mkDerivation, base, criterion, deepseq, lib, primitive, tasty
 , tasty-hunit, tasty-quickcheck, vector
 }:
 mkDerivation {
@@ -11,5 +11,5 @@
   ];
   benchmarkHaskellDepends = [ base criterion vector ];
   description = "native matrix based on vector";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/median-stream.nix.golden b/test/golden-test-cases/median-stream.nix.golden
--- a/test/golden-test-cases/median-stream.nix.golden
+++ b/test/golden-test-cases/median-stream.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, heap, QuickCheck, stdenv }:
+{ mkDerivation, base, heap, lib, QuickCheck }:
 mkDerivation {
   pname = "median-stream";
   version = "0.7.0.0";
@@ -7,5 +7,5 @@
   testHaskellDepends = [ base QuickCheck ];
   homepage = "https://github.com/caneroj1/median-stream#readme";
   description = "Constant-time queries for the median of a stream of numeric data";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/megaparsec.nix.golden b/test/golden-test-cases/megaparsec.nix.golden
--- a/test/golden-test-cases/megaparsec.nix.golden
+++ b/test/golden-test-cases/megaparsec.nix.golden
@@ -1,7 +1,7 @@
 { mkDerivation, base, bytestring, case-insensitive, containers
-, criterion, deepseq, hspec, hspec-expectations, mtl
-, parser-combinators, QuickCheck, scientific, stdenv, text
-, transformers, weigh
+, criterion, deepseq, hspec, hspec-expectations, lib, mtl
+, parser-combinators, QuickCheck, scientific, text, transformers
+, weigh
 }:
 mkDerivation {
   pname = "megaparsec";
@@ -18,5 +18,5 @@
   benchmarkHaskellDepends = [ base criterion deepseq text weigh ];
   homepage = "https://github.com/mrkkrp/megaparsec";
   description = "Monadic parser combinators";
-  license = stdenv.lib.licenses.bsd2;
+  license = lib.licenses.bsd2;
 }
diff --git a/test/golden-test-cases/mersenne-random.nix.golden b/test/golden-test-cases/mersenne-random.nix.golden
--- a/test/golden-test-cases/mersenne-random.nix.golden
+++ b/test/golden-test-cases/mersenne-random.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, old-time, stdenv }:
+{ mkDerivation, base, lib, old-time }:
 mkDerivation {
   pname = "mersenne-random";
   version = "1.0.0.1";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base old-time ];
   homepage = "http://code.haskell.org/~dons/code/mersenne-random";
   description = "Generate high quality pseudorandom numbers using a SIMD Fast Mersenne Twister";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/messagepack.nix.golden b/test/golden-test-cases/messagepack.nix.golden
--- a/test/golden-test-cases/messagepack.nix.golden
+++ b/test/golden-test-cases/messagepack.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, bytestring, cereal, containers, deepseq
-, QuickCheck, stdenv, test-framework, test-framework-quickcheck2
+{ mkDerivation, base, bytestring, cereal, containers, deepseq, lib
+, QuickCheck, test-framework, test-framework-quickcheck2
 , test-framework-th
 }:
 mkDerivation {
@@ -15,5 +15,5 @@
   ];
   homepage = "https://github.com/rodrigosetti/messagepack";
   description = "Serialize instance for Message Pack Object";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/microlens-ghc.nix.golden b/test/golden-test-cases/microlens-ghc.nix.golden
--- a/test/golden-test-cases/microlens-ghc.nix.golden
+++ b/test/golden-test-cases/microlens-ghc.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, array, base, bytestring, containers, microlens
-, stdenv, transformers
+{ mkDerivation, array, base, bytestring, containers, lib, microlens
+, transformers
 }:
 mkDerivation {
   pname = "microlens-ghc";
@@ -10,5 +10,5 @@
   ];
   homepage = "http://github.com/aelve/microlens";
   description = "microlens + array, bytestring, containers, transformers";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/microlens.nix.golden b/test/golden-test-cases/microlens.nix.golden
--- a/test/golden-test-cases/microlens.nix.golden
+++ b/test/golden-test-cases/microlens.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, stdenv }:
+{ mkDerivation, base, lib }:
 mkDerivation {
   pname = "microlens";
   version = "0.4.8.1";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base ];
   homepage = "http://github.com/aelve/microlens";
   description = "A tiny lens library with no dependencies. If you're writing an app, you probably want microlens-platform, not this.";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/minio-hs.nix.golden b/test/golden-test-cases/minio-hs.nix.golden
--- a/test/golden-test-cases/minio-hs.nix.golden
+++ b/test/golden-test-cases/minio-hs.nix.golden
@@ -2,8 +2,8 @@
 , case-insensitive, conduit, conduit-combinators, conduit-extra
 , containers, cryptonite, cryptonite-conduit, data-default
 , directory, exceptions, filepath, http-client, http-conduit
-, http-types, lifted-async, lifted-base, memory, monad-control
-, protolude, QuickCheck, resourcet, stdenv, tasty, tasty-hunit
+, http-types, lib, lifted-async, lifted-base, memory, monad-control
+, protolude, QuickCheck, resourcet, tasty, tasty-hunit
 , tasty-quickcheck, tasty-smallcheck, temporary, text, text-format
 , time, transformers, transformers-base, vector, xml-conduit
 }:
@@ -30,5 +30,5 @@
   ];
   homepage = "https://github.com/minio/minio-hs#readme";
   description = "A Minio Haskell Library for Amazon S3 compatible cloud storage";
-  license = stdenv.lib.licenses.asl20;
+  license = lib.licenses.asl20;
 }
diff --git a/test/golden-test-cases/mmorph.nix.golden b/test/golden-test-cases/mmorph.nix.golden
--- a/test/golden-test-cases/mmorph.nix.golden
+++ b/test/golden-test-cases/mmorph.nix.golden
@@ -1,5 +1,4 @@
-{ mkDerivation, base, mtl, stdenv, transformers
-, transformers-compat
+{ mkDerivation, base, lib, mtl, transformers, transformers-compat
 }:
 mkDerivation {
   pname = "mmorph";
@@ -9,5 +8,5 @@
     base mtl transformers transformers-compat
   ];
   description = "Monad morphisms";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/mnist-idx.nix.golden b/test/golden-test-cases/mnist-idx.nix.golden
--- a/test/golden-test-cases/mnist-idx.nix.golden
+++ b/test/golden-test-cases/mnist-idx.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, binary, bytestring, directory, hspec, stdenv
+{ mkDerivation, base, binary, bytestring, directory, hspec, lib
 , vector
 }:
 mkDerivation {
@@ -9,5 +9,5 @@
   testHaskellDepends = [ base binary directory hspec vector ];
   homepage = "https://github.com/kryoxide/mnist-idx/";
   description = "Read and write IDX data that is used in e.g. the MNIST database.";
-  license = stdenv.lib.licenses.lgpl3;
+  license = lib.licenses.lgpl3;
 }
diff --git a/test/golden-test-cases/mole.nix.golden b/test/golden-test-cases/mole.nix.golden
--- a/test/golden-test-cases/mole.nix.golden
+++ b/test/golden-test-cases/mole.nix.golden
@@ -1,8 +1,8 @@
 { mkDerivation, attoparsec, base, base64-bytestring, bytestring
 , containers, cryptohash, css-syntax, directory, filemanip
-, filepath, fsnotify, hspec, hspec-smallcheck, kraken, mtl
+, filepath, fsnotify, hspec, hspec-smallcheck, kraken, lib, mtl
 , network-uri, optparse-applicative, process, smallcheck, snap-core
-, snap-server, stdenv, stm, tagsoup, text, time, transformers, unix
+, snap-server, stm, tagsoup, text, time, transformers, unix
 , unordered-containers, vector
 }:
 mkDerivation {
@@ -22,5 +22,5 @@
     smallcheck stm text time unordered-containers vector
   ];
   description = "A glorified string replacement tool";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/monad-products.nix.golden b/test/golden-test-cases/monad-products.nix.golden
--- a/test/golden-test-cases/monad-products.nix.golden
+++ b/test/golden-test-cases/monad-products.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, semigroupoids, stdenv }:
+{ mkDerivation, base, lib, semigroupoids }:
 mkDerivation {
   pname = "monad-products";
   version = "4.0.1";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base semigroupoids ];
   homepage = "http://github.com/ekmett/monad-products";
   description = "Monad products";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/monadcryptorandom.nix.golden b/test/golden-test-cases/monadcryptorandom.nix.golden
--- a/test/golden-test-cases/monadcryptorandom.nix.golden
+++ b/test/golden-test-cases/monadcryptorandom.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, bytestring, crypto-api, exceptions, mtl
-, stdenv, tagged, transformers, transformers-compat
+{ mkDerivation, base, bytestring, crypto-api, exceptions, lib, mtl
+, tagged, transformers, transformers-compat
 }:
 mkDerivation {
   pname = "monadcryptorandom";
@@ -11,5 +11,5 @@
   ];
   homepage = "https://github.com/TomMD/monadcryptorandom";
   description = "A monad for using CryptoRandomGen";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/monadloc.nix.golden b/test/golden-test-cases/monadloc.nix.golden
--- a/test/golden-test-cases/monadloc.nix.golden
+++ b/test/golden-test-cases/monadloc.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, stdenv, template-haskell, transformers }:
+{ mkDerivation, base, lib, template-haskell, transformers }:
 mkDerivation {
   pname = "monadloc";
   version = "0.7.1";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base template-haskell transformers ];
   homepage = "http://github.com/pepeiborra/monadloc";
   description = "A class for monads which can keep a monadic call trace";
-  license = stdenv.lib.licenses.publicDomain;
+  license = lib.licenses.publicDomain;
 }
diff --git a/test/golden-test-cases/mongoDB.nix.golden b/test/golden-test-cases/mongoDB.nix.golden
--- a/test/golden-test-cases/mongoDB.nix.golden
+++ b/test/golden-test-cases/mongoDB.nix.golden
@@ -1,9 +1,9 @@
 { mkDerivation, array, base, base16-bytestring, base64-bytestring
 , binary, bson, bytestring, conduit, conduit-extra, containers
-, criterion, cryptohash, data-default-class, hashtables, hspec
+, criterion, cryptohash, data-default-class, hashtables, hspec, lib
 , lifted-base, monad-control, mtl, network, nonce, old-locale
-, parsec, pureMD5, random, random-shuffle, resourcet, stdenv
-, tagged, text, time, tls, transformers, transformers-base
+, parsec, pureMD5, random, random-shuffle, resourcet, tagged, text
+, time, tls, transformers, transformers-base
 }:
 mkDerivation {
   pname = "mongoDB";
@@ -25,5 +25,5 @@
   ];
   homepage = "https://github.com/mongodb-haskell/mongodb";
   description = "Driver (client) for MongoDB, a free, scalable, fast, document DBMS";
-  license = stdenv.lib.licenses.asl20;
+  license = lib.licenses.asl20;
 }
diff --git a/test/golden-test-cases/monoid-extras.nix.golden b/test/golden-test-cases/monoid-extras.nix.golden
--- a/test/golden-test-cases/monoid-extras.nix.golden
+++ b/test/golden-test-cases/monoid-extras.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, criterion, groups, semigroupoids, semigroups
-, stdenv
+{ mkDerivation, base, criterion, groups, lib, semigroupoids
+, semigroups
 }:
 mkDerivation {
   pname = "monoid-extras";
@@ -8,5 +8,5 @@
   libraryHaskellDepends = [ base groups semigroupoids semigroups ];
   benchmarkHaskellDepends = [ base criterion ];
   description = "Various extra monoid-related definitions and utilities";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/mwc-random-monad.nix.golden b/test/golden-test-cases/mwc-random-monad.nix.golden
--- a/test/golden-test-cases/mwc-random-monad.nix.golden
+++ b/test/golden-test-cases/mwc-random-monad.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, monad-primitive, mwc-random, primitive
-, stdenv, transformers, vector
+{ mkDerivation, base, lib, monad-primitive, mwc-random, primitive
+, transformers, vector
 }:
 mkDerivation {
   pname = "mwc-random-monad";
@@ -9,5 +9,5 @@
     base monad-primitive mwc-random primitive transformers vector
   ];
   description = "Monadic interface for mwc-random";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/mwc-random.nix.golden b/test/golden-test-cases/mwc-random.nix.golden
--- a/test/golden-test-cases/mwc-random.nix.golden
+++ b/test/golden-test-cases/mwc-random.nix.golden
@@ -1,5 +1,4 @@
-{ mkDerivation, base, math-functions, primitive, stdenv, time
-, vector
+{ mkDerivation, base, lib, math-functions, primitive, time, vector
 }:
 mkDerivation {
   pname = "mwc-random";
@@ -11,5 +10,5 @@
   doCheck = false;
   homepage = "https://github.com/bos/mwc-random";
   description = "Fast, high quality pseudo random number generation";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/nanospec.nix.golden b/test/golden-test-cases/nanospec.nix.golden
--- a/test/golden-test-cases/nanospec.nix.golden
+++ b/test/golden-test-cases/nanospec.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, hspec, silently, stdenv }:
+{ mkDerivation, base, hspec, lib, silently }:
 mkDerivation {
   pname = "nanospec";
   version = "0.2.1";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base ];
   testHaskellDepends = [ base hspec silently ];
   description = "A lightweight implementation of a subset of Hspec's API";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/netpbm.nix.golden b/test/golden-test-cases/netpbm.nix.golden
--- a/test/golden-test-cases/netpbm.nix.golden
+++ b/test/golden-test-cases/netpbm.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, attoparsec, attoparsec-binary, base, bytestring
-, criterion, hspec, HUnit, stdenv, storable-record
+, criterion, hspec, HUnit, lib, storable-record
 , unordered-containers, vector, vector-th-unbox
 }:
 mkDerivation {
@@ -14,5 +14,5 @@
   benchmarkHaskellDepends = [ base bytestring criterion ];
   homepage = "https://github.com/nh2/haskell-netpbm";
   description = "Loading PBM, PGM, PPM image files";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/network-protocol-xmpp.nix.golden b/test/golden-test-cases/network-protocol-xmpp.nix.golden
--- a/test/golden-test-cases/network-protocol-xmpp.nix.golden
+++ b/test/golden-test-cases/network-protocol-xmpp.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, bytestring, gnuidn, gnutls, gsasl, libxml-sax
-, monads-tf, network, stdenv, text, transformers, xml-types
+{ mkDerivation, base, bytestring, gnuidn, gnutls, gsasl, lib
+, libxml-sax, monads-tf, network, text, transformers, xml-types
 }:
 mkDerivation {
   pname = "network-protocol-xmpp";
@@ -11,5 +11,5 @@
   ];
   homepage = "https://john-millikin.com/software/haskell-xmpp/";
   description = "Client library for the XMPP protocol";
-  license = stdenv.lib.licenses.gpl3;
+  license = lib.licenses.gpl3;
 }
diff --git a/test/golden-test-cases/network-transport-tcp.nix.golden b/test/golden-test-cases/network-transport-tcp.nix.golden
--- a/test/golden-test-cases/network-transport-tcp.nix.golden
+++ b/test/golden-test-cases/network-transport-tcp.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, bytestring, containers, data-accessor
-, network, network-transport, network-transport-tests, stdenv
+{ mkDerivation, base, bytestring, containers, data-accessor, lib
+, network, network-transport, network-transport-tests
 }:
 mkDerivation {
   pname = "network-transport-tcp";
@@ -13,5 +13,5 @@
   ];
   homepage = "http://haskell-distributed.github.com";
   description = "TCP instantiation of Network.Transport";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/nix-paths.nix.golden b/test/golden-test-cases/nix-paths.nix.golden
--- a/test/golden-test-cases/nix-paths.nix.golden
+++ b/test/golden-test-cases/nix-paths.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, nix, process, stdenv }:
+{ mkDerivation, base, lib, nix, process }:
 mkDerivation {
   pname = "nix-paths";
   version = "1.0.1";
@@ -7,5 +7,5 @@
   libraryToolDepends = [ nix ];
   homepage = "https://github.com/peti/nix-paths";
   description = "Knowledge of Nix's installation directories";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/nvim-hs.nix.golden b/test/golden-test-cases/nvim-hs.nix.golden
--- a/test/golden-test-cases/nvim-hs.nix.golden
+++ b/test/golden-test-cases/nvim-hs.nix.golden
@@ -1,9 +1,9 @@
 { mkDerivation, ansi-wl-pprint, base, bytestring, cereal
 , cereal-conduit, conduit, conduit-extra, containers, data-default
 , deepseq, directory, dyre, exceptions, filepath, foreign-store
-, hslogger, hspec, hspec-discover, HUnit, lifted-base, megaparsec
-, messagepack, monad-control, mtl, network, optparse-applicative
-, process, QuickCheck, resourcet, setenv, stdenv, stm
+, hslogger, hspec, hspec-discover, HUnit, lib, lifted-base
+, megaparsec, messagepack, monad-control, mtl, network
+, optparse-applicative, process, QuickCheck, resourcet, setenv, stm
 , streaming-commons, template-haskell, text, time
 , time-locale-compat, transformers, transformers-base, utf8-string
 , void
@@ -35,5 +35,5 @@
   testToolDepends = [ hspec-discover ];
   homepage = "https://github.com/neovimhaskell/nvim-hs";
   description = "Haskell plugin backend for neovim";
-  license = stdenv.lib.licenses.asl20;
+  license = lib.licenses.asl20;
 }
diff --git a/test/golden-test-cases/once.nix.golden b/test/golden-test-cases/once.nix.golden
--- a/test/golden-test-cases/once.nix.golden
+++ b/test/golden-test-cases/once.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, containers, hashable, stdenv
-, template-haskell, unordered-containers
+{ mkDerivation, base, containers, hashable, lib, template-haskell
+, unordered-containers
 }:
 mkDerivation {
   pname = "once";
@@ -10,5 +10,5 @@
   ];
   homepage = "https://anonscm.debian.org/cgit/users/kaction-guest/haskell-once.git";
   description = "memoization for IO actions and functions";
-  license = stdenv.lib.licenses.gpl3;
+  license = lib.licenses.gpl3;
 }
diff --git a/test/golden-test-cases/one-liner.nix.golden b/test/golden-test-cases/one-liner.nix.golden
--- a/test/golden-test-cases/one-liner.nix.golden
+++ b/test/golden-test-cases/one-liner.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, base, bifunctors, contravariant, ghc-prim, HUnit
-, profunctors, stdenv, tagged, transformers
+, lib, profunctors, tagged, transformers
 }:
 mkDerivation {
   pname = "one-liner";
@@ -12,5 +12,5 @@
   testHaskellDepends = [ base contravariant HUnit ];
   homepage = "https://github.com/sjoerdvisscher/one-liner";
   description = "Constraint-based generics";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/online.nix.golden b/test/golden-test-cases/online.nix.golden
--- a/test/golden-test-cases/online.nix.golden
+++ b/test/golden-test-cases/online.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, foldl, numhask, protolude, stdenv, tdigest
+{ mkDerivation, base, foldl, lib, numhask, protolude, tdigest
 , vector, vector-algorithms
 }:
 mkDerivation {
@@ -10,5 +10,5 @@
   ];
   homepage = "https://github.com/tonyday567/online";
   description = "online statistics";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/opencv.nix.golden b/test/golden-test-cases/opencv.nix.golden
--- a/test/golden-test-cases/opencv.nix.golden
+++ b/test/golden-test-cases/opencv.nix.golden
@@ -1,8 +1,8 @@
 { mkDerivation, aeson, base, base64-bytestring, bindings-DSL
 , bytestring, Cabal, containers, criterion, data-default, deepseq
 , directory, Glob, haskell-src-exts, inline-c, inline-c-cpp
-, JuicyPixels, lens, linear, opencv3, primitive, QuickCheck, repa
-, stdenv, tasty, tasty-hunit, tasty-quickcheck, template-haskell
+, JuicyPixels, lens, lib, linear, opencv3, primitive, QuickCheck
+, repa, tasty, tasty-hunit, tasty-quickcheck, template-haskell
 , text, transformers, vector
 }:
 mkDerivation {
@@ -26,5 +26,5 @@
   hardeningDisable = [ "bindnow" ];
   homepage = "https://github.com/LumiGuide/haskell-opencv";
   description = "Haskell binding to OpenCV-3.x";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/openexr-write.nix.golden b/test/golden-test-cases/openexr-write.nix.golden
--- a/test/golden-test-cases/openexr-write.nix.golden
+++ b/test/golden-test-cases/openexr-write.nix.golden
@@ -1,6 +1,5 @@
 { mkDerivation, base, binary, bytestring, data-binary-ieee754
-, deepseq, directory, hspec, split, stdenv, vector, vector-split
-, zlib
+, deepseq, directory, hspec, lib, split, vector, vector-split, zlib
 }:
 mkDerivation {
   pname = "openexr-write";
@@ -13,5 +12,5 @@
   testHaskellDepends = [ base bytestring directory hspec vector ];
   homepage = "https://github.com/pavolzetor/openexr-write#readme";
   description = "Library for writing images in OpenEXR HDR file format";
-  license = stdenv.lib.licenses.gpl3;
+  license = lib.licenses.gpl3;
 }
diff --git a/test/golden-test-cases/openpgp-asciiarmor.nix.golden b/test/golden-test-cases/openpgp-asciiarmor.nix.golden
--- a/test/golden-test-cases/openpgp-asciiarmor.nix.golden
+++ b/test/golden-test-cases/openpgp-asciiarmor.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, attoparsec, base, base64-bytestring, bytestring
-, cereal, HUnit, stdenv, test-framework, test-framework-hunit
+, cereal, HUnit, lib, test-framework, test-framework-hunit
 }:
 mkDerivation {
   pname = "openpgp-asciiarmor";
@@ -15,5 +15,5 @@
   homepage = "http://floss.scru.org/openpgp-asciiarmor";
   description = "OpenPGP (RFC4880) ASCII Armor codec";
   license = "unknown";
-  hydraPlatforms = stdenv.lib.platforms.none;
+  hydraPlatforms = lib.platforms.none;
 }
diff --git a/test/golden-test-cases/pager.nix.golden b/test/golden-test-cases/pager.nix.golden
--- a/test/golden-test-cases/pager.nix.golden
+++ b/test/golden-test-cases/pager.nix.golden
@@ -1,6 +1,5 @@
 { mkDerivation, base, bytestring, conduit, conduit-extra, directory
-, process, resourcet, safe, stdenv, terminfo, text, transformers
-, unix
+, lib, process, resourcet, safe, terminfo, text, transformers, unix
 }:
 mkDerivation {
   pname = "pager";
@@ -16,5 +15,5 @@
   executableHaskellDepends = [ base bytestring conduit-extra text ];
   homepage = "https://github.com/pharpend/pager";
   description = "Open up a pager, like 'less' or 'more'";
-  license = stdenv.lib.licenses.bsd2;
+  license = lib.licenses.bsd2;
 }
diff --git a/test/golden-test-cases/partial-isomorphisms.nix.golden b/test/golden-test-cases/partial-isomorphisms.nix.golden
--- a/test/golden-test-cases/partial-isomorphisms.nix.golden
+++ b/test/golden-test-cases/partial-isomorphisms.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, stdenv, template-haskell }:
+{ mkDerivation, base, lib, template-haskell }:
 mkDerivation {
   pname = "partial-isomorphisms";
   version = "0.2.2.1";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base template-haskell ];
   homepage = "http://www.informatik.uni-marburg.de/~rendel/unparse";
   description = "Partial isomorphisms";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/partial-semigroup.nix.golden b/test/golden-test-cases/partial-semigroup.nix.golden
--- a/test/golden-test-cases/partial-semigroup.nix.golden
+++ b/test/golden-test-cases/partial-semigroup.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, doctest, hedgehog, stdenv }:
+{ mkDerivation, base, doctest, hedgehog, lib }:
 mkDerivation {
   pname = "partial-semigroup";
   version = "0.3.0.2";
@@ -7,5 +7,5 @@
   testHaskellDepends = [ base doctest hedgehog ];
   homepage = "https://github.com/chris-martin/partial-semigroup";
   description = "A partial binary associative operator";
-  license = stdenv.lib.licenses.asl20;
+  license = lib.licenses.asl20;
 }
diff --git a/test/golden-test-cases/pathtype.nix.golden b/test/golden-test-cases/pathtype.nix.golden
--- a/test/golden-test-cases/pathtype.nix.golden
+++ b/test/golden-test-cases/pathtype.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, deepseq, directory, old-time, QuickCheck
-, random, stdenv, tagged, time, transformers, utility-ht
+{ mkDerivation, base, deepseq, directory, lib, old-time, QuickCheck
+, random, tagged, time, transformers, utility-ht
 }:
 mkDerivation {
   pname = "pathtype";
@@ -14,5 +14,5 @@
   testHaskellDepends = [ base random ];
   homepage = "http://hub.darcs.net/thielema/pathtype/";
   description = "Type-safe replacement for System.FilePath etc";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/pcap.nix.golden b/test/golden-test-cases/pcap.nix.golden
--- a/test/golden-test-cases/pcap.nix.golden
+++ b/test/golden-test-cases/pcap.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, bytestring, network, stdenv, time }:
+{ mkDerivation, base, bytestring, lib, network, time }:
 mkDerivation {
   pname = "pcap";
   version = "0.4.5.2";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base bytestring network time ];
   homepage = "https://github.com/bos/pcap";
   description = "A system-independent interface for user-level packet capture";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/pdfinfo.nix.golden b/test/golden-test-cases/pdfinfo.nix.golden
--- a/test/golden-test-cases/pdfinfo.nix.golden
+++ b/test/golden-test-cases/pdfinfo.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, mtl, old-locale, process-extras, stdenv, text
+{ mkDerivation, base, lib, mtl, old-locale, process-extras, text
 , time, time-locale-compat
 }:
 mkDerivation {
@@ -10,5 +10,5 @@
   ];
   homepage = "https://github.com/chrisdone/pdfinfo";
   description = "Wrapper around the pdfinfo command";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/pell.nix.golden b/test/golden-test-cases/pell.nix.golden
--- a/test/golden-test-cases/pell.nix.golden
+++ b/test/golden-test-cases/pell.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, arithmoi, base, Cabal, cabal-test-quickcheck
-, containers, primes, QuickCheck, stdenv
+, containers, lib, primes, QuickCheck
 }:
 mkDerivation {
   pname = "pell";
@@ -12,5 +12,5 @@
   ];
   homepage = "https://github.com/brunjlar/pell";
   description = "Package to solve the Generalized Pell Equation";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/persistable-types-HDBC-pg.nix.golden b/test/golden-test-cases/persistable-types-HDBC-pg.nix.golden
--- a/test/golden-test-cases/persistable-types-HDBC-pg.nix.golden
+++ b/test/golden-test-cases/persistable-types-HDBC-pg.nix.golden
@@ -1,6 +1,5 @@
-{ mkDerivation, base, bytestring, convertible, HDBC
-, persistable-record, relational-query-HDBC, stdenv
-, text-postgresql
+{ mkDerivation, base, bytestring, convertible, HDBC, lib
+, persistable-record, relational-query-HDBC, text-postgresql
 }:
 mkDerivation {
   pname = "persistable-types-HDBC-pg";
@@ -12,5 +11,5 @@
   ];
   homepage = "http://khibino.github.io/haskell-relational-record/";
   description = "HDBC and Relational-Record instances of PostgreSQL extended types";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/persistent-mysql-haskell.nix.golden b/test/golden-test-cases/persistent-mysql-haskell.nix.golden
--- a/test/golden-test-cases/persistent-mysql-haskell.nix.golden
+++ b/test/golden-test-cases/persistent-mysql-haskell.nix.golden
@@ -1,7 +1,7 @@
 { mkDerivation, aeson, base, bytestring, conduit, containers
-, io-streams, monad-control, monad-logger, mysql-haskell, network
-, persistent, persistent-template, resource-pool, resourcet, stdenv
-, text, time, tls, transformers
+, io-streams, lib, monad-control, monad-logger, mysql-haskell
+, network, persistent, persistent-template, resource-pool
+, resourcet, text, time, tls, transformers
 }:
 mkDerivation {
   pname = "persistent-mysql-haskell";
@@ -19,5 +19,5 @@
   ];
   homepage = "http://www.yesodweb.com/book/persistent";
   description = "A pure haskell backend for the persistent library using MySQL database server";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/picosat.nix.golden b/test/golden-test-cases/picosat.nix.golden
--- a/test/golden-test-cases/picosat.nix.golden
+++ b/test/golden-test-cases/picosat.nix.golden
@@ -1,5 +1,4 @@
-{ mkDerivation, base, containers, random, rdtsc, stdenv
-, transformers
+{ mkDerivation, base, containers, lib, random, rdtsc, transformers
 }:
 mkDerivation {
   pname = "picosat";
@@ -9,5 +8,5 @@
   testHaskellDepends = [ base containers random rdtsc transformers ];
   homepage = "https://github.com/sdiehl/haskell-picosat";
   description = "Bindings to the PicoSAT solver";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/pinch.nix.golden b/test/golden-test-cases/pinch.nix.golden
--- a/test/golden-test-cases/pinch.nix.golden
+++ b/test/golden-test-cases/pinch.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, array, base, bytestring, containers, deepseq
-, ghc-prim, hashable, hspec, hspec-discover, QuickCheck, stdenv
-, text, unordered-containers, vector
+, ghc-prim, hashable, hspec, hspec-discover, lib, QuickCheck, text
+, unordered-containers, vector
 }:
 mkDerivation {
   pname = "pinch";
@@ -17,5 +17,5 @@
   testToolDepends = [ hspec-discover ];
   homepage = "https://github.com/abhinav/pinch#readme";
   description = "An alternative implementation of Thrift for Haskell";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/pipes-network.nix.golden b/test/golden-test-cases/pipes-network.nix.golden
--- a/test/golden-test-cases/pipes-network.nix.golden
+++ b/test/golden-test-cases/pipes-network.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, bytestring, network, network-simple, pipes
-, pipes-safe, stdenv, transformers
+{ mkDerivation, base, bytestring, lib, network, network-simple
+, pipes, pipes-safe, transformers
 }:
 mkDerivation {
   pname = "pipes-network";
@@ -11,5 +11,5 @@
   ];
   homepage = "https://github.com/k0001/pipes-network";
   description = "Use network sockets together with the pipes library";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/pipes-safe.nix.golden b/test/golden-test-cases/pipes-safe.nix.golden
--- a/test/golden-test-cases/pipes-safe.nix.golden
+++ b/test/golden-test-cases/pipes-safe.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, containers, exceptions, monad-control, mtl
-, pipes, primitive, stdenv, transformers, transformers-base
+{ mkDerivation, base, containers, exceptions, lib, monad-control
+, mtl, pipes, primitive, transformers, transformers-base
 }:
 mkDerivation {
   pname = "pipes-safe";
@@ -10,5 +10,5 @@
     transformers transformers-base
   ];
   description = "Safety for the pipes ecosystem";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/pointed.nix.golden b/test/golden-test-cases/pointed.nix.golden
--- a/test/golden-test-cases/pointed.nix.golden
+++ b/test/golden-test-cases/pointed.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, base, comonad, containers, data-default-class
-, hashable, kan-extensions, semigroupoids, semigroups, stdenv, stm
+, hashable, kan-extensions, lib, semigroupoids, semigroups, stm
 , tagged, transformers, transformers-compat, unordered-containers
 }:
 mkDerivation {
@@ -13,5 +13,5 @@
   ];
   homepage = "http://github.com/ekmett/pointed/";
   description = "Pointed and copointed data";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/poly-arity.nix.golden b/test/golden-test-cases/poly-arity.nix.golden
--- a/test/golden-test-cases/poly-arity.nix.golden
+++ b/test/golden-test-cases/poly-arity.nix.golden
@@ -1,9 +1,9 @@
-{ mkDerivation, base, constraints, stdenv }:
+{ mkDerivation, base, constraints, lib }:
 mkDerivation {
   pname = "poly-arity";
   version = "0.1.0";
   sha256 = "deadbeef";
   libraryHaskellDepends = [ base constraints ];
   description = "Tools for working with functions of undetermined arity";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/polynomials-bernstein.nix.golden b/test/golden-test-cases/polynomials-bernstein.nix.golden
--- a/test/golden-test-cases/polynomials-bernstein.nix.golden
+++ b/test/golden-test-cases/polynomials-bernstein.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, stdenv, vector }:
+{ mkDerivation, base, lib, vector }:
 mkDerivation {
   pname = "polynomials-bernstein";
   version = "1.1.2";
diff --git a/test/golden-test-cases/postgresql-simple-url.nix.golden b/test/golden-test-cases/postgresql-simple-url.nix.golden
--- a/test/golden-test-cases/postgresql-simple-url.nix.golden
+++ b/test/golden-test-cases/postgresql-simple-url.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, network-uri, postgresql-simple, split, stdenv
+{ mkDerivation, base, lib, network-uri, postgresql-simple, split
 , tasty, tasty-quickcheck
 }:
 mkDerivation {
@@ -13,5 +13,5 @@
   ];
   homepage = "https://github.com/futurice/postgresql-simple-url";
   description = "Parse postgres:// url into ConnectInfo";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/prelude-safeenum.nix.golden b/test/golden-test-cases/prelude-safeenum.nix.golden
--- a/test/golden-test-cases/prelude-safeenum.nix.golden
+++ b/test/golden-test-cases/prelude-safeenum.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, stdenv }:
+{ mkDerivation, base, lib }:
 mkDerivation {
   pname = "prelude-safeenum";
   version = "0.1.1.2";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base ];
   homepage = "http://code.haskell.org/~wren/";
   description = "A redefinition of the Prelude's Enum class in order to render it safe";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/presburger.nix.golden b/test/golden-test-cases/presburger.nix.golden
--- a/test/golden-test-cases/presburger.nix.golden
+++ b/test/golden-test-cases/presburger.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, containers, pretty, QuickCheck, stdenv }:
+{ mkDerivation, base, containers, lib, pretty, QuickCheck }:
 mkDerivation {
   pname = "presburger";
   version = "1.3.1";
@@ -7,5 +7,5 @@
   testHaskellDepends = [ base QuickCheck ];
   homepage = "http://github.com/yav/presburger";
   description = "A decision procedure for quantifier-free linear arithmetic";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/prettyclass.nix.golden b/test/golden-test-cases/prettyclass.nix.golden
--- a/test/golden-test-cases/prettyclass.nix.golden
+++ b/test/golden-test-cases/prettyclass.nix.golden
@@ -1,9 +1,9 @@
-{ mkDerivation, base, pretty, stdenv }:
+{ mkDerivation, base, lib, pretty }:
 mkDerivation {
   pname = "prettyclass";
   version = "1.0.0.0";
   sha256 = "deadbeef";
   libraryHaskellDepends = [ base pretty ];
   description = "Pretty printing class similar to Show";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/prettyprinter-compat-ansi-wl-pprint.nix.golden b/test/golden-test-cases/prettyprinter-compat-ansi-wl-pprint.nix.golden
--- a/test/golden-test-cases/prettyprinter-compat-ansi-wl-pprint.nix.golden
+++ b/test/golden-test-cases/prettyprinter-compat-ansi-wl-pprint.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, prettyprinter, prettyprinter-ansi-terminal
-, stdenv, text
+{ mkDerivation, base, lib, prettyprinter
+, prettyprinter-ansi-terminal, text
 }:
 mkDerivation {
   pname = "prettyprinter-compat-ansi-wl-pprint";
@@ -10,5 +10,5 @@
   ];
   homepage = "http://github.com/quchen/prettyprinter";
   description = "Drop-in compatibility package to migrate from »ansi-wl-pprint« to »prettyprinter«";
-  license = stdenv.lib.licenses.bsd2;
+  license = lib.licenses.bsd2;
 }
diff --git a/test/golden-test-cases/prettyprinter-compat-wl-pprint.nix.golden b/test/golden-test-cases/prettyprinter-compat-wl-pprint.nix.golden
--- a/test/golden-test-cases/prettyprinter-compat-wl-pprint.nix.golden
+++ b/test/golden-test-cases/prettyprinter-compat-wl-pprint.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, prettyprinter, stdenv, text }:
+{ mkDerivation, base, lib, prettyprinter, text }:
 mkDerivation {
   pname = "prettyprinter-compat-wl-pprint";
   version = "1.0.0.1";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base prettyprinter text ];
   homepage = "http://github.com/quchen/prettyprinter";
   description = "Prettyprinter compatibility module for previous users of the wl-pprint package";
-  license = stdenv.lib.licenses.bsd2;
+  license = lib.licenses.bsd2;
 }
diff --git a/test/golden-test-cases/primitive.nix.golden b/test/golden-test-cases/primitive.nix.golden
--- a/test/golden-test-cases/primitive.nix.golden
+++ b/test/golden-test-cases/primitive.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, ghc-prim, stdenv, transformers }:
+{ mkDerivation, base, ghc-prim, lib, transformers }:
 mkDerivation {
   pname = "primitive";
   version = "0.6.2.0";
@@ -7,5 +7,5 @@
   testHaskellDepends = [ base ghc-prim ];
   homepage = "https://github.com/haskell/primitive";
   description = "Primitive memory-related operations";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/product-profunctors.nix.golden b/test/golden-test-cases/product-profunctors.nix.golden
--- a/test/golden-test-cases/product-profunctors.nix.golden
+++ b/test/golden-test-cases/product-profunctors.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, contravariant, profunctors, stdenv, tagged
+{ mkDerivation, base, contravariant, lib, profunctors, tagged
 , template-haskell
 }:
 mkDerivation {
@@ -11,5 +11,5 @@
   testHaskellDepends = [ base profunctors ];
   homepage = "https://github.com/tomjaguarpaw/product-profunctors";
   description = "product-profunctors";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/profiterole.nix.golden b/test/golden-test-cases/profiterole.nix.golden
--- a/test/golden-test-cases/profiterole.nix.golden
+++ b/test/golden-test-cases/profiterole.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, base, containers, directory, extra, filepath
-, ghc-prof, hashable, scientific, stdenv, text
+, ghc-prof, hashable, lib, scientific, text
 }:
 mkDerivation {
   pname = "profiterole";
@@ -13,5 +13,5 @@
   ];
   homepage = "https://github.com/ndmitchell/profiterole#readme";
   description = "Restructure GHC profile reports";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/projectroot.nix.golden b/test/golden-test-cases/projectroot.nix.golden
--- a/test/golden-test-cases/projectroot.nix.golden
+++ b/test/golden-test-cases/projectroot.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, directory, hspec, QuickCheck, stdenv }:
+{ mkDerivation, base, directory, hspec, lib, QuickCheck }:
 mkDerivation {
   pname = "projectroot";
   version = "0.2.0.1";
@@ -7,5 +7,5 @@
   testHaskellDepends = [ base hspec QuickCheck ];
   homepage = "https://github.com/yamadapc/haskell-projectroot";
   description = "Bindings to the projectroot C logic";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/proto-lens-optparse.nix.golden b/test/golden-test-cases/proto-lens-optparse.nix.golden
--- a/test/golden-test-cases/proto-lens-optparse.nix.golden
+++ b/test/golden-test-cases/proto-lens-optparse.nix.golden
@@ -1,5 +1,4 @@
-{ mkDerivation, base, optparse-applicative, proto-lens, stdenv
-, text
+{ mkDerivation, base, lib, optparse-applicative, proto-lens, text
 }:
 mkDerivation {
   pname = "proto-lens-optparse";
@@ -10,5 +9,5 @@
   ];
   homepage = "https://github.com/google/proto-lens";
   description = "Adapting proto-lens to optparse-applicative ReadMs";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/proto-lens.nix.golden b/test/golden-test-cases/proto-lens.nix.golden
--- a/test/golden-test-cases/proto-lens.nix.golden
+++ b/test/golden-test-cases/proto-lens.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, attoparsec, base, bytestring, containers
-, data-default-class, lens-family, parsec, pretty, stdenv, text
+, data-default-class, lens-family, lib, parsec, pretty, text
 , transformers, void
 }:
 mkDerivation {
@@ -12,5 +12,5 @@
   ];
   homepage = "https://github.com/google/proto-lens";
   description = "A lens-based implementation of protocol buffers in Haskell";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/psqueues.nix.golden b/test/golden-test-cases/psqueues.nix.golden
--- a/test/golden-test-cases/psqueues.nix.golden
+++ b/test/golden-test-cases/psqueues.nix.golden
@@ -1,8 +1,7 @@
 { mkDerivation, array, base, containers, criterion, deepseq
-, fingertree-psqueue, ghc-prim, hashable, HUnit, mtl, PSQueue
-, QuickCheck, random, stdenv, tagged, test-framework
-, test-framework-hunit, test-framework-quickcheck2
-, unordered-containers
+, fingertree-psqueue, ghc-prim, hashable, HUnit, lib, mtl, PSQueue
+, QuickCheck, random, tagged, test-framework, test-framework-hunit
+, test-framework-quickcheck2, unordered-containers
 }:
 mkDerivation {
   pname = "psqueues";
@@ -18,5 +17,5 @@
     hashable mtl PSQueue random unordered-containers
   ];
   description = "Pure priority search queues";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/pusher-http-haskell.nix.golden b/test/golden-test-cases/pusher-http-haskell.nix.golden
--- a/test/golden-test-cases/pusher-http-haskell.nix.golden
+++ b/test/golden-test-cases/pusher-http-haskell.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, aeson, base, base16-bytestring, bytestring
-, cryptonite, hashable, hspec, http-client, http-types, memory
-, QuickCheck, scientific, stdenv, text, time, transformers
+, cryptonite, hashable, hspec, http-client, http-types, lib, memory
+, QuickCheck, scientific, text, time, transformers
 , unordered-containers, vector
 }:
 mkDerivation {
@@ -19,5 +19,5 @@
   ];
   homepage = "https://github.com/pusher-community/pusher-http-haskell";
   description = "Haskell client library for the Pusher HTTP API";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/quickcheck-arbitrary-adt.nix.golden b/test/golden-test-cases/quickcheck-arbitrary-adt.nix.golden
--- a/test/golden-test-cases/quickcheck-arbitrary-adt.nix.golden
+++ b/test/golden-test-cases/quickcheck-arbitrary-adt.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, hspec, lens, QuickCheck, stdenv
+{ mkDerivation, base, hspec, lens, lib, QuickCheck
 , template-haskell, transformers
 }:
 mkDerivation {
@@ -11,5 +11,5 @@
   ];
   homepage = "https://github.com/plow-technologies/quickcheck-arbitrary-adt#readme";
   description = "Generic typeclasses for generating arbitrary ADTs";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/quickcheck-combinators.nix.golden b/test/golden-test-cases/quickcheck-combinators.nix.golden
--- a/test/golden-test-cases/quickcheck-combinators.nix.golden
+++ b/test/golden-test-cases/quickcheck-combinators.nix.golden
@@ -1,9 +1,9 @@
-{ mkDerivation, base, QuickCheck, stdenv, unfoldable-restricted }:
+{ mkDerivation, base, lib, QuickCheck, unfoldable-restricted }:
 mkDerivation {
   pname = "quickcheck-combinators";
   version = "0.0.2";
   sha256 = "deadbeef";
   libraryHaskellDepends = [ base QuickCheck unfoldable-restricted ];
   description = "Simple type-level combinators for augmenting QuickCheck instances";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/rank1dynamic.nix.golden b/test/golden-test-cases/rank1dynamic.nix.golden
--- a/test/golden-test-cases/rank1dynamic.nix.golden
+++ b/test/golden-test-cases/rank1dynamic.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, binary, HUnit, stdenv, test-framework
+{ mkDerivation, base, binary, HUnit, lib, test-framework
 , test-framework-hunit
 }:
 mkDerivation {
@@ -11,5 +11,5 @@
   ];
   homepage = "http://haskell-distributed.github.com";
   description = "Like Data.Dynamic/Data.Typeable but with support for rank-1 polymorphic types";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/rasterific-svg.nix.golden b/test/golden-test-cases/rasterific-svg.nix.golden
--- a/test/golden-test-cases/rasterific-svg.nix.golden
+++ b/test/golden-test-cases/rasterific-svg.nix.golden
@@ -1,7 +1,7 @@
 { mkDerivation, base, binary, bytestring, containers, directory
-, filepath, FontyFruity, JuicyPixels, lens, linear, mtl
-, optparse-applicative, primitive, Rasterific, scientific, stdenv
-, svg-tree, text, transformers, vector
+, filepath, FontyFruity, JuicyPixels, lens, lib, linear, mtl
+, optparse-applicative, primitive, Rasterific, scientific, svg-tree
+, text, transformers, vector
 }:
 mkDerivation {
   pname = "rasterific-svg";
@@ -19,5 +19,5 @@
     optparse-applicative Rasterific svg-tree
   ];
   description = "SVG renderer based on Rasterific";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/ratio-int.nix.golden b/test/golden-test-cases/ratio-int.nix.golden
--- a/test/golden-test-cases/ratio-int.nix.golden
+++ b/test/golden-test-cases/ratio-int.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, stdenv }:
+{ mkDerivation, base, lib }:
 mkDerivation {
   pname = "ratio-int";
   version = "0.1.2";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base ];
   homepage = "https://github.com/RaphaelJ/ratio-int";
   description = "Fast specialisation of Data.Ratio for Int.";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/rawstring-qm.nix.golden b/test/golden-test-cases/rawstring-qm.nix.golden
--- a/test/golden-test-cases/rawstring-qm.nix.golden
+++ b/test/golden-test-cases/rawstring-qm.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, bytestring, stdenv, template-haskell, text }:
+{ mkDerivation, base, bytestring, lib, template-haskell, text }:
 mkDerivation {
   pname = "rawstring-qm";
   version = "0.2.3.0";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base bytestring template-haskell text ];
   homepage = "https://github.com/tolysz/rawstring-qm";
   description = "Simple raw string quotation and dictionary interpolation";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/reactive-banana.nix.golden b/test/golden-test-cases/reactive-banana.nix.golden
--- a/test/golden-test-cases/reactive-banana.nix.golden
+++ b/test/golden-test-cases/reactive-banana.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, containers, hashable, HUnit, pqueue, psqueues
-, stdenv, test-framework, test-framework-hunit, transformers
+{ mkDerivation, base, containers, hashable, HUnit, lib, pqueue
+, psqueues, test-framework, test-framework-hunit, transformers
 , unordered-containers, vault
 }:
 mkDerivation {
@@ -16,5 +16,5 @@
   ];
   homepage = "http://wiki.haskell.org/Reactive-banana";
   description = "Library for functional reactive programming (FRP)";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/readline.nix.golden b/test/golden-test-cases/readline.nix.golden
--- a/test/golden-test-cases/readline.nix.golden
+++ b/test/golden-test-cases/readline.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, ncurses, process, readline, stdenv }:
+{ mkDerivation, base, lib, ncurses, process, readline }:
 mkDerivation {
   pname = "readline";
   version = "1.0.3.0";
diff --git a/test/golden-test-cases/rebase.nix.golden b/test/golden-test-cases/rebase.nix.golden
--- a/test/golden-test-cases/rebase.nix.golden
+++ b/test/golden-test-cases/rebase.nix.golden
@@ -1,7 +1,7 @@
 { mkDerivation, base, base-prelude, bifunctors, bytestring
 , containers, contravariant, contravariant-extras, deepseq, dlist
-, either, fail, hashable, mtl, profunctors, scientific
-, semigroupoids, semigroups, stdenv, stm, text, time, transformers
+, either, fail, hashable, lib, mtl, profunctors, scientific
+, semigroupoids, semigroups, stm, text, time, transformers
 , unordered-containers, uuid, vector, void
 }:
 mkDerivation {
@@ -16,5 +16,5 @@
   ];
   homepage = "https://github.com/nikita-volkov/rebase";
   description = "A more progressive alternative to the \"base\" package";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/reform-blaze.nix.golden b/test/golden-test-cases/reform-blaze.nix.golden
--- a/test/golden-test-cases/reform-blaze.nix.golden
+++ b/test/golden-test-cases/reform-blaze.nix.golden
@@ -1,5 +1,4 @@
-{ mkDerivation, base, blaze-html, blaze-markup, reform, stdenv
-, text
+{ mkDerivation, base, blaze-html, blaze-markup, lib, reform, text
 }:
 mkDerivation {
   pname = "reform-blaze";
@@ -10,5 +9,5 @@
   ];
   homepage = "http://www.happstack.com/";
   description = "Add support for using blaze-html with Reform";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/reform-hsp.nix.golden b/test/golden-test-cases/reform-hsp.nix.golden
--- a/test/golden-test-cases/reform-hsp.nix.golden
+++ b/test/golden-test-cases/reform-hsp.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, hsp, hsx2hs, reform, stdenv, text }:
+{ mkDerivation, base, hsp, hsx2hs, lib, reform, text }:
 mkDerivation {
   pname = "reform-hsp";
   version = "0.2.7.1";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base hsp hsx2hs reform text ];
   homepage = "http://www.happstack.com/";
   description = "Add support for using HSP with Reform";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/regex-compat.nix.golden b/test/golden-test-cases/regex-compat.nix.golden
--- a/test/golden-test-cases/regex-compat.nix.golden
+++ b/test/golden-test-cases/regex-compat.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, array, base, regex-base, regex-posix, stdenv }:
+{ mkDerivation, array, base, lib, regex-base, regex-posix }:
 mkDerivation {
   pname = "regex-compat";
   version = "0.95.1";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ array base regex-base regex-posix ];
   homepage = "http://sourceforge.net/projects/lazy-regex";
   description = "Replaces/Enhances Text.Regex";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/regex-pcre.nix.golden b/test/golden-test-cases/regex-pcre.nix.golden
--- a/test/golden-test-cases/regex-pcre.nix.golden
+++ b/test/golden-test-cases/regex-pcre.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, array, base, bytestring, containers, pcre
-, regex-base, stdenv
+{ mkDerivation, array, base, bytestring, containers, lib, pcre
+, regex-base
 }:
 mkDerivation {
   pname = "regex-pcre";
@@ -11,5 +11,5 @@
   librarySystemDepends = [ pcre ];
   homepage = "http://hackage.haskell.org/package/regex-pcre";
   description = "Replaces/Enhances Text.Regex";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/relational-query.nix.golden b/test/golden-test-cases/relational-query.nix.golden
--- a/test/golden-test-cases/relational-query.nix.golden
+++ b/test/golden-test-cases/relational-query.nix.golden
@@ -1,6 +1,6 @@
-{ mkDerivation, array, base, bytestring, containers, dlist
+{ mkDerivation, array, base, bytestring, containers, dlist, lib
 , names-th, persistable-record, product-isomorphic
-, quickcheck-simple, sql-words, stdenv, template-haskell, text
+, quickcheck-simple, sql-words, template-haskell, text
 , th-reify-compat, time, time-locale-compat, transformers
 }:
 mkDerivation {
@@ -17,5 +17,5 @@
   ];
   homepage = "http://khibino.github.io/haskell-relational-record/";
   description = "Typeful, Modular, Relational, algebraic query engine";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/relational-schemas.nix.golden b/test/golden-test-cases/relational-schemas.nix.golden
--- a/test/golden-test-cases/relational-schemas.nix.golden
+++ b/test/golden-test-cases/relational-schemas.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, bytestring, containers, relational-query
-, stdenv, template-haskell, time
+{ mkDerivation, base, bytestring, containers, lib, relational-query
+, template-haskell, time
 }:
 mkDerivation {
   pname = "relational-schemas";
@@ -10,5 +10,5 @@
   ];
   homepage = "http://khibino.github.io/haskell-relational-record/";
   description = "RDBMSs' schema templates for relational-query";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/repa-io.nix.golden b/test/golden-test-cases/repa-io.nix.golden
--- a/test/golden-test-cases/repa-io.nix.golden
+++ b/test/golden-test-cases/repa-io.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, binary, bmp, bytestring, old-time, repa
-, stdenv, vector
+{ mkDerivation, base, binary, bmp, bytestring, lib, old-time, repa
+, vector
 }:
 mkDerivation {
   pname = "repa-io";
@@ -10,5 +10,5 @@
   ];
   homepage = "http://repa.ouroborus.net";
   description = "Read and write Repa arrays in various formats";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/repa.nix.golden b/test/golden-test-cases/repa.nix.golden
--- a/test/golden-test-cases/repa.nix.golden
+++ b/test/golden-test-cases/repa.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, bytestring, ghc-prim, QuickCheck, stdenv
+{ mkDerivation, base, bytestring, ghc-prim, lib, QuickCheck
 , template-haskell, vector
 }:
 mkDerivation {
@@ -10,5 +10,5 @@
   ];
   homepage = "http://repa.ouroborus.net";
   description = "High performance, regular, shape polymorphic parallel arrays";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/rosezipper.nix.golden b/test/golden-test-cases/rosezipper.nix.golden
--- a/test/golden-test-cases/rosezipper.nix.golden
+++ b/test/golden-test-cases/rosezipper.nix.golden
@@ -1,9 +1,9 @@
-{ mkDerivation, base, containers, stdenv }:
+{ mkDerivation, base, containers, lib }:
 mkDerivation {
   pname = "rosezipper";
   version = "0.2";
   sha256 = "deadbeef";
   libraryHaskellDepends = [ base containers ];
   description = "Generic zipper implementation for Data.Tree";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/rvar.nix.golden b/test/golden-test-cases/rvar.nix.golden
--- a/test/golden-test-cases/rvar.nix.golden
+++ b/test/golden-test-cases/rvar.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, MonadPrompt, mtl, random-source, stdenv
+{ mkDerivation, base, lib, MonadPrompt, mtl, random-source
 , transformers
 }:
 mkDerivation {
@@ -10,5 +10,5 @@
   ];
   homepage = "https://github.com/mokus0/random-fu";
   description = "Random Variables";
-  license = stdenv.lib.licenses.publicDomain;
+  license = lib.licenses.publicDomain;
 }
diff --git a/test/golden-test-cases/scalpel-core.nix.golden b/test/golden-test-cases/scalpel-core.nix.golden
--- a/test/golden-test-cases/scalpel-core.nix.golden
+++ b/test/golden-test-cases/scalpel-core.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, base, bytestring, containers, criterion
-, data-default, fail, HUnit, regex-base, regex-tdfa, stdenv
-, tagsoup, text, vector
+, data-default, fail, HUnit, lib, regex-base, regex-tdfa, tagsoup
+, text, vector
 }:
 mkDerivation {
   pname = "scalpel-core";
@@ -14,5 +14,5 @@
   benchmarkHaskellDepends = [ base criterion tagsoup text ];
   homepage = "https://github.com/fimad/scalpel";
   description = "A high level web scraping library for Haskell";
-  license = stdenv.lib.licenses.asl20;
+  license = lib.licenses.asl20;
 }
diff --git a/test/golden-test-cases/sdl2.nix.golden b/test/golden-test-cases/sdl2.nix.golden
--- a/test/golden-test-cases/sdl2.nix.golden
+++ b/test/golden-test-cases/sdl2.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, bytestring, exceptions, linear, SDL2
-, StateVar, stdenv, text, transformers, vector
+{ mkDerivation, base, bytestring, exceptions, lib, linear, SDL2
+, StateVar, text, transformers, vector
 }:
 mkDerivation {
   pname = "sdl2";
@@ -14,5 +14,5 @@
   librarySystemDepends = [ SDL2 ];
   libraryPkgconfigDepends = [ SDL2 ];
   description = "Both high- and low-level bindings to the SDL library (version 2.0.4+).";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/selda-sqlite.nix.golden b/test/golden-test-cases/selda-sqlite.nix.golden
--- a/test/golden-test-cases/selda-sqlite.nix.golden
+++ b/test/golden-test-cases/selda-sqlite.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, direct-sqlite, directory, exceptions, selda
-, stdenv, text
+{ mkDerivation, base, direct-sqlite, directory, exceptions, lib
+, selda, text
 }:
 mkDerivation {
   pname = "selda-sqlite";
@@ -10,5 +10,5 @@
   ];
   homepage = "https://github.com/valderman/selda";
   description = "SQLite backend for the Selda database EDSL";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/selda.nix.golden b/test/golden-test-cases/selda.nix.golden
--- a/test/golden-test-cases/selda.nix.golden
+++ b/test/golden-test-cases/selda.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, bytestring, exceptions, hashable, mtl
-, psqueues, stdenv, text, time, unordered-containers
+{ mkDerivation, base, bytestring, exceptions, hashable, lib, mtl
+, psqueues, text, time, unordered-containers
 }:
 mkDerivation {
   pname = "selda";
@@ -11,5 +11,5 @@
   ];
   homepage = "https://selda.link";
   description = "Type-safe, high-level EDSL for interacting with relational databases";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/servant-checked-exceptions.nix.golden b/test/golden-test-cases/servant-checked-exceptions.nix.golden
--- a/test/golden-test-cases/servant-checked-exceptions.nix.golden
+++ b/test/golden-test-cases/servant-checked-exceptions.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, aeson, base, bytestring, deepseq, doctest, Glob
-, hspec-wai, http-media, profunctors, servant, servant-client
-, servant-docs, servant-server, stdenv, tagged, tasty, tasty-hspec
+, hspec-wai, http-media, lib, profunctors, servant, servant-client
+, servant-docs, servant-server, tagged, tasty, tasty-hspec
 , tasty-hunit, text, wai
 }:
 mkDerivation {
@@ -19,5 +19,5 @@
   ];
   homepage = "https://github.com/cdepillabout/servant-checked-exceptions";
   description = "Checked exceptions for Servant APIs";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/set-cover.nix.golden b/test/golden-test-cases/set-cover.nix.golden
--- a/test/golden-test-cases/set-cover.nix.golden
+++ b/test/golden-test-cases/set-cover.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, containers, enummapset, psqueues, stdenv
+{ mkDerivation, base, containers, enummapset, lib, psqueues
 , utility-ht
 }:
 mkDerivation {
@@ -12,5 +12,5 @@
   ];
   homepage = "http://hub.darcs.net/thielema/set-cover/";
   description = "Solve exact set cover problems like Sudoku, 8 Queens, Soma Cube, Tetris Cube";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/sets.nix.golden b/test/golden-test-cases/sets.nix.golden
--- a/test/golden-test-cases/sets.nix.golden
+++ b/test/golden-test-cases/sets.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, base, commutative, composition, containers
-, contravariant, criterion, hashable, keys, mtl, QuickCheck
-, quickcheck-instances, semigroupoids, semigroups, stdenv, tasty
+, contravariant, criterion, hashable, keys, lib, mtl, QuickCheck
+, quickcheck-instances, semigroupoids, semigroups, tasty
 , tasty-hunit, tasty-quickcheck, transformers, transformers-base
 , unordered-containers, witherable
 }:
@@ -23,5 +23,5 @@
     unordered-containers
   ];
   description = "Ducktyped set interface for Haskell containers";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/simple-smt.nix.golden b/test/golden-test-cases/simple-smt.nix.golden
--- a/test/golden-test-cases/simple-smt.nix.golden
+++ b/test/golden-test-cases/simple-smt.nix.golden
@@ -1,9 +1,9 @@
-{ mkDerivation, base, process, stdenv }:
+{ mkDerivation, base, lib, process }:
 mkDerivation {
   pname = "simple-smt";
   version = "0.7.1";
   sha256 = "deadbeef";
   libraryHaskellDepends = [ base process ];
   description = "A simple way to interact with an SMT solver process";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/slack-web.nix.golden b/test/golden-test-cases/slack-web.nix.golden
--- a/test/golden-test-cases/slack-web.nix.golden
+++ b/test/golden-test-cases/slack-web.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, aeson, base, containers, errors, hspec
-, http-api-data, http-client, http-client-tls, megaparsec, mtl
-, servant, servant-client, stdenv, text, time, transformers
+, http-api-data, http-client, http-client-tls, lib, megaparsec, mtl
+, servant, servant-client, text, time, transformers
 }:
 mkDerivation {
   pname = "slack-web";
@@ -17,5 +17,5 @@
   ];
   homepage = "https://github.com/jpvillaisaza/slack-web";
   description = "Bindings for the Slack web API";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/slug.nix.golden b/test/golden-test-cases/slug.nix.golden
--- a/test/golden-test-cases/slug.nix.golden
+++ b/test/golden-test-cases/slug.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, aeson, base, exceptions, hspec, http-api-data
-, path-pieces, persistent, QuickCheck, stdenv, text
+{ mkDerivation, aeson, base, exceptions, hspec, http-api-data, lib
+, path-pieces, persistent, QuickCheck, text
 }:
 mkDerivation {
   pname = "slug";
@@ -14,5 +14,5 @@
   ];
   homepage = "https://github.com/mrkkrp/slug";
   description = "Type-safe slugs for Yesod ecosystem";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/soxlib.nix.golden b/test/golden-test-cases/soxlib.nix.golden
--- a/test/golden-test-cases/soxlib.nix.golden
+++ b/test/golden-test-cases/soxlib.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, base, bytestring, containers, explicit-exception
-, extensible-exceptions, sample-frame, sox, stdenv, storablevector
+, extensible-exceptions, lib, sample-frame, sox, storablevector
 , transformers, utility-ht
 }:
 mkDerivation {
@@ -15,5 +15,5 @@
   libraryPkgconfigDepends = [ sox ];
   homepage = "http://www.haskell.org/haskellwiki/Sox";
   description = "Write, read, convert audio signals using libsox";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/speedy-slice.nix.golden b/test/golden-test-cases/speedy-slice.nix.golden
--- a/test/golden-test-cases/speedy-slice.nix.golden
+++ b/test/golden-test-cases/speedy-slice.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, containers, kan-extensions, lens, mcmc-types
-, mwc-probability, pipes, primitive, stdenv, transformers
+{ mkDerivation, base, containers, kan-extensions, lens, lib
+, mcmc-types, mwc-probability, pipes, primitive, transformers
 }:
 mkDerivation {
   pname = "speedy-slice";
@@ -12,5 +12,5 @@
   testHaskellDepends = [ base containers mwc-probability ];
   homepage = "http://github.com/jtobin/speedy-slice";
   description = "Speedy slice sampling";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/splice.nix.golden b/test/golden-test-cases/splice.nix.golden
--- a/test/golden-test-cases/splice.nix.golden
+++ b/test/golden-test-cases/splice.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, network, stdenv }:
+{ mkDerivation, base, lib, network }:
 mkDerivation {
   pname = "splice";
   version = "0.6.1.1";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base network ];
   homepage = "http://corsis.github.com/splice/";
   description = "Cross-platform Socket to Socket Data Splicing";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/spreadsheet.nix.golden b/test/golden-test-cases/spreadsheet.nix.golden
--- a/test/golden-test-cases/spreadsheet.nix.golden
+++ b/test/golden-test-cases/spreadsheet.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, explicit-exception, stdenv, transformers
+{ mkDerivation, base, explicit-exception, lib, transformers
 , utility-ht
 }:
 mkDerivation {
@@ -12,5 +12,5 @@
   ];
   homepage = "http://www.haskell.org/haskellwiki/Spreadsheet";
   description = "Read and write spreadsheets from and to CSV files in a lazy way";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/stack-type.nix.golden b/test/golden-test-cases/stack-type.nix.golden
--- a/test/golden-test-cases/stack-type.nix.golden
+++ b/test/golden-test-cases/stack-type.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, stdenv, transformers }:
+{ mkDerivation, base, lib, transformers }:
 mkDerivation {
   pname = "stack-type";
   version = "0.1.0.0";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base transformers ];
   homepage = "https://github.com/aiya000/hs-stack-type";
   description = "The basic stack type";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/state-codes.nix.golden b/test/golden-test-cases/state-codes.nix.golden
--- a/test/golden-test-cases/state-codes.nix.golden
+++ b/test/golden-test-cases/state-codes.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, aeson, base, hspec, QuickCheck, shakespeare, stdenv
+{ mkDerivation, aeson, base, hspec, lib, QuickCheck, shakespeare
 , text
 }:
 mkDerivation {
@@ -9,5 +9,5 @@
   testHaskellDepends = [ aeson base hspec QuickCheck text ];
   homepage = "https://github.com/acamino/state-codes#README";
   description = "ISO 3166-2:US state codes and i18n names";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/stb-image-redux.nix.golden b/test/golden-test-cases/stb-image-redux.nix.golden
--- a/test/golden-test-cases/stb-image-redux.nix.golden
+++ b/test/golden-test-cases/stb-image-redux.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, hspec, stdenv, vector }:
+{ mkDerivation, base, hspec, lib, vector }:
 mkDerivation {
   pname = "stb-image-redux";
   version = "0.2.1.2";
@@ -7,5 +7,5 @@
   testHaskellDepends = [ base hspec vector ];
   homepage = "https://github.com/typedrat/stb-image-redux#readme";
   description = "Image loading and writing microlibrary";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/stm-containers.nix.golden b/test/golden-test-cases/stm-containers.nix.golden
--- a/test/golden-test-cases/stm-containers.nix.golden
+++ b/test/golden-test-cases/stm-containers.nix.golden
@@ -1,8 +1,8 @@
 { mkDerivation, async, base, base-prelude, containers, criterion
-, focus, free, hashable, hashtables, HTF, list-t, loch-th, mtl
+, focus, free, hashable, hashtables, HTF, lib, list-t, loch-th, mtl
 , mtl-prelude, mwc-random, mwc-random-monad, placeholders
-, primitive, QuickCheck, stdenv, text, transformers
-, unordered-containers, vector
+, primitive, QuickCheck, text, transformers, unordered-containers
+, vector
 }:
 mkDerivation {
   pname = "stm-containers";
@@ -23,5 +23,5 @@
   ];
   homepage = "https://github.com/nikita-volkov/stm-containers";
   description = "Containers for STM";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/streaming-commons.nix.golden b/test/golden-test-cases/streaming-commons.nix.golden
--- a/test/golden-test-cases/streaming-commons.nix.golden
+++ b/test/golden-test-cases/streaming-commons.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, array, async, base, blaze-builder, bytestring
-, criterion, deepseq, directory, hspec, network, process
-, QuickCheck, random, stdenv, stm, text, transformers, unix, zlib
+, criterion, deepseq, directory, hspec, lib, network, process
+, QuickCheck, random, stm, text, transformers, unix, zlib
 }:
 mkDerivation {
   pname = "streaming-commons";
@@ -19,5 +19,5 @@
   ];
   homepage = "https://github.com/fpco/streaming-commons";
   description = "Common lower-level functions needed by various streaming data libraries";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/strict-base-types.nix.golden b/test/golden-test-cases/strict-base-types.nix.golden
--- a/test/golden-test-cases/strict-base-types.nix.golden
+++ b/test/golden-test-cases/strict-base-types.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, aeson, base, bifunctors, binary, deepseq, ghc-prim
-, hashable, lens, QuickCheck, stdenv, strict
+, hashable, lens, lib, QuickCheck, strict
 }:
 mkDerivation {
   pname = "strict-base-types";
@@ -11,5 +11,5 @@
   ];
   homepage = "https://github.com/meiersi/strict-base-types";
   description = "Strict variants of the types provided in base";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/strict-types.nix.golden b/test/golden-test-cases/strict-types.nix.golden
--- a/test/golden-test-cases/strict-types.nix.golden
+++ b/test/golden-test-cases/strict-types.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, array, base, bytestring, containers, deepseq
-, hashable, stdenv, text, unordered-containers, vector
+, hashable, lib, text, unordered-containers, vector
 }:
 mkDerivation {
   pname = "strict-types";
@@ -11,5 +11,5 @@
   ];
   homepage = "https://github.com/pepeiborra/strict-types";
   description = "A type level predicate ranging over strict types";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/string-class.nix.golden b/test/golden-test-cases/string-class.nix.golden
--- a/test/golden-test-cases/string-class.nix.golden
+++ b/test/golden-test-cases/string-class.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, bytestring, stdenv, tagged, text }:
+{ mkDerivation, base, bytestring, lib, tagged, text }:
 mkDerivation {
   pname = "string-class";
   version = "0.1.6.5";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base bytestring tagged text ];
   homepage = "https://github.com/bairyn/string-class";
   description = "String class library";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/stripe-haskell.nix.golden b/test/golden-test-cases/stripe-haskell.nix.golden
--- a/test/golden-test-cases/stripe-haskell.nix.golden
+++ b/test/golden-test-cases/stripe-haskell.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, stdenv, stripe-core, stripe-http-streams }:
+{ mkDerivation, base, lib, stripe-core, stripe-http-streams }:
 mkDerivation {
   pname = "stripe-haskell";
   version = "2.2.3";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base stripe-core stripe-http-streams ];
   homepage = "https://github.com/dmjio/stripe";
   description = "Stripe API for Haskell";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/svg-tree.nix.golden b/test/golden-test-cases/svg-tree.nix.golden
--- a/test/golden-test-cases/svg-tree.nix.golden
+++ b/test/golden-test-cases/svg-tree.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, attoparsec, base, bytestring, containers
-, JuicyPixels, lens, linear, mtl, scientific, stdenv, text
+, JuicyPixels, lens, lib, linear, mtl, scientific, text
 , transformers, vector, xml
 }:
 mkDerivation {
@@ -11,5 +11,5 @@
     scientific text transformers vector xml
   ];
   description = "SVG file loader and serializer";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/swagger.nix.golden b/test/golden-test-cases/swagger.nix.golden
--- a/test/golden-test-cases/swagger.nix.golden
+++ b/test/golden-test-cases/swagger.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, aeson, base, bytestring, stdenv, tasty, tasty-hunit
+{ mkDerivation, aeson, base, bytestring, lib, tasty, tasty-hunit
 , text, time, transformers
 }:
 mkDerivation {
@@ -11,5 +11,5 @@
   testHaskellDepends = [ aeson base bytestring tasty tasty-hunit ];
   description = "Implementation of swagger data model";
   license = "unknown";
-  hydraPlatforms = stdenv.lib.platforms.none;
+  hydraPlatforms = lib.platforms.none;
 }
diff --git a/test/golden-test-cases/system-argv0.nix.golden b/test/golden-test-cases/system-argv0.nix.golden
--- a/test/golden-test-cases/system-argv0.nix.golden
+++ b/test/golden-test-cases/system-argv0.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, bytestring, stdenv, system-filepath, text }:
+{ mkDerivation, base, bytestring, lib, system-filepath, text }:
 mkDerivation {
   pname = "system-argv0";
   version = "0.1.1";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base bytestring system-filepath text ];
   homepage = "https://john-millikin.com/software/haskell-filesystem/";
   description = "Get argv[0] as a FilePath";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/system-fileio.nix.golden b/test/golden-test-cases/system-fileio.nix.golden
--- a/test/golden-test-cases/system-fileio.nix.golden
+++ b/test/golden-test-cases/system-fileio.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, bytestring, chell, stdenv, system-filepath
+{ mkDerivation, base, bytestring, chell, lib, system-filepath
 , temporary, text, time, transformers, unix
 }:
 mkDerivation {
@@ -14,5 +14,5 @@
   ];
   homepage = "https://github.com/fpco/haskell-filesystem";
   description = "Consistent filesystem interaction across GHC versions (deprecated)";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/system-filepath.nix.golden b/test/golden-test-cases/system-filepath.nix.golden
--- a/test/golden-test-cases/system-filepath.nix.golden
+++ b/test/golden-test-cases/system-filepath.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, base, bytestring, chell, chell-quickcheck, deepseq
-, QuickCheck, stdenv, text
+, lib, QuickCheck, text
 }:
 mkDerivation {
   pname = "system-filepath";
@@ -11,5 +11,5 @@
   ];
   homepage = "https://github.com/fpco/haskell-filesystem";
   description = "High-level, byte-based file and directory path manipulations (deprecated)";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/tagged.nix.golden b/test/golden-test-cases/tagged.nix.golden
--- a/test/golden-test-cases/tagged.nix.golden
+++ b/test/golden-test-cases/tagged.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, deepseq, stdenv, template-haskell
-, transformers, transformers-compat
+{ mkDerivation, base, deepseq, lib, template-haskell, transformers
+, transformers-compat
 }:
 mkDerivation {
   pname = "tagged";
@@ -10,5 +10,5 @@
   ];
   homepage = "http://github.com/ekmett/tagged";
   description = "Haskell 98 phantom types to avoid unsafely passing dummy arguments";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/taggy.nix.golden b/test/golden-test-cases/taggy.nix.golden
--- a/test/golden-test-cases/taggy.nix.golden
+++ b/test/golden-test-cases/taggy.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, attoparsec, base, blaze-html, blaze-markup
-, criterion, directory, hspec, hspec-attoparsec, stdenv, tagsoup
-, text, unordered-containers, vector
+, criterion, directory, hspec, hspec-attoparsec, lib, tagsoup, text
+, unordered-containers, vector
 }:
 mkDerivation {
   pname = "taggy";
@@ -23,5 +23,5 @@
   ];
   homepage = "http://github.com/alpmestan/taggy";
   description = "Efficient and simple HTML/XML parsing library";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/tagstream-conduit.nix.golden b/test/golden-test-cases/tagstream-conduit.nix.golden
--- a/test/golden-test-cases/tagstream-conduit.nix.golden
+++ b/test/golden-test-cases/tagstream-conduit.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, attoparsec, base, blaze-builder, bytestring
 , case-insensitive, conduit, conduit-extra, data-default, hspec
-, HUnit, QuickCheck, resourcet, stdenv, text, transformers
+, HUnit, lib, QuickCheck, resourcet, text, transformers
 , xml-conduit
 }:
 mkDerivation {
@@ -16,5 +16,5 @@
   ];
   homepage = "http://github.com/yihuang/tagstream-conduit";
   description = "streamlined html tag parser";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/tasty-hedgehog.nix.golden b/test/golden-test-cases/tasty-hedgehog.nix.golden
--- a/test/golden-test-cases/tasty-hedgehog.nix.golden
+++ b/test/golden-test-cases/tasty-hedgehog.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, hedgehog, stdenv, tagged, tasty
+{ mkDerivation, base, hedgehog, lib, tagged, tasty
 , tasty-expected-failure
 }:
 mkDerivation {
@@ -11,5 +11,5 @@
   ];
   homepage = "https://github.com/qfpl/tasty-hedghog";
   description = "Integrates the hedgehog testing library with the tasty testing framework";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/tasty-rerun.nix.golden b/test/golden-test-cases/tasty-rerun.nix.golden
--- a/test/golden-test-cases/tasty-rerun.nix.golden
+++ b/test/golden-test-cases/tasty-rerun.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, containers, mtl, optparse-applicative
-, reducers, split, stdenv, stm, tagged, tasty, transformers
+{ mkDerivation, base, containers, lib, mtl, optparse-applicative
+, reducers, split, stm, tagged, tasty, transformers
 }:
 mkDerivation {
   pname = "tasty-rerun";
@@ -11,5 +11,5 @@
   ];
   homepage = "http://github.com/ocharles/tasty-rerun";
   description = "Run tests by filtering the test tree depending on the result of previous test runs";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/tce-conf.nix.golden b/test/golden-test-cases/tce-conf.nix.golden
--- a/test/golden-test-cases/tce-conf.nix.golden
+++ b/test/golden-test-cases/tce-conf.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, containers, HUnit, stdenv }:
+{ mkDerivation, base, containers, HUnit, lib }:
 mkDerivation {
   pname = "tce-conf";
   version = "1.3";
@@ -10,5 +10,5 @@
   testHaskellDepends = [ base containers HUnit ];
   homepage = "http://hub.darcs.net/dino/tce-conf";
   description = "Very simple config file reading";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/terminal-progress-bar.nix.golden b/test/golden-test-cases/terminal-progress-bar.nix.golden
--- a/test/golden-test-cases/terminal-progress-bar.nix.golden
+++ b/test/golden-test-cases/terminal-progress-bar.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, HUnit, stdenv, stm, stm-chans, test-framework
+{ mkDerivation, base, HUnit, lib, stm, stm-chans, test-framework
 , test-framework-hunit
 }:
 mkDerivation {
@@ -13,5 +13,5 @@
   ];
   homepage = "https://github.com/roelvandijk/terminal-progress-bar";
   description = "A simple progress bar in the terminal";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/test-fixture.nix.golden b/test/golden-test-cases/test-fixture.nix.golden
--- a/test/golden-test-cases/test-fixture.nix.golden
+++ b/test/golden-test-cases/test-fixture.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, base, data-default-class, exceptions
-, haskell-src-exts, haskell-src-meta, hspec, hspec-discover, mtl
-, stdenv, template-haskell, th-orphans, transformers
+, haskell-src-exts, haskell-src-meta, hspec, hspec-discover, lib
+, mtl, template-haskell, th-orphans, transformers
 }:
 mkDerivation {
   pname = "test-fixture";
@@ -16,5 +16,5 @@
   testToolDepends = [ hspec-discover ];
   homepage = "http://github.com/cjdev/test-fixture#readme";
   description = "Test monadic side-effects";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/texmath.nix.golden b/test/golden-test-cases/texmath.nix.golden
--- a/test/golden-test-cases/texmath.nix.golden
+++ b/test/golden-test-cases/texmath.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, base, bytestring, containers, directory, filepath
-, mtl, pandoc-types, parsec, process, split, stdenv, syb, temporary
+, lib, mtl, pandoc-types, parsec, process, split, syb, temporary
 , text, utf8-string, xml
 }:
 mkDerivation {
diff --git a/test/golden-test-cases/text-icu.nix.golden b/test/golden-test-cases/text-icu.nix.golden
--- a/test/golden-test-cases/text-icu.nix.golden
+++ b/test/golden-test-cases/text-icu.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, array, base, bytestring, deepseq, directory
-, ghc-prim, HUnit, icu, QuickCheck, random, stdenv, test-framework
+, ghc-prim, HUnit, icu, lib, QuickCheck, random, test-framework
 , test-framework-hunit, test-framework-quickcheck2, text
 }:
 mkDerivation {
@@ -15,5 +15,5 @@
   ];
   homepage = "https://github.com/bos/text-icu";
   description = "Bindings to the ICU library";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/text-postgresql.nix.golden b/test/golden-test-cases/text-postgresql.nix.golden
--- a/test/golden-test-cases/text-postgresql.nix.golden
+++ b/test/golden-test-cases/text-postgresql.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, dlist, QuickCheck, quickcheck-simple, stdenv
+{ mkDerivation, base, dlist, lib, QuickCheck, quickcheck-simple
 , transformers, transformers-compat
 }:
 mkDerivation {
@@ -11,5 +11,5 @@
   testHaskellDepends = [ base QuickCheck quickcheck-simple ];
   homepage = "http://khibino.github.io/haskell-relational-record/";
   description = "Parser and Printer of PostgreSQL extended types";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/th-expand-syns.nix.golden b/test/golden-test-cases/th-expand-syns.nix.golden
--- a/test/golden-test-cases/th-expand-syns.nix.golden
+++ b/test/golden-test-cases/th-expand-syns.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, containers, stdenv, syb, template-haskell }:
+{ mkDerivation, base, containers, lib, syb, template-haskell }:
 mkDerivation {
   pname = "th-expand-syns";
   version = "0.4.4.0";
@@ -7,5 +7,5 @@
   testHaskellDepends = [ base template-haskell ];
   homepage = "https://github.com/DanielSchuessler/th-expand-syns";
   description = "Expands type synonyms in Template Haskell ASTs";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/these.nix.golden b/test/golden-test-cases/these.nix.golden
--- a/test/golden-test-cases/these.nix.golden
+++ b/test/golden-test-cases/these.nix.golden
@@ -1,7 +1,7 @@
 { mkDerivation, aeson, base, bifunctors, binary, containers
-, data-default-class, deepseq, hashable, keys, mtl, profunctors
-, QuickCheck, quickcheck-instances, semigroupoids, stdenv, tasty
-, tasty-quickcheck, transformers, transformers-compat
+, data-default-class, deepseq, hashable, keys, lib, mtl
+, profunctors, QuickCheck, quickcheck-instances, semigroupoids
+, tasty, tasty-quickcheck, transformers, transformers-compat
 , unordered-containers, vector, vector-instances
 }:
 mkDerivation {
@@ -20,5 +20,5 @@
   ];
   homepage = "https://github.com/isomorphism/these";
   description = "An either-or-both data type & a generalized 'zip with padding' typeclass";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/timezone-series.nix.golden b/test/golden-test-cases/timezone-series.nix.golden
--- a/test/golden-test-cases/timezone-series.nix.golden
+++ b/test/golden-test-cases/timezone-series.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, deepseq, stdenv, time }:
+{ mkDerivation, base, deepseq, lib, time }:
 mkDerivation {
   pname = "timezone-series";
   version = "0.1.8";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base deepseq time ];
   homepage = "http://projects.haskell.org/time-ng/";
   description = "Enhanced timezone handling for Data.Time";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/transformers-compat.nix.golden b/test/golden-test-cases/transformers-compat.nix.golden
--- a/test/golden-test-cases/transformers-compat.nix.golden
+++ b/test/golden-test-cases/transformers-compat.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, ghc-prim, stdenv, transformers }:
+{ mkDerivation, base, ghc-prim, lib, transformers }:
 mkDerivation {
   pname = "transformers-compat";
   version = "0.5.1.4";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base ghc-prim transformers ];
   homepage = "http://github.com/ekmett/transformers-compat/";
   description = "A small compatibility shim exposing the new types from transformers 0.3 and 0.4 to older Haskell platforms.";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/transformers-lift.nix.golden b/test/golden-test-cases/transformers-lift.nix.golden
--- a/test/golden-test-cases/transformers-lift.nix.golden
+++ b/test/golden-test-cases/transformers-lift.nix.golden
@@ -1,5 +1,4 @@
-{ mkDerivation, base, stdenv, transformers, writer-cps-transformers
-}:
+{ mkDerivation, base, lib, transformers, writer-cps-transformers }:
 mkDerivation {
   pname = "transformers-lift";
   version = "0.2.0.1";
@@ -8,5 +7,5 @@
     base transformers writer-cps-transformers
   ];
   description = "Ad-hoc type classes for lifting";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/tree-fun.nix.golden b/test/golden-test-cases/tree-fun.nix.golden
--- a/test/golden-test-cases/tree-fun.nix.golden
+++ b/test/golden-test-cases/tree-fun.nix.golden
@@ -1,9 +1,9 @@
-{ mkDerivation, base, containers, mtl, stdenv }:
+{ mkDerivation, base, containers, lib, mtl }:
 mkDerivation {
   pname = "tree-fun";
   version = "0.8.1.0";
   sha256 = "deadbeef";
   libraryHaskellDepends = [ base containers mtl ];
   description = "Library for functions pertaining to tree exploration and manipulation";
-  license = stdenv.lib.licenses.gpl3;
+  license = lib.licenses.gpl3;
 }
diff --git a/test/golden-test-cases/ttrie.nix.golden b/test/golden-test-cases/ttrie.nix.golden
--- a/test/golden-test-cases/ttrie.nix.golden
+++ b/test/golden-test-cases/ttrie.nix.golden
@@ -1,7 +1,7 @@
 { mkDerivation, async, atomic-primops, base, bifunctors, containers
-, criterion-plus, deepseq, hashable, mwc-random, primitive
-, QuickCheck, stdenv, stm, stm-containers, stm-stats
-, test-framework, test-framework-quickcheck2, text, transformers
+, criterion-plus, deepseq, hashable, lib, mwc-random, primitive
+, QuickCheck, stm, stm-containers, stm-stats, test-framework
+, test-framework-quickcheck2, text, transformers
 , unordered-containers, vector
 }:
 mkDerivation {
@@ -22,5 +22,5 @@
   ];
   homepage = "http://github.com/mcschroeder/ttrie";
   description = "Contention-free STM hash map";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/tuple-th.nix.golden b/test/golden-test-cases/tuple-th.nix.golden
--- a/test/golden-test-cases/tuple-th.nix.golden
+++ b/test/golden-test-cases/tuple-th.nix.golden
@@ -1,9 +1,9 @@
-{ mkDerivation, base, containers, stdenv, template-haskell }:
+{ mkDerivation, base, containers, lib, template-haskell }:
 mkDerivation {
   pname = "tuple-th";
   version = "0.2.5";
   sha256 = "deadbeef";
   libraryHaskellDepends = [ base containers template-haskell ];
   description = "Generate (non-recursive) utility functions for tuples of statically known size";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/tuples-homogenous-h98.nix.golden b/test/golden-test-cases/tuples-homogenous-h98.nix.golden
--- a/test/golden-test-cases/tuples-homogenous-h98.nix.golden
+++ b/test/golden-test-cases/tuples-homogenous-h98.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, stdenv }:
+{ mkDerivation, base, lib }:
 mkDerivation {
   pname = "tuples-homogenous-h98";
   version = "0.1.1.0";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base ];
   homepage = "https://github.com/ppetr/tuples-homogenous-h98";
   description = "Wrappers for n-ary tuples with Traversable and Applicative/Monad instances";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/turtle-options.nix.golden b/test/golden-test-cases/turtle-options.nix.golden
--- a/test/golden-test-cases/turtle-options.nix.golden
+++ b/test/golden-test-cases/turtle-options.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, HUnit, optional-args, parsec, stdenv, text
+{ mkDerivation, base, HUnit, lib, optional-args, parsec, text
 , turtle
 }:
 mkDerivation {
@@ -12,5 +12,5 @@
   testHaskellDepends = [ base HUnit parsec ];
   homepage = "https://github.com/elaye/turtle-options#readme";
   description = "Collection of command line options and parsers for these options";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/type-operators.nix.golden b/test/golden-test-cases/type-operators.nix.golden
--- a/test/golden-test-cases/type-operators.nix.golden
+++ b/test/golden-test-cases/type-operators.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, ghc-prim, stdenv }:
+{ mkDerivation, base, ghc-prim, lib }:
 mkDerivation {
   pname = "type-operators";
   version = "0.1.0.4";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base ghc-prim ];
   homepage = "https://github.com/Shou/type-operators#readme";
   description = "Various type-level operators";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/type-spec.nix.golden b/test/golden-test-cases/type-spec.nix.golden
--- a/test/golden-test-cases/type-spec.nix.golden
+++ b/test/golden-test-cases/type-spec.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, pretty, stdenv }:
+{ mkDerivation, base, lib, pretty }:
 mkDerivation {
   pname = "type-spec";
   version = "0.3.0.1";
@@ -7,5 +7,5 @@
   testHaskellDepends = [ base ];
   homepage = "https://github.com/sheyll/type-spec#readme";
   description = "Type Level Specification by Example";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/unicode-show.nix.golden b/test/golden-test-cases/unicode-show.nix.golden
--- a/test/golden-test-cases/unicode-show.nix.golden
+++ b/test/golden-test-cases/unicode-show.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, HUnit, QuickCheck, stdenv, test-framework
+{ mkDerivation, base, HUnit, lib, QuickCheck, test-framework
 , test-framework-hunit, test-framework-quickcheck2
 }:
 mkDerivation {
@@ -12,5 +12,5 @@
   ];
   homepage = "http://github.com/nushio3/unicode-show#readme";
   description = "print and show in unicode";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/unique.nix.golden b/test/golden-test-cases/unique.nix.golden
--- a/test/golden-test-cases/unique.nix.golden
+++ b/test/golden-test-cases/unique.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, ghc-prim, hashable, stdenv }:
+{ mkDerivation, base, ghc-prim, hashable, lib }:
 mkDerivation {
   pname = "unique";
   version = "0";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base ghc-prim hashable ];
   homepage = "http://github.com/ekmett/unique/";
   description = "Fully concurrent unique identifiers";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/unix-bytestring.nix.golden b/test/golden-test-cases/unix-bytestring.nix.golden
--- a/test/golden-test-cases/unix-bytestring.nix.golden
+++ b/test/golden-test-cases/unix-bytestring.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, bytestring, stdenv }:
+{ mkDerivation, base, bytestring, lib }:
 mkDerivation {
   pname = "unix-bytestring";
   version = "0.3.7.3";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base bytestring ];
   homepage = "http://code.haskell.org/~wren/";
   description = "Unix/Posix-specific functions for ByteStrings";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/unlit.nix.golden b/test/golden-test-cases/unlit.nix.golden
--- a/test/golden-test-cases/unlit.nix.golden
+++ b/test/golden-test-cases/unlit.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, directory, stdenv, text }:
+{ mkDerivation, base, directory, lib, text }:
 mkDerivation {
   pname = "unlit";
   version = "0.4.0.0";
@@ -8,5 +8,5 @@
   libraryHaskellDepends = [ base directory text ];
   executableHaskellDepends = [ base directory text ];
   description = "Tool to convert literate code between styles or to code";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/utility-ht.nix.golden b/test/golden-test-cases/utility-ht.nix.golden
--- a/test/golden-test-cases/utility-ht.nix.golden
+++ b/test/golden-test-cases/utility-ht.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, QuickCheck, stdenv }:
+{ mkDerivation, base, lib, QuickCheck }:
 mkDerivation {
   pname = "utility-ht";
   version = "0.0.14";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base ];
   testHaskellDepends = [ base QuickCheck ];
   description = "Various small helper functions for Lists, Maybes, Tuples, Functions";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/validity-aeson.nix.golden b/test/golden-test-cases/validity-aeson.nix.golden
--- a/test/golden-test-cases/validity-aeson.nix.golden
+++ b/test/golden-test-cases/validity-aeson.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, aeson, base, stdenv, validity, validity-scientific
+{ mkDerivation, aeson, base, lib, validity, validity-scientific
 , validity-text, validity-unordered-containers, validity-vector
 }:
 mkDerivation {
@@ -11,5 +11,5 @@
   ];
   homepage = "https://github.com/NorfairKing/validity#readme";
   description = "Validity instances for aeson";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/validity-containers.nix.golden b/test/golden-test-cases/validity-containers.nix.golden
--- a/test/golden-test-cases/validity-containers.nix.golden
+++ b/test/golden-test-cases/validity-containers.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, containers, stdenv, validity }:
+{ mkDerivation, base, containers, lib, validity }:
 mkDerivation {
   pname = "validity-containers";
   version = "0.2.0.0";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base containers validity ];
   homepage = "https://github.com/NorfairKing/validity#readme";
   description = "Validity instances for containers";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/vector-mmap.nix.golden b/test/golden-test-cases/vector-mmap.nix.golden
--- a/test/golden-test-cases/vector-mmap.nix.golden
+++ b/test/golden-test-cases/vector-mmap.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, mmap, primitive, QuickCheck, stdenv
-, temporary, vector
+{ mkDerivation, base, lib, mmap, primitive, QuickCheck, temporary
+, vector
 }:
 mkDerivation {
   pname = "vector-mmap";
@@ -9,5 +9,5 @@
   testHaskellDepends = [ base QuickCheck temporary vector ];
   homepage = "http://github.com/pumpkin/vector-mmap";
   description = "Memory map immutable and mutable vectors";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/vivid-supercollider.nix.golden b/test/golden-test-cases/vivid-supercollider.nix.golden
--- a/test/golden-test-cases/vivid-supercollider.nix.golden
+++ b/test/golden-test-cases/vivid-supercollider.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, binary, bytestring, cereal, microspec
-, QuickCheck, split, stdenv, utf8-string, vivid-osc
+{ mkDerivation, base, binary, bytestring, cereal, lib, microspec
+, QuickCheck, split, utf8-string, vivid-osc
 }:
 mkDerivation {
   pname = "vivid-supercollider";
diff --git a/test/golden-test-cases/vty.nix.golden b/test/golden-test-cases/vty.nix.golden
--- a/test/golden-test-cases/vty.nix.golden
+++ b/test/golden-test-cases/vty.nix.golden
@@ -1,7 +1,7 @@
 { mkDerivation, base, blaze-builder, bytestring, Cabal, containers
-, deepseq, directory, filepath, hashable, HUnit, microlens
+, deepseq, directory, filepath, hashable, HUnit, lib, microlens
 , microlens-mtl, microlens-th, mtl, parallel, parsec, QuickCheck
-, quickcheck-assertions, random, smallcheck, stdenv, stm, string-qq
+, quickcheck-assertions, random, smallcheck, stm, string-qq
 , terminfo, test-framework, test-framework-hunit
 , test-framework-smallcheck, text, transformers, unix, utf8-string
 , vector
@@ -29,5 +29,5 @@
   ];
   homepage = "https://github.com/jtdaugherty/vty";
   description = "A simple terminal UI library";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/wai-cors.nix.golden b/test/golden-test-cases/wai-cors.nix.golden
--- a/test/golden-test-cases/wai-cors.nix.golden
+++ b/test/golden-test-cases/wai-cors.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, attoparsec, base, base-unicode-symbols, bytestring
-, case-insensitive, directory, filepath, http-types, mtl, network
-, process, stdenv, tasty, tasty-hunit, text, transformers, wai
+, case-insensitive, directory, filepath, http-types, lib, mtl
+, network, process, tasty, tasty-hunit, text, transformers, wai
 , wai-extra, wai-websockets, warp, websockets
 }:
 mkDerivation {
@@ -19,5 +19,5 @@
   ];
   homepage = "https://github.com/larskuhtz/wai-cors";
   description = "CORS for WAI";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/wai-middleware-auth.nix.golden b/test/golden-test-cases/wai-middleware-auth.nix.golden
--- a/test/golden-test-cases/wai-middleware-auth.nix.golden
+++ b/test/golden-test-cases/wai-middleware-auth.nix.golden
@@ -2,9 +2,9 @@
 , blaze-builder, blaze-html, bytestring, case-insensitive, cereal
 , clientsession, cookie, exceptions, hoauth2, http-client
 , http-client-tls, http-conduit, http-reverse-proxy, http-types
-, optparse-simple, regex-posix, safe-exceptions, shakespeare
-, stdenv, text, unix-compat, unordered-containers, uri-bytestring
-, vault, wai, wai-app-static, wai-extra, warp, yaml
+, lib, optparse-simple, regex-posix, safe-exceptions, shakespeare
+, text, unix-compat, unordered-containers, uri-bytestring, vault
+, wai, wai-app-static, wai-extra, warp, yaml
 }:
 mkDerivation {
   pname = "wai-middleware-auth";
@@ -24,5 +24,5 @@
     base bytestring cereal clientsession optparse-simple warp
   ];
   description = "Authentication middleware that secures WAI application";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/wai-middleware-caching-redis.nix.golden b/test/golden-test-cases/wai-middleware-caching-redis.nix.golden
--- a/test/golden-test-cases/wai-middleware-caching-redis.nix.golden
+++ b/test/golden-test-cases/wai-middleware-caching-redis.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, base, blaze-builder, bytestring, hedis, http-types
-, stdenv, text, wai, wai-middleware-caching
+, lib, text, wai, wai-middleware-caching
 }:
 mkDerivation {
   pname = "wai-middleware-caching-redis";
@@ -12,5 +12,5 @@
   testHaskellDepends = [ base ];
   homepage = "http://github.com/yogsototh/wai-middleware-caching/tree/master/wai-middleware-caching-redis#readme";
   description = "Cache Wai Middleware using Redis backend";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/wai-middleware-prometheus.nix.golden b/test/golden-test-cases/wai-middleware-prometheus.nix.golden
--- a/test/golden-test-cases/wai-middleware-prometheus.nix.golden
+++ b/test/golden-test-cases/wai-middleware-prometheus.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, base, bytestring, clock, data-default, doctest
-, http-types, prometheus-client, stdenv, text, wai
+, http-types, lib, prometheus-client, text, wai
 }:
 mkDerivation {
   pname = "wai-middleware-prometheus";
@@ -12,5 +12,5 @@
   testHaskellDepends = [ base doctest prometheus-client ];
   homepage = "https://github.com/fimad/prometheus-haskell";
   description = "WAI middlware for exposing http://prometheus.io metrics.";
-  license = stdenv.lib.licenses.asl20;
+  license = lib.licenses.asl20;
 }
diff --git a/test/golden-test-cases/warp.nix.golden b/test/golden-test-cases/warp.nix.golden
--- a/test/golden-test-cases/warp.nix.golden
+++ b/test/golden-test-cases/warp.nix.golden
@@ -1,10 +1,10 @@
 { mkDerivation, array, async, auto-update, base, blaze-builder
 , bytestring, bytestring-builder, case-insensitive, containers
 , criterion, directory, doctest, ghc-prim, hashable, hspec, HTTP
-, http-date, http-types, http2, HUnit, iproute, lifted-base
-, network, process, QuickCheck, silently, simple-sendfile, stdenv
-, stm, streaming-commons, text, time, transformers, unix
-, unix-compat, vault, wai, word8
+, http-date, http-types, http2, HUnit, iproute, lib, lifted-base
+, network, process, QuickCheck, silently, simple-sendfile, stm
+, streaming-commons, text, time, transformers, unix, unix-compat
+, vault, wai, word8
 }:
 mkDerivation {
   pname = "warp";
@@ -30,5 +30,5 @@
   ];
   homepage = "http://github.com/yesodweb/wai";
   description = "A fast, light-weight web server for WAI applications";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/weigh.nix.golden b/test/golden-test-cases/weigh.nix.golden
--- a/test/golden-test-cases/weigh.nix.golden
+++ b/test/golden-test-cases/weigh.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, deepseq, mtl, process, split, stdenv
+{ mkDerivation, base, deepseq, lib, mtl, process, split
 , template-haskell, temporary
 }:
 mkDerivation {
@@ -11,5 +11,5 @@
   testHaskellDepends = [ base deepseq ];
   homepage = "https://github.com/fpco/weigh#readme";
   description = "Measure allocations of a Haskell functions/values";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/xml-hamlet.nix.golden b/test/golden-test-cases/xml-hamlet.nix.golden
--- a/test/golden-test-cases/xml-hamlet.nix.golden
+++ b/test/golden-test-cases/xml-hamlet.nix.golden
@@ -1,5 +1,5 @@
-{ mkDerivation, base, containers, hspec, HUnit, parsec, shakespeare
-, stdenv, template-haskell, text, xml-conduit
+{ mkDerivation, base, containers, hspec, HUnit, lib, parsec
+, shakespeare, template-haskell, text, xml-conduit
 }:
 mkDerivation {
   pname = "xml-hamlet";
@@ -15,5 +15,5 @@
   ];
   homepage = "http://www.yesodweb.com/";
   description = "Hamlet-style quasiquoter for XML content";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/xmonad-contrib.nix.golden b/test/golden-test-cases/xmonad-contrib.nix.golden
--- a/test/golden-test-cases/xmonad-contrib.nix.golden
+++ b/test/golden-test-cases/xmonad-contrib.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, base, bytestring, containers, directory
-, extensible-exceptions, filepath, mtl, old-locale, old-time
-, process, random, stdenv, unix, utf8-string, X11, X11-xft, xmonad
+, extensible-exceptions, filepath, lib, mtl, old-locale, old-time
+, process, random, unix, utf8-string, X11, X11-xft, xmonad
 }:
 mkDerivation {
   pname = "xmonad-contrib";
@@ -13,5 +13,5 @@
   ];
   homepage = "http://xmonad.org/";
   description = "Third party extensions for xmonad";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/yahoo-finance-api.nix.golden b/test/golden-test-cases/yahoo-finance-api.nix.golden
--- a/test/golden-test-cases/yahoo-finance-api.nix.golden
+++ b/test/golden-test-cases/yahoo-finance-api.nix.golden
@@ -1,6 +1,6 @@
 { mkDerivation, aeson, base, doctest, either, Glob, hspec
-, http-api-data, http-client, http-client-tls, mtl, safe, servant
-, servant-client, stdenv, text, time, transformers, vector
+, http-api-data, http-client, http-client-tls, lib, mtl, safe
+, servant, servant-client, text, time, transformers, vector
 }:
 mkDerivation {
   pname = "yahoo-finance-api";
@@ -16,5 +16,5 @@
   ];
   homepage = "https://github.com/cdepillabout/yahoo-finance-api";
   description = "Read quotes from Yahoo Finance API";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
diff --git a/test/golden-test-cases/yesod-form-bootstrap4.nix.golden b/test/golden-test-cases/yesod-form-bootstrap4.nix.golden
--- a/test/golden-test-cases/yesod-form-bootstrap4.nix.golden
+++ b/test/golden-test-cases/yesod-form-bootstrap4.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, classy-prelude-yesod, stdenv, yesod-form }:
+{ mkDerivation, base, classy-prelude-yesod, lib, yesod-form }:
 mkDerivation {
   pname = "yesod-form-bootstrap4";
   version = "0.1.0.2";
@@ -6,5 +6,5 @@
   libraryHaskellDepends = [ base classy-prelude-yesod yesod-form ];
   homepage = "https://github.com/ncaq/yesod-form-bootstrap4#readme";
   description = "renderBootstrap4";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/yesod-gitrepo.nix.golden b/test/golden-test-cases/yesod-gitrepo.nix.golden
--- a/test/golden-test-cases/yesod-gitrepo.nix.golden
+++ b/test/golden-test-cases/yesod-gitrepo.nix.golden
@@ -1,5 +1,5 @@
 { mkDerivation, base, directory, enclosed-exceptions, http-types
-, lifted-base, process, stdenv, temporary, text, wai, yesod-core
+, lib, lifted-base, process, temporary, text, wai, yesod-core
 }:
 mkDerivation {
   pname = "yesod-gitrepo";
@@ -11,5 +11,5 @@
   ];
   homepage = "https://github.com/snoyberg/yesod-gitrepo";
   description = "Host content provided by a Git repo";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/yesod-recaptcha2.nix.golden b/test/golden-test-cases/yesod-recaptcha2.nix.golden
--- a/test/golden-test-cases/yesod-recaptcha2.nix.golden
+++ b/test/golden-test-cases/yesod-recaptcha2.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, classy-prelude-yesod, http-conduit, stdenv
+{ mkDerivation, base, classy-prelude-yesod, http-conduit, lib
 , yesod-auth
 }:
 mkDerivation {
@@ -10,5 +10,5 @@
   ];
   homepage = "https://github.com/ncaq/yesod-recaptcha2#readme";
   description = "yesod recaptcha2";
-  license = stdenv.lib.licenses.mit;
+  license = lib.licenses.mit;
 }
diff --git a/test/golden-test-cases/zlib.nix.golden b/test/golden-test-cases/zlib.nix.golden
--- a/test/golden-test-cases/zlib.nix.golden
+++ b/test/golden-test-cases/zlib.nix.golden
@@ -1,4 +1,4 @@
-{ mkDerivation, base, bytestring, QuickCheck, stdenv, tasty
+{ mkDerivation, base, bytestring, lib, QuickCheck, tasty
 , tasty-hunit, tasty-quickcheck, zlib
 }:
 mkDerivation {
@@ -11,5 +11,5 @@
     base bytestring QuickCheck tasty tasty-hunit tasty-quickcheck
   ];
   description = "Compression and decompression in the gzip and zlib formats";
-  license = stdenv.lib.licenses.bsd3;
+  license = lib.licenses.bsd3;
 }
