diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-04-14 16:26:48 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2014-04-14 16:26:48 +0200 |
commit | 29027fd1e12461fc5ff5722bea79df7ff4299599 (patch) | |
tree | fec0d7ba9f295be106fcf41759cee8b94d79dc9d /nixos/modules/installer | |
parent | 4f2aa2f7061984fa7aa21bac92ed5eec3f3daa06 (diff) | |
download | nixlib-29027fd1e12461fc5ff5722bea79df7ff4299599.tar nixlib-29027fd1e12461fc5ff5722bea79df7ff4299599.tar.gz nixlib-29027fd1e12461fc5ff5722bea79df7ff4299599.tar.bz2 nixlib-29027fd1e12461fc5ff5722bea79df7ff4299599.tar.lz nixlib-29027fd1e12461fc5ff5722bea79df7ff4299599.tar.xz nixlib-29027fd1e12461fc5ff5722bea79df7ff4299599.tar.zst nixlib-29027fd1e12461fc5ff5722bea79df7ff4299599.zip |
Rewrite ‘with pkgs.lib’ -> ‘with lib’
Using pkgs.lib on the spine of module evaluation is problematic because the pkgs argument depends on the result of module evaluation. To prevent an infinite recursion, pkgs and some of the modules are evaluated twice, which is inefficient. Using ‘with lib’ prevents this problem.
Diffstat (limited to 'nixos/modules/installer')
13 files changed, 26 insertions, 26 deletions
diff --git a/nixos/modules/installer/cd-dvd/channel.nix b/nixos/modules/installer/cd-dvd/channel.nix index 74428f66dfa1..ca0e233f9e3f 100644 --- a/nixos/modules/installer/cd-dvd/channel.nix +++ b/nixos/modules/installer/cd-dvd/channel.nix @@ -1,9 +1,9 @@ # Provide an initial copy of the NixOS channel so that the user # doesn't need to run "nix-channel --update" first. -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: -with pkgs.lib; +with lib; let diff --git a/nixos/modules/installer/cd-dvd/installation-cd-base.nix b/nixos/modules/installer/cd-dvd/installation-cd-base.nix index 74a2f50f027b..a120a01041bd 100644 --- a/nixos/modules/installer/cd-dvd/installation-cd-base.nix +++ b/nixos/modules/installer/cd-dvd/installation-cd-base.nix @@ -1,9 +1,9 @@ # This module contains the basic configuration for building a NixOS # installation CD. -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: -with pkgs.lib; +with lib; { imports = diff --git a/nixos/modules/installer/cd-dvd/installation-cd-graphical.nix b/nixos/modules/installer/cd-dvd/installation-cd-graphical.nix index debf3e7db906..65aa11670893 100644 --- a/nixos/modules/installer/cd-dvd/installation-cd-graphical.nix +++ b/nixos/modules/installer/cd-dvd/installation-cd-graphical.nix @@ -1,9 +1,9 @@ # This module defines a NixOS installation CD that contains X11 and # KDE 4. -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: -with pkgs.lib; +with lib; { imports = [ ./installation-cd-base.nix ../../profiles/graphical.nix ]; diff --git a/nixos/modules/installer/cd-dvd/iso-image.nix b/nixos/modules/installer/cd-dvd/iso-image.nix index 00a9e91c7338..00f5fae84342 100644 --- a/nixos/modules/installer/cd-dvd/iso-image.nix +++ b/nixos/modules/installer/cd-dvd/iso-image.nix @@ -2,9 +2,9 @@ # configuration. The derivation for the ISO image will be placed in # config.system.build.isoImage. -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: -with pkgs.lib; +with lib; let diff --git a/nixos/modules/installer/cd-dvd/system-tarball-fuloong2f.nix b/nixos/modules/installer/cd-dvd/system-tarball-fuloong2f.nix index 13ed95d4cebd..c274970c5536 100644 --- a/nixos/modules/installer/cd-dvd/system-tarball-fuloong2f.nix +++ b/nixos/modules/installer/cd-dvd/system-tarball-fuloong2f.nix @@ -1,6 +1,6 @@ -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: -with pkgs.lib; +with lib; let diff --git a/nixos/modules/installer/cd-dvd/system-tarball-pc.nix b/nixos/modules/installer/cd-dvd/system-tarball-pc.nix index fcb96f7a24fe..0357bf801960 100644 --- a/nixos/modules/installer/cd-dvd/system-tarball-pc.nix +++ b/nixos/modules/installer/cd-dvd/system-tarball-pc.nix @@ -1,9 +1,9 @@ # This module contains the basic configuration for building a NixOS # tarball, that can directly boot, maybe using PXE or unpacking on a fs. -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: -with pkgs.lib; +with lib; let diff --git a/nixos/modules/installer/cd-dvd/system-tarball-sheevaplug.nix b/nixos/modules/installer/cd-dvd/system-tarball-sheevaplug.nix index c3ced8490014..1008bd5d3d0d 100644 --- a/nixos/modules/installer/cd-dvd/system-tarball-sheevaplug.nix +++ b/nixos/modules/installer/cd-dvd/system-tarball-sheevaplug.nix @@ -1,9 +1,9 @@ # This module contains the basic configuration for building a NixOS # tarball for the sheevaplug. -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: -with pkgs.lib; +with lib; let diff --git a/nixos/modules/installer/cd-dvd/system-tarball.nix b/nixos/modules/installer/cd-dvd/system-tarball.nix index 8d678fba71f5..eaecbe1381f5 100644 --- a/nixos/modules/installer/cd-dvd/system-tarball.nix +++ b/nixos/modules/installer/cd-dvd/system-tarball.nix @@ -2,9 +2,9 @@ # configuration. The derivation for the ISO image will be placed in # config.system.build.tarball. -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: -with pkgs.lib; +with lib; let diff --git a/nixos/modules/installer/scan/detected.nix b/nixos/modules/installer/scan/detected.nix index 09d04608e685..f350cd986afa 100644 --- a/nixos/modules/installer/scan/detected.nix +++ b/nixos/modules/installer/scan/detected.nix @@ -1,8 +1,8 @@ # List all devices which are detected by nixos-hardware-scan. # Common devices are enabled by default. -{config, pkgs, ...}: +{ config, lib, pkgs, ... }: -with pkgs.lib; +with lib; { config = mkDefault { diff --git a/nixos/modules/installer/scan/not-detected.nix b/nixos/modules/installer/scan/not-detected.nix index 814858fdffda..b30c569ed2a7 100644 --- a/nixos/modules/installer/scan/not-detected.nix +++ b/nixos/modules/installer/scan/not-detected.nix @@ -1,8 +1,8 @@ # List all devices which are _not_ detected by nixos-hardware-scan. # Common devices are enabled by default. -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: -with pkgs.lib; +with lib; { hardware.enableAllFirmware = true; diff --git a/nixos/modules/installer/tools/nixos-checkout.nix b/nixos/modules/installer/tools/nixos-checkout.nix index 418998556864..3338e5119acb 100644 --- a/nixos/modules/installer/tools/nixos-checkout.nix +++ b/nixos/modules/installer/tools/nixos-checkout.nix @@ -1,9 +1,9 @@ # This module generates the nixos-checkout script, which replaces the # Nixpkgs source trees in /etc/nixos/nixpkgs with a Git checkout. -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: -with pkgs.lib; +with lib; let diff --git a/nixos/modules/installer/tools/tools.nix b/nixos/modules/installer/tools/tools.nix index 652bfa917dfa..7dbcc261485d 100644 --- a/nixos/modules/installer/tools/tools.nix +++ b/nixos/modules/installer/tools/tools.nix @@ -80,9 +80,9 @@ in /* options = { - installer.enableGraphicalTools = pkgs.lib.mkOption { + installer.enableGraphicalTools = mkOption { default = false; - type = with pkgs.lib.types; bool; + type = types.bool; example = true; description = '' Enable the installation of graphical tools. diff --git a/nixos/modules/installer/virtualbox-demo.nix b/nixos/modules/installer/virtualbox-demo.nix index 9ef41e470747..0a52cbea2897 100644 --- a/nixos/modules/installer/virtualbox-demo.nix +++ b/nixos/modules/installer/virtualbox-demo.nix @@ -1,6 +1,6 @@ -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: -with pkgs.lib; +with lib; { imports = |