diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 31060040c1a..bc43f80a060 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -37,7 +37,7 @@ under the terms of [COPYING](../COPYING), which is an MIT-like license. * Not start with the package name. * Not have a period at the end. * `meta.license` must be set and fit the upstream license. - * If there is no upstream license, `meta.license` should default to `stdenv.lib.licenses.unfree`. + * If there is no upstream license, `meta.license` should default to `lib.licenses.unfree`. * `meta.maintainers` must be set. See the nixpkgs manual for more details on [standard meta-attributes](https://nixos.org/nixpkgs/manual/#sec-standard-meta-attributes) and on how to [submit changes to nixpkgs](https://nixos.org/nixpkgs/manual/#chap-submitting-changes). diff --git a/nixos/tests/usbguard.nix b/nixos/tests/usbguard.nix index a5d78f316fb..cba905db44f 100644 --- a/nixos/tests/usbguard.nix +++ b/nixos/tests/usbguard.nix @@ -1,6 +1,6 @@ import ./make-test-python.nix ({ pkgs, ... }: { name = "usbguard"; - meta = with pkgs.stdenv.lib.maintainers; { + meta = with pkgs.lib.maintainers; { maintainers = [ tnias ]; }; diff --git a/pkgs/applications/graphics/hdr-plus/default.nix b/pkgs/applications/graphics/hdr-plus/default.nix index 107694b2fcd..15042e6877f 100644 --- a/pkgs/applications/graphics/hdr-plus/default.nix +++ b/pkgs/applications/graphics/hdr-plus/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, fetchpatch +{ lib, stdenv, fetchFromGitHub, fetchpatch , cmake, halide , libpng, libjpeg, libtiff, libraw }: @@ -32,7 +32,7 @@ stdenv.mkDerivation rec { done ''; - meta = with stdenv.lib; { + meta = with lib; { description = "Burst photography pipeline based on Google's HDR+"; homepage = "https://www.timothybrooks.com/tech/hdr-plus/"; license = licenses.mit; diff --git a/pkgs/applications/misc/rescuetime/default.nix b/pkgs/applications/misc/rescuetime/default.nix index ddb99c35d05..476a441ae05 100644 --- a/pkgs/applications/misc/rescuetime/default.nix +++ b/pkgs/applications/misc/rescuetime/default.nix @@ -38,10 +38,10 @@ in mkDerivation rec { passthru.updateScript = writeScript "${pname}-updater" '' #!${stdenv.shell} set -eu -o pipefail - PATH=${stdenv.lib.makeBinPath [curl pup common-updater-scripts]}:$PATH + PATH=${lib.makeBinPath [curl pup common-updater-scripts]}:$PATH latestVersion="$(curl -sS https://www.rescuetime.com/release-notes/linux | pup '.release:first-of-type h2 strong text{}' | tr -d '\n')" - for platform in ${stdenv.lib.concatStringsSep " " meta.platforms}; do + for platform in ${lib.concatStringsSep " " meta.platforms}; do # The script will not perform an update when the version attribute is up to date from previous platform run # We need to clear it before each run update-source-version ${pname} 0 $(yes 0 | head -64 | tr -d "\n") --system=$platform diff --git a/pkgs/applications/radio/klog/default.nix b/pkgs/applications/radio/klog/default.nix index cb8ac9fe5dd..080011e167e 100644 --- a/pkgs/applications/radio/klog/default.nix +++ b/pkgs/applications/radio/klog/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchurl, hamlib, pkg-config, qt5, qtbase, qttools, qtserialport, qtcharts, qmake, wrapQtAppsHook }: +{ lib, stdenv, fetchurl, hamlib, pkg-config, qt5, qtbase, qttools, qtserialport, qtcharts, qmake, wrapQtAppsHook }: stdenv.mkDerivation rec { pname = "klog"; @@ -14,7 +14,7 @@ stdenv.mkDerivation rec { qmakeFlags = [ "KLog.pro" ]; - meta = with stdenv.lib; { + meta = with lib; { description = "A multiplatform free hamradio logger"; longDescription = '' KLog provides QSO management, useful QSL management DX-Cluster client, DXCC management, diff --git a/pkgs/applications/science/biology/migrate/default.nix b/pkgs/applications/science/biology/migrate/default.nix index ba55898e4f9..41a2e89f02c 100644 --- a/pkgs/applications/science/biology/migrate/default.nix +++ b/pkgs/applications/science/biology/migrate/default.nix @@ -1,4 +1,4 @@ -{ gccStdenv, fetchurl, zlib, mpi }: +{ lib, gccStdenv, fetchurl, zlib, mpi }: gccStdenv.mkDerivation rec { version = "3.7.2"; @@ -14,7 +14,7 @@ gccStdenv.mkDerivation rec { buildFlags = [ "thread" "mpis" ]; preInstall = "mkdir -p $out/man/man1"; - meta = with gccStdenv.lib; { + meta = with lib; { description = "Estimates population size, migration, population splitting parameters using genetic/genomic data"; homepage = "https://peterbeerli.com/migrate-html5/index.html"; license = licenses.mit; diff --git a/pkgs/build-support/alternatives/blas/default.nix b/pkgs/build-support/alternatives/blas/default.nix index 5ebbc737e11..cf880677fdd 100644 --- a/pkgs/build-support/alternatives/blas/default.nix +++ b/pkgs/build-support/alternatives/blas/default.nix @@ -132,7 +132,7 @@ Description: BLAS C implementation Cflags: -I$dev/include Libs: -L$out/lib -lcblas EOF -'' + stdenv.lib.optionalString (blasImplementation == "mkl") '' +'' + lib.optionalString (blasImplementation == "mkl") '' mkdir -p $out/nix-support echo 'export MKL_INTERFACE_LAYER=${lib.optionalString isILP64 "I"}LP64,GNU' > $out/nix-support/setup-hook ln -s $out/lib/libblas${canonicalExtension} $out/lib/libmkl_rt${stdenv.hostPlatform.extensions.sharedLibrary} diff --git a/pkgs/build-support/alternatives/lapack/default.nix b/pkgs/build-support/alternatives/lapack/default.nix index 98b458b778a..7e74eb96b74 100644 --- a/pkgs/build-support/alternatives/lapack/default.nix +++ b/pkgs/build-support/alternatives/lapack/default.nix @@ -98,7 +98,7 @@ Description: LAPACK C implementation Cflags: -I$dev/include Libs: -L$out/lib -llapacke EOF -'' + stdenv.lib.optionalString (lapackImplementation == "mkl") '' +'' + lib.optionalString (lapackImplementation == "mkl") '' mkdir -p $out/nix-support echo 'export MKL_INTERFACE_LAYER=${lib.optionalString isILP64 "I"}LP64,GNU' > $out/nix-support/setup-hook ln -s $out/lib/liblapack${canonicalExtension} $out/lib/libmkl_rt${stdenv.hostPlatform.extensions.sharedLibrary} diff --git a/pkgs/build-support/appimage/default.nix b/pkgs/build-support/appimage/default.nix index e6014e35aef..170c25dffe2 100644 --- a/pkgs/build-support/appimage/default.nix +++ b/pkgs/build-support/appimage/default.nix @@ -1,4 +1,5 @@ -{ stdenv +{ lib +, stdenv , bash , binutils-unwrapped , coreutils @@ -15,7 +16,7 @@ rec { src = ./appimage-exec.sh; isExecutable = true; dir = "bin"; - path = with pkgs; stdenv.lib.makeBinPath [ + path = lib.makeBinPath [ bash binutils-unwrapped coreutils diff --git a/pkgs/build-support/docker/default.nix b/pkgs/build-support/docker/default.nix index 916d3cd003e..0c9d4f110ad 100644 --- a/pkgs/build-support/docker/default.nix +++ b/pkgs/build-support/docker/default.nix @@ -94,7 +94,7 @@ rec { inherit imageDigest; imageName = finalImageName; imageTag = finalImageTag; - impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars; + impureEnvVars = lib.fetchers.proxyImpureEnvVars; outputHashMode = "flat"; outputHashAlgo = "sha256"; outputHash = sha256; diff --git a/pkgs/build-support/docker/nix-prefetch-docker.nix b/pkgs/build-support/docker/nix-prefetch-docker.nix index 6341eb0154b..61e917461ed 100644 --- a/pkgs/build-support/docker/nix-prefetch-docker.nix +++ b/pkgs/build-support/docker/nix-prefetch-docker.nix @@ -1,6 +1,4 @@ -{ stdenv, makeWrapper, nix, skopeo, jq }: - -with stdenv.lib; +{ lib, stdenv, makeWrapper, nix, skopeo, jq }: stdenv.mkDerivation { name = "nix-prefetch-docker"; @@ -12,13 +10,13 @@ stdenv.mkDerivation { installPhase = '' install -vD ${./nix-prefetch-docker} $out/bin/$name; wrapProgram $out/bin/$name \ - --prefix PATH : ${makeBinPath [ nix skopeo jq ]} \ + --prefix PATH : ${lib.makeBinPath [ nix skopeo jq ]} \ --set HOME /homeless-shelter ''; preferLocalBuild = true; - meta = { + meta = with lib; { description = "Script used to obtain source hashes for dockerTools.pullImage"; maintainers = with maintainers; [ offline ]; platforms = platforms.unix; diff --git a/pkgs/build-support/dotnetenv/build-solution.nix b/pkgs/build-support/dotnetenv/build-solution.nix index 57af1fe9bd4..b3372b94217 100644 --- a/pkgs/build-support/dotnetenv/build-solution.nix +++ b/pkgs/build-support/dotnetenv/build-solution.nix @@ -1,4 +1,4 @@ -{stdenv, dotnetfx}: +{ lib, stdenv, dotnetfx }: { name , src , baseDir ? "." @@ -24,7 +24,7 @@ stdenv.mkDerivation { ''; preBuild = '' - ${stdenv.lib.optionalString modifyPublicMain '' + ${lib.optionalString modifyPublicMain '' sed -i -e "s|static void Main|public static void Main|" ${mainClassFile} ''} ${preBuild} diff --git a/pkgs/build-support/dotnetenv/default.nix b/pkgs/build-support/dotnetenv/default.nix index c7145504eb7..3015db42b07 100644 --- a/pkgs/build-support/dotnetenv/default.nix +++ b/pkgs/build-support/dotnetenv/default.nix @@ -1,9 +1,9 @@ -{stdenv, dotnetfx}: +{ lib, stdenv, dotnetfx }: let dotnetenv = { buildSolution = import ./build-solution.nix { - inherit stdenv; + inherit lib stdenv; dotnetfx = dotnetfx.pkg; }; diff --git a/pkgs/build-support/fetchmavenartifact/default.nix b/pkgs/build-support/fetchmavenartifact/default.nix index 42162638e72..4274b4b52bf 100644 --- a/pkgs/build-support/fetchmavenartifact/default.nix +++ b/pkgs/build-support/fetchmavenartifact/default.nix @@ -1,6 +1,6 @@ # Adaptation of the MIT-licensed work on `sbt2nix` done by Charles O'Farrell -{ fetchurl, stdenv }: +{ lib, fetchurl, stdenv }: let defaultRepos = [ "https://repo1.maven.org/maven2" @@ -36,21 +36,20 @@ assert (url == "") || (urls == []); # if repos is empty, then url or urls must be specified. assert (repos != []) || (url != "") || (urls != []); - let name_ = - with stdenv.lib; concatStrings [ - (replaceChars ["."] ["_"] groupId) "_" - (replaceChars ["."] ["_"] artifactId) "-" + lib.concatStrings [ + (lib.replaceChars ["."] ["_"] groupId) "_" + (lib.replaceChars ["."] ["_"] artifactId) "-" version ]; mkJarUrl = repoUrl: - with stdenv.lib; concatStringsSep "/" [ - (removeSuffix "/" repoUrl) - (replaceChars ["."] ["/"] groupId) + lib.concatStringsSep "/" [ + (lib.removeSuffix "/" repoUrl) + (lib.replaceChars ["."] ["/"] groupId) artifactId version - "${artifactId}-${version}${optionalString (!isNull classifier) "-${classifier}"}.jar" + "${artifactId}-${version}${lib.optionalString (!isNull classifier) "-${classifier}"}.jar" ]; urls_ = if url != "" then [url] diff --git a/pkgs/build-support/icon-conv-tools/default.nix b/pkgs/build-support/icon-conv-tools/default.nix index 0ea18d8768a..79d3838e688 100644 --- a/pkgs/build-support/icon-conv-tools/default.nix +++ b/pkgs/build-support/icon-conv-tools/default.nix @@ -1,4 +1,4 @@ -{ stdenv, icoutils }: +{ lib, stdenv, icoutils }: stdenv.mkDerivation { name = "icon-conv-tools-0.0.0"; @@ -23,9 +23,9 @@ stdenv.mkDerivation { dontPatchELF = true; dontStrip = true; - meta = { + meta = with lib; { description = "Tools for icon conversion specific to nix package manager"; - maintainers = with stdenv.lib.maintainers; [ jraygauthier ]; - platforms = with stdenv.lib.platforms; linux; + maintainers = with maintainers; [ jraygauthier ]; + platforms = platforms.linux; }; } diff --git a/pkgs/build-support/libredirect/default.nix b/pkgs/build-support/libredirect/default.nix index 6e54e2a696c..70da5bf5b5f 100644 --- a/pkgs/build-support/libredirect/default.nix +++ b/pkgs/build-support/libredirect/default.nix @@ -46,8 +46,8 @@ stdenv.mkDerivation { ) ''; - meta = { - platforms = stdenv.lib.platforms.unix; + meta = with lib; { + platforms = platforms.unix; description = "An LD_PRELOAD library to intercept and rewrite the paths in glibc calls"; longDescription = '' libredirect is an LD_PRELOAD library to intercept and rewrite the paths in diff --git a/pkgs/build-support/ocaml/default.nix b/pkgs/build-support/ocaml/default.nix index 3957b955a2c..88ed3dfc2c2 100644 --- a/pkgs/build-support/ocaml/default.nix +++ b/pkgs/build-support/ocaml/default.nix @@ -1,4 +1,4 @@ -{ stdenv, writeText, ocaml, findlib, ocamlbuild, camlp4 }: +{ lib, stdenv, writeText, ocaml, findlib, ocamlbuild, camlp4 }: { name, version, buildInputs ? [], createFindlibDestdir ? true, @@ -14,7 +14,7 @@ let }; in assert minimumSupportedOcamlVersion != null -> - stdenv.lib.versionOlder minimumSupportedOcamlVersion ocaml.version; + lib.versionOlder minimumSupportedOcamlVersion ocaml.version; stdenv.mkDerivation (args // { name = "ocaml-${name}-${version}"; diff --git a/pkgs/build-support/ocaml/dune.nix b/pkgs/build-support/ocaml/dune.nix index fce0096c83d..f9f59b21510 100644 --- a/pkgs/build-support/ocaml/dune.nix +++ b/pkgs/build-support/ocaml/dune.nix @@ -1,11 +1,11 @@ -{ stdenv, ocaml, findlib, dune, dune_2 }: +{ lib, stdenv, ocaml, findlib, dune, dune_2 }: { pname, version, buildInputs ? [], enableParallelBuilding ? true, ... }@args: let Dune = if args.useDune2 or false then dune_2 else dune; in if args ? minimumOCamlVersion && - ! stdenv.lib.versionAtLeast ocaml.version args.minimumOCamlVersion + ! lib.versionAtLeast ocaml.version args.minimumOCamlVersion then throw "${pname}-${version} is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/build-support/ocaml/oasis.nix b/pkgs/build-support/ocaml/oasis.nix index c1d1d699765..ee231a6e258 100644 --- a/pkgs/build-support/ocaml/oasis.nix +++ b/pkgs/build-support/ocaml/oasis.nix @@ -1,4 +1,4 @@ -{ stdenv, ocaml_oasis, ocaml, findlib, ocamlbuild }: +{ lib, stdenv, ocaml_oasis, ocaml, findlib, ocamlbuild }: { pname, version, buildInputs ? [], meta ? { platforms = ocaml.meta.platforms or []; }, minimumOCamlVersion ? null, @@ -8,7 +8,7 @@ }@args: if args ? minimumOCamlVersion && - ! stdenv.lib.versionAtLeast ocaml.version args.minimumOCamlVersion + ! lib.versionAtLeast ocaml.version args.minimumOCamlVersion then throw "${pname}-${version} is not available for OCaml ${ocaml.version}" else diff --git a/pkgs/build-support/pkg-config-wrapper/default.nix b/pkgs/build-support/pkg-config-wrapper/default.nix index e01df107dd1..b61936c50a8 100644 --- a/pkgs/build-support/pkg-config-wrapper/default.nix +++ b/pkgs/build-support/pkg-config-wrapper/default.nix @@ -2,6 +2,7 @@ # PKG_CONFIG_PATH_FOR_BUILD work properly. { stdenvNoCC +, lib , buildPackages , pkg-config , baseBinName ? "pkg-config" @@ -19,7 +20,7 @@ let # # TODO(@Ericson2314) Make unconditional, or optional but always true by # default. - targetPrefix = stdenv.lib.optionalString (targetPlatform != hostPlatform) + targetPrefix = lib.optionalString (targetPlatform != hostPlatform) (targetPlatform.config + "-"); # See description in cc-wrapper. @@ -119,7 +120,7 @@ stdenv.mkDerivation { let pkg-config_ = if pkg-config != null then pkg-config else {}; in (if pkg-config_ ? meta then removeAttrs pkg-config.meta ["priority"] else {}) // { description = - stdenv.lib.attrByPath ["meta" "description"] "pkg-config" pkg-config_ + lib.attrByPath ["meta" "description"] "pkg-config" pkg-config_ + " (wrapper script)"; priority = 10; }; diff --git a/pkgs/build-support/plugins.nix b/pkgs/build-support/plugins.nix index bf8a982a88f..1ed74851597 100644 --- a/pkgs/build-support/plugins.nix +++ b/pkgs/build-support/plugins.nix @@ -1,4 +1,4 @@ -{ stdenv }: +{ lib, stdenv }: # helper functions for packaging programs with plugin systems { @@ -13,7 +13,7 @@ diffPlugins = expectedPlugins: foundPluginsFilePath: '' # sort both lists first plugins_expected=$(mktemp) - (${stdenv.lib.concatMapStrings (s: "echo \"${s}\";") expectedPlugins}) \ + (${lib.concatMapStrings (s: "echo \"${s}\";") expectedPlugins}) \ | sort -u > "$plugins_expected" plugins_found=$(mktemp) sort -u "${foundPluginsFilePath}" > "$plugins_found" diff --git a/pkgs/build-support/release/debian-build.nix b/pkgs/build-support/release/debian-build.nix index dfa896a86a6..9ac335d288a 100644 --- a/pkgs/build-support/release/debian-build.nix +++ b/pkgs/build-support/release/debian-build.nix @@ -2,6 +2,7 @@ # that contains a Debian-like (i.e. dpkg-based) OS. { name ? "debian-build" +, lib , diskImage , src, stdenv, vmTools, checkinstall , fsTranslation ? false @@ -11,8 +12,6 @@ debRequires ? [] , ... } @ args: -with stdenv.lib; - vmTools.runInLinuxImage (stdenv.mkDerivation ( { @@ -59,8 +58,8 @@ vmTools.runInLinuxImage (stdenv.mkDerivation ( export PAGER=cat ${checkinstall}/sbin/checkinstall --nodoc -y -D \ --fstrans=${if fsTranslation then "yes" else "no"} \ - --requires="${concatStringsSep "," debRequires}" \ - --provides="${concatStringsSep "," debProvides}" \ + --requires="${lib.concatStringsSep "," debRequires}" \ + --provides="${lib.concatStringsSep "," debProvides}" \ ${if (src ? version) then "--pkgversion=$(echo ${src.version} | tr _ -)" else "--pkgversion=0.0.0"} \ ''${debMaintainer:+--maintainer="'$debMaintainer'"} \ diff --git a/pkgs/build-support/release/default.nix b/pkgs/build-support/release/default.nix index 6aaa0338f0c..0276fa1be61 100644 --- a/pkgs/build-support/release/default.nix +++ b/pkgs/build-support/release/default.nix @@ -1,4 +1,4 @@ -{ pkgs }: +{ lib, pkgs }: with pkgs; @@ -23,7 +23,7 @@ rec { } // args); nixBuild = args: import ./nix-build.nix ( - { inherit stdenv; + { inherit lib stdenv; } // args); coverageAnalysis = args: nixBuild ( @@ -46,7 +46,7 @@ rec { } // args); debBuild = args: import ./debian-build.nix ( - { inherit stdenv vmTools checkinstall; + { inherit lib stdenv vmTools checkinstall; } // args); aggregate = @@ -94,7 +94,7 @@ rec { phases = [ "unpackPhase" "patchPhase" "installPhase" ]; - patchPhase = stdenv.lib.optionalString isNixOS '' + patchPhase = lib.optionalString isNixOS '' touch .update-on-nixos-rebuild ''; diff --git a/pkgs/build-support/release/nix-build.nix b/pkgs/build-support/release/nix-build.nix index feda54de46f..97df52eaced 100644 --- a/pkgs/build-support/release/nix-build.nix +++ b/pkgs/build-support/release/nix-build.nix @@ -12,7 +12,7 @@ , doCoverityAnalysis ? false , lcovFilter ? [] , lcovExtraTraceFiles ? [] -, src, stdenv +, src, lib, stdenv , name ? if doCoverageAnalysis then "nix-coverage" else "nix-build" , failureHook ? null , prePhases ? [] @@ -69,7 +69,7 @@ stdenv.mkDerivation ( fi ''; - failureHook = (stdenv.lib.optionalString (failureHook != null) failureHook) + + failureHook = (lib.optionalString (failureHook != null) failureHook) + '' if test -n "$succeedOnFailure"; then if test -n "$keepBuildDirectory"; then @@ -136,10 +136,10 @@ stdenv.mkDerivation ( buildInputs = buildInputs ++ - (stdenv.lib.optional doCoverageAnalysis args.makeGCOVReport) ++ - (stdenv.lib.optional doClangAnalysis args.clang-analyzer) ++ - (stdenv.lib.optional doCoverityAnalysis args.cov-build) ++ - (stdenv.lib.optional doCoverityAnalysis args.xz); + (lib.optional doCoverageAnalysis args.makeGCOVReport) ++ + (lib.optional doClangAnalysis args.clang-analyzer) ++ + (lib.optional doCoverityAnalysis args.cov-build) ++ + (lib.optional doCoverityAnalysis args.xz); lcovFilter = ["/nix/store/*"] ++ lcovFilter; diff --git a/pkgs/build-support/rust/default-crate-overrides.nix b/pkgs/build-support/rust/default-crate-overrides.nix index 4ff8640c2ff..3d2dc3733c2 100644 --- a/pkgs/build-support/rust/default-crate-overrides.nix +++ b/pkgs/build-support/rust/default-crate-overrides.nix @@ -1,4 +1,4 @@ -{ stdenv, pkg-config, curl, darwin, libiconv, libgit2, libssh2, +{ lib, stdenv, pkg-config, curl, darwin, libiconv, libgit2, libssh2, openssl, sqlite, zlib, dbus, dbus-glib, gdk-pixbuf, cairo, python3, libsodium, postgresql, gmp, foundationdb, capnproto, nettle, clang, llvmPackages, ... }: @@ -17,7 +17,7 @@ in cargo = attrs: { buildInputs = [ openssl zlib curl ] - ++ stdenv.lib.optionals stdenv.isDarwin [ CoreFoundation Security libiconv ]; + ++ lib.optionals stdenv.isDarwin [ CoreFoundation Security libiconv ]; }; libz-sys = attrs: { @@ -149,7 +149,7 @@ in }; serde_derive = attrs: { - buildInputs = stdenv.lib.optional stdenv.isDarwin Security; + buildInputs = lib.optional stdenv.isDarwin Security; }; thrussh-libsodium = attrs: { diff --git a/pkgs/build-support/rust/default.nix b/pkgs/build-support/rust/default.nix index 9e8e32035d0..dc86a7dc581 100644 --- a/pkgs/build-support/rust/default.nix +++ b/pkgs/build-support/rust/default.nix @@ -1,4 +1,5 @@ { stdenv +, lib , buildPackages , cacert , cargo @@ -83,13 +84,13 @@ let cargoDepsCopy="$sourceRoot/${cargoVendorDir}" ''; - targetIsJSON = stdenv.lib.hasSuffix ".json" target; + targetIsJSON = lib.hasSuffix ".json" target; useSysroot = targetIsJSON && !__internal_dontAddSysroot; # see https://github.com/rust-lang/cargo/blob/964a16a28e234a3d397b2a7031d4ab4a428b1391/src/cargo/core/compiler/compile_kind.rs#L151-L168 # the "${}" is needed to transform the path into a /nix/store path before baseNameOf shortTarget = if targetIsJSON then - (stdenv.lib.removeSuffix ".json" (builtins.baseNameOf "${target}")) + (lib.removeSuffix ".json" (builtins.baseNameOf "${target}")) else target; sysroot = (callPackage ./sysroot {}) { @@ -116,7 +117,7 @@ in # See https://os.phil-opp.com/testing/ for more information. assert useSysroot -> !(args.doCheck or true); -stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // stdenv.lib.optionalAttrs useSysroot { +stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // lib.optionalAttrs useSysroot { RUSTFLAGS = "--sysroot ${sysroot} " + (args.RUSTFLAGS or ""); } // { inherit cargoDeps; @@ -124,7 +125,7 @@ stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // stdenv.lib.optional patchRegistryDeps = ./patch-registry-deps; nativeBuildInputs = nativeBuildInputs ++ [ cacert git cargo rustc ]; - buildInputs = buildInputs ++ stdenv.lib.optional stdenv.hostPlatform.isMinGW windows.pthreads; + buildInputs = buildInputs ++ lib.optional stdenv.hostPlatform.isMinGW windows.pthreads; patches = cargoPatches ++ patches; @@ -147,11 +148,11 @@ stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // stdenv.lib.optional cat >> .cargo/config <<'EOF' [target."${rust.toRustTarget stdenv.buildPlatform}"] "linker" = "${ccForBuild}" - ${stdenv.lib.optionalString (stdenv.buildPlatform.config != stdenv.hostPlatform.config) '' + ${lib.optionalString (stdenv.buildPlatform.config != stdenv.hostPlatform.config) '' [target."${shortTarget}"] "linker" = "${ccForHost}" ${# https://github.com/rust-lang/rust/issues/46651#issuecomment-433611633 - stdenv.lib.optionalString (stdenv.hostPlatform.isMusl && stdenv.hostPlatform.isAarch64) '' + lib.optionalString (stdenv.hostPlatform.isMusl && stdenv.hostPlatform.isAarch64) '' "rustflags" = [ "-C", "target-feature=+crt-static", "-C", "link-arg=-lgcc" ] ''} ''} @@ -163,7 +164,7 @@ stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // stdenv.lib.optional # After unpacking and applying patches, check that the Cargo.lock matches our # src package. Note that we do this after the patchPhase, because the # patchPhase may create the Cargo.lock if upstream has not shipped one. - postPatch = (args.postPatch or "") + stdenv.lib.optionalString validateCargoDeps '' + postPatch = (args.postPatch or "") + lib.optionalString validateCargoDeps '' cargoDepsLockfile=$NIX_BUILD_TOP/$cargoDepsCopy/Cargo.lock srcLockfile=$NIX_BUILD_TOP/$sourceRoot/Cargo.lock @@ -206,7 +207,7 @@ stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // stdenv.lib.optional ''; buildPhase = with builtins; args.buildPhase or '' - ${stdenv.lib.optionalString (buildAndTestSubdir != null) "pushd ${buildAndTestSubdir}"} + ${lib.optionalString (buildAndTestSubdir != null) "pushd ${buildAndTestSubdir}"} runHook preBuild ( @@ -217,14 +218,14 @@ stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // stdenv.lib.optional "CC_${rust.toRustTarget stdenv.hostPlatform}"="${ccForHost}" \ "CXX_${rust.toRustTarget stdenv.hostPlatform}"="${cxxForHost}" \ cargo build -j $NIX_BUILD_CORES \ - ${stdenv.lib.optionalString (buildType == "release") "--release"} \ + ${lib.optionalString (buildType == "release") "--release"} \ --target ${target} \ --frozen ${concatStringsSep " " cargoBuildFlags} ) runHook postBuild - ${stdenv.lib.optionalString (buildAndTestSubdir != null) "popd"} + ${lib.optionalString (buildAndTestSubdir != null) "popd"} # This needs to be done after postBuild: packages like `cargo` do a pushd/popd in # the pre/postBuild-hooks that need to be taken into account before gathering @@ -238,15 +239,15 @@ stdenv.mkDerivation ((removeAttrs args ["depsExtraArgs"]) // stdenv.lib.optional ''; checkPhase = args.checkPhase or (let - argstr = "${stdenv.lib.optionalString (checkType == "release") "--release"} --target ${target} --frozen"; + argstr = "${lib.optionalString (checkType == "release") "--release"} --target ${target} --frozen"; threads = if cargoParallelTestThreads then "$NIX_BUILD_CORES" else "1"; in '' - ${stdenv.lib.optionalString (buildAndTestSubdir != null) "pushd ${buildAndTestSubdir}"} + ${lib.optionalString (buildAndTestSubdir != null) "pushd ${buildAndTestSubdir}"} runHook preCheck echo "Running cargo test ${argstr} -- ''${checkFlags} ''${checkFlagsArray+''${checkFlagsArray[@]}}" cargo test -j $NIX_BUILD_CORES ${argstr} -- --test-threads=${threads} ''${checkFlags} ''${checkFlagsArray+"''${checkFlagsArray[@]}"} runHook postCheck - ${stdenv.lib.optionalString (buildAndTestSubdir != null) "popd"} + ${lib.optionalString (buildAndTestSubdir != null) "popd"} ''); doCheck = args.doCheck or true; diff --git a/pkgs/build-support/rust/fetchCargoTarball.nix b/pkgs/build-support/rust/fetchCargoTarball.nix index 0726e5cfa5a..c30e88d99b8 100644 --- a/pkgs/build-support/rust/fetchCargoTarball.nix +++ b/pkgs/build-support/rust/fetchCargoTarball.nix @@ -1,4 +1,4 @@ -{ stdenv, cacert, git, cargo, python3 }: +{ lib, stdenv, cacert, git, cargo, python3 }: let cargo-vendor-normalise = stdenv.mkDerivation { name = "cargo-vendor-normalise"; src = ./cargo-vendor-normalise.py; @@ -80,7 +80,7 @@ in stdenv.mkDerivation ({ inherit (hash_) outputHashAlgo outputHash; - impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars; + impureEnvVars = lib.fetchers.proxyImpureEnvVars; } // (builtins.removeAttrs args [ "name" "sha256" "cargoUpdateHook" ])) diff --git a/pkgs/build-support/singularity-tools/default.nix b/pkgs/build-support/singularity-tools/default.nix index 4a54498d117..318f5b430fe 100644 --- a/pkgs/build-support/singularity-tools/default.nix +++ b/pkgs/build-support/singularity-tools/default.nix @@ -1,4 +1,5 @@ { runCommand +, lib , stdenv , storeDir ? builtins.storeDir , writeScript @@ -64,7 +65,7 @@ rec { mkdir proc sys dev # Run root script - ${stdenv.lib.optionalString (runAsRoot != null) '' + ${lib.optionalString (runAsRoot != null) '' mkdir -p ./${storeDir} mount --rbind ${storeDir} ./${storeDir} unshare -imnpuf --mount-proc chroot ./ ${runAsRootFile} diff --git a/pkgs/build-support/skaware/build-skaware-package.nix b/pkgs/build-support/skaware/build-skaware-package.nix index e6e2e35789b..7a5db942b2c 100644 --- a/pkgs/build-support/skaware/build-skaware-package.nix +++ b/pkgs/build-support/skaware/build-skaware-package.nix @@ -1,6 +1,5 @@ -{ stdenv, cleanPackaging, fetchurl }: -let lib = stdenv.lib; -in { +{ lib, stdenv, cleanPackaging, fetchurl }: +{ # : string pname # : string @@ -98,7 +97,7 @@ in stdenv.mkDerivation { meta = { homepage = "https://skarnet.org/software/${pname}/"; inherit description platforms; - license = stdenv.lib.licenses.isc; + license = lib.licenses.isc; maintainers = with lib.maintainers; [ pmahoney Profpatsch ] ++ maintainers; }; diff --git a/pkgs/build-support/skaware/clean-packaging.nix b/pkgs/build-support/skaware/clean-packaging.nix index 762fe25c0ac..421d00ad24a 100644 --- a/pkgs/build-support/skaware/clean-packaging.nix +++ b/pkgs/build-support/skaware/clean-packaging.nix @@ -3,10 +3,10 @@ # files were either discarded or moved to outputs. # This ensures nothing is forgotten and new files # are correctly handled on update. -{ stdenv, file, writeScript }: +{ lib, stdenv, file, writeScript }: let - globWith = stdenv.lib.concatMapStringsSep "\n"; + globWith = lib.concatMapStringsSep "\n"; rmNoise = noiseGlobs: globWith (f: ''rm -rf ${f}'') noiseGlobs; mvDoc = docGlobs: globWith diff --git a/pkgs/build-support/substitute-files/substitute-all-files.nix b/pkgs/build-support/substitute-files/substitute-all-files.nix index 66feb695c41..682e976dcfe 100644 --- a/pkgs/build-support/substitute-files/substitute-all-files.nix +++ b/pkgs/build-support/substitute-files/substitute-all-files.nix @@ -1,10 +1,10 @@ -{ stdenv }: +{ lib, stdenv }: args: stdenv.mkDerivation ({ name = if args ? name then args.name else baseNameOf (toString args.src); - builder = with stdenv.lib; builtins.toFile "builder.sh" '' + builder = builtins.toFile "builder.sh" '' source $stdenv/setup set -o pipefail @@ -13,7 +13,7 @@ stdenv.mkDerivation ({ args= pushd "$src" - echo -ne "${concatStringsSep "\\0" args.files}" | xargs -0 -n1 -I {} -- find {} -type f -print0 | while read -d "" line; do + echo -ne "${lib.concatStringsSep "\\0" args.files}" | xargs -0 -n1 -I {} -- find {} -type f -print0 | while read -d "" line; do mkdir -p "$out/$(dirname "$line")" substituteAll "$line" "$out/$line" done diff --git a/pkgs/build-support/templaterpm/default.nix b/pkgs/build-support/templaterpm/default.nix index 0f7acc13277..ffe5b0b4581 100644 --- a/pkgs/build-support/templaterpm/default.nix +++ b/pkgs/build-support/templaterpm/default.nix @@ -18,7 +18,7 @@ stdenv.mkDerivation { meta = with lib; { description = "Create templates of nix expressions from RPM .spec files"; maintainers = with maintainers; [ tstrobel ]; - platforms = with stdenv.lib.platforms; unix; + platforms = platforms.unix; hydraPlatforms = []; }; } diff --git a/pkgs/build-support/vm/default.nix b/pkgs/build-support/vm/default.nix index 215782368f6..759245aed1a 100644 --- a/pkgs/build-support/vm/default.nix +++ b/pkgs/build-support/vm/default.nix @@ -1,4 +1,5 @@ -{ pkgs +{ lib +, pkgs , kernel ? pkgs.linux , img ? pkgs.stdenv.hostPlatform.linux-kernel.target , storeDir ? builtins.storeDir @@ -572,7 +573,7 @@ rec { buildCommand = '' ${createRootFS} - PATH=$PATH:${stdenv.lib.makeBinPath [ dpkg dpkg glibc lzma ]} + PATH=$PATH:${lib.makeBinPath [ dpkg dpkg glibc lzma ]} # Unpack the .debs. We do this to prevent pre-install scripts # (which have lots of circular dependencies) from barfing. diff --git a/pkgs/build-support/writers/test.nix b/pkgs/build-support/writers/test.nix index 0febad2929a..7b7a698376a 100644 --- a/pkgs/build-support/writers/test.nix +++ b/pkgs/build-support/writers/test.nix @@ -196,7 +196,7 @@ let in runCommand "test-writers" { passthru = { inherit writeTest bin simple; }; - meta.platforms = stdenv.lib.platforms.all; + meta.platforms = lib.platforms.all; } '' ${lib.concatMapStringsSep "\n" (test: writeTest "success" "${test}/bin/test_writers") (lib.attrValues bin)} ${lib.concatMapStringsSep "\n" (test: writeTest "success" test) (lib.attrValues simple)} diff --git a/pkgs/common-updater/scripts.nix b/pkgs/common-updater/scripts.nix index 739f44387b3..351db619884 100644 --- a/pkgs/common-updater/scripts.nix +++ b/pkgs/common-updater/scripts.nix @@ -1,4 +1,4 @@ -{ stdenv, makeWrapper, coreutils, gnused, gnugrep, diffutils, nix, git, jq }: +{ lib, stdenv, makeWrapper, coreutils, gnused, gnugrep, diffutils, nix, git, jq }: stdenv.mkDerivation { name = "common-updater-scripts"; @@ -12,7 +12,7 @@ stdenv.mkDerivation { cp ${./scripts}/* $out/bin for f in $out/bin/*; do - wrapProgram $f --prefix PATH : ${stdenv.lib.makeBinPath [ coreutils gnused gnugrep nix diffutils git jq ]} + wrapProgram $f --prefix PATH : ${lib.makeBinPath [ coreutils gnused gnugrep nix diffutils git jq ]} done ''; } diff --git a/pkgs/games/shattered-pixel-dungeon/default.nix b/pkgs/games/shattered-pixel-dungeon/default.nix index e9186fbf5b7..eea8d5650be 100644 --- a/pkgs/games/shattered-pixel-dungeon/default.nix +++ b/pkgs/games/shattered-pixel-dungeon/default.nix @@ -35,7 +35,7 @@ let buildPhase = '' export GRADLE_USER_HOME=$(mktemp -d) # https://github.com/gradle/gradle/issues/4426 - ${stdenv.lib.optionalString stdenv.isDarwin "export TERM=dumb"} + ${lib.optionalString stdenv.isDarwin "export TERM=dumb"} gradle --no-daemon desktop:release ''; # perl code mavenizes pathes (com.squareup.okio/okio/1.13.0/a9283170b7305c8d92d25aff02a6ab7e45d06cbe/okio-1.13.0.jar -> com/squareup/okio/okio/1.13.0/okio-1.13.0.jar) @@ -57,7 +57,7 @@ in stdenv.mkDerivation rec { buildPhase = '' export GRADLE_USER_HOME=$(mktemp -d) # https://github.com/gradle/gradle/issues/4426 - ${stdenv.lib.optionalString stdenv.isDarwin "export TERM=dumb"} + ${lib.optionalString stdenv.isDarwin "export TERM=dumb"} # point to offline repo sed -ie "s#repositories {#repositories { maven { url '${deps}' };#g" build.gradle gradle --offline --no-daemon desktop:release diff --git a/pkgs/os-specific/linux/statifier/default.nix b/pkgs/os-specific/linux/statifier/default.nix index 376ae47ffbe..5afb399fc16 100644 --- a/pkgs/os-specific/linux/statifier/default.nix +++ b/pkgs/os-specific/linux/statifier/default.nix @@ -1,4 +1,4 @@ -{ multiStdenv, fetchurl }: +{ lib, multiStdenv, fetchurl }: let version = "1.7.4"; in multiStdenv.mkDerivation { @@ -16,7 +16,7 @@ multiStdenv.mkDerivation { sed -e s@/bin/bash@"${multiStdenv.shell}"@g -i src/*.sh ''; - meta = with multiStdenv.lib; { + meta = with lib; { description = "Tool for creating static Linux binaries"; platforms = platforms.linux; license = licenses.gpl2; diff --git a/pkgs/servers/fiche/default.nix b/pkgs/servers/fiche/default.nix index 10ce1c30a0c..2875f274dc0 100644 --- a/pkgs/servers/fiche/default.nix +++ b/pkgs/servers/fiche/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub }: +{ lib, stdenv, fetchFromGitHub }: stdenv.mkDerivation rec { pname = "fiche"; @@ -17,7 +17,7 @@ stdenv.mkDerivation rec { doCheck = true; - meta = with stdenv.lib; { + meta = with lib; { description = "Command line pastebin for sharing terminal output"; longDescription = '' Fiche is a command line pastebin server for sharing terminal output. diff --git a/pkgs/servers/foundationdb/vsmake.nix b/pkgs/servers/foundationdb/vsmake.nix index 262ea39ca5b..aac9ab07c0f 100644 --- a/pkgs/servers/foundationdb/vsmake.nix +++ b/pkgs/servers/foundationdb/vsmake.nix @@ -139,7 +139,7 @@ let outputs = [ "out" "lib" "dev" "pythonsrc" ]; - meta = with gcc6Stdenv.lib; { + meta = with lib; { description = "Open source, distributed, transactional key-value store"; homepage = "https://www.foundationdb.org"; license = licenses.asl20; diff --git a/pkgs/servers/http/envoy/default.nix b/pkgs/servers/http/envoy/default.nix index 0da0cb23d76..c297ea38245 100644 --- a/pkgs/servers/http/envoy/default.nix +++ b/pkgs/servers/http/envoy/default.nix @@ -1,4 +1,5 @@ -{ buildBazelPackage +{ lib +, buildBazelPackage , fetchFromGitHub , stdenv , cmake @@ -109,7 +110,7 @@ buildBazelPackage rec { "--cxxopt=-Wno-uninitialized" ]; - meta = with stdenv.lib; { + meta = with lib; { homepage = "https://envoyproxy.io"; description = "Cloud-native edge and service proxy"; license = licenses.asl20; diff --git a/pkgs/test/cc-wrapper/default.nix b/pkgs/test/cc-wrapper/default.nix index fae3448c44c..d82ba296e2f 100644 --- a/pkgs/test/cc-wrapper/default.nix +++ b/pkgs/test/cc-wrapper/default.nix @@ -1,13 +1,13 @@ -{ stdenv, glibc }: -with stdenv.lib; +{ lib, stdenv, glibc }: + let # Sanitizers are not supported on Darwin. # Sanitizer headers aren't available in older libc++ stdenvs due to a bug sanitizersWorking = !stdenv.hostPlatform.isMusl && ( - (stdenv.cc.isClang && versionAtLeast (getVersion stdenv.cc.name) "5.0.0") + (stdenv.cc.isClang && lib.versionAtLeast (lib.getVersion stdenv.cc.name) "5.0.0") || (stdenv.cc.isGNU && stdenv.isLinux) ); - staticLibc = optionalString (stdenv.hostPlatform.libc == "glibc") "-L ${glibc.static}/lib"; + staticLibc = lib.optionalString (stdenv.hostPlatform.libc == "glibc") "-L ${glibc.static}/lib"; in stdenv.mkDerivation { name = "cc-wrapper-test"; @@ -23,7 +23,7 @@ in stdenv.mkDerivation { $CXX -o cxx-check ${./cxx-main.cc} ./cxx-check - ${optionalString (stdenv.isDarwin && stdenv.cc.isClang) '' + ${lib.optionalString (stdenv.isDarwin && stdenv.cc.isClang) '' printf "checking whether compiler can build with CoreFoundation.framework... " >&2 mkdir -p foo/lib $CC -framework CoreFoundation -o core-foundation-check ${./core-foundation-main.c} @@ -31,12 +31,12 @@ in stdenv.mkDerivation { ''} - ${optionalString (!stdenv.isDarwin) '' + ${lib.optionalString (!stdenv.isDarwin) '' printf "checking whether compiler builds valid static C binaries... " >&2 $CC ${staticLibc} -static -o cc-static ${./cc-main.c} ./cc-static # our glibc does not have pie enabled yet. - ${optionalString (stdenv.hostPlatform.isMusl && stdenv.cc.isGNU) '' + ${lib.optionalString (stdenv.hostPlatform.isMusl && stdenv.cc.isGNU) '' printf "checking whether compiler builds valid static pie C binaries... " >&2 $CC ${staticLibc} -static-pie -o cc-static-pie ${./cc-main.c} ./cc-static-pie @@ -52,7 +52,7 @@ in stdenv.mkDerivation { printf "checking whether compiler uses NIX_LDFLAGS... " >&2 mkdir -p foo/lib $CC -shared \ - ${optionalString stdenv.isDarwin "-Wl,-install_name,@rpath/libfoo.dylib"} \ + ${lib.optionalString stdenv.isDarwin "-Wl,-install_name,@rpath/libfoo.dylib"} \ -DVALUE=42 \ -o foo/lib/libfoo${stdenv.hostPlatform.extensions.sharedLibrary} \ ${./foo.c} @@ -68,7 +68,7 @@ in stdenv.mkDerivation { $CXX -I std-include -nostdinc++ -o nostdinc-main++ ${./nostdinc-main.c} ./nostdinc-main++ - ${optionalString sanitizersWorking '' + ${lib.optionalString sanitizersWorking '' printf "checking whether sanitizers are fully functional... ">&2 $CC -o sanitizers -fsanitize=address,undefined ${./sanitizers.c} ./sanitizers @@ -77,5 +77,5 @@ in stdenv.mkDerivation { touch $out ''; - meta.platforms = platforms.all; + meta.platforms = lib.platforms.all; } diff --git a/pkgs/test/cc-wrapper/multilib.nix b/pkgs/test/cc-wrapper/multilib.nix index 5ea50b5eb26..828ad67f6c8 100644 --- a/pkgs/test/cc-wrapper/multilib.nix +++ b/pkgs/test/cc-wrapper/multilib.nix @@ -1,4 +1,4 @@ -{ stdenv }: +{ lib, stdenv }: stdenv.mkDerivation { name = "cc-multilib-test"; @@ -33,5 +33,5 @@ stdenv.mkDerivation { touch $out ''; - meta.platforms = stdenv.lib.platforms.x86_64; + meta.platforms = lib.platforms.x86_64; } diff --git a/pkgs/test/install-shell-files/default.nix b/pkgs/test/install-shell-files/default.nix index e3729c7d250..e9d32e4ccf6 100644 --- a/pkgs/test/install-shell-files/default.nix +++ b/pkgs/test/install-shell-files/default.nix @@ -1,10 +1,10 @@ -{ stdenv, runCommandLocal, recurseIntoAttrs, installShellFiles }: +{ lib, stdenv, runCommandLocal, recurseIntoAttrs, installShellFiles }: let runTest = name: env: buildCommand: runCommandLocal "install-shell-files--${name}" ({ nativeBuildInputs = [ installShellFiles ]; - meta.platforms = stdenv.lib.platforms.all; + meta.platforms = lib.platforms.all; } // env) buildCommand; in diff --git a/pkgs/test/ld-library-path/default.nix b/pkgs/test/ld-library-path/default.nix index bda3f0be84a..74c52cef253 100644 --- a/pkgs/test/ld-library-path/default.nix +++ b/pkgs/test/ld-library-path/default.nix @@ -1,4 +1,4 @@ -{ stdenv }: +{ lib, stdenv }: # This tests that libraries listed in LD_LIBRARY_PATH take precedence over those listed in RPATH. @@ -84,5 +84,5 @@ in stdenv.mkDerivation { touch $out ''; - meta.platforms = stdenv.lib.platforms.linux; + meta.platforms = lib.platforms.linux; } diff --git a/pkgs/test/patch-shebangs/default.nix b/pkgs/test/patch-shebangs/default.nix index 3e68d96004f..5e1d859c138 100644 --- a/pkgs/test/patch-shebangs/default.nix +++ b/pkgs/test/patch-shebangs/default.nix @@ -1,4 +1,4 @@ -{ stdenv, runCommand }: +{ lib, stdenv, runCommand }: let bad-shebang = stdenv.mkDerivation { @@ -13,7 +13,7 @@ let }; in runCommand "patch-shebangs-test" { passthru = { inherit bad-shebang; }; - meta.platforms = stdenv.lib.platforms.all; + meta.platforms = lib.platforms.all; } '' printf "checking whether patchShebangs works properly... ">&2 if ! grep -q '^#!/bin/sh' ${bad-shebang}/bin/test; then diff --git a/pkgs/test/stdenv-inputs/default.nix b/pkgs/test/stdenv-inputs/default.nix index 4db10e75086..6a2e441d019 100644 --- a/pkgs/test/stdenv-inputs/default.nix +++ b/pkgs/test/stdenv-inputs/default.nix @@ -1,4 +1,4 @@ -{ stdenv }: +{ lib, stdenv }: let foo = stdenv.mkDerivation { @@ -12,7 +12,7 @@ let chmod +x $out/bin/foo cp ${./foo.c} $out/include/foo.h $CC -shared \ - ${stdenv.lib.optionalString stdenv.isDarwin "-Wl,-install_name,$out/lib/libfoo.dylib"} \ + ${lib.optionalString stdenv.isDarwin "-Wl,-install_name,$out/lib/libfoo.dylib"} \ -o $out/lib/libfoo${stdenv.hostPlatform.extensions.sharedLibrary} \ ${./foo.c} ''; @@ -30,7 +30,7 @@ let chmod +x $out/bin/bar cp ${./bar.c} $dev/include/bar.h $CC -shared \ - ${stdenv.lib.optionalString stdenv.isDarwin "-Wl,-install_name,$dev/lib/libbar.dylib"} \ + ${lib.optionalString stdenv.isDarwin "-Wl,-install_name,$dev/lib/libbar.dylib"} \ -o $dev/lib/libbar${stdenv.hostPlatform.extensions.sharedLibrary} \ ${./bar.c} ''; @@ -64,5 +64,5 @@ stdenv.mkDerivation { touch $out ''; - meta.platforms = stdenv.lib.platforms.all; + meta.platforms = lib.platforms.all; } diff --git a/pkgs/tools/graphics/metapixel/default.nix b/pkgs/tools/graphics/metapixel/default.nix index a97be7f809c..8c9fef0cd48 100644 --- a/pkgs/tools/graphics/metapixel/default.nix +++ b/pkgs/tools/graphics/metapixel/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, libpng, libjpeg, giflib, perl, pkg-config }: +{ lib, stdenv, fetchFromGitHub, libpng, libjpeg, giflib, perl, pkg-config }: stdenv.mkDerivation rec { pname = "metapixel"; @@ -24,7 +24,7 @@ stdenv.mkDerivation rec { cp metapixel-sizesort $out/bin/metapixel-sizesort ''; - meta = with stdenv.lib; { + meta = with lib; { homepage = "https://github.com/schani/metapixel"; description = "Tool for generating photomosaics"; license = licenses.gpl2Only; diff --git a/pkgs/tools/networking/lxi-tools/default.nix b/pkgs/tools/networking/lxi-tools/default.nix index 3f3e62fb807..92ef7f688a5 100644 --- a/pkgs/tools/networking/lxi-tools/default.nix +++ b/pkgs/tools/networking/lxi-tools/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub +{ lib, stdenv, fetchFromGitHub , autoreconfHook, pkg-config , liblxi, readline, lua }: @@ -18,7 +18,7 @@ stdenv.mkDerivation rec { buildInputs = [ liblxi readline lua ]; - meta = with stdenv.lib; { + meta = with lib; { description = "Tool for communicating with LXI compatible instruments"; longDescription = '' lxi-tools is a collection of open source software tools diff --git a/pkgs/tools/text/source-highlight/default.nix b/pkgs/tools/text/source-highlight/default.nix index 3d3a0f8c50a..2e60d2a31c0 100644 --- a/pkgs/tools/text/source-highlight/default.nix +++ b/pkgs/tools/text/source-highlight/default.nix @@ -15,7 +15,7 @@ stdenv.mkDerivation { # source-highlight uses it's own binary to generate documentation. # During cross-compilation, that binary was built for the target # platform architecture, so it can't run on the build host. - patchPhase = stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' + patchPhase = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) '' substituteInPlace Makefile.in --replace "src doc tests" "src tests" '';