2013-09-04 11:05:09 +00:00
|
|
|
{ config, pkgs, ... }:
|
|
|
|
|
|
|
|
with pkgs.lib;
|
2008-08-27 14:01:17 +00:00
|
|
|
|
|
|
|
let
|
2013-09-04 11:05:09 +00:00
|
|
|
|
|
|
|
pcmciaUtils = pkgs.pcmciaUtils.passthru.function {
|
|
|
|
inherit (config.hardware.pcmcia) firmware config;
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
###### interface
|
2008-08-27 14:01:17 +00:00
|
|
|
|
|
|
|
options = {
|
2013-09-04 11:05:09 +00:00
|
|
|
|
|
|
|
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.
|
|
|
|
'';
|
2008-08-27 14:01:17 +00:00
|
|
|
};
|
|
|
|
};
|
2013-09-04 11:05:09 +00:00
|
|
|
|
2008-08-27 14:01:17 +00:00
|
|
|
};
|
|
|
|
|
2013-09-04 11:05:09 +00:00
|
|
|
###### implementation
|
2008-08-27 14:01:17 +00:00
|
|
|
|
2013-09-04 11:05:09 +00:00
|
|
|
config = mkIf config.hardware.pcmcia.enable {
|
2008-08-27 14:01:17 +00:00
|
|
|
|
2013-09-04 11:05:09 +00:00
|
|
|
boot.kernelModules = [ "pcmcia" ];
|
2008-11-23 01:29:25 +00:00
|
|
|
|
2013-09-04 11:05:09 +00:00
|
|
|
services.udev.packages = [ pcmciaUtils ];
|
2008-08-27 14:01:17 +00:00
|
|
|
|
2013-09-04 11:05:09 +00:00
|
|
|
environment.systemPackages = [ pcmciaUtils ];
|
2008-08-27 14:01:17 +00:00
|
|
|
|
2013-09-04 11:05:09 +00:00
|
|
|
};
|
2008-08-27 14:01:17 +00:00
|
|
|
|
|
|
|
}
|