| 
									
										
										
										
											2014-04-14 16:26:48 +02:00
										 |  |  | { config, lib, pkgs, ... }: | 
					
						
							| 
									
										
										
										
											2013-10-30 17:37:45 +01:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-04-14 16:26:48 +02:00
										 |  |  | with lib; | 
					
						
							| 
									
										
										
										
											2012-01-12 17:17:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-05-08 08:50:03 +01:00
										 |  |  | let | 
					
						
							|  |  |  |   cfg = config.hardware; | 
					
						
							|  |  |  | in { | 
					
						
							| 
									
										
										
										
											2012-01-12 17:17:01 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-12-10 02:51:19 +01:00
										 |  |  |   imports = [ | 
					
						
							|  |  |  |     (mkRenamedOptionModule [ "networking" "enableRT73Firmware" ] [ "hardware" "enableRedistributableFirmware" ]) | 
					
						
							|  |  |  |     (mkRenamedOptionModule [ "networking" "enableIntel3945ABGFirmware" ] [ "hardware" "enableRedistributableFirmware" ]) | 
					
						
							|  |  |  |     (mkRenamedOptionModule [ "networking" "enableIntel2100BGFirmware" ] [ "hardware" "enableRedistributableFirmware" ]) | 
					
						
							|  |  |  |     (mkRenamedOptionModule [ "networking" "enableRalinkFirmware" ] [ "hardware" "enableRedistributableFirmware" ]) | 
					
						
							|  |  |  |     (mkRenamedOptionModule [ "networking" "enableRTL8192cFirmware" ] [ "hardware" "enableRedistributableFirmware" ]) | 
					
						
							|  |  |  |   ]; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-01-12 17:17:01 +00:00
										 |  |  |   ###### interface | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   options = { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-10-30 17:37:45 +01:00
										 |  |  |     hardware.enableAllFirmware = mkOption { | 
					
						
							| 
									
										
										
										
											2012-01-12 17:17:01 +00:00
										 |  |  |       default = false; | 
					
						
							| 
									
										
										
										
											2013-10-30 17:37:45 +01:00
										 |  |  |       type = types.bool; | 
					
						
							| 
									
										
										
										
											2012-01-12 17:17:01 +00:00
										 |  |  |       description = ''
 | 
					
						
							| 
									
										
										
										
											2017-05-08 08:50:03 +01:00
										 |  |  |         Turn on this option if you want to enable all the firmware. | 
					
						
							|  |  |  |       '';
 | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-05-09 20:10:41 +01:00
										 |  |  |     hardware.enableRedistributableFirmware = mkOption { | 
					
						
							| 
									
										
										
										
											2017-05-08 08:50:03 +01:00
										 |  |  |       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>) | 
					
						
							| 
									
										
										
										
											2012-01-12 17:17:01 +00:00
										 |  |  |       '';
 | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   ###### implementation | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-05-08 08:50:03 +01:00
										 |  |  |   config = mkMerge [ | 
					
						
							| 
									
										
										
										
											2017-05-09 20:10:41 +01:00
										 |  |  |     (mkIf (cfg.enableAllFirmware || cfg.enableRedistributableFirmware) { | 
					
						
							| 
									
										
										
										
											2017-05-08 08:50:03 +01:00
										 |  |  |       hardware.firmware = with pkgs; [ | 
					
						
							|  |  |  |         firmwareLinuxNonfree | 
					
						
							|  |  |  |         intel2200BGFirmware | 
					
						
							|  |  |  |         rtl8192su-firmware | 
					
						
							| 
									
										
										
										
											2019-03-28 23:59:57 +01:00
										 |  |  |         rt5677-firmware | 
					
						
							|  |  |  |         rtl8723bs-firmware | 
					
						
							| 
									
										
										
										
											2020-12-20 16:25:55 +01:00
										 |  |  |         rtl8761b-firmware | 
					
						
							| 
									
										
										
										
											2019-03-28 23:59:57 +01:00
										 |  |  |         rtlwifi_new-firmware | 
					
						
							|  |  |  |         zd1211fw | 
					
						
							|  |  |  |         alsa-firmware | 
					
						
							| 
									
										
										
										
											2020-04-28 05:25:38 +00:00
										 |  |  |         sof-firmware | 
					
						
							| 
									
										
										
										
											2019-03-28 23:59:57 +01:00
										 |  |  |         openelec-dvb-firmware | 
					
						
							| 
									
										
										
										
											2018-12-30 20:34:57 -06:00
										 |  |  |       ] ++ optional (pkgs.stdenv.hostPlatform.isAarch32 || pkgs.stdenv.hostPlatform.isAarch64) raspberrypiWirelessFirmware | 
					
						
							| 
									
										
										
										
											2018-05-24 23:03:42 -04:00
										 |  |  |         ++ optionals (versionOlder config.boot.kernelPackages.kernel.version "4.13") [ | 
					
						
							| 
									
										
										
										
											2017-11-13 13:42:20 -05:00
										 |  |  |         rtl8723bs-firmware | 
					
						
							| 
									
										
										
										
											2017-05-08 08:50:03 +01:00
										 |  |  |       ]; | 
					
						
							|  |  |  |     }) | 
					
						
							|  |  |  |     (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. | 
					
						
							| 
									
										
										
										
											2017-05-09 20:10:41 +01:00
										 |  |  |             An alternative is to use the hardware.enableRedistributableFirmware option. | 
					
						
							| 
									
										
										
										
											2017-05-08 08:50:03 +01:00
										 |  |  |         '';
 | 
					
						
							|  |  |  |       }]; | 
					
						
							|  |  |  |       hardware.firmware = with pkgs; [ | 
					
						
							|  |  |  |         broadcom-bt-firmware | 
					
						
							| 
									
										
										
										
											2019-03-28 23:59:57 +01:00
										 |  |  |         b43Firmware_5_1_138 | 
					
						
							|  |  |  |         b43Firmware_6_30_163_46 | 
					
						
							|  |  |  |         b43FirmwareCutter | 
					
						
							| 
									
										
										
										
											2019-05-06 10:49:42 +02:00
										 |  |  |       ] ++ optional (pkgs.stdenv.hostPlatform.isi686 || pkgs.stdenv.hostPlatform.isx86_64) facetimehd-firmware; | 
					
						
							| 
									
										
										
										
											2017-05-08 08:50:03 +01:00
										 |  |  |     }) | 
					
						
							|  |  |  |   ]; | 
					
						
							| 
									
										
										
										
											2012-01-12 17:17:01 +00:00
										 |  |  | } |