document components
This commit is contained in:
		
							parent
							
								
									5189feae3a
								
							
						
					
					
						commit
						f76e2e42fe
					
				
					 3 changed files with 4 additions and 0 deletions
				
			
		
							
								
								
									
										2
									
								
								lib.nix
									
										
									
									
									
								
							
							
						
						
									
										2
									
								
								lib.nix
									
										
									
									
									
								
							|  | @ -1,10 +1,12 @@ | |||
| { pkgs, nix_templater }: | ||||
| rec { | ||||
|   # placeholder to be substituted with the content of a secret file | ||||
|   fileContents = file: { | ||||
|    outPath = "<${builtins.placeholder "nix_template"}${toString file}${builtins.placeholder "nix_template"}>"; | ||||
|    file = file; | ||||
|   }; | ||||
| 
 | ||||
|   # make a template with placeholders | ||||
|   template_text = { name, text, outPath }: | ||||
|     pkgs.runCommand name { | ||||
|       textBeforeTemplate = text; | ||||
|  |  | |||
|  | @ -1,3 +1,4 @@ | |||
| # replace occurrences of a magic string in a template file | ||||
| import sys | ||||
| from pathlib import Path | ||||
| 
 | ||||
|  |  | |||
|  | @ -1,3 +1,4 @@ | |||
| # test injecting a secret into a template | ||||
| { legacyPackages, system, nixpkgs }: | ||||
| let | ||||
|   # this file would usually be outside of the store | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue