diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-10-10 13:28:20 +0200 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2013-10-10 13:28:20 +0200 |
commit | 5c1f8cbc70cd5e6867ef6a2a06d27a40daa07010 (patch) | |
tree | a6c0f605be6de3f372ae69905b331f9f75452da7 /nixos/modules/hardware | |
parent | 6070bc016bd2fd945b04347e25cfd3738622d2ac (diff) |
Move all of NixOS to nixos/ in preparation of the repository merge
Diffstat (limited to 'nixos/modules/hardware')
23 files changed, 380 insertions, 0 deletions
diff --git a/nixos/modules/hardware/all-firmware.nix b/nixos/modules/hardware/all-firmware.nix new file mode 100644 index 0000000000000..16b6a862593a0 --- /dev/null +++ b/nixos/modules/hardware/all-firmware.nix @@ -0,0 +1,26 @@ +{pkgs, config, ...}: + +{ + + ###### interface + + options = { + + hardware.enableAllFirmware = pkgs.lib.mkOption { + default = false; + type = pkgs.lib.types.bool; + description = '' + Turn on this option if you want to enable all the firmware shipped with Debian/Ubuntu. + ''; + }; + + }; + + + ###### implementation + + config = pkgs.lib.mkIf config.hardware.enableAllFirmware { + hardware.firmware = [ "${pkgs.firmwareLinuxNonfree}/lib/firmware" ]; + }; + +} diff --git a/nixos/modules/hardware/cpu/amd-microcode.nix b/nixos/modules/hardware/cpu/amd-microcode.nix new file mode 100644 index 0000000000000..5720a63834f55 --- /dev/null +++ b/nixos/modules/hardware/cpu/amd-microcode.nix @@ -0,0 +1,29 @@ +{ config, pkgs, ... }: + +with pkgs.lib; + +{ + + ###### interface + + options = { + + hardware.cpu.amd.updateMicrocode = mkOption { + default = false; + type = types.bool; + description = '' + Update the CPU microcode for AMD processors. + ''; + }; + + }; + + + ###### implementation + + config = mkIf config.hardware.cpu.amd.updateMicrocode { + hardware.firmware = [ "${pkgs.amdUcode}/lib/firmware" ]; + boot.kernelModules = [ "microcode" ]; + }; + +} diff --git a/nixos/modules/hardware/cpu/intel-microcode.nix b/nixos/modules/hardware/cpu/intel-microcode.nix new file mode 100644 index 0000000000000..9046ddf83bbf4 --- /dev/null +++ b/nixos/modules/hardware/cpu/intel-microcode.nix @@ -0,0 +1,29 @@ +{ config, pkgs, ... }: + +with pkgs.lib; + +{ + + ###### interface + + options = { + + hardware.cpu.intel.updateMicrocode = mkOption { + default = false; + type = types.bool; + description = '' + Update the CPU microcode for Intel processors. + ''; + }; + + }; + + + ###### implementation + + config = mkIf config.hardware.cpu.intel.updateMicrocode { + hardware.firmware = [ "${pkgs.microcodeIntel}/lib/firmware" ]; + boot.kernelModules = [ "microcode" ]; + }; + +} diff --git a/nixos/modules/hardware/network/b43.nix b/nixos/modules/hardware/network/b43.nix new file mode 100644 index 0000000000000..8f45bd4d3f1a5 --- /dev/null +++ b/nixos/modules/hardware/network/b43.nix @@ -0,0 +1,32 @@ +{pkgs, config, ...}: + +let kernelVersion = config.boot.kernelPackages.kernel.version; in + +{ + + ###### interface + + options = { + + networking.enableB43Firmware = pkgs.lib.mkOption { + default = false; + type = pkgs.lib.types.bool; + description = '' + Turn on this option if you want firmware for the NICs supported by the b43 module. + ''; + }; + + }; + + + ###### implementation + + config = pkgs.lib.mkIf config.networking.enableB43Firmware { + assertions = [ { + assertion = builtins.lessThan 0 (builtins.compareVersions kernelVersion "3.2"); + message = "b43 firmware for kernels older than 3.2 not packaged yet!"; + } ]; + hardware.firmware = [ pkgs.b43Firmware_5_1_138 ]; + }; + +} diff --git a/nixos/modules/hardware/network/broadcom-43xx.nix b/nixos/modules/hardware/network/broadcom-43xx.nix new file mode 100644 index 0000000000000..8fecdae36bf26 --- /dev/null +++ b/nixos/modules/hardware/network/broadcom-43xx.nix @@ -0,0 +1,3 @@ +{ + hardware.enableAllFirmware = true; +} diff --git a/nixos/modules/hardware/network/intel-2030.nix b/nixos/modules/hardware/network/intel-2030.nix new file mode 100644 index 0000000000000..8fecdae36bf26 --- /dev/null +++ b/nixos/modules/hardware/network/intel-2030.nix @@ -0,0 +1,3 @@ +{ + hardware.enableAllFirmware = true; +} diff --git a/nixos/modules/hardware/network/intel-2100bg.nix b/nixos/modules/hardware/network/intel-2100bg.nix new file mode 100644 index 0000000000000..1e0033eb414a1 --- /dev/null +++ b/nixos/modules/hardware/network/intel-2100bg.nix @@ -0,0 +1,30 @@ +{ config, pkgs, ... }: + +{ + + ###### interface + + options = { + + networking.enableIntel2100BGFirmware = pkgs.lib.mkOption { + default = false; + type = pkgs.lib.types.bool; + description = '' + Turn on this option if you want firmware for the Intel + PRO/Wireless 2100BG to be loaded automatically. This is + required if you want to use this device. + ''; + }; + + }; + + + ###### implementation + + config = pkgs.lib.mkIf config.networking.enableIntel2100BGFirmware { + + hardware.enableAllFirmware = true; + + }; + +} diff --git a/nixos/modules/hardware/network/intel-2200bg.nix b/nixos/modules/hardware/network/intel-2200bg.nix new file mode 100644 index 0000000000000..ae5b69b7981da --- /dev/null +++ b/nixos/modules/hardware/network/intel-2200bg.nix @@ -0,0 +1,30 @@ +{ config, pkgs, ... }: + +{ + + ###### interface + + options = { + + networking.enableIntel2200BGFirmware = pkgs.lib.mkOption { + default = false; + type = pkgs.lib.types.bool; + description = '' + Turn on this option if you want firmware for the Intel + PRO/Wireless 2200BG to be loaded automatically. This is + required if you want to use this device. + ''; + }; + + }; + + + ###### implementation + + config = pkgs.lib.mkIf config.networking.enableIntel2200BGFirmware { + + hardware.enableAllFirmware = true; + + }; + +} diff --git a/nixos/modules/hardware/network/intel-3945abg.nix b/nixos/modules/hardware/network/intel-3945abg.nix new file mode 100644 index 0000000000000..80baf260ab9ae --- /dev/null +++ b/nixos/modules/hardware/network/intel-3945abg.nix @@ -0,0 +1,29 @@ +{ config, pkgs, ... }: + +{ + + ###### interface + + options = { + + networking.enableIntel3945ABGFirmware = pkgs.lib.mkOption { + default = false; + type = pkgs.lib.types.bool; + description = '' + This option enables automatic loading of the firmware for the Intel + PRO/Wireless 3945ABG. + ''; + }; + + }; + + + ###### implementation + + config = pkgs.lib.mkIf config.networking.enableIntel3945ABGFirmware { + + hardware.enableAllFirmware = true; + + }; + +} diff --git a/nixos/modules/hardware/network/intel-4965agn.nix b/nixos/modules/hardware/network/intel-4965agn.nix new file mode 100644 index 0000000000000..8fecdae36bf26 --- /dev/null +++ b/nixos/modules/hardware/network/intel-4965agn.nix @@ -0,0 +1,3 @@ +{ + hardware.enableAllFirmware = true; +} diff --git a/nixos/modules/hardware/network/intel-5000.nix b/nixos/modules/hardware/network/intel-5000.nix new file mode 100644 index 0000000000000..8fecdae36bf26 --- /dev/null +++ b/nixos/modules/hardware/network/intel-5000.nix @@ -0,0 +1,3 @@ +{ + hardware.enableAllFirmware = true; +} diff --git a/nixos/modules/hardware/network/intel-5150.nix b/nixos/modules/hardware/network/intel-5150.nix new file mode 100644 index 0000000000000..8fecdae36bf26 --- /dev/null +++ b/nixos/modules/hardware/network/intel-5150.nix @@ -0,0 +1,3 @@ +{ + hardware.enableAllFirmware = true; +} diff --git a/nixos/modules/hardware/network/intel-6000.nix b/nixos/modules/hardware/network/intel-6000.nix new file mode 100644 index 0000000000000..8fecdae36bf26 --- /dev/null +++ b/nixos/modules/hardware/network/intel-6000.nix @@ -0,0 +1,3 @@ +{ + hardware.enableAllFirmware = true; +} diff --git a/nixos/modules/hardware/network/intel-6000g2a.nix b/nixos/modules/hardware/network/intel-6000g2a.nix new file mode 100644 index 0000000000000..8fecdae36bf26 --- /dev/null +++ b/nixos/modules/hardware/network/intel-6000g2a.nix @@ -0,0 +1,3 @@ +{ + hardware.enableAllFirmware = true; +} diff --git a/nixos/modules/hardware/network/intel-6000g2b.nix b/nixos/modules/hardware/network/intel-6000g2b.nix new file mode 100644 index 0000000000000..8fecdae36bf26 --- /dev/null +++ b/nixos/modules/hardware/network/intel-6000g2b.nix @@ -0,0 +1,3 @@ +{ + hardware.enableAllFirmware = true; +} diff --git a/nixos/modules/hardware/network/ralink.nix b/nixos/modules/hardware/network/ralink.nix new file mode 100644 index 0000000000000..92f34d8643bc1 --- /dev/null +++ b/nixos/modules/hardware/network/ralink.nix @@ -0,0 +1,26 @@ +{pkgs, config, ...}: + +{ + + ###### interface + + options = { + + networking.enableRalinkFirmware = pkgs.lib.mkOption { + default = false; + type = pkgs.lib.types.bool; + description = '' + Turn on this option if you want firmware for the RT73 NIC. + ''; + }; + + }; + + + ###### implementation + + config = pkgs.lib.mkIf config.networking.enableRalinkFirmware { + hardware.enableAllFirmware = true; + }; + +} diff --git a/nixos/modules/hardware/network/rtl8192c.nix b/nixos/modules/hardware/network/rtl8192c.nix new file mode 100644 index 0000000000000..3aefb7bdd6088 --- /dev/null +++ b/nixos/modules/hardware/network/rtl8192c.nix @@ -0,0 +1,26 @@ +{pkgs, config, ...}: + +{ + + ###### interface + + options = { + + networking.enableRTL8192cFirmware = pkgs.lib.mkOption { + default = false; + type = pkgs.lib.types.bool; + description = '' + Turn on this option if you want firmware for the RTL8192c (and related) NICs. + ''; + }; + + }; + + + ###### implementation + + config = pkgs.lib.mkIf config.networking.enableRTL8192cFirmware { + hardware.enableAllFirmware = true; + }; + +} diff --git a/nixos/modules/hardware/network/smc-2632w/default.nix b/nixos/modules/hardware/network/smc-2632w/default.nix new file mode 100644 index 0000000000000..318131be7493e --- /dev/null +++ b/nixos/modules/hardware/network/smc-2632w/default.nix @@ -0,0 +1,9 @@ +{pkgs, config, ...}: + +{ + hardware = { + pcmcia = { + firmware = [ (pkgs.lib.cleanSource ./firmware) ]; + }; + }; +} diff --git a/nixos/modules/hardware/network/smc-2632w/firmware/cis/SMC2632W-v1.02.cis b/nixos/modules/hardware/network/smc-2632w/firmware/cis/SMC2632W-v1.02.cis new file mode 100644 index 0000000000000..5f13088c37351 --- /dev/null +++ b/nixos/modules/hardware/network/smc-2632w/firmware/cis/SMC2632W-v1.02.cis @@ -0,0 +1,8 @@ + vers_1 5.0, "SMC", "SMC2632W", "Version 01.02", "" + manfid 0x0156, 0x0002 + funcid network_adapter + cftable_entry 0x01 [default] + Vcc Vmin 3000mV Vmax 3300mV Iavg 300mA Ipeak 300mA + Idown 10mA + io 0x0000-0x003f [lines=6] [16bit] + irq mask 0xffff [level] [pulse] diff --git a/nixos/modules/hardware/network/zydas-zd1211.nix b/nixos/modules/hardware/network/zydas-zd1211.nix new file mode 100644 index 0000000000000..c8428a7241b1c --- /dev/null +++ b/nixos/modules/hardware/network/zydas-zd1211.nix @@ -0,0 +1,5 @@ +{pkgs, config, ...}: + +{ + hardware.firmware = [ pkgs.zd1211fw ]; +} diff --git a/nixos/modules/hardware/pcmcia.nix b/nixos/modules/hardware/pcmcia.nix new file mode 100644 index 0000000000000..0dba59734ca72 --- /dev/null +++ b/nixos/modules/hardware/pcmcia.nix @@ -0,0 +1,59 @@ +{ config, pkgs, ... }: + +with pkgs.lib; + +let + + pcmciaUtils = pkgs.pcmciaUtils.passthru.function { + inherit (config.hardware.pcmcia) firmware config; + }; + +in + + +{ + ###### interface + + options = { + + hardware.pcmcia = { + enable = mkOption { + default = false; + merge = mergeEnableOption; + description = '' + Enable this option to support PCMCIA card. + ''; + }; + + firmware = mkOption { + default = []; + merge = mergeListOption; + description = '' + List of firmware used to handle specific PCMCIA card. + ''; + }; + + config = mkOption { + default = null; + description = '' + Path to the configuration file which map the memory, irq + and ports used by the PCMCIA hardware. + ''; + }; + }; + + }; + + ###### implementation + + config = mkIf config.hardware.pcmcia.enable { + + boot.kernelModules = [ "pcmcia" ]; + + services.udev.packages = [ pcmciaUtils ]; + + environment.systemPackages = [ pcmciaUtils ]; + + }; + +} diff --git a/nixos/modules/hardware/video/encoder/wis-go7007.nix b/nixos/modules/hardware/video/encoder/wis-go7007.nix new file mode 100644 index 0000000000000..c0eb2b814b332 --- /dev/null +++ b/nixos/modules/hardware/video/encoder/wis-go7007.nix @@ -0,0 +1,15 @@ +{pkgs, config, ...}: + +let + wis_go7007 = config.boot.kernelPackages.wis_go7007; +in + +{ + boot.extraModulePackages = [wis_go7007]; + + environment.systemPackages = [wis_go7007]; + + hardware.firmware = ["${wis_go7007}/firmware"]; + + services.udev.packages = [wis_go7007]; +} diff --git a/nixos/modules/hardware/video/radeon.nix b/nixos/modules/hardware/video/radeon.nix new file mode 100644 index 0000000000000..8fecdae36bf26 --- /dev/null +++ b/nixos/modules/hardware/video/radeon.nix @@ -0,0 +1,3 @@ +{ + hardware.enableAllFirmware = true; +} |