at 24.11-pre 1.1 kB view raw
1{ config, lib, pkgs, ... }: 2 3with lib; 4 5let 6 7 pcmciaUtils = pkgs.pcmciaUtils.passthru.function { 8 inherit (config.hardware.pcmcia) firmware config; 9 }; 10 11in 12 13 14{ 15 ###### interface 16 17 options = { 18 19 hardware.pcmcia = { 20 enable = mkOption { 21 type = types.bool; 22 default = false; 23 description = '' 24 Enable this option to support PCMCIA card. 25 ''; 26 }; 27 28 firmware = mkOption { 29 type = types.listOf types.path; 30 default = []; 31 description = '' 32 List of firmware used to handle specific PCMCIA card. 33 ''; 34 }; 35 36 config = mkOption { 37 default = null; 38 type = types.nullOr types.path; 39 description = '' 40 Path to the configuration file which maps the memory, IRQs 41 and ports used by the PCMCIA hardware. 42 ''; 43 }; 44 }; 45 46 }; 47 48 ###### implementation 49 50 config = mkIf config.hardware.pcmcia.enable { 51 52 boot.kernelModules = [ "pcmcia" ]; 53 54 services.udev.packages = [ pcmciaUtils ]; 55 56 environment.systemPackages = [ pcmciaUtils ]; 57 58 }; 59 60}