| 
									
										
										
										
											2010-02-15 23:27:51 +00:00
										 |  |  | { stdenv, perl, xz, pathsFromGraph | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | , # The file name of the resulting tarball | 
					
						
							| 
									
										
										
										
											2010-09-08 16:53:36 +00:00
										 |  |  |   fileName ? "nixos-system-${stdenv.system}" | 
					
						
							| 
									
										
										
										
											2010-02-15 23:27:51 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | , # The files and directories to be placed in the tarball. | 
					
						
							|  |  |  |   # This is a list of attribute sets {source, target} where `source' | 
					
						
							|  |  |  |   # is the file system object (regular file or directory) to be | 
					
						
							|  |  |  |   # grafted in the file system at path `target'. | 
					
						
							|  |  |  |   contents | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | , # In addition to `contents', the closure of the store paths listed | 
					
						
							|  |  |  |   # in `packages' are also placed in the Nix store of the tarball.  This is | 
					
						
							|  |  |  |   # a list of attribute sets {object, symlink} where `object' if a | 
					
						
							|  |  |  |   # store path whose closure will be copied, and `symlink' is a | 
					
						
							|  |  |  |   # symlink to `object' that will be added to the tarball. | 
					
						
							|  |  |  |   storeContents ? [] | 
					
						
							| 
									
										
										
										
											2014-08-25 02:45:33 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-11 22:54:46 +01:00
										 |  |  |   # Extra commands to be executed before archiving files | 
					
						
							|  |  |  | , extraCommands ? "" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-08-25 02:45:33 +02:00
										 |  |  |   # Extra tar arguments | 
					
						
							|  |  |  | , extraArgs ? "" | 
					
						
							| 
									
										
										
										
											2010-02-15 23:27:51 +00:00
										 |  |  | }: | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | stdenv.mkDerivation { | 
					
						
							|  |  |  |   name = "tarball"; | 
					
						
							|  |  |  |   builder = ./make-system-tarball.sh; | 
					
						
							|  |  |  |   buildInputs = [perl xz]; | 
					
						
							| 
									
										
										
										
											2011-09-14 18:20:50 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-11 22:54:46 +01:00
										 |  |  |   inherit fileName pathsFromGraph extraArgs extraCommands; | 
					
						
							| 
									
										
										
										
											2010-02-15 23:27:51 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |   # !!! should use XML. | 
					
						
							|  |  |  |   sources = map (x: x.source) contents; | 
					
						
							|  |  |  |   targets = map (x: x.target) contents; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |   # !!! should use XML. | 
					
						
							|  |  |  |   objects = map (x: x.object) storeContents; | 
					
						
							|  |  |  |   symlinks = map (x: x.symlink) storeContents; | 
					
						
							| 
									
										
										
										
											2011-09-14 18:20:50 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-15 23:27:51 +00:00
										 |  |  |   # For obtaining the closure of `storeContents'. | 
					
						
							|  |  |  |   exportReferencesGraph = | 
					
						
							|  |  |  |     map (x: [("closure-" + baseNameOf x.object) x.object]) storeContents; | 
					
						
							|  |  |  | } |