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.
This commit is contained in:
K900 2023-10-01 20:48:40 +03:00
parent 58aa673711
commit e53c99eb17
3 changed files with 3 additions and 3 deletions

View file

@ -69,7 +69,7 @@ in {
}) })
(mkIf cfg.enableAllFirmware { (mkIf cfg.enableAllFirmware {
assertions = [{ assertions = [{
assertion = !cfg.enableAllFirmware || config.nixpkgs.config.allowUnfree; assertion = !cfg.enableAllFirmware || pkgs.config.allowUnfree;
message = '' message = ''
the list of hardware.enableAllFirmware contains non-redistributable licensed firmware files. the list of hardware.enableAllFirmware contains non-redistributable licensed firmware files.
This requires nixpkgs.config.allowUnfree to be true. This requires nixpkgs.config.allowUnfree to be true.

View file

@ -237,7 +237,7 @@ in
# copy-pasted from the wrapper; TODO: figure out fix # copy-pasted from the wrapper; TODO: figure out fix
applicationName = cfg.package.binaryName or (lib.getName cfg.package); applicationName = cfg.package.binaryName or (lib.getName cfg.package);
nixpkgsConfig = config.nixpkgs.config.${applicationName} or {}; nixpkgsConfig = pkgs.config.${applicationName} or {};
optionConfig = cfg.wrapperConfig; optionConfig = cfg.wrapperConfig;
nmhConfig = { nmhConfig = {
enableBrowserpass = nmh.browserpass; enableBrowserpass = nmh.browserpass;

View file

@ -91,7 +91,7 @@ in
}; };
config = mkIf cfg.enable (mkMerge [{ 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'"]; ["'nixpkgs.virtualbox.enableExtensionPack' has no effect, please use 'virtualisation.virtualbox.host.enableExtensionPack'"];
boot.kernelModules = [ "vboxdrv" "vboxnetadp" "vboxnetflt" ]; boot.kernelModules = [ "vboxdrv" "vboxnetadp" "vboxnetflt" ];
boot.extraModulePackages = [ kernelModules ]; boot.extraModulePackages = [ kernelModules ];