Switch to a different way of building the VM.
This commit is contained in:
		
							parent
							
								
									fbbff409a0
								
							
						
					
					
						commit
						74499fb6a0
					
				| @ -8,6 +8,7 @@ | ||||
|       ./boot.nix | ||||
|       ./zfs.nix | ||||
|       ./network.nix | ||||
|       ./roles/sway | ||||
|     ]; | ||||
| 
 | ||||
|   nix.settings.experimental-features = [ "nix-command" "flakes" ]; | ||||
|  | ||||
							
								
								
									
										99
									
								
								nix/configuration/flake.lock
									
									
									
										generated
									
									
									
										Normal file
									
								
							
							
						
						
									
										99
									
								
								nix/configuration/flake.lock
									
									
									
										generated
									
									
									
										Normal file
									
								
							| @ -0,0 +1,99 @@ | ||||
| { | ||||
|   "nodes": { | ||||
|     "home-manager": { | ||||
|       "inputs": { | ||||
|         "nixpkgs": [ | ||||
|           "nixpkgs" | ||||
|         ] | ||||
|       }, | ||||
|       "locked": { | ||||
|         "lastModified": 1734366194, | ||||
|         "narHash": "sha256-vykpJ1xsdkv0j8WOVXrRFHUAdp9NXHpxdnn1F4pYgSw=", | ||||
|         "owner": "nix-community", | ||||
|         "repo": "home-manager", | ||||
|         "rev": "80b0fdf483c5d1cb75aaad909bd390d48673857f", | ||||
|         "type": "github" | ||||
|       }, | ||||
|       "original": { | ||||
|         "owner": "nix-community", | ||||
|         "ref": "release-24.11", | ||||
|         "repo": "home-manager", | ||||
|         "type": "github" | ||||
|       } | ||||
|     }, | ||||
|     "impermanence": { | ||||
|       "locked": { | ||||
|         "lastModified": 1734200366, | ||||
|         "narHash": "sha256-0NursoP4BUdnc+wy+Mq3icHkXu/RgP1Sjo0MJxV2+Dw=", | ||||
|         "owner": "nix-community", | ||||
|         "repo": "impermanence", | ||||
|         "rev": "c6323585fa0035d780e3d8906eb1b24b65d19a48", | ||||
|         "type": "github" | ||||
|       }, | ||||
|       "original": { | ||||
|         "owner": "nix-community", | ||||
|         "repo": "impermanence", | ||||
|         "type": "github" | ||||
|       } | ||||
|     }, | ||||
|     "nixpkgs": { | ||||
|       "locked": { | ||||
|         "lastModified": 1734323986, | ||||
|         "narHash": "sha256-m/lh6hYMIWDYHCAsn81CDAiXoT3gmxXI9J987W5tZrE=", | ||||
|         "owner": "NixOS", | ||||
|         "repo": "nixpkgs", | ||||
|         "rev": "394571358ce82dff7411395829aa6a3aad45b907", | ||||
|         "type": "github" | ||||
|       }, | ||||
|       "original": { | ||||
|         "owner": "NixOS", | ||||
|         "ref": "nixos-24.11", | ||||
|         "repo": "nixpkgs", | ||||
|         "type": "github" | ||||
|       } | ||||
|     }, | ||||
|     "nixpkgs-b93b4e9b5": { | ||||
|       "locked": { | ||||
|         "lastModified": 1713721570, | ||||
|         "narHash": "sha256-R0s+O5UjTePQRb72XPgtkTmEiOOW8n+1q9Gxt/OJnKU=", | ||||
|         "owner": "NixOS", | ||||
|         "repo": "nixpkgs", | ||||
|         "rev": "b93b4e9b527904aadf52dba6ca35efde2067cbd4", | ||||
|         "type": "github" | ||||
|       }, | ||||
|       "original": { | ||||
|         "owner": "NixOS", | ||||
|         "repo": "nixpkgs", | ||||
|         "rev": "b93b4e9b527904aadf52dba6ca35efde2067cbd4", | ||||
|         "type": "github" | ||||
|       } | ||||
|     }, | ||||
|     "nixpkgs-unstable": { | ||||
|       "locked": { | ||||
|         "lastModified": 1734424634, | ||||
|         "narHash": "sha256-cHar1vqHOOyC7f1+tVycPoWTfKIaqkoe1Q6TnKzuti4=", | ||||
|         "owner": "NixOS", | ||||
|         "repo": "nixpkgs", | ||||
|         "rev": "d3c42f187194c26d9f0309a8ecc469d6c878ce33", | ||||
|         "type": "github" | ||||
|       }, | ||||
|       "original": { | ||||
|         "owner": "NixOS", | ||||
|         "ref": "nixos-unstable", | ||||
|         "repo": "nixpkgs", | ||||
|         "type": "github" | ||||
|       } | ||||
|     }, | ||||
|     "root": { | ||||
|       "inputs": { | ||||
|         "home-manager": "home-manager", | ||||
|         "impermanence": "impermanence", | ||||
|         "nixpkgs": "nixpkgs", | ||||
|         "nixpkgs-b93b4e9b5": "nixpkgs-b93b4e9b5", | ||||
|         "nixpkgs-unstable": "nixpkgs-unstable" | ||||
|       } | ||||
|     } | ||||
|   }, | ||||
|   "root": "root", | ||||
|   "version": 7 | ||||
| } | ||||
| @ -12,8 +12,52 @@ | ||||
| 
 | ||||
