depot/third_party/nixpkgs/nixos/modules/hardware/pcmcia.nix
Default email 159e378cbb Project import generated by Copybara.
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
2024-09-19 17:19:46 +03:00

52 lines
1.1 KiB
Nix

{ config, lib, pkgs, ... }:
let
pcmciaUtils = pkgs.pcmciaUtils.passthru.function {
inherit (config.hardware.pcmcia) firmware config;
};
in
{
###### interface
options = {
hardware.pcmcia = {
enable = lib.mkOption {
type = lib.types.bool;
default = false;
description = ''
Enable this option to support PCMCIA card.
'';
};
firmware = lib.mkOption {
type = lib.types.listOf lib.types.path;
default = [];
description = ''
List of firmware used to handle specific PCMCIA card.
'';
};
config = lib.mkOption {
default = null;
type = lib.types.nullOr lib.types.path;
description = ''
Path to the configuration file which maps the memory, IRQs
and ports used by the PCMCIA hardware.
'';
};
};
};
###### implementation
config = lib.mkIf config.hardware.pcmcia.enable {
boot.kernelModules = [ "pcmcia" ];
services.udev.packages = [ pcmciaUtils ];
environment.systemPackages = [ pcmciaUtils ];
};
}