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