forked from fabian/nix
		
	doctrine/lib: support module dependencies
This commit is contained in:
		
							parent
							
								
									3152a0f626
								
							
						
					
					
						commit
						3121013376
					
				
					 1 changed files with 17 additions and 5 deletions
				
			
		|  | @ -1,12 +1,14 @@ | |||
| { | ||||
|   # The first few arguments are implicitly passed by the 'close' helper | ||||
|   lib, | ||||
|   pkgs, | ||||
|   doctrine, | ||||
|   name, | ||||
|   config, | ||||
|   hm ? null, | ||||
|   sys ? null, | ||||
|   options ? null, | ||||
|   lib, | ||||
|   config, | ||||
|   pkgs, | ||||
|   doctrine, | ||||
|   requires ? [], | ||||
| }: let | ||||
|   optionsSet = import options { | ||||
|     inherit config lib pkgs cfg name doctrine; | ||||
|  | @ -24,7 +26,17 @@ | |||
| in { | ||||
|   config = | ||||
|     lib.optionalAttrs (configFiles ? ${doctrine.namespace}) | ||||
|     (lib.mkIf cfg.enable configSet); | ||||
|     (lib.mkIf cfg.enable (lib.mkMerge [ | ||||
|       configSet | ||||
|       { | ||||
|         assertions = | ||||
|           map (dependency: { | ||||
|             assertion = cfg.enable -> config.${doctrine.prefix}.${dependency}.enable; | ||||
|             message = "${doctrine.prefix}.${name}.enable requires ${doctrine.prefix}.${dependency}.enable"; | ||||
|           }) | ||||
|           requires; | ||||
|       } | ||||
|     ])); | ||||
| 
 | ||||
|   options.${doctrine.prefix}.${name} = | ||||
|     lib.optionalAttrs (options != null && optionsSet ? ${doctrine.namespace}) optionsSet.${doctrine.namespace} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Alejandro Soto
						Alejandro Soto