Unverified Commit 93fec6dc authored by Sandro Jäckel's avatar Sandro Jäckel Committed by GitHub
Browse files

nixos/firmware: remove restrictive hardware.enableAllFirmware assertion (#441240)

parents ad420818 ea7e940d
Loading
Loading
Loading
Loading
+12 −11
Original line number Diff line number Diff line
@@ -36,7 +36,18 @@ in

  options = {

    hardware.enableAllFirmware = lib.mkEnableOption "all firmware regardless of license";
    hardware.enableAllFirmware = lib.mkOption {
      default = false;
      example = true;

      description = ''
        Whether to enable all firmware, including [unfree packages that must be explictly allowed](https://nixos.org/manual/nixpkgs/unstable/#sec-allow-unfree).

        Alternatively, use the {option}`hardware.enableRedistributableFirmware` option.
      '';

      type = lib.types.bool;
    };

    hardware.enableRedistributableFirmware =
      lib.mkEnableOption "firmware with a license allowing redistribution"
@@ -74,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;
        [