about summary refs log tree commit diff
path: root/pkgs/applications/graphics
diff options
context:
space:
mode:
authorBen Siraphob <bensiraphob@gmail.com>2021-01-15 20:21:58 +0700
committerBen Siraphob <bensiraphob@gmail.com>2021-01-16 17:58:11 +0700
commitbadf51221db8fae81bf9948c39eaf8342dfd5597 (patch)
tree34eeb35ca97f0b081da465e9ddd6c120a9d2b7df /pkgs/applications/graphics
parenta9bb54359eeedf2594fdf191de5b673fd1dd102d (diff)
treewide: stdenv.lib -> lib
Diffstat (limited to 'pkgs/applications/graphics')
-rw-r--r--pkgs/applications/graphics/ahoviewer/default.nix2
-rw-r--r--pkgs/applications/graphics/apitrace/default.nix2
-rw-r--r--pkgs/applications/graphics/autopanosiftc/default.nix6
-rw-r--r--pkgs/applications/graphics/autotrace/default.nix2
-rw-r--r--pkgs/applications/graphics/avocode/default.nix2
-rw-r--r--pkgs/applications/graphics/c3d/default.nix2
-rw-r--r--pkgs/applications/graphics/comical/default.nix8
-rw-r--r--pkgs/applications/graphics/darktable/default.nix10
-rw-r--r--pkgs/applications/graphics/dia/default.nix6
-rw-r--r--pkgs/applications/graphics/displaycal/default.nix8
-rw-r--r--pkgs/applications/graphics/djview/default.nix4
-rw-r--r--pkgs/applications/graphics/dosage/default.nix4
-rw-r--r--pkgs/applications/graphics/exrdisplay/default.nix6
-rw-r--r--pkgs/applications/graphics/f3d/default.nix4
-rw-r--r--pkgs/applications/graphics/feh/default.nix4
-rw-r--r--pkgs/applications/graphics/fluxus/default.nix2
-rw-r--r--pkgs/applications/graphics/freepv/default.nix4
-rw-r--r--pkgs/applications/graphics/fstl/default.nix2
-rw-r--r--pkgs/applications/graphics/gcolor2/default.nix8
-rw-r--r--pkgs/applications/graphics/geeqie/default.nix2
-rw-r--r--pkgs/applications/graphics/gimp/plugins/default.nix4
-rw-r--r--pkgs/applications/graphics/gimp/wrapper.nix2
-rw-r--r--pkgs/applications/graphics/glabels/default.nix2
-rw-r--r--pkgs/applications/graphics/gnome-photos/default.nix2
-rw-r--r--pkgs/applications/graphics/gocr/default.nix6
-rw-r--r--pkgs/applications/graphics/grafx2/default.nix6
-rw-r--r--pkgs/applications/graphics/graphicsmagick/compat.nix6
-rw-r--r--pkgs/applications/graphics/graphicsmagick/default.nix8
-rw-r--r--pkgs/applications/graphics/gscan2pdf/default.nix4
-rw-r--r--pkgs/applications/graphics/gthumb/default.nix2
-rw-r--r--pkgs/applications/graphics/guetzli/default.nix8
-rw-r--r--pkgs/applications/graphics/inkscape/default.nix6
-rw-r--r--pkgs/applications/graphics/ipe/default.nix8
-rw-r--r--pkgs/applications/graphics/kodelife/default.nix4
-rw-r--r--pkgs/applications/graphics/krop/default.nix8
-rw-r--r--pkgs/applications/graphics/lazpaint/default.nix2
-rw-r--r--pkgs/applications/graphics/lightburn/default.nix6
-rw-r--r--pkgs/applications/graphics/meh/default.nix6
-rw-r--r--pkgs/applications/graphics/minidjvu/default.nix8
-rw-r--r--pkgs/applications/graphics/mozjpeg/default.nix8
-rw-r--r--pkgs/applications/graphics/mtpaint/default.nix8
-rw-r--r--pkgs/applications/graphics/nomacs/default.nix2
-rw-r--r--pkgs/applications/graphics/ocrfeeder/default.nix4
-rw-r--r--pkgs/applications/graphics/openscad/default.nix14
-rw-r--r--pkgs/applications/graphics/opentoonz/default.nix6
-rw-r--r--pkgs/applications/graphics/panotools/default.nix6
-rw-r--r--pkgs/applications/graphics/photoqt/default.nix6
-rw-r--r--pkgs/applications/graphics/pinta/default.nix10
-rw-r--r--pkgs/applications/graphics/qscreenshot/default.nix2
-rw-r--r--pkgs/applications/graphics/rapid-photo-downloader/default.nix4
-rw-r--r--pkgs/applications/graphics/rawtherapee/default.nix8
-rw-r--r--pkgs/applications/graphics/rx/default.nix4
-rw-r--r--pkgs/applications/graphics/sane/backends/brscan4/default.nix12
-rw-r--r--pkgs/applications/graphics/sane/backends/brscan4/udev_rules_type1.nix8
-rw-r--r--pkgs/applications/graphics/sane/backends/dsseries/default.nix8
-rw-r--r--pkgs/applications/graphics/sane/backends/generic.nix10
-rw-r--r--pkgs/applications/graphics/sane/config.nix4
-rw-r--r--pkgs/applications/graphics/sane/frontends.nix2
-rw-r--r--pkgs/applications/graphics/sane/xsane.nix10
-rw-r--r--pkgs/applications/graphics/scantailor/default.nix8
-rw-r--r--pkgs/applications/graphics/screencloud/default.nix10
-rw-r--r--pkgs/applications/graphics/shotwell/default.nix2
-rw-r--r--pkgs/applications/graphics/smartdeblur/default.nix8
-rw-r--r--pkgs/applications/graphics/sxiv/default.nix8
-rw-r--r--pkgs/applications/graphics/tesseract/tesseract3.nix8
-rw-r--r--pkgs/applications/graphics/tesseract/tesseract4.nix8
-rw-r--r--pkgs/applications/graphics/tesseract/wrapper.nix4
-rw-r--r--pkgs/applications/graphics/unigine-valley/default.nix8
-rw-r--r--pkgs/applications/graphics/wings/default.nix8
-rw-r--r--pkgs/applications/graphics/write_stylus/default.nix2
-rw-r--r--pkgs/applications/graphics/xaos/default.nix4
-rw-r--r--pkgs/applications/graphics/xfractint/default.nix8
-rw-r--r--pkgs/applications/graphics/xournal/default.nix4
-rw-r--r--pkgs/applications/graphics/xournalpp/default.nix2
-rw-r--r--pkgs/applications/graphics/zgrviewer/default.nix8
75 files changed, 211 insertions, 211 deletions
diff --git a/pkgs/applications/graphics/ahoviewer/default.nix b/pkgs/applications/graphics/ahoviewer/default.nix
index a994ae271c9c3..ec146767a6aeb 100644
--- a/pkgs/applications/graphics/ahoviewer/default.nix
+++ b/pkgs/applications/graphics/ahoviewer/default.nix
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
     gst_all_1.gst-plugins-good
     gst_all_1.gst-libav
     gst_all_1.gst-plugins-base
-  ] ++ stdenv.lib.optional useUnrar unrar;
+  ] ++ lib.optional useUnrar unrar;
 
   NIX_LDFLAGS = "-lpthread";
 
diff --git a/pkgs/applications/graphics/apitrace/default.nix b/pkgs/applications/graphics/apitrace/default.nix
index 462962d9e188b..f842cf6f5c4b8 100644
--- a/pkgs/applications/graphics/apitrace/default.nix
+++ b/pkgs/applications/graphics/apitrace/default.nix
@@ -52,7 +52,7 @@ stdenv.mkDerivation rec {
     for i in $out/bin/eglretrace $out/bin/glretrace
     do
       echo "Patching RPath for $i"
-      patchelf --set-rpath "${stdenv.lib.makeLibraryPath [libglvnd]}:$(patchelf --print-rpath $i)" $i
+      patchelf --set-rpath "${lib.makeLibraryPath [libglvnd]}:$(patchelf --print-rpath $i)" $i
     done
 
     wrapQtApp $out/bin/qapitrace
diff --git a/pkgs/applications/graphics/autopanosiftc/default.nix b/pkgs/applications/graphics/autopanosiftc/default.nix
index 5c649b384c789..129e3e5476914 100644
--- a/pkgs/applications/graphics/autopanosiftc/default.nix
+++ b/pkgs/applications/graphics/autopanosiftc/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, cmake, libpng, libtiff, libjpeg, panotools, libxml2 }:
+{lib, stdenv, fetchurl, cmake, libpng, libtiff, libjpeg, panotools, libxml2 }:
 
 stdenv.mkDerivation {
   name = "autopano-sift-C-2.5.1";
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = "http://hugin.sourceforge.net/";
     description = "Implementation in C of the autopano-sift algorithm for automatically stitching panoramas";
-    license = stdenv.lib.licenses.gpl2;
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/graphics/autotrace/default.nix b/pkgs/applications/graphics/autotrace/default.nix
index 54cc09a4d18f0..5e8e1e63344b5 100644
--- a/pkgs/applications/graphics/autotrace/default.nix
+++ b/pkgs/applications/graphics/autotrace/default.nix
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
   autofig = callPackage ./autofig.nix {};
   nativeBuildInputs = [ autoreconfHook glib autofig pkgconfig gettext ];
   buildInputs = [ libpng12 imagemagick pstoedit ]
-    ++ stdenv.lib.optionals stdenv.isDarwin
+    ++ lib.optionals stdenv.isDarwin
        (with darwin.apple_sdk.frameworks; [ gd ApplicationServices ]);
 
   postUnpack = ''
diff --git a/pkgs/applications/graphics/avocode/default.nix b/pkgs/applications/graphics/avocode/default.nix
index 65fc56f81b1c0..7627d79554a52 100644
--- a/pkgs/applications/graphics/avocode/default.nix
+++ b/pkgs/applications/graphics/avocode/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "06xf5y2mljk3pd74ap9n90bhhidbzpg5c6wws361ygd4f3x86c46";
   };
 
