Skip to content

Commit

Permalink
treewide: use pkgs.config instead of config.nixpkgs.config
Browse files Browse the repository at this point in the history
`pkgs` may be passed in externally, in which case `config.nixpkgs.config` will not be set.

Follow-up to NixOS#257458.
  • Loading branch information
K900 committed Oct 1, 2023
1 parent 58aa673 commit e53c99e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nixos/modules/hardware/all-firmware.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/programs/firefox.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion nixos/modules/virtualisation/virtualbox-host.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ];
Expand Down

0 comments on commit e53c99e

Please sign in to comment.