Unverified Commit ea7e940d authored by NAHO's avatar NAHO
Browse files

nixos/firmware: remove restrictive hardware.enableAllFirmware assertion

Remove the too restrictive hardware.enableAllFirmware assertion
introduced in commit 05aa80c0 ("hardware: add
enableRedistributalFirmware").

This assertion is too restrictive because it enforces globally enabling
unfree packages without allowing explicit whitelisting:

     hardware.enableAllFirmware = true;

    -nixpkgs.config.allowUnfree = true;
    +nixpkgs.config.allowUnfreePredicate = pkg:
    +    builtins.elem (lib.getName pkg) [
    +      "b43-firmware"
    +      "broadcom-bt-firmware"
    +      "facetimehd-calibration"
    +      "facetimehd-firmware"
    +      "xow_dongle-firmware"
    +    ];

Declaring neither nixpkgs.config.allowUnfree nor
nixpkgs.config.allowUnfreePredicate without this
hardware.enableAllFirmware assertion results in detailed and instructive
evaluation error messages.
parent aa047cc6
Loading
Loading
Loading
Loading
+0 −10
Original line number Diff line number Diff line
@@ -85,16 +85,6 @@ in
        ++ lib.optional pkgs.stdenv.hostPlatform.isAarch raspberrypiWirelessFirmware;
    })
    (lib.mkIf cfg.enableAllFirmware {
      assertions = [
        {
          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.
              An alternative is to use the hardware.enableRedistributableFirmware option.
          '';
        }
      ];
      hardware.firmware =
        with pkgs;
        [