2014-08-24 19:18:18 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								<chapter  xmlns= "http://docbook.org/ns/docbook" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        xmlns:xlink="http://www.w3.org/1999/xlink"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        xmlns:xi="http://www.w3.org/2001/XInclude"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        version="5.0"
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								        xml:id="sec-building-cd">
							 
						 
					
						
							
								
									
										
										
										
											2018-05-01 19:57:09 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								 <title > Building Your Own NixOS CD</title> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 <para > 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-19 19:17:30 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  Building a NixOS CD is as easy as configuring your own computer. The idea is
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  to use another module which will replace your
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  <filename > configuration.nix</filename>  to configure the system that would be
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  installed on the CD.
							 
						 
					
						
							
								
									
										
										
										
											2018-05-01 19:57:09 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								 </para> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 <para > 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-19 19:17:30 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  Default CD/DVD configurations are available inside
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  <filename > nixos/modules/installer/cd-dvd</filename> .
							 
						 
					
						
							
								
									
										
										
										
											2014-08-24 19:18:18 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								<screen > 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-17 13:25:50 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								<prompt > $ </prompt> git clone https://github.com/NixOS/nixpkgs.git
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								<prompt > $ </prompt> cd nixpkgs/nixos
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								<prompt > $ </prompt> nix-build -A config.system.build.isoImage -I nixos-config=modules/installer/cd-dvd/installation-cd-minimal.nix default.nix</screen> 
							 
						 
					
						
							
								
									
										
										
										
											2018-05-01 19:57:09 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								 </para> 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 <para > 
							 
						 
					
						
							
								
									
										
										
										
											2019-09-19 19:17:30 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								  Before burning your CD/DVD, you can check the content of the image by
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								  mounting anywhere like suggested by the following command:
							 
						 
					
						
							
								
									
										
										
										
											2014-08-24 19:18:18 +02:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								<screen > 
							 
						 
					
						
							
								
									
										
										
										
											2019-06-17 13:25:50 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								<prompt > # </prompt> mount -o loop -t iso9660 ./result/iso/cd.iso /mnt/iso</screen> 
							 
						 
					
						
							
								
									
										
										
										
											2018-05-01 19:57:09 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								 </para> 
							 
						 
					
						
							
								
									
										
										
										
											2020-09-27 21:59:54 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								 <para > 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 If you want to customize your NixOS CD in more detail, or generate other kinds
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 of images, you might want to check out <link 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 xlink:href="https://github.com/nix-community/nixos-generators">nixos-generators</link> . This can also be a good starting point when you want to use Nix to build a
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 'minimal' image that doesn't include a NixOS installation.
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								 </para> 
							 
						 
					
						
							
								
									
										
										
										
											2016-06-01 16:23:32 +02:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								</chapter>