2020-04-24 23:36:52 +00:00
|
|
|
{ config, lib, pkgs, ... }:
|
|
|
|
let
|
|
|
|
pcmciaUtils = pkgs.pcmciaUtils.passthru.function {
|
|
|
|
inherit (config.hardware.pcmcia) firmware config;
|
|
|
|
};
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
###### interface
|
|
|
|
options = {
|
|
|
|
|
|
|
|
hardware.pcmcia = {
|
2024-09-19 14:19:46 +00:00
|
|
|
enable = lib.mkOption {
|
|
|
|
type = lib.types.bool;
|
2020-04-24 23:36:52 +00:00
|
|
|
default = false;
|
2024-04-21 15:54:59 +00:00
|
|
|
description = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
Enable this option to support PCMCIA card.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
firmware = lib.mkOption {
|
|
|
|
type = lib.types.listOf lib.types.path;
|
2020-04-24 23:36:52 +00:00
|
|
|
default = [];
|
2024-04-21 15:54:59 +00:00
|
|
|
description = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
List of firmware used to handle specific PCMCIA card.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
config = lib.mkOption {
|
2020-04-24 23:36:52 +00:00
|
|
|
default = null;
|
2024-09-19 14:19:46 +00:00
|
|
|
type = lib.types.nullOr lib.types.path;
|
2024-04-21 15:54:59 +00:00
|
|
|
description = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
Path to the configuration file which maps the memory, IRQs
|
|
|
|
and ports used by the PCMCIA hardware.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
###### implementation
|
|
|
|
|
2024-09-19 14:19:46 +00:00
|
|
|
config = lib.mkIf config.hardware.pcmcia.enable {
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
boot.kernelModules = [ "pcmcia" ];
|
|
|
|
|
|
|
|
services.udev.packages = [ pcmciaUtils ];
|
|
|
|
|
|
|
|
environment.systemPackages = [ pcmciaUtils ];
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|