-  libPath = stdenv.lib.makeLibraryPath (with xorg; [
+  libPath = lib.makeLibraryPath (with xorg; [
     stdenv.cc.cc.lib
     at-spi2-core.out
     gdk-pixbuf
diff --git a/pkgs/applications/graphics/c3d/default.nix b/pkgs/applications/graphics/c3d/default.nix
index 4317cc78cda3b..0a4ed515511c0 100644
--- a/pkgs/applications/graphics/c3d/default.nix
+++ b/pkgs/applications/graphics/c3d/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ itk4 ]
-    ++ stdenv.lib.optional stdenv.isDarwin Cocoa;
+    ++ lib.optional stdenv.isDarwin Cocoa;
 
   meta = with lib; {
     homepage = "https://github.com/pyushkevich/c3d";
diff --git a/pkgs/applications/graphics/comical/default.nix b/pkgs/applications/graphics/comical/default.nix
index 800709de054a5..5c6ec804e62c8 100644
--- a/pkgs/applications/graphics/comical/default.nix
+++ b/pkgs/applications/graphics/comical/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, wxGTK, util-linux, zlib }:
+{lib, stdenv, fetchurl, wxGTK, util-linux, zlib }:
 
 stdenv.mkDerivation rec {
   name = "comical-0.8";
@@ -16,8 +16,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Viewer of CBR and CBZ files, often used to store scanned comics";
     homepage = "http://comical.sourceforge.net/";
-    license = stdenv.lib.licenses.gpl2Plus;
-    maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; linux;
+    license = lib.licenses.gpl2Plus;
+    maintainers = with lib.maintainers; [viric];
+    platforms = with lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/graphics/darktable/default.nix b/pkgs/applications/graphics/darktable/default.nix
index c93b94ee18360..550b23173fce2 100644
--- a/pkgs/applications/graphics/darktable/default.nix
+++ b/pkgs/applications/graphics/darktable/default.nix
@@ -22,14 +22,14 @@ stdenv.mkDerivation rec {
     libgphoto2 libjpeg libpng librsvg libtiff openexr sqlite libxslt
     libsoup graphicsmagick json-glib openjpeg lua pugixml
     libwebp libsecret gnome3.adwaita-icon-theme osm-gps-map pcre isocodes
-  ] ++ stdenv.lib.optionals stdenv.isLinux [
+  ] ++ lib.optionals stdenv.isLinux [
     colord colord-gtk libX11 ocl-icd
-  ] ++ stdenv.lib.optional stdenv.isDarwin gtk-mac-integration
-    ++ stdenv.lib.optional stdenv.cc.isClang llvmPackages.openmp;
+  ] ++ lib.optional stdenv.isDarwin gtk-mac-integration
+    ++ lib.optional stdenv.cc.isClang llvmPackages.openmp;
 
   cmakeFlags = [
     "-DBUILD_USERMANUAL=False"
-  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+  ] ++ lib.optionals stdenv.isDarwin [
     "-DUSE_COLORD=OFF"
     "-DUSE_KWALLET=OFF"
   ];
@@ -41,7 +41,7 @@ stdenv.mkDerivation rec {
   # the wrappers:
   preFixup = let
     libPathEnvVar = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH";
-    libPathPrefix = "$out/lib/darktable" + stdenv.lib.optionalString stdenv.isLinux ":${ocl-icd}/lib";
+    libPathPrefix = "$out/lib/darktable" + lib.optionalString stdenv.isLinux ":${ocl-icd}/lib";
   in ''
     for f in $out/share/darktable/kernels/*.cl; do
       sed -r "s|#include \"(.*)\"|#include \"$out/share/darktable/kernels/\1\"|g" -i "$f"
diff --git a/pkgs/applications/graphics/dia/default.nix b/pkgs/applications/graphics/dia/default.nix
index da6047a025666..2648828cfdcd6 100644
--- a/pkgs/applications/graphics/dia/default.nix
+++ b/pkgs/applications/graphics/dia/default.nix
@@ -16,8 +16,8 @@ stdenv.mkDerivation {
   buildInputs =
     [ gtk2 libxml2 gettext python libxml2Python docbook5
       libxslt docbook_xsl libart_lgpl ]
-      ++ stdenv.lib.optional withGNOME libgnomeui
-      ++ stdenv.lib.optional stdenv.isDarwin gtk-mac-integration-gtk2;
+      ++ lib.optional withGNOME libgnomeui
+      ++ lib.optional stdenv.isDarwin gtk-mac-integration-gtk2;
 
   nativeBuildInputs = [ autoconf automake libtool pkgconfig intltool ]
     ++ (with perlPackages; [ perl XMLParser ]);
@@ -25,7 +25,7 @@ stdenv.mkDerivation {
   preConfigure = ''
     NOCONFIGURE=1 ./autogen.sh # autoreconfHook is not enough
   '';
-  configureFlags = stdenv.lib.optional withGNOME "--enable-gnome";
+  configureFlags = lib.optional withGNOME "--enable-gnome";
 
   hardeningDisable = [ "format" ];
 
diff --git a/pkgs/applications/graphics/displaycal/default.nix b/pkgs/applications/graphics/displaycal/default.nix
index 5b324a5974d7c..9437d04108c21 100644
--- a/pkgs/applications/graphics/displaycal/default.nix
+++ b/pkgs/applications/graphics/displaycal/default.nix
@@ -1,5 +1,5 @@
 { python2
-, stdenv
+, lib, stdenv
 , fetchurl
 , pkgconfig
 , libXext
@@ -65,8 +65,8 @@ in buildPythonApplication rec {
   meta = {
     description = "Display Calibration and Characterization powered by Argyll CMS";
     homepage = "https://displaycal.net/";
-    license = stdenv.lib.licenses.gpl3;
-    maintainers = [stdenv.lib.maintainers.marcweber];
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.gpl3;
+    maintainers = [lib.maintainers.marcweber];
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/graphics/djview/default.nix b/pkgs/applications/graphics/djview/default.nix
index a7fc17ce29b10..1b475df92a63f 100644
--- a/pkgs/applications/graphics/djview/default.nix
+++ b/pkgs/applications/graphics/djview/default.nix
@@ -29,7 +29,7 @@ mkDerivation rec {
     qtbase
     xorg.libXt
     libtiff
-  ] ++ stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.AGL;
+  ] ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.AGL;
 
   configureFlags = [
     "--disable-silent-rules"
@@ -37,7 +37,7 @@ mkDerivation rec {
     "--with-x"
     "--with-tiff"
     # NOTE: 2019-09-19: experimental "--enable-npdjvu" fails
-  ] ++ stdenv.lib.optional stdenv.isDarwin "--enable-mac";
+  ] ++ lib.optional stdenv.isDarwin "--enable-mac";
 
   passthru = {
     mozillaPlugin = "/lib/mozilla/plugins";
diff --git a/pkgs/applications/graphics/dosage/default.nix b/pkgs/applications/graphics/dosage/default.nix
index b491c3e3ead09..b2997c2c474a0 100644
--- a/pkgs/applications/graphics/dosage/default.nix
+++ b/pkgs/applications/graphics/dosage/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, python3Packages, fetchFromGitHub }:
+{ lib, stdenv, python3Packages, fetchFromGitHub }:
 
 python3Packages.buildPythonApplication rec {
   pname = "dosage";
@@ -23,6 +23,6 @@ python3Packages.buildPythonApplication rec {
   meta = {
     description = "A comic strip downloader and archiver";
     homepage = "https://dosage.rocks/";
-    license = stdenv.lib.licenses.mit;
+    license = lib.licenses.mit;
   };
 }
diff --git a/pkgs/applications/graphics/exrdisplay/default.nix b/pkgs/applications/graphics/exrdisplay/default.nix
index 7841e9d571b74..12e4ec4496dc0 100644
--- a/pkgs/applications/graphics/exrdisplay/default.nix
+++ b/pkgs/applications/graphics/exrdisplay/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, fltk, openexr, libGLU, libGL, ctl }:
+{ lib, stdenv, fetchurl, pkgconfig, fltk, openexr, libGLU, libGL, ctl }:
 
 stdenv.mkDerivation {
   name ="openexr_viewers-2.2.1";
@@ -22,7 +22,7 @@ stdenv.mkDerivation {
   meta = {
     description = "Application for viewing OpenEXR images on a display at various exposure settings";
     homepage = "http://openexr.com";
-    platforms = stdenv.lib.platforms.linux;
-    license = stdenv.lib.licenses.bsd3;
+    platforms = lib.platforms.linux;
+    license = lib.licenses.bsd3;
   };
 }
diff --git a/pkgs/applications/graphics/f3d/default.nix b/pkgs/applications/graphics/f3d/default.nix
index e90d0e13f2254..2e01af5c4fc40 100644
--- a/pkgs/applications/graphics/f3d/default.nix
+++ b/pkgs/applications/graphics/f3d/default.nix
@@ -15,8 +15,8 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake ];
 
   buildInputs = [ vtk_9 ]
-    ++ stdenv.lib.optionals stdenv.isLinux [ libGL libX11 ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa OpenGL ];
+    ++ lib.optionals stdenv.isLinux [ libGL libX11 ]
+    ++ lib.optionals stdenv.isDarwin [ Cocoa OpenGL ];
 
   meta = with lib; {
     description = "Fast and minimalist 3D viewer using VTK";
diff --git a/pkgs/applications/graphics/feh/default.nix b/pkgs/applications/graphics/feh/default.nix
index a7d26f5300a6d..e1a488a4c27d0 100644
--- a/pkgs/applications/graphics/feh/default.nix
+++ b/pkgs/applications/graphics/feh/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchurl, makeWrapper
+{ lib, stdenv, fetchurl, makeWrapper
 , xorg, imlib2, libjpeg, libpng
 , curl, libexif, jpegexiforient, perlPackages
 , enableAutoreload ? !stdenv.hostPlatform.isDarwin }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "feh";
diff --git a/pkgs/applications/graphics/fluxus/default.nix b/pkgs/applications/graphics/fluxus/default.nix
index 05260dc9812a2..acec5293101fc 100644
--- a/pkgs/applications/graphics/fluxus/default.nix
+++ b/pkgs/applications/graphics/fluxus/default.nix
@@ -76,7 +76,7 @@ stdenv.mkDerivation rec {
     "RacketPrefix=${racket}"
     "RacketInclude=${racket}/include/racket"
     "RacketLib=${racket}/lib/racket"
-    "LIBPATH=${stdenv.lib.makeLibraryPath libs}"
+    "LIBPATH=${lib.makeLibraryPath libs}"
     "DESTDIR=build"
   ];
   configurePhase = ''
diff --git a/pkgs/applications/graphics/freepv/default.nix b/pkgs/applications/graphics/freepv/default.nix
index a0356d1298180..bf990c4d0ef82 100644
--- a/pkgs/applications/graphics/freepv/default.nix
+++ b/pkgs/applications/graphics/freepv/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libjpeg, libGLU, libGL, freeglut, zlib, cmake, libX11, libxml2, libpng,
+{ lib, stdenv, fetchurl, libjpeg, libGLU, libGL, freeglut, zlib, cmake, libX11, libxml2, libpng,
   libXxf86vm }:
 
 stdenv.mkDerivation {
@@ -30,6 +30,6 @@ stdenv.mkDerivation {
   meta = {
     description = "Open source panorama viewer using GL";
     homepage = "http://freepv.sourceforge.net/";
-    license = [ stdenv.lib.licenses.lgpl21 ];
+    license = [ lib.licenses.lgpl21 ];
   };
 }
diff --git a/pkgs/applications/graphics/fstl/default.nix b/pkgs/applications/graphics/fstl/default.nix
index e7eb2c4f92acd..c6b77300cb312 100644
--- a/pkgs/applications/graphics/fstl/default.nix
+++ b/pkgs/applications/graphics/fstl/default.nix
@@ -14,7 +14,7 @@ mkDerivation rec {
     qmake qt/fstl.pro
   '';
 
-  postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
+  postInstall = lib.optionalString stdenv.isDarwin ''
     mkdir -p $out/Applications
     mv fstl.app $out/Applications
   '';
diff --git a/pkgs/applications/graphics/gcolor2/default.nix b/pkgs/applications/graphics/gcolor2/default.nix
index f585a0c5d29c1..34391754e7f07 100644
--- a/pkgs/applications/graphics/gcolor2/default.nix
+++ b/pkgs/applications/graphics/gcolor2/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, gtk2, perlPackages, pkgconfig } :
+{lib, stdenv, fetchurl, gtk2, perlPackages, pkgconfig } :
 
 let version = "0.4"; in
 stdenv.mkDerivation {
@@ -27,8 +27,8 @@ stdenv.mkDerivation {
   meta = {
     description = "Simple GTK 2 color selector";
     homepage = "http://gcolor2.sourceforge.net/";
-    license = stdenv.lib.licenses.gpl2Plus;
-    maintainers = with stdenv.lib.maintainers; [ notthemessiah ];
-    platforms = with stdenv.lib.platforms; unix;
+    license = lib.licenses.gpl2Plus;
+    maintainers = with lib.maintainers; [ notthemessiah ];
+    platforms = with lib.platforms; unix;
   };
 }
diff --git a/pkgs/applications/graphics/geeqie/default.nix b/pkgs/applications/graphics/geeqie/default.nix
index 7167700c244c9..f107d492434f3 100644
--- a/pkgs/applications/graphics/geeqie/default.nix
+++ b/pkgs/applications/graphics/geeqie/default.nix
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
     # Allow geeqie to find exiv2 and exiftran, necessary to
     # losslessly rotate JPEG images.
     sed -i $out/lib/geeqie/geeqie-rotate \
-        -e '1 a export PATH=${stdenv.lib.makeBinPath [ exiv2 fbida ]}:$PATH'
+        -e '1 a export PATH=${lib.makeBinPath [ exiv2 fbida ]}:$PATH'
   '';
 
   enableParallelBuilding = true;
diff --git a/pkgs/applications/graphics/gimp/plugins/default.nix b/pkgs/applications/graphics/gimp/plugins/default.nix
index c2e8a47420eba..b2a5b771211cc 100644
--- a/pkgs/applications/graphics/gimp/plugins/default.nix
+++ b/pkgs/applications/graphics/gimp/plugins/default.nix
@@ -189,9 +189,9 @@ in
 
       homepage = "http://lensfun.sebastiankraft.net/";
 
-      license = stdenv.lib.licenses.gpl3Plus;
+      license = lib.licenses.gpl3Plus;
       maintainers = [ ];
-      platforms = stdenv.lib.platforms.gnu ++ stdenv.lib.platforms.linux;
+      platforms = lib.platforms.gnu ++ lib.platforms.linux;
     };
   };
 
diff --git a/pkgs/applications/graphics/gimp/wrapper.nix b/pkgs/applications/graphics/gimp/wrapper.nix
index 7e8ce913f0220..094dcf0703e43 100644
--- a/pkgs/applications/graphics/gimp/wrapper.nix
+++ b/pkgs/applications/graphics/gimp/wrapper.nix
@@ -4,7 +4,7 @@ let
 allPlugins = lib.filter (pkg: lib.isDerivation pkg && !pkg.meta.broken or false) (lib.attrValues gimpPlugins);
 selectedPlugins = lib.filter (pkg: pkg != gimpPlugins.gimp) (if plugins == null then allPlugins else plugins);
 extraArgs = map (x: x.wrapArgs or "") selectedPlugins;
-versionBranch = stdenv.lib.versions.majorMinor gimp.version;
+versionBranch = lib.versions.majorMinor gimp.version;
 
 in symlinkJoin {
   name = "gimp-with-plugins-${gimp.version}";
diff --git a/pkgs/applications/graphics/glabels/default.nix b/pkgs/applications/graphics/glabels/default.nix
index c6b7b60c98e81..37387e2a72055 100644
--- a/pkgs/applications/graphics/glabels/default.nix
+++ b/pkgs/applications/graphics/glabels/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
   version = "3.4.1";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0f2rki8i27pkd9r0gz03cdl1g4vnmvp0j49nhxqn275vi8lmgr0q";
   };
 
diff --git a/pkgs/applications/graphics/gnome-photos/default.nix b/pkgs/applications/graphics/gnome-photos/default.nix
index 425762fdaa966..b292314301719 100644
--- a/pkgs/applications/graphics/gnome-photos/default.nix
+++ b/pkgs/applications/graphics/gnome-photos/default.nix
@@ -41,7 +41,7 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "installedTests" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1i64w69kk3sdf9vn7npnwrhy8qjwn0vizq200x3pgmbrfm3kjzv6";
   };
 
diff --git a/pkgs/applications/graphics/gocr/default.nix b/pkgs/applications/graphics/gocr/default.nix
index 7c586374ec513..3c87e62e3d668 100644
--- a/pkgs/applications/graphics/gocr/default.nix
+++ b/pkgs/applications/graphics/gocr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, tk }:
+{ lib, stdenv, fetchurl, tk }:
 
 stdenv.mkDerivation rec {
   name = "gocr-0.52";
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://jocr.sourceforge.net/";
     description = "GPL Optical Character Recognition";
-    license = stdenv.lib.licenses.gpl2;
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/graphics/grafx2/default.nix b/pkgs/applications/graphics/grafx2/default.nix
index 2a2a6a6759891..961cc7e49f7f0 100644
--- a/pkgs/applications/graphics/grafx2/default.nix
+++ b/pkgs/applications/graphics/grafx2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, SDL, SDL_image, SDL_ttf, zlib, libpng, pkgconfig, lua5 }:
+{ lib, stdenv, fetchurl, SDL, SDL_image, SDL_ttf, zlib, libpng, pkgconfig, lua5 }:
 
 stdenv.mkDerivation rec {
 
@@ -22,8 +22,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Bitmap paint program inspired by the Amiga programs Deluxe Paint and Brilliance";
     homepage = "http://pulkomandy.tk/projects/GrafX2";
-    license = stdenv.lib.licenses.gpl2;
+    license = lib.licenses.gpl2;
     platforms = [ "x86_64-linux" "i686-linux" ];
-    maintainers = [ stdenv.lib.maintainers.zoomulator ];
+    maintainers = [ lib.maintainers.zoomulator ];
   };
 }
diff --git a/pkgs/applications/graphics/graphicsmagick/compat.nix b/pkgs/applications/graphics/graphicsmagick/compat.nix
index 9517aa78ee461..b715093308fab 100644
--- a/pkgs/applications/graphics/graphicsmagick/compat.nix
+++ b/pkgs/applications/graphics/graphicsmagick/compat.nix
@@ -1,4 +1,4 @@
-{ stdenv, graphicsmagick }:
+{ lib, stdenv, graphicsmagick }:
 
 stdenv.mkDerivation {
   pname = "graphicsmagick-imagemagick-compat";
@@ -31,7 +31,7 @@ stdenv.mkDerivation {
 
   meta = {
     description = "ImageMagick interface for GraphicsMagick";
-    license = stdenv.lib.licenses.free;
-    platforms = stdenv.lib.platforms.all;
+    license = lib.licenses.free;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/applications/graphics/graphicsmagick/default.nix b/pkgs/applications/graphics/graphicsmagick/default.nix
index b8b21e71c9308..5916cdd3b4a09 100644
--- a/pkgs/applications/graphics/graphicsmagick/default.nix
+++ b/pkgs/applications/graphics/graphicsmagick/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, bzip2, freetype, graphviz, ghostscript
+{ lib, stdenv, fetchurl, bzip2, freetype, graphviz, ghostscript
 , libjpeg, libpng, libtiff, libxml2, zlib, libtool, xz, libX11
 , libwebp, quantumdepth ? 8, fixDarwinDylibNames }:
 
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
     ];
 
   nativeBuildInputs = [ xz ]
-    ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+    ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
 
   postInstall = ''
     sed -i 's/-ltiff.*'\'/\'/ $out/bin/*
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://www.graphicsmagick.org";
     description = "Swiss army knife of image processing";
-    license = stdenv.lib.licenses.mit;
-    platforms = stdenv.lib.platforms.all;
+    license = lib.licenses.mit;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/applications/graphics/gscan2pdf/default.nix b/pkgs/applications/graphics/gscan2pdf/default.nix
index 5125df7b7dae3..30c211498279a 100644
--- a/pkgs/applications/graphics/gscan2pdf/default.nix
+++ b/pkgs/applications/graphics/gscan2pdf/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perlPackages, wrapGAppsHook,
+{ lib, stdenv, fetchurl, perlPackages, wrapGAppsHook,
   # libs
   librsvg, sane-backends, sane-frontends,
   # runtime dependencies
@@ -6,7 +6,7 @@
   # test dependencies
   xvfb_run, liberation_ttf, file, tesseract }:
 
-with stdenv.lib;
+with lib;
 
 perlPackages.buildPerlPackage rec {
   pname = "gscan2pdf";
diff --git a/pkgs/applications/graphics/gthumb/default.nix b/pkgs/applications/graphics/gthumb/default.nix
index c97e28c9f9afb..538e665be2505 100644
--- a/pkgs/applications/graphics/gthumb/default.nix
+++ b/pkgs/applications/graphics/gthumb/default.nix
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
   version = "3.10.1";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0gm7q6n9lnjsdqpx5b0cqjayhzwnplqb6p5pshzhbfp2zqd2g9ss";
   };
 
diff --git a/pkgs/applications/graphics/guetzli/default.nix b/pkgs/applications/graphics/guetzli/default.nix
index ccddf907e94cc..d888e55ed3d40 100644
--- a/pkgs/applications/graphics/guetzli/default.nix
+++ b/pkgs/applications/graphics/guetzli/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, libpng, fetchFromGitHub, pkgconfig }:
+{ lib, stdenv, libpng, fetchFromGitHub, pkgconfig }:
 let
   version = "1.0.1";
 in
@@ -23,8 +23,8 @@ stdenv.mkDerivation {
     description = "Perceptual JPEG encoder";
     longDescription = "Guetzli is a JPEG encoder that aims for excellent compression density at high visual quality.";
     homepage = "https://github.com/google/guetzli";
-    license = stdenv.lib.licenses.asl20;
-    platforms = stdenv.lib.platforms.x86_64;
-    maintainers = [ stdenv.lib.maintainers.seppeljordan ];
+    license = lib.licenses.asl20;
+    platforms = lib.platforms.x86_64;
+    maintainers = [ lib.maintainers.seppeljordan ];
   };
 }
diff --git a/pkgs/applications/graphics/inkscape/default.nix b/pkgs/applications/graphics/inkscape/default.nix
index be89d32e722a9..d70e3c5f0d599 100644
--- a/pkgs/applications/graphics/inkscape/default.nix
+++ b/pkgs/applications/graphics/inkscape/default.nix
@@ -122,15 +122,15 @@ stdenv.mkDerivation rec {
     potrace
     python3Env
     zlib
-  ] ++ stdenv.lib.optionals (!stdenv.isDarwin) [
+  ] ++ lib.optionals (!stdenv.isDarwin) [
     gtkspell3
-  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+  ] ++ lib.optionals stdenv.isDarwin [
     cairo
     gtk-mac-integration
   ];
 
   # Make sure PyXML modules can be found at run-time.
-  postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
+  postInstall = lib.optionalString stdenv.isDarwin ''
     install_name_tool -change $out/lib/libinkscape_base.dylib $out/lib/inkscape/libinkscape_base.dylib $out/bin/inkscape
     install_name_tool -change $out/lib/libinkscape_base.dylib $out/lib/inkscape/libinkscape_base.dylib $out/bin/inkview
   '';
diff --git a/pkgs/applications/graphics/ipe/default.nix b/pkgs/applications/graphics/ipe/default.nix
index 6a2a8dbc18fe9..161260bcea949 100644
--- a/pkgs/applications/graphics/ipe/default.nix
+++ b/pkgs/applications/graphics/ipe/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper, pkgconfig, zlib, freetype, cairo, lua5, texlive, ghostscript
+{ lib, stdenv, fetchurl, makeWrapper, pkgconfig, zlib, freetype, cairo, lua5, texlive, ghostscript
 , libjpeg, libpng, qtbase, mkDerivation
 }:
 
@@ -31,13 +31,13 @@ mkDerivation rec {
   meta = {
     description = "An editor for drawing figures";
     homepage = "http://ipe.otfried.org";
-    license = stdenv.lib.licenses.gpl3Plus;
+    license = lib.licenses.gpl3Plus;
     longDescription = ''
       Ipe is an extensible drawing editor for creating figures in PDF and Postscript format.
       It supports making small figures for inclusion into LaTeX-documents
       as well as presentations in PDF.
     '';
-    maintainers = [ stdenv.lib.maintainers.ttuegel ];
-    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ lib.maintainers.ttuegel ];
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/graphics/kodelife/default.nix b/pkgs/applications/graphics/kodelife/default.nix
index 80abca80f87f0..4eaab036eb95c 100644
--- a/pkgs/applications/graphics/kodelife/default.nix
+++ b/pkgs/applications/graphics/kodelife/default.nix
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
   '';
 
   preFixup = let
-    libPath = stdenv.lib.makeLibraryPath [
+    libPath = lib.makeLibraryPath [
       stdenv.cc.cc.lib
       alsaLib
       glib
@@ -49,7 +49,7 @@ stdenv.mkDerivation rec {
       libGLU libGL
       xorg.libX11
     ];
-  in stdenv.lib.optionalString (!stdenv.isDarwin) ''
+  in lib.optionalString (!stdenv.isDarwin) ''
     patchelf \
       --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
       --set-rpath "${libPath}" \
diff --git a/pkgs/applications/graphics/krop/default.nix b/pkgs/applications/graphics/krop/default.nix
index ee49067697709..314e4c6ec140f 100644
--- a/pkgs/applications/graphics/krop/default.nix
+++ b/pkgs/applications/graphics/krop/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, python3Packages, libsForQt5, ghostscript, qt5}:
+{ lib, stdenv, fetchFromGitHub, python3Packages, libsForQt5, ghostscript, qt5}:
 
 python3Packages.buildPythonApplication rec {
   pname = "krop";
@@ -44,8 +44,8 @@ python3Packages.buildPythonApplication rec {
     your eReader does not support convenient scrolling. Krop also has a command line
     interface.
     '';
-    license = stdenv.lib.licenses.gpl3Plus;
-    maintainers = with stdenv.lib.maintainers; [ leenaars ];
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.gpl3Plus;
+    maintainers = with lib.maintainers; [ leenaars ];
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/graphics/lazpaint/default.nix b/pkgs/applications/graphics/lazpaint/default.nix
index 2756414d30dee..4dae4dd3f9aa3 100644
--- a/pkgs/applications/graphics/lazpaint/default.nix
+++ b/pkgs/applications/graphics/lazpaint/default.nix
@@ -55,7 +55,7 @@ in stdenv.mkDerivation rec {
 
     # Python is needed for scripts
     makeWrapper $out/share/lazpaint/lazpaint $out/bin/lazpaint \
-      --prefix PATH : ${stdenv.lib.makeBinPath [ python3 ]}
+      --prefix PATH : ${lib.makeBinPath [ python3 ]}
   '';
 
   meta = with lib; {
diff --git a/pkgs/applications/graphics/lightburn/default.nix b/pkgs/applications/graphics/lightburn/default.nix
index 9d2c6c4dd59fa..d90ef152401e7 100644
--- a/pkgs/applications/graphics/lightburn/default.nix
+++ b/pkgs/applications/graphics/lightburn/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, patchelf, fetchurl, p7zip
+{ lib, stdenv, patchelf, fetchurl, p7zip
 , nss, nspr, libusb1
 , qtbase, qtmultimedia, qtserialport
 , autoPatchelfHook, wrapQtAppsHook
@@ -42,8 +42,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Layout, editing, and control software for your laser cutter";
     homepage = "https://lightburnsoftware.com/";
-    license = stdenv.lib.licenses.unfree;
-    maintainers = with stdenv.lib.maintainers; [ q3k ];
+    license = lib.licenses.unfree;
+    maintainers = with lib.maintainers; [ q3k ];
     platforms = [ "x86_64-linux" ];
   };
 }
diff --git a/pkgs/applications/graphics/meh/default.nix b/pkgs/applications/graphics/meh/default.nix
index 0b2e5bc377747..28f307d6cec8e 100644
--- a/pkgs/applications/graphics/meh/default.nix
+++ b/pkgs/applications/graphics/meh/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, libX11, libXext, libjpeg, libpng, giflib }:
+{ lib, stdenv, fetchFromGitHub, libX11, libXext, libjpeg, libpng, giflib }:
 
 stdenv.mkDerivation {
   name = "meh-unstable-2015-04-11";
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
   meta = {
     description = "A minimal image viewer using raw XLib";
     homepage = "https://www.johnhawthorn.com/meh/";
-    license = stdenv.lib.licenses.mit;
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.mit;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/graphics/minidjvu/default.nix b/pkgs/applications/graphics/minidjvu/default.nix
index 2af79659cedb2..40b28dd8566ac 100644
--- a/pkgs/applications/graphics/minidjvu/default.nix
+++ b/pkgs/applications/graphics/minidjvu/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, libtiff, gettext }:
+{lib, stdenv, fetchurl, libtiff, gettext }:
 
 stdenv.mkDerivation {
   name = "minidjvu-0.8";
@@ -20,8 +20,8 @@ stdenv.mkDerivation {
   meta = {
     homepage = "http://djvu.sourceforge.net/djview4.html";
     description = "Black-and-white djvu page encoder and decoder that use interpage information";
-    license = stdenv.lib.licenses.gpl2Plus;
-    maintainers = [ stdenv.lib.maintainers.viric ];
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.gpl2Plus;
+    maintainers = [ lib.maintainers.viric ];
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/applications/graphics/mozjpeg/default.nix b/pkgs/applications/graphics/mozjpeg/default.nix
index e17664a018ab7..5bc67a8c63b05 100644
--- a/pkgs/applications/graphics/mozjpeg/default.nix
+++ b/pkgs/applications/graphics/mozjpeg/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, libpng, nasm }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, libpng, nasm }:
 
 stdenv.mkDerivation rec {
   version = "3.3.1";
@@ -23,8 +23,8 @@ stdenv.mkDerivation rec {
       The idea is to reduce transfer times for JPEGs on the Web, thus reducing page load times.
     '';
     homepage = "https://github.com/mozilla/mozjpeg";
-    license = stdenv.lib.licenses.bsd3;
-    maintainers = [ stdenv.lib.maintainers.aristid ];
-    platforms = stdenv.lib.platforms.all;
+    license = lib.licenses.bsd3;
+    maintainers = [ lib.maintainers.aristid ];
+    platforms = lib.platforms.all;
   };
 }
diff --git a/pkgs/applications/graphics/mtpaint/default.nix b/pkgs/applications/graphics/mtpaint/default.nix
index c002e2a8d0549..3565173285b4b 100644
--- a/pkgs/applications/graphics/mtpaint/default.nix
+++ b/pkgs/applications/graphics/mtpaint/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub
+{ lib, stdenv, fetchFromGitHub
 , pkg-config
 , freetype, giflib, gtk3, lcms2, libjpeg, libpng, libtiff, openjpeg, gifsicle
 }:
@@ -35,9 +35,9 @@ stdenv.mkDerivation rec {
       GNU/Linux, Windows and older PC hardware.
     '';
     homepage = "http://mtpaint.sourceforge.net/";
-    license = stdenv.lib.licenses.gpl3Plus;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.vklquevs ];
+    license = lib.licenses.gpl3Plus;
+    platforms = lib.platforms.linux;
+    maintainers = [ lib.maintainers.vklquevs ];
   };
 }
 
diff --git a/pkgs/applications/graphics/nomacs/default.nix b/pkgs/applications/graphics/nomacs/default.nix
index 3c571fedb830c..73a4d631acbb1 100644
--- a/pkgs/applications/graphics/nomacs/default.nix
+++ b/pkgs/applications/graphics/nomacs/default.nix
@@ -53,7 +53,7 @@ mkDerivation rec {
   meta = with lib; {
     homepage = "https://nomacs.org";
     description = "Qt-based image viewer";
-    maintainers = with stdenv.lib.maintainers; [ mindavi ];
+    maintainers = with lib.maintainers; [ mindavi ];
     license = licenses.gpl3Plus;
     repositories.git = "https://github.com/nomacs/nomacs.git";
     inherit (qtbase.meta) platforms;
diff --git a/pkgs/applications/graphics/ocrfeeder/default.nix b/pkgs/applications/graphics/ocrfeeder/default.nix
index 95ff90a8eeff2..ff5d4bdf41de7 100644
--- a/pkgs/applications/graphics/ocrfeeder/default.nix
+++ b/pkgs/applications/graphics/ocrfeeder/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   version = "0.8.3";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "12f5gnq92ffnd5zaj04df7jrnsdz1zn4zcgpbf5p9qnd21i2y529";
   };
 
@@ -55,7 +55,7 @@ stdenv.mkDerivation rec {
       --replace /usr/share/xml/iso-codes ${isocodes}/share/xml/iso-codes
   '';
 
-  enginesPath = stdenv.lib.makeBinPath ([
+  enginesPath = lib.makeBinPath ([
     tesseract4
   ] ++ extraOcrEngines);
 
diff --git a/pkgs/applications/graphics/openscad/default.nix b/pkgs/applications/graphics/openscad/default.nix
index 8ff4d6f27e039..ad80d3a540440 100644
--- a/pkgs/applications/graphics/openscad/default.nix
+++ b/pkgs/applications/graphics/openscad/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , qtbase
 , qtmultimedia
@@ -44,8 +44,8 @@ mkDerivation rec {
     eigen boost glew opencsg cgal mpfr gmp glib
     harfbuzz lib3mf libzip double-conversion freetype fontconfig
     qtbase qtmultimedia qscintilla
-  ] ++ stdenv.lib.optionals stdenv.isLinux [ libGLU libGL ]
-    ++ stdenv.lib.optional stdenv.isDarwin qtmacextras
+  ] ++ lib.optionals stdenv.isLinux [ libGLU libGL ]
+    ++ lib.optional stdenv.isDarwin qtmacextras
   ;
 
   qmakeFlags = [ "VERSION=${version}" ];
@@ -53,7 +53,7 @@ mkDerivation rec {
   # src/lexer.l:36:10: fatal error: parser.hxx: No such file or directory
   enableParallelBuilding = false; # true by default due to qmake
 
-  postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
+  postInstall = lib.optionalString stdenv.isDarwin ''
     mkdir $out/Applications
     mv $out/bin/*.app $out/Applications
     rmdir $out/bin || true
@@ -80,8 +80,8 @@ mkDerivation rec {
       interested in creating computer-animated movies.
     '';
     homepage = "http://openscad.org/";
-    license = stdenv.lib.licenses.gpl2;
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ bjornfor raskin gebner ];
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ bjornfor raskin gebner ];
   };
 }
diff --git a/pkgs/applications/graphics/opentoonz/default.nix b/pkgs/applications/graphics/opentoonz/default.nix
index 68830699699e2..d8a6a7c5f9539 100644
--- a/pkgs/applications/graphics/opentoonz/default.nix
+++ b/pkgs/applications/graphics/opentoonz/default.nix
@@ -1,6 +1,6 @@
 { boost, cmake, fetchFromGitHub, freeglut, freetype, glew, libjpeg, libmypaint
 , libpng, libtiff, libusb1, lz4, lzma, lzo, openblas, pkgconfig, qtbase
-, qtmultimedia, qtscript, stdenv, superlu, wrapQtAppsHook, }:
+, qtmultimedia, qtscript, lib, stdenv, superlu, wrapQtAppsHook, }:
 let source = import ./source.nix { inherit fetchFromGitHub; };
 in stdenv.mkDerivation rec {
   inherit (source) src;
@@ -45,7 +45,7 @@ in stdenv.mkDerivation rec {
   meta = {
     description = "Full-featured 2D animation creation software";
     homepage = "https://opentoonz.github.io/";
-    license = stdenv.lib.licenses.bsd3;
-    maintainers = with stdenv.lib.maintainers; [ chkno ];
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ chkno ];
   };
 }
diff --git a/pkgs/applications/graphics/panotools/default.nix b/pkgs/applications/graphics/panotools/default.nix
index c03bdd8331be8..50e0f3955f746 100644
--- a/pkgs/applications/graphics/panotools/default.nix
+++ b/pkgs/applications/graphics/panotools/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, libjpeg, libpng, libtiff, perl }:
+{ fetchurl, lib, stdenv, libjpeg, libpng, libtiff, perl }:
 
 stdenv.mkDerivation rec {
   name = "libpano13-2.9.19";
@@ -16,8 +16,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://panotools.sourceforge.net/";
     description = "Free software suite for authoring and displaying virtual reality panoramas";
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
 
-    platforms = stdenv.lib.platforms.gnu ++ stdenv.lib.platforms.linux;  # arbitrary choice
+    platforms = lib.platforms.gnu ++ lib.platforms.linux;  # arbitrary choice
   };
 }
diff --git a/pkgs/applications/graphics/photoqt/default.nix b/pkgs/applications/graphics/photoqt/default.nix
index 4f470b014afe5..fe49d5fa154db 100644
--- a/pkgs/applications/graphics/photoqt/default.nix
+++ b/pkgs/applications/graphics/photoqt/default.nix
@@ -1,4 +1,4 @@
-{ mkDerivation, stdenv, fetchurl, cmake, exiv2, graphicsmagick, libraw, fetchpatch
+{ mkDerivation, lib, stdenv, fetchurl, cmake, exiv2, graphicsmagick, libraw, fetchpatch
 , qtbase, qtdeclarative, qtmultimedia, qtquickcontrols, qttools, qtgraphicaleffects
 , extra-cmake-modules, poppler, kimageformats, libarchive, libdevil
 }:
@@ -40,7 +40,7 @@ mkDerivation rec {
   meta = {
     homepage = "https://photoqt.org/";
     description = "Simple, yet powerful and good looking image viewer";
-    license = stdenv.lib.licenses.gpl2Plus;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/applications/graphics/pinta/default.nix b/pkgs/applications/graphics/pinta/default.nix
index b534763b2456c..c3dd9f548d2de 100644
--- a/pkgs/applications/graphics/pinta/default.nix
+++ b/pkgs/applications/graphics/pinta/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, buildDotnetPackage, dotnetPackages, gtksharp,
+{ lib, stdenv, fetchFromGitHub, buildDotnetPackage, dotnetPackages, gtksharp,
   gettext }:
 
 let
@@ -21,7 +21,7 @@ buildDotnetPackage rec {
   };
 
   # Remove version information from nodes <Reference Include="... Version=... ">
-  postPatch = with stdenv.lib; let
+  postPatch = with lib; let
     csprojFiles = [
       "Pinta/Pinta.csproj"
       "Pinta.Core/Pinta.Core.csproj"
@@ -76,8 +76,8 @@ buildDotnetPackage rec {
   meta = {
     homepage = "https://www.pinta-project.com/";
     description = "Drawing/editing program modeled after Paint.NET";
-    license = stdenv.lib.licenses.mit;
-    maintainers = with stdenv.lib.maintainers; [ ];
-    platforms = with stdenv.lib.platforms; linux;
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ ];
+    platforms = with lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/graphics/qscreenshot/default.nix b/pkgs/applications/graphics/qscreenshot/default.nix
index 635da088e5604..b3e555358bede 100644
--- a/pkgs/applications/graphics/qscreenshot/default.nix
+++ b/pkgs/applications/graphics/qscreenshot/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ dos2unix which qt ]
-    ++ stdenv.lib.optional stdenv.isDarwin Carbon;
+    ++ lib.optional stdenv.isDarwin Carbon;
 
   # Remove carriage returns that cause /bin/sh to abort
   preConfigure = ''
diff --git a/pkgs/applications/graphics/rapid-photo-downloader/default.nix b/pkgs/applications/graphics/rapid-photo-downloader/default.nix
index 73341cf2ea055..26522d78bcdd0 100644
--- a/pkgs/applications/graphics/rapid-photo-downloader/default.nix
+++ b/pkgs/applications/graphics/rapid-photo-downloader/default.nix
@@ -71,8 +71,8 @@ mkDerivationWith python3Packages.buildPythonApplication rec {
     makeWrapperArgs+=(
       --set GI_TYPELIB_PATH "$GI_TYPELIB_PATH"
       --set PYTHONPATH "$PYTHONPATH"
-      --prefix PATH : "${stdenv.lib.makeBinPath [ exiftool vmtouch ]}"
-      --prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ libmediainfo ]}"
+      --prefix PATH : "${lib.makeBinPath [ exiftool vmtouch ]}"
+      --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ libmediainfo ]}"
       --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0"
       "''${qtWrapperArgs[@]}"
     )
diff --git a/pkgs/applications/graphics/rawtherapee/default.nix b/pkgs/applications/graphics/rawtherapee/default.nix
index 14a46bbfcc873..7f9f4167c64b3 100644
--- a/pkgs/applications/graphics/rawtherapee/default.nix
+++ b/pkgs/applications/graphics/rawtherapee/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, pkgconfig, cmake, pixman, libpthreadstubs, gtkmm3, libXau
+{ lib, stdenv, fetchFromGitHub, pkgconfig, cmake, pixman, libpthreadstubs, gtkmm3, libXau
 , libXdmcp, lcms2, libiptcdata, libcanberra-gtk3, fftw, expat, pcre, libsigcxx, wrapGAppsHook
 , lensfun, librsvg
 }:
@@ -35,8 +35,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "RAW converter and digital photo processing software";
     homepage = "http://www.rawtherapee.com/";
-    license = stdenv.lib.licenses.gpl3Plus;
-    maintainers = with stdenv.lib.maintainers; [ jcumming mahe ];
-    platforms = with stdenv.lib.platforms; linux;
+    license = lib.licenses.gpl3Plus;
+    maintainers = with lib.maintainers; [ jcumming mahe ];
+    platforms = with lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/graphics/rx/default.nix b/pkgs/applications/graphics/rx/default.nix
index 9350d7c5cd787..78cc664acccea 100644
--- a/pkgs/applications/graphics/rx/default.nix
+++ b/pkgs/applications/graphics/rx/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, rustPlatform, fetchFromGitHub, makeWrapper
+{ lib, stdenv, rustPlatform, fetchFromGitHub, makeWrapper
 , cmake, pkg-config
 , xorg ? null
 , libGL ? null }:
 
-with stdenv.lib;
+with lib;
 
 rustPlatform.buildRustPackage rec {
   pname = "rx";
diff --git a/pkgs/applications/graphics/sane/backends/brscan4/default.nix b/pkgs/applications/graphics/sane/backends/brscan4/default.nix
index 4ad5c24ddd683..0e768afdde1df 100644
--- a/pkgs/applications/graphics/sane/backends/brscan4/default.nix
+++ b/pkgs/applications/graphics/sane/backends/brscan4/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchurl, callPackage, patchelf, makeWrapper, coreutils, libusb-compat-0_1 }:
+{ lib, stdenv, fetchurl, callPackage, patchelf, makeWrapper, coreutils, libusb-compat-0_1 }:
 
 let
-  myPatchElf = file: with stdenv.lib; ''
+  myPatchElf = file: with lib; ''
     patchelf --set-interpreter \
       ${stdenv.glibc}/lib/ld-linux${optionalString stdenv.is64bit "-x86-64"}.so.2 \
       ${file}
@@ -44,7 +44,7 @@ in stdenv.mkDerivation rec {
     done
   '';
 
-  installPhase = with stdenv.lib; ''
+  installPhase = with lib; ''
     PATH_TO_BRSCAN4="opt/brother/scanner/brscan4"
     mkdir -p $out/$PATH_TO_BRSCAN4
     cp -rp $PATH_TO_BRSCAN4/* $out/$PATH_TO_BRSCAN4
@@ -87,8 +87,8 @@ in stdenv.mkDerivation rec {
   meta = {
     description = "Brother brscan4 sane backend driver";
     homepage = "http://www.brother.com";
-    platforms = stdenv.lib.platforms.linux;
-    license = stdenv.lib.licenses.unfree;
-    maintainers = with stdenv.lib.maintainers; [ jraygauthier ];
+    platforms = lib.platforms.linux;
+    license = lib.licenses.unfree;
+    maintainers = with lib.maintainers; [ jraygauthier ];
   };
 }
diff --git a/pkgs/applications/graphics/sane/backends/brscan4/udev_rules_type1.nix b/pkgs/applications/graphics/sane/backends/brscan4/udev_rules_type1.nix
index 682e401c069bd..9ca0a7020609c 100644
--- a/pkgs/applications/graphics/sane/backends/brscan4/udev_rules_type1.nix
+++ b/pkgs/applications/graphics/sane/backends/brscan4/udev_rules_type1.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libsaneUDevRuleNumber ? "49"}:
+{ lib, stdenv, fetchurl, libsaneUDevRuleNumber ? "49"}:
 
 stdenv.mkDerivation rec {
   name = "brother-udev-rule-type1-1.0.0-1";
@@ -48,8 +48,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Brother type1 scanners udev rules";
     homepage = "http://www.brother.com";
-    platforms = stdenv.lib.platforms.linux;
-    license = stdenv.lib.licenses.unfree;
-    maintainers = with stdenv.lib.maintainers; [ jraygauthier ];
+    platforms = lib.platforms.linux;
+    license = lib.licenses.unfree;
+    maintainers = with lib.maintainers; [ jraygauthier ];
   };
 }
diff --git a/pkgs/applications/graphics/sane/backends/dsseries/default.nix b/pkgs/applications/graphics/sane/backends/dsseries/default.nix
index 37ac02987061e..8a01f70c6b00f 100644
--- a/pkgs/applications/graphics/sane/backends/dsseries/default.nix
+++ b/pkgs/applications/graphics/sane/backends/dsseries/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, rpmextract }:
+{ lib, stdenv, fetchurl, rpmextract }:
 
 stdenv.mkDerivation rec {
   pname = "libsane-dsseries";
@@ -46,8 +46,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Brother DSSeries SANE backend driver";
     homepage = "http://www.brother.com";
-    platforms = stdenv.lib.platforms.linux;
-    license = stdenv.lib.licenses.unfree;
-    maintainers = with stdenv.lib.maintainers; [ callahad ];
+    platforms = lib.platforms.linux;
+    license = lib.licenses.unfree;
+    maintainers = with lib.maintainers; [ callahad ];
   };
 }
diff --git a/pkgs/applications/graphics/sane/backends/generic.nix b/pkgs/applications/graphics/sane/backends/generic.nix
index cef48daca11ad..31ec8e8ddc786 100644
--- a/pkgs/applications/graphics/sane/backends/generic.nix
+++ b/pkgs/applications/graphics/sane/backends/generic.nix
@@ -39,19 +39,19 @@ stdenv.mkDerivation {
   enableParallelBuilding = true;
 
   configureFlags = []
-    ++ stdenv.lib.optional (avahi != null)   "--enable-avahi"
-    ++ stdenv.lib.optional (libusb1 != null) "--with-usb"
+    ++ lib.optional (avahi != null)   "--enable-avahi"
+    ++ lib.optional (libusb1 != null) "--with-usb"
   ;
 
   postInstall = let
 
     compatFirmware = extraFirmware
-      ++ stdenv.lib.optional (gt68xxFirmware != null) {
+      ++ lib.optional (gt68xxFirmware != null) {
         src = gt68xxFirmware.fw;
         inherit (gt68xxFirmware) name;
         backend = "gt68xx";
       }
-      ++ stdenv.lib.optional (snapscanFirmware != null) {
+      ++ lib.optional (snapscanFirmware != null) {
         src = snapscanFirmware;
         name = "your-firmwarefile.bin";
         backend = "snapscan";
@@ -75,7 +75,7 @@ stdenv.mkDerivation {
 
     # net.conf conflicts with the file generated by the nixos module
     rm -f $out/etc/sane.d/net.conf
-  '' + stdenv.lib.concatStrings (builtins.map installFirmware compatFirmware);
+  '' + lib.concatStrings (builtins.map installFirmware compatFirmware);
 
   meta = with lib; {
     description = "SANE (Scanner Access Now Easy) backends";
diff --git a/pkgs/applications/graphics/sane/config.nix b/pkgs/applications/graphics/sane/config.nix
index 2ef1e26f5ac6b..304df652f1575 100644
--- a/pkgs/applications/graphics/sane/config.nix
+++ b/pkgs/applications/graphics/sane/config.nix
@@ -1,8 +1,8 @@
-{ stdenv }:
+{ lib, stdenv }:
 
 { paths }:
 
-with stdenv.lib;
+with lib;
 let installSanePath = path: ''
       if [ -e "${path}/lib/sane" ]; then
         find "${path}/lib/sane" -maxdepth 1 -not -type d | while read backend; do
diff --git a/pkgs/applications/graphics/sane/frontends.nix b/pkgs/applications/graphics/sane/frontends.nix
index 86a1f201f8267..8f5a10268e483 100644
--- a/pkgs/applications/graphics/sane/frontends.nix
+++ b/pkgs/applications/graphics/sane/frontends.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   '';
 
   buildInputs = [ sane-backends libX11 gtk2 ]
-    ++ stdenv.lib.optional (libusb-compat-0_1 != null) libusb-compat-0_1;
+    ++ lib.optional (libusb-compat-0_1 != null) libusb-compat-0_1;
   nativeBuildInputs = [ pkgconfig ];
 
   enableParallelBuilding = true;
diff --git a/pkgs/applications/graphics/sane/xsane.nix b/pkgs/applications/graphics/sane/xsane.nix
index 04d19dee8a8e9..b9e45a767516a 100644
--- a/pkgs/applications/graphics/sane/xsane.nix
+++ b/pkgs/applications/graphics/sane/xsane.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, sane-backends, sane-frontends, libX11, gtk2, pkgconfig, libpng
+{ lib, stdenv, fetchurl, sane-backends, sane-frontends, libX11, gtk2, pkgconfig, libpng
 , libusb-compat-0_1 ? null
 , gimpSupport ? false, gimp ? null
 }:
@@ -21,13 +21,13 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [libpng sane-backends sane-frontends libX11 gtk2 ]
     ++ (if libusb-compat-0_1 != null then [libusb-compat-0_1] else [])
-    ++ stdenv.lib.optional gimpSupport gimp;
+    ++ lib.optional gimpSupport gimp;
 
   meta = {
     homepage = "http://www.sane-project.org/";
     description = "Graphical scanning frontend for sane";
-    license = stdenv.lib.licenses.gpl2Plus;
-    maintainers = with stdenv.lib.maintainers; [peti];
-    platforms = with stdenv.lib.platforms; linux;
+    license = lib.licenses.gpl2Plus;
+    maintainers = with lib.maintainers; [peti];
+    platforms = with lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/graphics/scantailor/default.nix b/pkgs/applications/graphics/scantailor/default.nix
index 5e05072f7b58b..291825770ac78 100644
--- a/pkgs/applications/graphics/scantailor/default.nix
+++ b/pkgs/applications/graphics/scantailor/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, qt4, cmake, libjpeg, libtiff, boost }:
+{lib, stdenv, fetchurl, qt4, cmake, libjpeg, libtiff, boost }:
 
 stdenv.mkDerivation {
   name = "scantailor-0.9.12.1";
@@ -15,9 +15,9 @@ stdenv.mkDerivation {
     homepage = "http://scantailor.org/";
     description = "Interactive post-processing tool for scanned pages";
 
-    license = stdenv.lib.licenses.gpl3Plus;
+    license = lib.licenses.gpl3Plus;
 
-    maintainers = [ stdenv.lib.maintainers.viric ];
-    platforms = stdenv.lib.platforms.gnu ++ stdenv.lib.platforms.linux;
+    maintainers = [ lib.maintainers.viric ];
+    platforms = lib.platforms.gnu ++ lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/graphics/screencloud/default.nix b/pkgs/applications/graphics/screencloud/default.nix
index f5478f684fe63..b7d6ecdef3d7b 100644
--- a/pkgs/applications/graphics/screencloud/default.nix
+++ b/pkgs/applications/graphics/screencloud/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchFromGitHub, cmake, qt4, quazip, qt-mobility, qxt, pythonPackages }:
+{ lib, stdenv, fetchFromGitHub, cmake, qt4, quazip, qt-mobility, qxt, pythonPackages }:
 
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
   pname = "screencloud";
   version = "1.2.0";
@@ -69,8 +69,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://screencloud.net/";
     description = "Client for Screencloud, an easy to use screenshot sharing tool";
-    license = stdenv.lib.licenses.gpl2;
-    maintainers = with stdenv.lib.maintainers; [ forkk ];
-    platforms = with stdenv.lib.platforms; linux;
+    license = lib.licenses.gpl2;
+    maintainers = with lib.maintainers; [ forkk ];
+    platforms = with lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/graphics/shotwell/default.nix b/pkgs/applications/graphics/shotwell/default.nix
index 992a7f7879944..347d66df987ae 100644
--- a/pkgs/applications/graphics/shotwell/default.nix
+++ b/pkgs/applications/graphics/shotwell/default.nix
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
   version = "0.31.2";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0ywzr6vgcz8yy60v0jp55na9lgqi4dbh2vakfphkcml1gpah0r2l";
   };
 
diff --git a/pkgs/applications/graphics/smartdeblur/default.nix b/pkgs/applications/graphics/smartdeblur/default.nix
index d9877afad86f8..6a835fb3c71a4 100644
--- a/pkgs/applications/graphics/smartdeblur/default.nix
+++ b/pkgs/applications/graphics/smartdeblur/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, cmake, qt4, fftw }:
+{ fetchurl, lib, stdenv, cmake, qt4, fftw }:
 
 let
   rev = "9895036d26";
@@ -24,8 +24,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://github.com/Y-Vladimir/SmartDeblur";
     description = "Tool for restoring blurry and defocused images";
-    license = stdenv.lib.licenses.gpl3;
-    maintainers = with stdenv.lib.maintainers; [ ];
-    platforms = with stdenv.lib.platforms; linux;
+    license = lib.licenses.gpl3;
+    maintainers = with lib.maintainers; [ ];
+    platforms = with lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/graphics/sxiv/default.nix b/pkgs/applications/graphics/sxiv/default.nix
index 4cf0ae5557897..fec378d384376 100644
--- a/pkgs/applications/graphics/sxiv/default.nix
+++ b/pkgs/applications/graphics/sxiv/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchFromGitHub, libXft, imlib2, giflib, libexif, conf ? null }:
+{ lib, stdenv, fetchFromGitHub, libXft, imlib2, giflib, libexif, conf ? null }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "sxiv";
@@ -27,8 +27,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Simple X Image Viewer";
     homepage = "https://github.com/muennich/sxiv";
-    license = stdenv.lib.licenses.gpl2Plus;
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.linux;
     maintainers = with maintainers; [ jfrankenau ];
   };
 }
diff --git a/pkgs/applications/graphics/tesseract/tesseract3.nix b/pkgs/applications/graphics/tesseract/tesseract3.nix
index dc9d4ac2d595d..66ff8675a31fe 100644
--- a/pkgs/applications/graphics/tesseract/tesseract3.nix
+++ b/pkgs/applications/graphics/tesseract/tesseract3.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkgconfig
 , leptonica, libpng, libtiff, icu, pango, opencl-headers }:
 
 stdenv.mkDerivation rec {
@@ -22,8 +22,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "OCR engine";
     homepage = "https://github.com/tesseract-ocr/tesseract";
-    license = stdenv.lib.licenses.asl20;
-    maintainers = with stdenv.lib.maintainers; [ viric earvstedt ];
-    platforms = with stdenv.lib.platforms; linux ++ darwin;
+    license = lib.licenses.asl20;
+    maintainers = with lib.maintainers; [ viric earvstedt ];
+    platforms = with lib.platforms; linux ++ darwin;
   };
 }
diff --git a/pkgs/applications/graphics/tesseract/tesseract4.nix b/pkgs/applications/graphics/tesseract/tesseract4.nix
index d7c3cacc1f961..18d865ae81c51 100644
--- a/pkgs/applications/graphics/tesseract/tesseract4.nix
+++ b/pkgs/applications/graphics/tesseract/tesseract4.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, autoconf-archive, pkgconfig
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, autoconf-archive, pkgconfig
 , leptonica, libpng, libtiff, icu, pango, opencl-headers }:
 
 stdenv.mkDerivation rec {
@@ -20,8 +20,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "OCR engine";
     homepage = "https://github.com/tesseract-ocr/tesseract";
-    license = stdenv.lib.licenses.asl20;
-    maintainers = with stdenv.lib.maintainers; [ viric earvstedt ];
-    platforms = with stdenv.lib.platforms; linux ++ darwin;
+    license = lib.licenses.asl20;
+    maintainers = with lib.maintainers; [ viric earvstedt ];
+    platforms = with lib.platforms; linux ++ darwin;
   };
 }
diff --git a/pkgs/applications/graphics/tesseract/wrapper.nix b/pkgs/applications/graphics/tesseract/wrapper.nix
index 365d68a9ee76b..22751f38fe1e5 100644
--- a/pkgs/applications/graphics/tesseract/wrapper.nix
+++ b/pkgs/applications/graphics/tesseract/wrapper.nix
@@ -1,4 +1,4 @@
-{ stdenv, makeWrapper, tesseractBase, languages
+{ lib, stdenv, makeWrapper, tesseractBase, languages
 
 # A list of languages like [ "eng" "spa" … ] or `null` for all available languages
 , enableLanguages ? null
@@ -54,5 +54,5 @@ in
   if enableLanguagesHash == null then
     tesseract
   else
-    stdenv.lib.warn "Argument `enableLanguagesHash` is obsolete and can be removed."
+    lib.warn "Argument `enableLanguagesHash` is obsolete and can be removed."
     tesseract
diff --git a/pkgs/applications/graphics/unigine-valley/default.nix b/pkgs/applications/graphics/unigine-valley/default.nix
index 8043f153083fc..0c5c8f3ff2816 100644
--- a/pkgs/applications/graphics/unigine-valley/default.nix
+++ b/pkgs/applications/graphics/unigine-valley/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl
+{ lib, stdenv, fetchurl
 
 # Build-time dependencies
 , makeWrapper
@@ -40,7 +40,7 @@ in
 
     buildInputs = [file makeWrapper];
 
-    libPath = stdenv.lib.makeLibraryPath [
+    libPath = lib.makeLibraryPath [
       stdenv.cc.cc  # libstdc++.so.6
       fontconfig
       freetype
@@ -108,8 +108,8 @@ in
     meta = {
       description = "The Unigine Valley GPU benchmarking tool";
       homepage = "https://unigine.com/products/benchmarks/valley/";
-      license = stdenv.lib.licenses.unfree; # see also: $out/$instPath/documentation/License.pdf
-      maintainers = [ stdenv.lib.maintainers.kierdavis ];
+      license = lib.licenses.unfree; # see also: $out/$instPath/documentation/License.pdf
+      maintainers = [ lib.maintainers.kierdavis ];
       platforms = ["x86_64-linux" "i686-linux"];
     };
   }
diff --git a/pkgs/applications/graphics/wings/default.nix b/pkgs/applications/graphics/wings/default.nix
index 19c30f3ecc4d1..ef8d4b5096e6b 100644
--- a/pkgs/applications/graphics/wings/default.nix
+++ b/pkgs/applications/graphics/wings/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, erlang, cl, libGL, libGLU, runtimeShell }:
+{ fetchurl, lib, stdenv, erlang, cl, libGL, libGLU, runtimeShell }:
 
 stdenv.mkDerivation rec {
   name = "wings-2.2.4";
@@ -38,8 +38,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://www.wings3d.com/";
     description = "Subdivision modeler inspired by Nendo and Mirai from Izware";
-    license = stdenv.lib.licenses.tcltk;
-    maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; linux;
+    license = lib.licenses.tcltk;
+    maintainers = with lib.maintainers; [viric];
+    platforms = with lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/graphics/write_stylus/default.nix b/pkgs/applications/graphics/write_stylus/default.nix
index d03c29a58ecef..65f6c46f7daf2 100644
--- a/pkgs/applications/graphics/write_stylus/default.nix
+++ b/pkgs/applications/graphics/write_stylus/default.nix
@@ -55,7 +55,7 @@ mkDerivation rec {
     homepage = "http://www.styluslabs.com/";
     description = "Write is a word processor for handwriting";
     platforms = platforms.linux;
-    license = stdenv.lib.licenses.unfree;
+    license = lib.licenses.unfree;
     maintainers = with maintainers; [ oyren ];
   };
 }
diff --git a/pkgs/applications/graphics/xaos/default.nix b/pkgs/applications/graphics/xaos/default.nix
index 767f3aa920bfb..15c2d468fb4f0 100644
--- a/pkgs/applications/graphics/xaos/default.nix
+++ b/pkgs/applications/graphics/xaos/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, aalib, gsl, libpng, libX11, xorgproto, libXext
+{ lib, stdenv, fetchurl, aalib, gsl, libpng, libX11, xorgproto, libXext
 , libXt, zlib, gettext, intltool, perl }:
 
 stdenv.mkDerivation rec {
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://xaos.sourceforge.net/";
     description = "Fractal viewer";
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
     platforms = [ "x86_64-linux" ];
   };
 }
diff --git a/pkgs/applications/graphics/xfractint/default.nix b/pkgs/applications/graphics/xfractint/default.nix
index 08ef0cd7b5844..cca061ed2a6b5 100644
--- a/pkgs/applications/graphics/xfractint/default.nix
+++ b/pkgs/applications/graphics/xfractint/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, libX11, libXft}:
+{lib, stdenv, fetchurl, libX11, libXft}:
 stdenv.mkDerivation rec {
   pname = "xfractint";
   version = "20.04p16";
@@ -21,9 +21,9 @@ stdenv.mkDerivation rec {
     description = "";
     # Code cannot be used in commercial programs
     # Looks like the definition hinges on the price, not license
-    license = stdenv.lib.licenses.unfree;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.unfree;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.linux;
     homepage = "https://www.fractint.net/";
   };
 }
diff --git a/pkgs/applications/graphics/xournal/default.nix b/pkgs/applications/graphics/xournal/default.nix
index 066e6cf2fb13e..41af11ef3387a 100644
--- a/pkgs/applications/graphics/xournal/default.nix
+++ b/pkgs/applications/graphics/xournal/default.nix
@@ -20,14 +20,14 @@ stdenv.mkDerivation rec {
     ghostscript atk gtk2 glib fontconfig freetype
     libgnomecanvas
     pango libX11 xorgproto zlib poppler
-  ] ++ stdenv.lib.optionals (!stdenv.isDarwin) [
+  ] ++ lib.optionals (!stdenv.isDarwin) [
     libgnomeprint libgnomeprintui
   ];
 
   nativeBuildInputs = [ autoconf automake libtool pkgconfig ];
 
   NIX_LDFLAGS = "-lz"
-    + stdenv.lib.optionalString (!isGdkQuartzBackend) " -lX11";
+    + lib.optionalString (!isGdkQuartzBackend) " -lX11";
 
   desktopItem = makeDesktopItem {
     name = name;
diff --git a/pkgs/applications/graphics/xournalpp/default.nix b/pkgs/applications/graphics/xournalpp/default.nix
index c6aa330329c22..1810a6c6b8ebe 100644
--- a/pkgs/applications/graphics/xournalpp/default.nix
+++ b/pkgs/applications/graphics/xournalpp/default.nix
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
       portaudio
       zlib
     ]
-    ++ stdenv.lib.optional withLua lua;
+    ++ lib.optional withLua lua;
 
   buildFlags = "translations";
 
diff --git a/pkgs/applications/graphics/zgrviewer/default.nix b/pkgs/applications/graphics/zgrviewer/default.nix
index 598a94138262c..c47c41a1cdc7f 100644
--- a/pkgs/applications/graphics/zgrviewer/default.nix
+++ b/pkgs/applications/graphics/zgrviewer/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, jre, unzip, runtimeShell }:
+{ lib, stdenv, fetchurl, jre, unzip, runtimeShell }:
 stdenv.mkDerivation rec {
   version = "0.9.0";
   pname = "zgrviewer";
@@ -22,9 +22,9 @@ stdenv.mkDerivation rec {
   meta = {
     # Quicker to unpack locally than load Hydra
     hydraPlatforms = [];
-    maintainers = with stdenv.lib.maintainers; [raskin];
-    license = stdenv.lib.licenses.lgpl21Plus;
+    maintainers = with lib.maintainers; [raskin];
+    license = lib.licenses.lgpl21Plus;
     description = "GraphViz graph viewer/navigator";
-    platforms = with stdenv.lib.platforms; unix;
+    platforms = with lib.platforms; unix;
   };
 }