 e1b1683981
			
		
	
	
		e1b1683981
		
	
	
	
	
		
			
			Allows one to access a package configured with overrides given in `nixpkgs.config`, e.g.: nix-build ./nixos/default.nix -A pkgs.ffmpeg
		
			
				
	
	
		
			39 lines
		
	
	
		
			886 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
			
		
		
	
	
			39 lines
		
	
	
		
			886 B
		
	
	
	
		
			Nix
		
	
	
	
	
	
| { configuration ? import ./lib/from-env.nix "NIXOS_CONFIG" <nixos-config>
 | |
| , system ? builtins.currentSystem
 | |
| }:
 | |
| 
 | |
| let
 | |
| 
 | |
|   eval = import ./lib/eval-config.nix {
 | |
|     inherit system;
 | |
|     modules = [ configuration ];
 | |
|   };
 | |
| 
 | |
|   # This is for `nixos-rebuild build-vm'.
 | |
|   vmConfig = (import ./lib/eval-config.nix {
 | |
|     inherit system;
 | |
|     modules = [ configuration ./modules/virtualisation/qemu-vm.nix ];
 | |
|   }).config;
 | |
| 
 | |
|   # This is for `nixos-rebuild build-vm-with-bootloader'.
 | |
|   vmWithBootLoaderConfig = (import ./lib/eval-config.nix {
 | |
|     inherit system;
 | |
|     modules =
 | |
|       [ configuration
 | |
|         ./modules/virtualisation/qemu-vm.nix
 | |
|         { virtualisation.useBootLoader = true; }
 | |
|       ];
 | |
|   }).config;
 | |
| 
 | |
| in
 | |
| 
 | |
| {
 | |
|   inherit (eval) pkgs config options;
 | |
| 
 | |
|   system = eval.config.system.build.toplevel;
 | |
| 
 | |
|   vm = vmConfig.system.build.vm;
 | |
| 
 | |
|   vmWithBootLoader = vmWithBootLoaderConfig.system.build.vm;
 | |
| }
 |