From e53c99eb17265d7000d95db909cd1494618deefa Mon Sep 17 00:00:00 2001 From: K900 Date: Sun, 1 Oct 2023 20:48:40 +0300 Subject: [PATCH] treewide: use `pkgs.config` instead of `config.nixpkgs.config` `pkgs` may be passed in externally, in which case `config.nixpkgs.config` will not be set. Follow-up to #257458. --- nixos/modules/hardware/all-firmware.nix | 2 +- nixos/modules/programs/firefox.nix | 2 +- nixos/modules/virtualisation/virtualbox-host.nix | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/nixos/modules/hardware/all-firmware.nix b/nixos/modules/hardware/all-firmware.nix index 9e7a01c58afe..08141bb0e87b 100644 --- a/nixos/modules/hardware/all-firmware.nix +++ b/nixos/modules/hardware/all-firmware.nix @@ -69,7 +69,7 @@ in { }) (mkIf cfg.enableAllFirmware { assertions = [{ - assertion = !cfg.enableAllFirmware || config.nixpkgs.config.allowUnfree; + assertion = !cfg.enableAllFirmware || pkgs.config.allowUnfree; message = '' the list of hardware.enableAllFirmware contains non-redistributable licensed firmware files. This requires nixpkgs.config.allowUnfree to be true. diff --git a/nixos/modules/programs/firefox.nix b/nixos/modules/programs/firefox.nix index 43cf64cf1d82..83a3edaf813e 100644 --- a/nixos/modules/programs/firefox.nix +++ b/nixos/modules/programs/firefox.nix @@ -237,7 +237,7 @@ in # copy-pasted from the wrapper; TODO: figure out fix applicationName = cfg.package.binaryName or (lib.getName cfg.package); - nixpkgsConfig = config.nixpkgs.config.${applicationName} or {}; + nixpkgsConfig = pkgs.config.${applicationName} or {}; optionConfig = cfg.wrapperConfig; nmhConfig = { enableBrowserpass = nmh.browserpass; diff --git a/nixos/modules/virtualisation/virtualbox-host.nix b/nixos/modules/virtualisation/virtualbox-host.nix index b1565a09682a..9741ea090f79 100644 --- a/nixos/modules/virtualisation/virtualbox-host.nix +++ b/nixos/modules/virtualisation/virtualbox-host.nix @@ -91,7 +91,7 @@ in }; config = mkIf cfg.enable (mkMerge [{ - warnings = mkIf (config.nixpkgs.config.virtualbox.enableExtensionPack or false) + warnings = mkIf (pkgs.config.virtualbox.enableExtensionPack or false) ["'nixpkgs.virtualbox.enableExtensionPack' has no effect, please use 'virtualisation.virtualbox.host.enableExtensionPack'"]; boot.kernelModules = [ "vboxdrv" "vboxnetadp" "vboxnetflt" ]; boot.extraModulePackages = [ kernelModules ];