forked from fabian/nix
		
	trivionomicon/doctrine: add support for overriding the prefix
This commit is contained in:
		
							parent
							
								
									c651b8c470
								
							
						
					
					
						commit
						7daa3d91b3
					
				
					 3 changed files with 28 additions and 18 deletions
				
			
		|  | @ -1,12 +1,16 @@ | |||
| { | ||||
|   lib ? pkgs.lib, | ||||
|   pkgs, | ||||
|   namespace, | ||||
|   prefix ? "trivium", | ||||
|   namespace ? null, | ||||
| }: let | ||||
|   doctrine = { | ||||
|     lib = import ./lib {inherit lib pkgs doctrine;}; | ||||
|     prefix = "trivium"; | ||||
|     inherit namespace; | ||||
|   }; | ||||
|   inherit (pkgs) lib; | ||||
|   doctrine = | ||||
|     { | ||||
|       lib = import ./lib {inherit lib pkgs doctrine;}; | ||||
|       inherit namespace prefix; | ||||
|     } | ||||
|     // lib.optionalAttrs (pkgs != null) { | ||||
|       inherit pkgs; | ||||
|     }; | ||||
| in | ||||
|   doctrine | ||||
|  |  | |||
|  | @ -13,8 +13,11 @@ | |||
| 
 | ||||
|   closeLib = close {inherit lib;}; | ||||
|   closeFull = close {inherit lib pkgs doctrine;}; | ||||
| in { | ||||
|   inherit close; | ||||
|   importAll = closeLib ./import-all.nix; | ||||
|   mkModule = closeFull ./mk-module.nix; | ||||
| } | ||||
| in | ||||
|   { | ||||
|     inherit close; | ||||
|     importAll = closeLib ./import-all.nix; | ||||
|   } | ||||
|   // lib.optionalAttrs (doctrine.namespace != null) { | ||||
|     mkModule = closeFull ./mk-module.nix; | ||||
|   } | ||||
|  |  | |||
|  | @ -11,14 +11,17 @@ | |||
|   requires ? [], | ||||
|   prefix ? doctrine.prefix, | ||||
|   namespace ? doctrine.namespace, | ||||
|   passthru ? {}, | ||||
| }: let | ||||
|   optionsSet = import options { | ||||
|     inherit config lib pkgs cfg name doctrine; | ||||
|   }; | ||||
|   optionsSet = import options (passthru | ||||
|     // { | ||||
|       inherit config lib pkgs cfg name doctrine; | ||||
|     }); | ||||
| 
 | ||||
|   configSet = import configFiles.${namespace} { | ||||
|     inherit config lib pkgs doctrine cfg; | ||||
|   }; | ||||
|   configSet = import configFiles.${namespace} (passthru | ||||
|     // { | ||||
|       inherit config lib pkgs doctrine cfg; | ||||
|     }); | ||||
| 
 | ||||
|   configFiles = lib.filterAttrs (k: v: v != null) { | ||||
|     inherit sys hm; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Alejandro Soto
						Alejandro Soto