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