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,8 +1,8 @@
|
||||
# Global configuration for atop.
|
||||
|
||||
{config, pkgs, ...}:
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with pkgs.lib;
|
||||
with lib;
|
||||
|
||||
let cfg = config.programs.atop;
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
# This module defines global configuration for the Bash shell, in
|
||||
# particular /etc/bashrc and /etc/profile.
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with pkgs.lib;
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
# SQLite database that maps program names to Nix package names (e.g.,
|
||||
# "pdflatex" is mapped to "tetex").
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with pkgs.lib;
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@
|
||||
|
||||
# Most of the stuff here should probably be moved elsewhere sometime.
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with pkgs.lib;
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Configuration for the pwdutils suite of tools: passwd, useradd, etc.
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with pkgs.lib;
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# This module defines a standard configuration for NixOS shells.
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with pkgs.lib;
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Global configuration for the SSH client.
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with pkgs.lib;
|
||||
with lib;
|
||||
|
||||
let cfg = config.programs.ssh;
|
||||
cfgd = config.services.openssh;
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
# directly to an SMTP server defined in its configuration file, wihout
|
||||
# queueing mail locally.
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with pkgs.lib;
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{config, pkgs, ...}:
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with pkgs.lib;
|
||||
with lib;
|
||||
let
|
||||
cfg = config.services.venus;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{ config, pkgs, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with pkgs.lib;
|
||||
with lib;
|
||||
|
||||
let virtualbox = config.boot.kernelPackages.virtualbox; in
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# Global configuration for wvdial.
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with pkgs.lib;
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# This module defines global configuration for the zshell.
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
{ config, lib, pkgs, ... }:
|
||||
|
||||
with pkgs.lib;
|
||||
with lib;
|
||||
|
||||
let
|
||||
|
||||
|
||||
Reference in New Issue
Block a user