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/virtualisation | |
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/virtualisation')
-rw-r--r-- | nixos/modules/virtualisation/amazon-image.nix | 4 | ||||
-rw-r--r-- | nixos/modules/virtualisation/containers.nix | 4 | ||||
-rw-r--r-- | nixos/modules/virtualisation/ec2-data.nix | 4 | ||||
-rw-r--r-- | nixos/modules/virtualisation/google-compute-image.nix | 4 | ||||
-rw-r--r-- | nixos/modules/virtualisation/libvirtd.nix | 4 | ||||
-rw-r--r-- | nixos/modules/virtualisation/nixos-container.pl | 4 | ||||
-rw-r--r-- | nixos/modules/virtualisation/nova-image.nix | 4 | ||||
-rw-r--r-- | nixos/modules/virtualisation/nova.nix | 4 | ||||
-rw-r--r-- | nixos/modules/virtualisation/qemu-vm.nix | 4 | ||||
-rw-r--r-- | nixos/modules/virtualisation/virtualbox-guest.nix | 4 | ||||
-rw-r--r-- | nixos/modules/virtualisation/virtualbox-image.nix | 4 | ||||
-rw-r--r-- | nixos/modules/virtualisation/xen-dom0.nix | 4 |
12 files changed, 24 insertions, 24 deletions
diff --git a/nixos/modules/virtualisation/amazon-image.nix b/nixos/modules/virtualisation/amazon-image.nix index 99d6f927ef0b..18b18dd4b230 100644 --- a/nixos/modules/virtualisation/amazon-image.nix +++ b/nixos/modules/virtualisation/amazon-image.nix @@ -1,6 +1,6 @@ -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: -with pkgs.lib; +with lib; { imports = [ ../profiles/headless.nix ./ec2-data.nix ]; diff --git a/nixos/modules/virtualisation/containers.nix b/nixos/modules/virtualisation/containers.nix index c53bd7d3509d..51402f3e32de 100644 --- a/nixos/modules/virtualisation/containers.nix +++ b/nixos/modules/virtualisation/containers.nix @@ -1,6 +1,6 @@ -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: -with pkgs.lib; +with lib; let diff --git a/nixos/modules/virtualisation/ec2-data.nix b/nixos/modules/virtualisation/ec2-data.nix index 5133a98cd962..246d35065317 100644 --- a/nixos/modules/virtualisation/ec2-data.nix +++ b/nixos/modules/virtualisation/ec2-data.nix @@ -2,9 +2,9 @@ # host name of virtual machines running on Amazon EC2, Eucalyptus and # OpenStack Compute (Nova). -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: -with pkgs.lib; +with lib; { options = { diff --git a/nixos/modules/virtualisation/google-compute-image.nix b/nixos/modules/virtualisation/google-compute-image.nix index 5fca115b819c..34b8b0e9c1ca 100644 --- a/nixos/modules/virtualisation/google-compute-image.nix +++ b/nixos/modules/virtualisation/google-compute-image.nix @@ -1,6 +1,6 @@ -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: -with pkgs.lib; +with lib; let diskSize = "100G"; in diff --git a/nixos/modules/virtualisation/libvirtd.nix b/nixos/modules/virtualisation/libvirtd.nix index 6d36fd4caa06..d7d700d88412 100644 --- a/nixos/modules/virtualisation/libvirtd.nix +++ b/nixos/modules/virtualisation/libvirtd.nix @@ -1,8 +1,8 @@ # Systemd services for libvirtd. -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: -with pkgs.lib; +with lib; let diff --git a/nixos/modules/virtualisation/nixos-container.pl b/nixos/modules/virtualisation/nixos-container.pl index d7e8c7339b6d..f04b2b3e74e2 100644 --- a/nixos/modules/virtualisation/nixos-container.pl +++ b/nixos/modules/virtualisation/nixos-container.pl @@ -59,9 +59,9 @@ sub writeNixOSConfig { my ($nixosConfigFile) = @_; my $nixosConfig = <<EOF; -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: -with pkgs.lib; +with lib; { boot.isContainer = true; security.initialRootPassword = mkDefault "!"; diff --git a/nixos/modules/virtualisation/nova-image.nix b/nixos/modules/virtualisation/nova-image.nix index 5c9481b71278..2523dacc0b56 100644 --- a/nixos/modules/virtualisation/nova-image.nix +++ b/nixos/modules/virtualisation/nova-image.nix @@ -1,6 +1,6 @@ -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: -with pkgs.lib; +with lib; { imports = [ ../profiles/qemu-guest.nix ../profiles/headless.nix ./ec2-data.nix ]; diff --git a/nixos/modules/virtualisation/nova.nix b/nixos/modules/virtualisation/nova.nix index e0d25183574e..8795b5b52d5a 100644 --- a/nixos/modules/virtualisation/nova.nix +++ b/nixos/modules/virtualisation/nova.nix @@ -1,8 +1,8 @@ # Module for Nova, a.k.a. OpenStack Compute. -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: -with pkgs.lib; +with lib; let diff --git a/nixos/modules/virtualisation/qemu-vm.nix b/nixos/modules/virtualisation/qemu-vm.nix index a866b513f0f2..7662427854e5 100644 --- a/nixos/modules/virtualisation/qemu-vm.nix +++ b/nixos/modules/virtualisation/qemu-vm.nix @@ -7,9 +7,9 @@ # the VM in the host. On the other hand, the root filesystem is a # read/writable disk image persistent across VM reboots. -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: -with pkgs.lib; +with lib; let diff --git a/nixos/modules/virtualisation/virtualbox-guest.nix b/nixos/modules/virtualisation/virtualbox-guest.nix index b06ae94438ee..96354f1d81d0 100644 --- a/nixos/modules/virtualisation/virtualbox-guest.nix +++ b/nixos/modules/virtualisation/virtualbox-guest.nix @@ -1,8 +1,8 @@ # Module for VirtualBox guests. -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: -with pkgs.lib; +with lib; let diff --git a/nixos/modules/virtualisation/virtualbox-image.nix b/nixos/modules/virtualisation/virtualbox-image.nix index 8323325dabf2..3247881784e4 100644 --- a/nixos/modules/virtualisation/virtualbox-image.nix +++ b/nixos/modules/virtualisation/virtualbox-image.nix @@ -1,6 +1,6 @@ -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: -with pkgs.lib; +with lib; { system.build.virtualBoxImage = diff --git a/nixos/modules/virtualisation/xen-dom0.nix b/nixos/modules/virtualisation/xen-dom0.nix index 40f6929be4f0..566059472c9f 100644 --- a/nixos/modules/virtualisation/xen-dom0.nix +++ b/nixos/modules/virtualisation/xen-dom0.nix @@ -1,8 +1,8 @@ # Xen hypervisor (Dom0) support. -{ config, pkgs, ... }: +{ config, lib, pkgs, ... }: -with pkgs.lib; +with lib; let |