Allow setting the state directory as a store parameter
E.g. "local?store=/tmp/store&state=/tmp/var".
This commit is contained in:
		
							parent
							
								
									f2682e6e18
								
							
						
					
					
						commit
						812c0dfbe2
					
				
					 13 changed files with 112 additions and 77 deletions
				
			
		|  | @ -692,6 +692,9 @@ static void opSetFlag(Globals & globals, Strings opFlags, Strings opArgs) | |||
| 
 | ||||
| static void opSet(Globals & globals, Strings opFlags, Strings opArgs) | ||||
| { | ||||
|     auto store2 = globals.state->store.dynamic_pointer_cast<LocalFSStore>(); | ||||
|     if (!store2) throw Error("--set is not supported for this Nix store"); | ||||
| 
 | ||||
|     for (Strings::iterator i = opFlags.begin(); i != opFlags.end(); ) { | ||||
|         string arg = *i++; | ||||
|         if (parseInstallSourceOptions(globals, i, opFlags, arg)) ; | ||||
|  | @ -722,7 +725,7 @@ static void opSet(Globals & globals, Strings opFlags, Strings opArgs) | |||
|     } | ||||
| 
 | ||||
|     debug(format("switching to new user environment")); | ||||
|     Path generation = createGeneration(globals.state->store, globals.profile, drv.queryOutPath()); | ||||
|     Path generation = createGeneration(ref<LocalFSStore>(store2), globals.profile, drv.queryOutPath()); | ||||
|     switchLink(globals.profile, generation); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue