diff --git a/hosts/chocolatebar/virtualisation/create-service.nix b/hosts/chocolatebar/virtualisation/create-service.nix index 2f174e9..00fd21d 100644 --- a/hosts/chocolatebar/virtualisation/create-service.nix +++ b/hosts/chocolatebar/virtualisation/create-service.nix @@ -15,7 +15,7 @@ in script = let networkXML = pkgs.writeText "network.xml" (import ./network-xml.nix { inherit config; inherit pkgs; inherit lib; }); - machineXML = pkgs.writeText "${vm.name}.xml" (generateXML { inherit config; inherit pkgs; inherit lib; inherit vm; varsFile = varsFile; }); + machineXML = pkgs.writeText "${vm.name}.xml" (vm.generateXML { inherit config; inherit pkgs; inherit lib; inherit vm; varsFile = varsFile; }); in '' echo "Checking if ${vm.name} is already running" diff --git a/hosts/chocolatebar/virtualisation/default.nix b/hosts/chocolatebar/virtualisation/default.nix index 730e5a9..24fa205 100644 --- a/hosts/chocolatebar/virtualisation/default.nix +++ b/hosts/chocolatebar/virtualisation/default.nix @@ -4,8 +4,11 @@ let psCfg = config.pub-solar; xdg = config.home-manager.users."${psCfg.user.name}".xdg; createService = import ./create-service.nix; + generateXML = import ./guest-xml.nix; + generateTailsXML = import ./tails-xml.nix; isolateGPU = "rx550x"; + memory = 48; # in GB handOverUSBDevices = false; isolateAnyGPU = isolateGPU != null; @@ -31,8 +34,10 @@ in id = "http://microsoft.com/win/10"; gpu = true; mountHome = false; + memory = memory; isolateGPU = isolateGPU; handOverUSBDevices = handOverUSBDevices; + generateXML = generateXML; }; }; vm-manjaro = createService { @@ -45,8 +50,27 @@ in id = "https://manjaro.org/download/#i3"; gpu = true; mountHome = true; + memory = memory; isolateGPU = isolateGPU; handOverUSBDevices = handOverUSBDevices; + generateXML = generateXML; + }; + }; + vm-tails = createService { + inherit config; + inherit pkgs; + inherit lib; + vm = { + name = "tails"; + disk = "/var/lib/vms/tails/tails-amd64-5.4.iso"; + # disk = "/var/lib/vms/nixos/nixos-minimal.iso"; + id = "https://tails.boum.org/install/index.en.html"; + gpu = false; + mountHome = false; + memory = 16; + isolateGPU = isolateGPU; + handOverUSBDevices = false; + generateXML = generateTailsXML; }; }; }; diff --git a/hosts/chocolatebar/virtualisation/guest-xml.nix b/hosts/chocolatebar/virtualisation/guest-xml.nix index 801e0d7..117e4da 100644 --- a/hosts/chocolatebar/virtualisation/guest-xml.nix +++ b/hosts/chocolatebar/virtualisation/guest-xml.nix @@ -13,8 +13,8 @@ in - 33554432 - 33554432 + ${toString vm.memory} + ${toString vm.memory} 12 diff --git a/hosts/chocolatebar/virtualisation/tails-xml.nix b/hosts/chocolatebar/virtualisation/tails-xml.nix new file mode 100644 index 0000000..5efefb2 --- /dev/null +++ b/hosts/chocolatebar/virtualisation/tails-xml.nix @@ -0,0 +1,183 @@ +{ config, pkgs, lib, vm, varsFile, ... }: +let + psCfg = config.pub-solar; + xdg = config.home-manager.users."${psCfg.user.name}".xdg; + home = config.home-manager.users."${psCfg.user.name}".home; +in +'' + + ${vm.name} + UUID + + + + + + ${toString vm.memory} + ${toString vm.memory} + 8 + + hvm + + + + + + + + + + + + + + destroy + restart + destroy + + + + + + /run/libvirt/nix-emulators/qemu-system-x86_64 + + + + + +
+ + +
+ + + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + + + +
+ + +
+ + +
+ + + + + +
+ + + + + + + + + + + +
+ + + +
+ + +
+ + + + + + + + +
+ +