feat(qemu): improve QEMU configuration
This commit is contained in:
		
							parent
							
								
									660239293e
								
							
						
					
					
						commit
						5a5730a840
					
				@ -7,11 +7,25 @@
 | 
			
		||||
with lib; let
 | 
			
		||||
  cfg = config.mySystem.dev.qemu;
 | 
			
		||||
in {
 | 
			
		||||
  options.mySystem.dev.qemu.enable = mkEnableOption "Enable QEMU";
 | 
			
		||||
  options.mySystem.dev.qemu = {
 | 
			
		||||
    enable = mkEnableOption "Enable QEMU";
 | 
			
		||||
    users = mkOption {
 | 
			
		||||
      type = types.listOf types.str;
 | 
			
		||||
      default = ["phundrak"];
 | 
			
		||||
      example = ["user1" "user2"];
 | 
			
		||||
    };
 | 
			
		||||
  };
 | 
			
		||||
  config = mkIf cfg.enable {
 | 
			
		||||
    programs.virt-manager.enable = true;
 | 
			
		||||
    users.groups.libvirtd.members = cfg.users;
 | 
			
		||||
    virtualisation = {
 | 
			
		||||
      libvirtd.enable = true;
 | 
			
		||||
      spiceUSBRedirection.enable = true;
 | 
			
		||||
    };
 | 
			
		||||
    environment.systemPackages = with pkgs; [
 | 
			
		||||
      qemu
 | 
			
		||||
      virt-manager
 | 
			
		||||
      quickemu
 | 
			
		||||
      swtpm
 | 
			
		||||
    ];
 | 
			
		||||
    systemd.tmpfiles.rules = ["L+ /var/lib/qemu/firmware - - - - ${pkgs.qemu}/share/qemu/firmware"];
 | 
			
		||||
    boot.binfmt.emulatedSystems = ["aarch64-linux"];
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user