summary refs log tree commit diff
path: root/nixos/modules/hardware/network/b43.nix
blob: 8f45bd4d3f1a59e284a3ae94510bfbb54467bf3b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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 ];
  };

}