1{ config, lib, pkgs, ... }:
2
3with lib;
4
5let
6
7 pcmciaUtils = pkgs.pcmciaUtils.passthru.function {
8 inherit (config.hardware.pcmcia) firmware config;
9 };
10
11in
12
13
14{
15 ###### interface
16
17 options = {
18
19 hardware.pcmcia = {
20 enable = mkOption {
21 type = types.bool;
22 default = false;
23 description = ''
24 Enable this option to support PCMCIA card.
25 '';
26 };
27
28 firmware = mkOption {
29 type = types.listOf types.path;
30 default = [];
31 description = ''
32 List of firmware used to handle specific PCMCIA card.
33 '';
34 };
35
36 config = mkOption {
37 default = null;
38 description = ''
39 Path to the configuration file which maps the memory, IRQs
40 and ports used by the PCMCIA hardware.
41 '';
42 };
43 };
44
45 };
46
47 ###### implementation
48
49 config = mkIf config.hardware.pcmcia.enable {
50
51 boot.kernelModules = [ "pcmcia" ];
52
53 services.udev.packages = [ pcmciaUtils ];
54
55 environment.systemPackages = [ pcmciaUtils ];
56
57 };
58
59}