From 2141b99d9e22754bfba55b75c26a7da0c66d1241 Mon Sep 17 00:00:00 2001 From: Yureka Date: Tue, 27 Jan 2026 13:01:28 +0100 Subject: [PATCH] tree-wide: use allowUnfreePackages where applicable --- nixos/modules/hardware/facter/virtualisation.nix | 2 +- nixos/modules/installer/tools/nixos-generate-config.pl | 2 +- nixos/tests/sabnzbd-module.nix | 2 +- .../networking/cluster/k3s/docs/examples/NVIDIA.md | 2 +- pkgs/by-name/jo/joypixels/package.nix | 9 ++++----- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/nixos/modules/hardware/facter/virtualisation.nix b/nixos/modules/hardware/facter/virtualisation.nix index e1a9a1647708..6acdd62516f9 100644 --- a/nixos/modules/hardware/facter/virtualisation.nix +++ b/nixos/modules/hardware/facter/virtualisation.nix @@ -105,7 +105,7 @@ in # parallels hardware.parallels.enable = lib.mkIf cfg.parallels.enable (lib.mkDefault true); nixpkgs.config = lib.mkIf (!options.nixpkgs.pkgs.isDefined && cfg.parallels.enable) { - allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "prl-tools" ]; + allowUnfreePackages = [ "prl-tools" ]; }; }; } diff --git a/nixos/modules/installer/tools/nixos-generate-config.pl b/nixos/modules/installer/tools/nixos-generate-config.pl index bbd0a093b998..1586a09aee5f 100644 --- a/nixos/modules/installer/tools/nixos-generate-config.pl +++ b/nixos/modules/installer/tools/nixos-generate-config.pl @@ -300,7 +300,7 @@ if ($virt eq "oracle") { # It is blocked by https://github.com/systemd/systemd/pull/23859 if ($virt eq "parallels") { push @attrs, "hardware.parallels.enable = true;"; - push @attrs, "nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ \"prl-tools\" ];"; + push @attrs, "nixpkgs.config.allowUnfreePackages = [ \"prl-tools\" ];"; } # Likewise for QEMU. diff --git a/nixos/tests/sabnzbd-module.nix b/nixos/tests/sabnzbd-module.nix index 6b04049e9131..fd9f48ae35d0 100644 --- a/nixos/tests/sabnzbd-module.nix +++ b/nixos/tests/sabnzbd-module.nix @@ -60,7 +60,7 @@ ]; # unrar is unfree - nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ "unrar" ]; + nixpkgs.config.allowUnfreePackages = [ "unrar" ]; }; testScript = '' diff --git a/pkgs/applications/networking/cluster/k3s/docs/examples/NVIDIA.md b/pkgs/applications/networking/cluster/k3s/docs/examples/NVIDIA.md index 5e86618a0ef8..3163024ec595 100644 --- a/pkgs/applications/networking/cluster/k3s/docs/examples/NVIDIA.md +++ b/pkgs/applications/networking/cluster/k3s/docs/examples/NVIDIA.md @@ -17,7 +17,7 @@ services.xserver = { videoDrivers = [ "nvidia" ]; }; -nixpkgs.config.allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ +nixpkgs.config.allowUnfreePackages = [ "nvidia-x11" "nvidia-settings" ]; diff --git a/pkgs/by-name/jo/joypixels/package.nix b/pkgs/by-name/jo/joypixels/package.nix index b8c15b6675d6..0dcd10dc8f47 100644 --- a/pkgs/by-name/jo/joypixels/package.nix +++ b/pkgs/by-name/jo/joypixels/package.nix @@ -47,14 +47,13 @@ let unfree licenses. configuration.nix: - nixpkgs.config.allowUnfreePredicate = pkg: - builtins.elem (lib.getName pkg) [ - "joypixels" - ]; + nixpkgs.config.allowUnfreePackages = [ + "joypixels" + ]; nixpkgs.config.joypixels.acceptLicense = true; config.nix: - allowUnfreePredicate = pkg: builtins.elem (lib.getName pkg) [ + allowUnfreePackages = [ "joypixels" ]; joypixels.acceptLicense = true;