2021-10-18 22:53:44 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, stdenv
|
|
|
|
, makeWrapper
|
|
|
|
, qemu
|
|
|
|
, gnugrep
|
2022-09-22 09:16:24 +00:00
|
|
|
, gnused
|
2021-10-18 22:53:44 +00:00
|
|
|
, lsb-release
|
|
|
|
, jq
|
|
|
|
, procps
|
|
|
|
, python3
|
|
|
|
, cdrtools
|
|
|
|
, usbutils
|
|
|
|
, util-linux
|
2022-09-22 09:16:24 +00:00
|
|
|
, socat
|
2022-05-02 19:47:10 +00:00
|
|
|
, spice-gtk
|
2021-10-18 22:53:44 +00:00
|
|
|
, swtpm
|
2022-09-22 09:16:24 +00:00
|
|
|
, unzip
|
2021-10-18 22:53:44 +00:00
|
|
|
, wget
|
|
|
|
, xdg-user-dirs
|
|
|
|
, xrandr
|
|
|
|
, zsync
|
2021-12-07 11:49:40 +00:00
|
|
|
, OVMF
|
2022-09-22 09:16:24 +00:00
|
|
|
, OVMFFull
|
2021-12-07 11:49:40 +00:00
|
|
|
, quickemu
|
2022-04-20 14:40:48 +00:00
|
|
|
, testers
|
2021-10-18 22:53:44 +00:00
|
|
|
}:
|
|
|
|
let
|
|
|
|
runtimePaths = [
|
|
|
|
qemu
|
|
|
|
gnugrep
|
2022-09-22 09:16:24 +00:00
|
|
|
gnused
|
2021-10-18 22:53:44 +00:00
|
|
|
jq
|
|
|
|
lsb-release
|
|
|
|
procps
|
|
|
|
python3
|
|
|
|
cdrtools
|
|
|
|
usbutils
|
|
|
|
util-linux
|
2022-09-22 09:16:24 +00:00
|
|
|
unzip
|
|
|
|
socat
|
2022-05-02 19:47:10 +00:00
|
|
|
spice-gtk
|
2021-10-18 22:53:44 +00:00
|
|
|
swtpm
|
|
|
|
wget
|
|
|
|
xdg-user-dirs
|
|
|
|
xrandr
|
|
|
|
zsync
|
|
|
|
];
|
|
|
|
in
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "quickemu";
|
2022-12-13 06:34:06 +00:00
|
|
|
version = "4.5";
|
2021-10-18 22:53:44 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2021-12-07 11:49:40 +00:00
|
|
|
owner = "quickemu-project";
|
|
|
|
repo = "quickemu";
|
2021-10-18 22:53:44 +00:00
|
|
|
rev = version;
|
2022-12-13 06:34:06 +00:00
|
|
|
hash = "sha256-31f4BIIYCh2acbueUtGZShKnlhctd1FfKkFqsNiUqrI=";
|
2021-10-18 22:53:44 +00:00
|
|
|
};
|
|
|
|
|
2022-09-22 09:16:24 +00:00
|
|
|
postPatch = ''
|
|
|
|
sed -i \
|
|
|
|
-e '/OVMF_CODE_4M.secboot.fd/s|ovmfs=(|ovmfs=("${OVMFFull.fd}/FV/OVMF_CODE.fd","${OVMFFull.fd}/FV/OVMF_VARS.fd" |' \
|
|
|
|
-e '/OVMF_CODE_4M.fd/s|ovmfs=(|ovmfs=("${OVMF.fd}/FV/OVMF_CODE.fd","${OVMF.fd}/FV/OVMF_VARS.fd" |' \
|
|
|
|
-e '/cp "''${VARS_IN}" "''${VARS_OUT}"/a chmod +w "''${VARS_OUT}"' \
|
|
|
|
-e 's/Icon=.*qemu.svg/Icon=qemu/' \
|
|
|
|
quickemu
|
|
|
|
'';
|
2021-12-07 11:49:40 +00:00
|
|
|
|
2021-10-18 22:53:44 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
2022-09-22 09:16:24 +00:00
|
|
|
install -Dm755 -t "$out/bin" macrecovery quickemu quickget windowskey
|
2021-10-18 22:53:44 +00:00
|
|
|
|
2022-09-22 09:16:24 +00:00
|
|
|
for f in macrecovery quickget quickemu windowskey; do
|
|
|
|
wrapProgram $out/bin/$f --prefix PATH : "${lib.makeBinPath runtimePaths}"
|
2021-12-07 11:49:40 +00:00
|
|
|
done
|
2021-10-18 22:53:44 +00:00
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2022-04-20 14:40:48 +00:00
|
|
|
passthru.tests = testers.testVersion { package = quickemu; };
|
2021-12-07 11:49:40 +00:00
|
|
|
|
2021-10-18 22:53:44 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Quickly create and run optimised Windows, macOS and Linux desktop virtual machines";
|
2021-12-07 11:49:40 +00:00
|
|
|
homepage = "https://github.com/quickemu-project/quickemu";
|
2021-10-18 22:53:44 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fedx-sudo ];
|
|
|
|
};
|
|
|
|
}
|