You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
1.0 KiB

  1. { config, pkgs, ... }:
  2. with pkgs.lib;
  3. let
  4. pcmciaUtils = pkgs.pcmciaUtils.passthru.function {
  5. inherit (config.hardware.pcmcia) firmware config;
  6. };
  7. in
  8. {
  9. ###### interface
  10. options = {
  11. hardware.pcmcia = {
  12. enable = mkOption {
  13. default = false;
  14. merge = mergeEnableOption;
  15. description = ''
  16. Enable this option to support PCMCIA card.
  17. '';
  18. };
  19. firmware = mkOption {
  20. default = [];
  21. merge = mergeListOption;
  22. description = ''
  23. List of firmware used to handle specific PCMCIA card.
  24. '';
  25. };
  26. config = mkOption {
  27. default = null;
  28. description = ''
  29. Path to the configuration file which map the memory, irq
  30. and ports used by the PCMCIA hardware.
  31. '';
  32. };
  33. };
  34. };
  35. ###### implementation
  36. config = mkIf config.hardware.pcmcia.enable {
  37. boot.kernelModules = [ "pcmcia" ];
  38. services.udev.packages = [ pcmciaUtils ];
  39. environment.systemPackages = [ pcmciaUtils ];
  40. };
  41. }