2014-04-14 15:26:48 +01:00
|
|
|
{ config, lib, pkgs, ... }:
|
2013-09-04 12:05:09 +01:00
|
|
|
|
2014-04-14 15:26:48 +01:00
|
|
|
with lib;
|
2008-08-27 15:01:17 +01:00
|
|
|
|
|
|
|
let
|
2013-09-04 12:05:09 +01:00
|
|
|
|
|
|
|
pcmciaUtils = pkgs.pcmciaUtils.passthru.function {
|
|
|
|
inherit (config.hardware.pcmcia) firmware config;
|
|
|
|
};
|
|
|
|
|
|
|
|
in
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
###### interface
|
2008-08-27 15:01:17 +01:00
|
|
|
|
|
|
|
options = {
|
2013-09-04 12:05:09 +01:00
|
|
|
|
|
|
|
hardware.pcmcia = {
|
|
|
|
enable = mkOption {
|
2013-10-28 15:14:15 +00:00
|
|
|
type = types.bool;
|
2013-09-04 12:05:09 +01:00
|
|
|
default = false;
|
|
|
|
description = ''
|
|
|
|
Enable this option to support PCMCIA card.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
firmware = mkOption {
|
2013-10-28 15:14:15 +00:00
|
|
|
type = types.listOf types.path;
|
2013-09-04 12:05:09 +01:00
|
|
|
default = [];
|
|
|
|
description = ''
|
|
|
|
List of firmware used to handle specific PCMCIA card.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
|
|
|
config = mkOption {
|
|
|
|
default = null;
|
2021-12-07 17:38:42 +00:00
|
|
|
type = types.nullOr types.path;
|
2013-09-04 12:05:09 +01:00
|
|
|
description = ''
|
2013-10-30 16:37:45 +00:00
|
|
|
Path to the configuration file which maps the memory, IRQs
|
2013-09-04 12:05:09 +01:00
|
|
|
and ports used by the PCMCIA hardware.
|
|
|
|
'';
|
2008-08-27 15:01:17 +01:00
|
|
|
};
|
|
|
|
};
|
2013-09-04 12:05:09 +01:00
|
|
|
|
2008-08-27 15:01:17 +01:00
|
|
|
};
|
|
|
|
|
2013-09-04 12:05:09 +01:00
|
|
|
###### implementation
|
2008-08-27 15:01:17 +01:00
|
|
|
|
2013-09-04 12:05:09 +01:00
|
|
|
config = mkIf config.hardware.pcmcia.enable {
|
2008-08-27 15:01:17 +01:00
|
|
|
|
2013-09-04 12:05:09 +01:00
|
|
|
boot.kernelModules = [ "pcmcia" ];
|
2008-11-23 01:29:25 +00:00
|
|
|
|
2013-09-04 12:05:09 +01:00
|
|
|
services.udev.packages = [ pcmciaUtils ];
|
2008-08-27 15:01:17 +01:00
|
|
|
|
2013-09-04 12:05:09 +01:00
|
|
|
environment.systemPackages = [ pcmciaUtils ];
|
2008-08-27 15:01:17 +01:00
|
|
|
|
2013-09-04 12:05:09 +01:00
|
|
|
};
|
2008-08-27 15:01:17 +01:00
|
|
|
|
|
|
|
}
|