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.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# Provide a basic configuration for installation devices like CDs.
|
||||
{ config, pkgs, modules, ... }:
|
||||
{ config, lib, ... }:
|
||||
|
||||
with pkgs.lib;
|
||||
with lib;
|
||||
|
||||
{
|
||||
imports =
|
||||
@@ -45,7 +45,7 @@ with pkgs.lib;
|
||||
|
||||
# Enable wpa_supplicant, but don't start it by default.
|
||||
networking.wireless.enable = true;
|
||||
jobs.wpa_supplicant.startOn = pkgs.lib.mkOverride 50 "";
|
||||
jobs.wpa_supplicant.startOn = mkOverride 50 "";
|
||||
|
||||
# Tell the Nix evaluator to garbage collect more aggressively.
|
||||
# This is desirable in memory-constrained environments that don't
|
||||
|
||||
Reference in New Issue
Block a user