summary refs log tree commit diff
path: root/nixos/modules/system/activation
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2014-04-14 16:26:48 +0200
committerEelco Dolstra <eelco.dolstra@logicblox.com>2014-04-14 16:26:48 +0200
commit29027fd1e12461fc5ff5722bea79df7ff4299599 (patch)
treefec0d7ba9f295be106fcf41759cee8b94d79dc9d /nixos/modules/system/activation
parent4f2aa2f7061984fa7aa21bac92ed5eec3f3daa06 (diff)
downloadnixlib-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/system/activation')
-rw-r--r--nixos/modules/system/activation/activation-script.nix4
-rw-r--r--nixos/modules/system/activation/no-clone.nix4
-rw-r--r--nixos/modules/system/activation/top-level.nix6
3 files changed, 7 insertions, 7 deletions
diff --git a/nixos/modules/system/activation/activation-script.nix b/nixos/modules/system/activation/activation-script.nix
index 1545bcb8a1f9..41fe7d309a5a 100644
--- a/nixos/modules/system/activation/activation-script.nix
+++ b/nixos/modules/system/activation/activation-script.nix
@@ -1,7 +1,7 @@
 # generate the script used to activate the configuration.
-{ config, pkgs, ... }:
+{ config, lib, pkgs, ... }:
 
-with pkgs.lib;
+with lib;
 
 let
 
diff --git a/nixos/modules/system/activation/no-clone.nix b/nixos/modules/system/activation/no-clone.nix
index c9ab691ce477..7f4584435266 100644
--- a/nixos/modules/system/activation/no-clone.nix
+++ b/nixos/modules/system/activation/no-clone.nix
@@ -1,6 +1,6 @@
-{pkgs, ...}:
+{ lib, ... }:
 
-with pkgs.lib;
+with lib;
 
 {
   boot.loader.grub.device = mkOverride 0 "nodev";
diff --git a/nixos/modules/system/activation/top-level.nix b/nixos/modules/system/activation/top-level.nix
index d9891f434cc8..a4a0d14df6ab 100644
--- a/nixos/modules/system/activation/top-level.nix
+++ b/nixos/modules/system/activation/top-level.nix
@@ -1,6 +1,6 @@
-{ config, pkgs, modules, baseModules, ... }:
+{ config, lib, pkgs, modules, baseModules, ... }:
 
-with pkgs.lib;
+with lib;
 
 let
 
@@ -11,7 +11,7 @@ let
   # you can provide an easy way to boot the same configuration
   # as you use, but with another kernel
   # !!! fix this
-  cloner = inheritParent: list: with pkgs.lib;
+  cloner = inheritParent: list:
     map (childConfig:
       (import ../../../lib/eval-config.nix {
         inherit baseModules;