cleanup changes

This commit is contained in:
Daylin Morgan 2024-12-24 09:48:12 -06:00
parent d7f3c7de3c
commit a3b4ea2046
Signed by: daylin
GPG key ID: 950D13E9719334AD

View file

@ -15,25 +15,19 @@ let
}
);
};
win-desktop = pkgs.stdenvNoCC.mkDerivation rec {
name = "win11-vm";
unpackPhase = "true";
version = "unstable";
windows10Logo = pkgs.fetchurl {
url = "https://upload.wikimedia.org/wikipedia/commons/c/c7/Windows_logo_-_2012.png";
hash = "sha256-uVNgGUo0NZN+mUmvMzyk0HKnhx64uqT4YWGSdeBz3T4=";
};
desktopItem = pkgs.makeDesktopItem {
name = "win11-vm";
# exec = "VBoxManage startvm win10";
exec = "${pkgs.libvirt}/bin/virsh start win11 && ${pkgs.virt-viewer}/bin/virt-viewer --wait -c qemu:///system win11 && ${pkgs.libvirt}/bin/virsh shutdown win11";
icon = "${windows10Logo}";
desktopName = "Windows 11 VM";
};
installPhase = ''
install -Dm0644 {${desktopItem},$out}/share/applications/win11vm.desktop
windows10Logo = pkgs.fetchurl {
url = "https://upload.wikimedia.org/wikipedia/commons/c/c7/Windows_logo_-_2012.png";
hash = "sha256-uVNgGUo0NZN+mUmvMzyk0HKnhx64uqT4YWGSdeBz3T4=";
};
windows-desktopItem = pkgs.makeDesktopItem {
name = "win11-vm";
exec = ''
${pkgs.bash}/bin/sh -c "${pkgs.libvirt}/bin/virsh start win11 && ${pkgs.virt-viewer}/bin/virt-viewer --wait -c qemu:///system win11 && ${pkgs.libvirt}/bin/virsh shutdown win11"
'';
icon = "${windows10Logo}";
desktopName = "Windows 11 VM";
};
in
@ -67,5 +61,9 @@ in
extraGroups = [ "libvirtd" ];
};
environment.systemPackages = [ win-desktop ];
environment.systemPackages = [
(pkgs.runCommand "windows-vm-desktop-item" { } ''
install -Dm444 -t $out/share/applications ${windows-desktopItem}/share/applications/*.desktop
'')
];
}