about summary refs log tree commit diff
path: root/nixos/modules/hardware
diff options
context:
space:
mode:
authorVladimír Čunát <vcunat@gmail.com>2016-02-17 10:06:31 +0100
committerVladimír Čunát <vcunat@gmail.com>2016-02-17 10:06:31 +0100
commite9520e81b375fca8bcf06b3f4c2dd3bb0b757be6 (patch)
tree7da1bda216c30520d864a266735c48988c2b2369 /nixos/modules/hardware
parentee994dfae6e897ee4e7405e1624be43625086622 (diff)
parent2f3eae3a87eb4f9e330ac2c31611061c1ae8699f (diff)
downloadnixlib-e9520e81b375fca8bcf06b3f4c2dd3bb0b757be6.tar
nixlib-e9520e81b375fca8bcf06b3f4c2dd3bb0b757be6.tar.gz
nixlib-e9520e81b375fca8bcf06b3f4c2dd3bb0b757be6.tar.bz2
nixlib-e9520e81b375fca8bcf06b3f4c2dd3bb0b757be6.tar.lz
nixlib-e9520e81b375fca8bcf06b3f4c2dd3bb0b757be6.tar.xz
nixlib-e9520e81b375fca8bcf06b3f4c2dd3bb0b757be6.tar.zst
nixlib-e9520e81b375fca8bcf06b3f4c2dd3bb0b757be6.zip
Merge branch 'master' into staging
Diffstat (limited to 'nixos/modules/hardware')
-rw-r--r--nixos/modules/hardware/all-firmware.nix2
-rw-r--r--nixos/modules/hardware/network/intel-2200bg.nix2
-rw-r--r--nixos/modules/hardware/video/webcam/facetimehd.nix45
3 files changed, 47 insertions, 2 deletions
diff --git a/nixos/modules/hardware/all-firmware.nix b/nixos/modules/hardware/all-firmware.nix
index 1a04baef1930..d0d481f72a40 100644
--- a/nixos/modules/hardware/all-firmware.nix
+++ b/nixos/modules/hardware/all-firmware.nix
@@ -22,7 +22,7 @@ with lib;
   ###### implementation
 
   config = mkIf config.hardware.enableAllFirmware {
-    hardware.firmware = [ pkgs.firmwareLinuxNonfree ];
+    hardware.firmware = [ pkgs.firmwareLinuxNonfree pkgs.intel2200BGFirmware ];
   };
 
 }
diff --git a/nixos/modules/hardware/network/intel-2200bg.nix b/nixos/modules/hardware/network/intel-2200bg.nix
index 1b70057d135b..17b973474c93 100644
--- a/nixos/modules/hardware/network/intel-2200bg.nix
+++ b/nixos/modules/hardware/network/intel-2200bg.nix
@@ -23,7 +23,7 @@
 
   config = lib.mkIf config.networking.enableIntel2200BGFirmware {
 
-    hardware.enableAllFirmware = true;
+    hardware.firmware = [ pkgs.intel2200BGFirmware ];
 
   };
 
diff --git a/nixos/modules/hardware/video/webcam/facetimehd.nix b/nixos/modules/hardware/video/webcam/facetimehd.nix
new file mode 100644
index 000000000000..b35709763b90
--- /dev/null
+++ b/nixos/modules/hardware/video/webcam/facetimehd.nix
@@ -0,0 +1,45 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+
+  cfg = config.hardware.facetimehd;
+
+  kernelPackages = config.boot.kernelPackages;
+
+in
+
+{
+
+  options.hardware.facetimehd.enable = mkEnableOption "facetimehd kernel module";
+
+  config = mkIf cfg.enable {
+
+    assertions = singleton {
+      assertion = versionAtLeast kernelPackages.kernel.version "3.19";
+      message = "facetimehd is not supported for kernels older than 3.19";
+    };
+
+    boot.kernelModules = [ "facetimehd" ];
+
+    boot.blacklistedKernelModules = [ "bdc_pci" ];
+
+    boot.extraModulePackages = [ kernelPackages.facetimehd ];
+
+    hardware.firmware = [ pkgs.facetimehd-firmware ];
+
+    # unload module during suspend/hibernate as it crashes the whole system
+    powerManagement.powerDownCommands = ''
+      ${pkgs.module_init_tools}/bin/rmmod -f facetimehd
+    '';
+
+    # and load it back on resume
+    powerManagement.resumeCommands = ''
+      export MODULE_DIR=/run/current-system/kernel-modules/lib/modules
+      ${pkgs.module_init_tools}/bin/modprobe -v facetimehd
+    '';
+
+  };
+
+}