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