* Simplified the udev rules generation: merged nixRules into services.udev.extraRules, and handle services.udev.extraRules using services.udev.packages. svn path=/nixos/trunk/; revision=16655
		
			
				
	
	
		
			62 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			62 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Nix
		
	
	
	
	
	
{pkgs, config, ...}:
 | 
						|
 | 
						|
###### interface
 | 
						|
let
 | 
						|
  inherit (pkgs.lib) mkOption
 | 
						|
    mergeEnableOption mergeListOption;
 | 
						|
 | 
						|
  options = {
 | 
						|
    hardware = {
 | 
						|
      pcmcia = {
 | 
						|
        enable = mkOption {
 | 
						|
          default = false;
 | 
						|
          merge = mergeEnableOption;
 | 
						|
          description = ''
 | 
						|
            Enable this option to support PCMCIA card.
 | 
						|
          '';
 | 
						|
        };
 | 
						|
 | 
						|
        firmware = mkOption {
 | 
						|
          default = [];
 | 
						|
          merge = mergeListOption;
 | 
						|
          description = ''
 | 
						|
            List of firmware used to handle specific PCMCIA card.
 | 
						|
          '';
 | 
						|
        };
 | 
						|
 | 
						|
        config = mkOption {
 | 
						|
          default = null;
 | 
						|
          description = ''
 | 
						|
            Path to the configuration file which map the memory, irq
 | 
						|
            and ports used by the PCMCIA hardware.
 | 
						|
          '';
 | 
						|
        };
 | 
						|
      };
 | 
						|
    };
 | 
						|
  };
 | 
						|
in
 | 
						|
 | 
						|
###### implementation
 | 
						|
let
 | 
						|
  inherit (pkgs.lib) mkIf;
 | 
						|
 | 
						|
  pcmciaUtils = pkgs.pcmciaUtils.passthru.function {
 | 
						|
    inherit (config.hardware.pcmcia) firmware config;
 | 
						|
  };
 | 
						|
in
 | 
						|
 | 
						|
 | 
						|
mkIf config.hardware.pcmcia.enable {
 | 
						|
  require = [
 | 
						|
    # ../upstart-jobs/udev.nix
 | 
						|
    # ? # config.environment.extraPackages
 | 
						|
    options
 | 
						|
  ];
 | 
						|
 | 
						|
  boot.kernelModules = [ "pcmcia" ];
 | 
						|
 | 
						|
  services.udev.packages = [ pcmciaUtils ];
 | 
						|
 | 
						|
  environment.systemPackages = [ pcmciaUtils ];
 | 
						|
}
 |