| 
									
										
										
										
											2019-11-05 00:39:07 +01:00
										 |  |  | import ./make-test-python.nix ({ lib, ... } : { | 
					
						
							| 
									
										
										
										
											2019-08-07 18:04:18 +02:00
										 |  |  |   name = "nixos-generate-config"; | 
					
						
							|  |  |  |   meta.maintainers = with lib.maintainers; [ basvandijk ]; | 
					
						
							|  |  |  |   machine = { | 
					
						
							|  |  |  |     system.nixos-generate-config.configuration = ''
 | 
					
						
							|  |  |  |       # OVERRIDDEN | 
					
						
							|  |  |  |       { config, pkgs, ... }: { | 
					
						
							|  |  |  |         imports = [ ./hardware-configuration.nix ]; | 
					
						
							|  |  |  |       $bootLoaderConfig | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |     '';
 | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  |   testScript = ''
 | 
					
						
							| 
									
										
										
										
											2019-11-05 00:39:07 +01:00
										 |  |  |     start_all() | 
					
						
							|  |  |  |     machine.wait_for_unit("multi-user.target") | 
					
						
							|  |  |  |     machine.succeed("nixos-generate-config") | 
					
						
							| 
									
										
										
										
											2019-08-07 18:04:18 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     # Test if the configuration really is overridden | 
					
						
							| 
									
										
										
										
											2019-11-05 00:39:07 +01:00
										 |  |  |     machine.succeed("grep 'OVERRIDDEN' /etc/nixos/configuration.nix") | 
					
						
							| 
									
										
										
										
											2019-08-07 18:04:18 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  |     # Test of if the Perl variable $bootLoaderConfig is spliced correctly: | 
					
						
							| 
									
										
										
										
											2019-11-05 00:39:07 +01:00
										 |  |  |     machine.succeed( | 
					
						
							|  |  |  |         "grep 'boot\\.loader\\.grub\\.enable = true;' /etc/nixos/configuration.nix" | 
					
						
							|  |  |  |     ) | 
					
						
							| 
									
										
										
										
											2019-08-07 18:04:18 +02:00
										 |  |  |   '';
 | 
					
						
							|  |  |  | }) |