diff options
author | Jörg Thalheim <Mic92@users.noreply.github.com> | 2017-05-09 15:57:49 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-09 15:57:49 +0100 |
commit | 5385a8e21681b982f30fc10231fcfaf67592ead0 (patch) | |
tree | c1fae725d2f67d6d4ba8c08d9842c660b378ad26 | |
parent | 00712bf472093150649fb081a400d3232838ef23 (diff) | |
parent | 05aa80c06ab45da7c44b6bf1b858a87815665c71 (diff) | |
download | nixlib-5385a8e21681b982f30fc10231fcfaf67592ead0.tar nixlib-5385a8e21681b982f30fc10231fcfaf67592ead0.tar.gz nixlib-5385a8e21681b982f30fc10231fcfaf67592ead0.tar.bz2 nixlib-5385a8e21681b982f30fc10231fcfaf67592ead0.tar.lz nixlib-5385a8e21681b982f30fc10231fcfaf67592ead0.tar.xz nixlib-5385a8e21681b982f30fc10231fcfaf67592ead0.tar.zst nixlib-5385a8e21681b982f30fc10231fcfaf67592ead0.zip |
Merge pull request #25636 from Mic92/firmware
hardware: add enableRedistributalFirmware
-rw-r--r-- | nixos/modules/hardware/all-firmware.nix | 49 | ||||
-rw-r--r-- | nixos/modules/hardware/network/broadcom-43xx.nix | 2 | ||||
-rw-r--r-- | nixos/modules/hardware/network/intel-2030.nix | 2 | ||||
-rw-r--r-- | nixos/modules/hardware/network/intel-2100bg.nix | 2 | ||||
-rw-r--r-- | nixos/modules/hardware/network/intel-3945abg.nix | 2 | ||||
-rw-r--r-- | nixos/modules/hardware/network/intel-4965agn.nix | 2 | ||||
-rw-r--r-- | nixos/modules/hardware/network/intel-5000.nix | 2 | ||||
-rw-r--r-- | nixos/modules/hardware/network/intel-5150.nix | 2 | ||||
-rw-r--r-- | nixos/modules/hardware/network/intel-6000.nix | 2 | ||||
-rw-r--r-- | nixos/modules/hardware/network/intel-6000g2a.nix | 2 | ||||
-rw-r--r-- | nixos/modules/hardware/network/intel-6000g2b.nix | 2 | ||||
-rw-r--r-- | nixos/modules/hardware/network/ralink.nix | 2 | ||||
-rw-r--r-- | nixos/modules/hardware/network/rtl8192c.nix | 2 | ||||
-rw-r--r-- | nixos/modules/hardware/video/radeon.nix | 2 | ||||
-rw-r--r-- | nixos/modules/installer/scan/not-detected.nix | 2 | ||||
-rw-r--r-- | nixos/modules/profiles/all-hardware.nix | 2 |
16 files changed, 51 insertions, 28 deletions
diff --git a/nixos/modules/hardware/all-firmware.nix b/nixos/modules/hardware/all-firmware.nix index ceca3b887b58..8f26d8f57ea4 100644 --- a/nixos/modules/hardware/all-firmware.nix +++ b/nixos/modules/hardware/all-firmware.nix @@ -2,7 +2,9 @@ with lib; -{ +let + cfg = config.hardware; +in { ###### interface @@ -12,7 +14,16 @@ with lib; default = false; type = types.bool; description = '' - Turn on this option if you want to enable all the firmware shipped in linux-firmware. + Turn on this option if you want to enable all the firmware. + ''; + }; + + hardware.enableRedistributalFirmware = mkOption { + default = false; + type = types.bool; + description = '' + Turn on this option if you want to enable all the firmware with a license allowing redistribution. + (i.e. free firmware and <literal>firmware-linux-nonfree</literal>) ''; }; @@ -21,15 +32,27 @@ with lib; ###### implementation - config = mkIf config.hardware.enableAllFirmware { - hardware.firmware = with pkgs; [ - firmwareLinuxNonfree - intel2200BGFirmware - rtl8723bs-firmware - rtl8192su-firmware - ] ++ optionals config.nixpkgs.config.allowUnfree [ - broadcom-bt-firmware - ]; - }; - + config = mkMerge [ + (mkIf (cfg.enableAllFirmware || cfg.enableRedistributalFirmware) { + hardware.firmware = with pkgs; [ + firmwareLinuxNonfree + intel2200BGFirmware + rtl8723bs-firmware + rtl8192su-firmware + ]; + }) + (mkIf cfg.enableAllFirmware { + assertions = [{ + assertion = !cfg.enableAllFirmware || (config.nixpkgs.config.allowUnfree or false); + 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.enableRedistributalFirmware option. + ''; + }]; + hardware.firmware = with pkgs; [ + broadcom-bt-firmware + ]; + }) + ]; } diff --git a/nixos/modules/hardware/network/broadcom-43xx.nix b/nixos/modules/hardware/network/broadcom-43xx.nix index 8fecdae36bf2..e0bd16a34830 100644 --- a/nixos/modules/hardware/network/broadcom-43xx.nix +++ b/nixos/modules/hardware/network/broadcom-43xx.nix @@ -1,3 +1,3 @@ { - hardware.enableAllFirmware = true; + hardware.enableRedistributalFirmware = true; } diff --git a/nixos/modules/hardware/network/intel-2030.nix b/nixos/modules/hardware/network/intel-2030.nix index 8fecdae36bf2..e0bd16a34830 100644 --- a/nixos/modules/hardware/network/intel-2030.nix +++ b/nixos/modules/hardware/network/intel-2030.nix @@ -1,3 +1,3 @@ { - hardware.enableAllFirmware = true; + hardware.enableRedistributalFirmware = true; } diff --git a/nixos/modules/hardware/network/intel-2100bg.nix b/nixos/modules/hardware/network/intel-2100bg.nix index 89fdce415dda..a54ce30e2d38 100644 --- a/nixos/modules/hardware/network/intel-2100bg.nix +++ b/nixos/modules/hardware/network/intel-2100bg.nix @@ -23,7 +23,7 @@ config = lib.mkIf config.networking.enableIntel2100BGFirmware { - hardware.enableAllFirmware = true; + hardware.enableRedistributalFirmware = true; }; diff --git a/nixos/modules/hardware/network/intel-3945abg.nix b/nixos/modules/hardware/network/intel-3945abg.nix index f4f19d208348..a6e490d97892 100644 --- a/nixos/modules/hardware/network/intel-3945abg.nix +++ b/nixos/modules/hardware/network/intel-3945abg.nix @@ -22,7 +22,7 @@ config = lib.mkIf config.networking.enableIntel3945ABGFirmware { - hardware.enableAllFirmware = true; + hardware.enableRedistributalFirmware = true; }; diff --git a/nixos/modules/hardware/network/intel-4965agn.nix b/nixos/modules/hardware/network/intel-4965agn.nix index 8fecdae36bf2..e0bd16a34830 100644 --- a/nixos/modules/hardware/network/intel-4965agn.nix +++ b/nixos/modules/hardware/network/intel-4965agn.nix @@ -1,3 +1,3 @@ { - hardware.enableAllFirmware = true; + hardware.enableRedistributalFirmware = true; } diff --git a/nixos/modules/hardware/network/intel-5000.nix b/nixos/modules/hardware/network/intel-5000.nix index 8fecdae36bf2..e0bd16a34830 100644 --- a/nixos/modules/hardware/network/intel-5000.nix +++ b/nixos/modules/hardware/network/intel-5000.nix @@ -1,3 +1,3 @@ { - hardware.enableAllFirmware = true; + hardware.enableRedistributalFirmware = true; } diff --git a/nixos/modules/hardware/network/intel-5150.nix b/nixos/modules/hardware/network/intel-5150.nix index 8fecdae36bf2..e0bd16a34830 100644 --- a/nixos/modules/hardware/network/intel-5150.nix +++ b/nixos/modules/hardware/network/intel-5150.nix @@ -1,3 +1,3 @@ { - hardware.enableAllFirmware = true; + hardware.enableRedistributalFirmware = true; } diff --git a/nixos/modules/hardware/network/intel-6000.nix b/nixos/modules/hardware/network/intel-6000.nix index 8fecdae36bf2..e0bd16a34830 100644 --- a/nixos/modules/hardware/network/intel-6000.nix +++ b/nixos/modules/hardware/network/intel-6000.nix @@ -1,3 +1,3 @@ { - hardware.enableAllFirmware = true; + hardware.enableRedistributalFirmware = true; } diff --git a/nixos/modules/hardware/network/intel-6000g2a.nix b/nixos/modules/hardware/network/intel-6000g2a.nix index 8fecdae36bf2..e0bd16a34830 100644 --- a/nixos/modules/hardware/network/intel-6000g2a.nix +++ b/nixos/modules/hardware/network/intel-6000g2a.nix @@ -1,3 +1,3 @@ { - hardware.enableAllFirmware = true; + hardware.enableRedistributalFirmware = true; } diff --git a/nixos/modules/hardware/network/intel-6000g2b.nix b/nixos/modules/hardware/network/intel-6000g2b.nix index 8fecdae36bf2..e0bd16a34830 100644 --- a/nixos/modules/hardware/network/intel-6000g2b.nix +++ b/nixos/modules/hardware/network/intel-6000g2b.nix @@ -1,3 +1,3 @@ { - hardware.enableAllFirmware = true; + hardware.enableRedistributalFirmware = true; } diff --git a/nixos/modules/hardware/network/ralink.nix b/nixos/modules/hardware/network/ralink.nix index 0469ae3a1fb3..a15b0f8894b7 100644 --- a/nixos/modules/hardware/network/ralink.nix +++ b/nixos/modules/hardware/network/ralink.nix @@ -20,7 +20,7 @@ ###### implementation config = lib.mkIf config.networking.enableRalinkFirmware { - hardware.enableAllFirmware = true; + hardware.enableRedistributalFirmware = true; }; } diff --git a/nixos/modules/hardware/network/rtl8192c.nix b/nixos/modules/hardware/network/rtl8192c.nix index deae6355492c..44b4b767d348 100644 --- a/nixos/modules/hardware/network/rtl8192c.nix +++ b/nixos/modules/hardware/network/rtl8192c.nix @@ -20,7 +20,7 @@ ###### implementation config = lib.mkIf config.networking.enableRTL8192cFirmware { - hardware.enableAllFirmware = true; + hardware.enableRedistributalFirmware = true; }; } diff --git a/nixos/modules/hardware/video/radeon.nix b/nixos/modules/hardware/video/radeon.nix index 8fecdae36bf2..e0bd16a34830 100644 --- a/nixos/modules/hardware/video/radeon.nix +++ b/nixos/modules/hardware/video/radeon.nix @@ -1,3 +1,3 @@ { - hardware.enableAllFirmware = true; + hardware.enableRedistributalFirmware = true; } diff --git a/nixos/modules/installer/scan/not-detected.nix b/nixos/modules/installer/scan/not-detected.nix index e1a3052ba957..962ab513f955 100644 --- a/nixos/modules/installer/scan/not-detected.nix +++ b/nixos/modules/installer/scan/not-detected.nix @@ -5,5 +5,5 @@ with lib; { - hardware.enableAllFirmware = true; + hardware.enableRedistributalFirmware = true; } diff --git a/nixos/modules/profiles/all-hardware.nix b/nixos/modules/profiles/all-hardware.nix index 6b4d8c737eba..e8f49fc1fbe6 100644 --- a/nixos/modules/profiles/all-hardware.nix +++ b/nixos/modules/profiles/all-hardware.nix @@ -50,7 +50,7 @@ ]; # Include lots of firmware. - hardware.enableAllFirmware = true; + hardware.enableRedistributalFirmware = true; imports = [ ../hardware/network/zydas-zd1211.nix ]; |