summary refs log tree commit diff
path: root/nixos/modules/hardware/pcmcia.nix
blob: aef35a28e54da73adbcace183a49410497ec4ba5 (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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
{ config, lib, pkgs, ... }:

with lib;

let

  pcmciaUtils = pkgs.pcmciaUtils.passthru.function {
    inherit (config.hardware.pcmcia) firmware config;
  };

in


{
  ###### interface

  options = {

    hardware.pcmcia = {
      enable = mkOption {
        type = types.bool;
        default = false;
        description = ''
          Enable this option to support PCMCIA card.
        '';
      };

      firmware = mkOption {
        type = types.listOf types.path;
        default = [];
        description = ''
          List of firmware used to handle specific PCMCIA card.
        '';
      };

      config = mkOption {
        default = null;
        type = types.nullOr types.path;
        description = ''
          Path to the configuration file which maps the memory, IRQs
          and ports used by the PCMCIA hardware.
        '';
      };
    };

  };

  ###### implementation

  config = mkIf config.hardware.pcmcia.enable {

    boot.kernelModules = [ "pcmcia" ];

    services.udev.packages = [ pcmciaUtils ];

    environment.systemPackages = [ pcmciaUtils ];

  };

}