winapps/packages/winapps/default.nix
2024-09-09 17:50:55 +02:00

76 lines
1.5 KiB
Nix

{
stdenv,
lib,
fetchFromGitHub,
makeWrapper,
freerdp3,
dialog,
libnotify,
netcat-gnu,
iproute2,
...
}:
let
rev = "07817afe0c2cad15c4eb90b5c94261a2b4d365d4";
hash = "sha256-4KxssnSw1Xk6huKRpbRFw6NXIhjCoZYBzu/HYA1ngDM=";
in
stdenv.mkDerivation rec {
pname = "winapps";
version = "git+${rev}";
src = fetchFromGitHub {
owner = "winapps-org";
repo = "winapps";
inherit rev hash;
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [
freerdp3
libnotify
dialog
netcat-gnu
iproute2
];
patches = [
./winapps.patch
./setup.patch
];
postPatch = ''
substituteAllInPlace bin/winapps
substituteAllInPlace setup.sh
patchShebangs install/inquirer.sh
'';
installPhase = ''
runHook preInstall
mkdir -p $out
mkdir -p $out/src
cp -r ./ $out/src/
install -m755 -D bin/winapps $out/bin/winapps
install -m755 -D setup.sh $out/bin/winapps-setup
for f in winapps-setup winapps; do
wrapProgram $out/bin/$f \
--set LIBVIRT_DEFAULT_URI "qemu:///system" \
--prefix PATH : "${lib.makeBinPath buildInputs}"
done
runHook postInstall
'';
meta = with lib; {
homepage = "https://github.com/winapps-org/winapps";
description = "Run Windows applications (including Microsoft 365 and Adobe Creative Cloud) on GNU/Linux with KDE, GNOME or XFCE, integrated seamlessly as if they were native to the OS. Wayland is currently unsupported.";
mainProgram = "winapps";
platforms = platforms.linux;
license = licenses.agpl3Plus;
};
}