|   outputs = { self, nixpkgs, nixpkgs-unstable, nixpkgs-b93b4e9b5, impermanence, home-manager, ... }@inputs: let | ||||
|     base-system = {}; | ||||
|     odoqemu = nixpkgs.lib.nixosSystem rec { | ||||
|       system = "x86_64-linux"; | ||||
|       specialArgs = { | ||||
|         pkgs-b93b4e9b5 = import nixpkgs-b93b4e9b5 { | ||||
|           inherit system; | ||||
|           # config.allowUnfree = true; | ||||
|         }; | ||||
|         pkgs-unstable = import nixpkgs-unstable { | ||||
|           inherit system; | ||||
|           # config.allowUnfree = true; | ||||
|         }; | ||||
|       }; | ||||
|       modules = [ | ||||
|         impermanence.nixosModules.impermanence | ||||
|         home-manager.nixosModules.home-manager | ||||
|         { | ||||
|           home-manager.useGlobalPkgs = true; | ||||
|           home-manager.useUserPackages = true; | ||||
|         } | ||||
|         ./configuration.nix | ||||
|         ({lib, ...}: { | ||||
|           imports = [ <nixpkgs/nixos/modules/virtualisation/qemu-vm.nix> ]; | ||||
|           virtualisation.qemu.options = [ | ||||
|             "-device virtio-vga" | ||||
|           ]; | ||||
|           virtualisation.vmVariant = { | ||||
|             # following configuration is added only when building VM with build-vm | ||||
|             virtualisation = { | ||||
|               memorySize = 2048; # Use 2048MiB memory. | ||||
|               cores = 3; | ||||
|               graphics = false; | ||||
|             }; | ||||
|           }; | ||||
|           networking.dhcpcd.enable = lib.mkForce true; | ||||
|           networking.useDHCP = lib.mkForce true; | ||||
|           boot.loader.efi.canTouchEfiVariables = lib.mkForce true; | ||||
|           # doas nixos-rebuild build-vm --flake .#odoqemu | ||||
|           #./result/bin/run-nixos-vm | ||||
|         }) | ||||
|       ]; | ||||
|     }; | ||||
|   in | ||||
|     { | ||||
|       # doas nix build --extra-experimental-features nix-command --extra-experimental-features flakes .#vms.odo | ||||
|       # ./result/bin/run-nixos-vim | ||||
|       vms.odo = odoqemu.config.system.build.vm; | ||||
|       nixosConfigurations.odo = nixpkgs.lib.nixosSystem rec { | ||||
|         system = "x86_64-linux"; | ||||
|         specialArgs = { | ||||
| @ -63,46 +107,5 @@ | ||||
|           }) | ||||
|         ]; | ||||
|       }; | ||||
|       nixosConfigurations.odoqemu = nixpkgs.lib.nixosSystem rec { | ||||
|         system = "x86_64-linux"; | ||||
|         specialArgs = { | ||||
|           pkgs-b93b4e9b5 = import nixpkgs-b93b4e9b5 { | ||||
|             inherit system; | ||||
|             # config.allowUnfree = true; | ||||
|           }; | ||||
|           pkgs-unstable = import nixpkgs-unstable { | ||||
|             inherit system; | ||||
|             # config.allowUnfree = true; | ||||
|           }; | ||||
|         }; | ||||
|         modules = [ | ||||
|           impermanence.nixosModules.impermanence | ||||
|           home-manager.nixosModules.home-manager | ||||
|           { | ||||
|             home-manager.useGlobalPkgs = true; | ||||
|             home-manager.useUserPackages = true; | ||||
|           } | ||||
|           ./configuration.nix | ||||
|           ({lib, ...}: { | ||||
|             imports = [ <nixpkgs/nixos/modules/virtualisation/qemu-vm.nix> ]; | ||||
|             virtualisation.qemu.options = [ | ||||
|               "-device virtio-vga" | ||||
|             ]; | ||||
|             virtualisation.vmVariant = { | ||||
|               # following configuration is added only when building VM with build-vm | ||||
|               virtualisation = { | ||||
|                 memorySize = 2048; # Use 2048MiB memory. | ||||
|                 cores = 3; | ||||
|                 graphics = false; | ||||
|               }; | ||||
|             }; | ||||
|             networking.dhcpcd.enable = lib.mkForce true; | ||||
|             networking.useDHCP = lib.mkForce true; | ||||
|             boot.loader.efi.canTouchEfiVariables = lib.mkForce true; | ||||
|             # doas nixos-rebuild build-vm --flake .#odoqemu | ||||
|             #./result/bin/run-nixos-vm | ||||
|           }) | ||||
|         ]; | ||||
|       }; | ||||
|     }; | ||||
| } | ||||
|  | ||||
| @ -3,5 +3,18 @@ | ||||
| { | ||||
|   imports = []; | ||||
| 
 | ||||
|   environment.systemPackages = with pkgs; [ | ||||
|     grim # screenshot functionality | ||||
|     slurp # screenshot functionality | ||||
|     wl-clipboard # wl-copy and wl-paste for copy/paste from stdin / stdout | ||||
|     mako # notification system developed by swaywm maintainer | ||||
|   ]; | ||||
| 
 | ||||
|   # enable Sway window manager | ||||
|   programs.sway = { | ||||
|     enable = true; | ||||
|     wrapperFeatures.gtk = true; | ||||
|   }; | ||||
| 
 | ||||
|   # foo | ||||
| } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Tom Alexander
						Tom Alexander