2008-12-04 15:48:27 +00:00
|
|
|
{pkgs, config, ...}:
|
2008-08-27 15:01:17 +01:00
|
|
|
|
|
|
|
###### interface
|
|
|
|
let
|
|
|
|
inherit (pkgs.lib) mkOption
|
|
|
|
mergeEnableOption mergeListOption;
|
|
|
|
|
|
|
|
options = {
|
|
|
|
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;
|
2008-08-27 22:22:49 +01:00
|
|
|
description = ''
|
2008-08-27 15:01:17 +01:00
|
|
|
Path to the configuration file which map the memory, irq
|
|
|
|
and ports used by the PCMCIA hardware.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
###### implementation
|
|
|
|
let
|
2008-11-23 01:29:25 +00:00
|
|
|
inherit (pkgs.lib) mkIf;
|
2008-08-27 15:01:17 +01:00
|
|
|
|
2008-11-04 21:24:58 +00:00
|
|
|
pcmciaUtils = pkgs.pcmciaUtils.passthru.function {
|
2008-08-27 15:01:17 +01:00
|
|
|
inherit (config.hardware.pcmcia) firmware config;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
2008-11-23 01:29:25 +00:00
|
|
|
|
|
|
|
mkIf config.hardware.pcmcia.enable {
|
|
|
|
require = [
|
2009-05-20 00:14:45 +01:00
|
|
|
# ../upstart-jobs/udev.nix
|
|
|
|
# ? # config.environment.extraPackages
|
2008-11-23 01:29:25 +00:00
|
|
|
options
|
|
|
|
];
|
2008-08-27 15:01:17 +01:00
|
|
|
|
|
|
|
boot = {
|
2008-11-23 01:29:25 +00:00
|
|
|
kernelModules = [ "pcmcia" ];
|
2008-08-27 15:01:17 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
services = {
|
|
|
|
udev = {
|
2008-11-23 01:29:25 +00:00
|
|
|
addUdevPkgs = [ pcmciaUtils ];
|
2008-08-27 15:01:17 +01:00
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
environment = {
|
2008-11-23 01:29:25 +00:00
|
|
|
extraPackages = [ pcmciaUtils ];
|
2008-08-27 15:01:17 +01:00
|
|
|
};
|
|
|
|
}
|