forked from fediversity/fediversity
		
	extract importing Nix files
This commit is contained in:
		
							parent
							
								
									6c84b9dae0
								
							
						
					
					
						commit
						04fef22dc3
					
				
					 2 changed files with 12 additions and 1 deletions
				
			
		|  | @ -3,7 +3,7 @@ let | |||
|   inherit (config) pages; | ||||
| in | ||||
| { | ||||
|   imports = with lib.fileset; toList (difference (fileFilter ({ hasExt, ... }: hasExt "nix") ./.) ./default.nix); | ||||
|   imports = lib.nixFiles ./.; | ||||
| 
 | ||||
|   collections.news.type = config.content-types.article; | ||||
| 
 | ||||
|  |  | |||
|  | @ -65,6 +65,17 @@ rec { | |||
|     in | ||||
|     join "/" relativeComponents; | ||||
| 
 | ||||
|   /** | ||||
|     Recursively list all Nix files from a directory, except the top-level `default.nix` | ||||
| 
 | ||||
|     Useful for module system `imports` from a top-level module. | ||||
|   **/ | ||||
|   nixFiles = dir: with lib.fileset; | ||||
|     toList (difference | ||||
|       (fileFilter ({ hasExt, ... }: hasExt "nix") dir) | ||||
|       (dir + "/default.nix") | ||||
|     ); | ||||
| 
 | ||||
|   types = rec { | ||||
|     collection = elemType: | ||||
|       let | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Valentin Gagarin
							Valentin Gagarin