home: 'home-environment-with-provenance' uses the HE location info.
* gnu/home.scm (home-environment-with-provenance): Make `config-file` optional, with the default taken from the HE location info. Signed-off-by: Andrew Tropin <andrew@trop.in>
This commit is contained in:
		
							parent
							
								
									d429ff12e5
								
							
						
					
					
						commit
						1f36534c7e
					
				
					 1 changed files with 15 additions and 1 deletions
				
			
		
							
								
								
									
										16
									
								
								gnu/home.scm
									
										
									
									
									
								
							
							
						
						
									
										16
									
								
								gnu/home.scm
									
										
									
									
									
								
							|  | @ -103,7 +103,21 @@ | |||
|                               #:target-type home-service-type))) | ||||
|     (service-value home))) | ||||
| 
 | ||||
| (define* (home-environment-with-provenance he config-file) | ||||
| 
 | ||||
| (define (home-environment-configuration-file he) | ||||
|   "Return the configuration file of HE, based on its 'location' field, or #f | ||||
| if it could not be determined." | ||||
|   (let ((file (and=> (home-environment-location he) | ||||
|                      location-file))) | ||||
|     (and file | ||||
|          (or (and (string-prefix? "/" file) file) | ||||
|              (search-path %load-path file))))) | ||||
| 
 | ||||
| (define* (home-environment-with-provenance he | ||||
|                                            #:optional | ||||
|                                            (config-file | ||||
|                                             (home-environment-configuration-file | ||||
|                                              he))) | ||||
|   "Return a variant of HE that stores its own provenance information, | ||||
| including CONFIG-FILE, if available.  This is achieved by adding an instance | ||||
| of HOME-PROVENANCE-SERVICE-TYPE to its services." | ||||
|  |  | |||
		Reference in a new issue