-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: package winapps & the winapps launcher using nix
doc: document installation using Nix fix: explicitely specify path to inquirer fix: libvirt group is called libvirtd on nix fix: set libvirturl for winapps-launcher fix: refine group change sed expr feat: add desktop file fix: do not use source derivation fix: use install instead of cp fix: ensure exists
- Loading branch information
1 parent
9417382
commit 5475085
Showing
5 changed files
with
288 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
description = "WinApps Nix packages & NixOS module"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
flake-utils.url = "github:numtide/flake-utils"; | ||
}; | ||
|
||
outputs = { | ||
nixpkgs, | ||
flake-utils, | ||
... | ||
}: | ||
flake-utils.lib.eachDefaultSystem ( | ||
system: let | ||
pkgs = import nixpkgs {inherit system;}; | ||
in { | ||
formatter = pkgs.alejandra; | ||
|
||
packages.winapps = pkgs.callPackage ./packages/winapps {}; | ||
packages.winapps-launcher = pkgs.callPackage ./packages/winapps-launcher {}; | ||
} | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
{ | ||
stdenv, | ||
lib, | ||
fetchFromGitHub, | ||
makeWrapper, | ||
makeDesktopItem, | ||
callPackage, | ||
yad, | ||
... | ||
}: let | ||
rev = "eaa660d39bf3f49b136c98c87c35e3e12f118f8f"; | ||
hash = "sha256-7lkx/O4dOdVqAPX6s2IkkM6Ggbzmz9sm++20BBeoUQ4="; | ||
icon = "winapps"; | ||
in | ||
stdenv.mkDerivation rec { | ||
pname = "winapps"; | ||
version = "git+${rev}"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "winapps-org"; | ||
repo = "WinApps-Launcher"; | ||
|
||
inherit rev hash; | ||
}; | ||
|
||
nativeBuildInputs = [makeWrapper]; | ||
buildInputs = [yad (callPackage ../winapps {})]; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
mkdir -p $out | ||
cp -r ./Icons $out/Icons | ||
sed -E -i \ | ||
-e "$(printf "%s$out%s" 's|^declare -rx ICONS_PATH="./Icons"|declare -rx ICONS_PATH="' '/Icons"|')" \ | ||
WinAppsLauncher.sh | ||
patchShebangs WinAppsLauncher.sh | ||
install -m755 -D WinAppsLauncher.sh $out/bin/winapps-launcher | ||
install -Dm444 -T Icons/AppIcon.svg $out/share/pixmaps/winapps.svg | ||
wrapProgram $out/bin/winapps-launcher \ | ||
--set LIBVIRT_DEFAULT_URI "qemu:///system" \ | ||
--prefix PATH : "${lib.makeBinPath buildInputs}" | ||
runHook postInstall | ||
''; | ||
|
||
desktopItems = [ | ||
(makeDesktopItem { | ||
name = "winapps"; | ||
exec = "winapps-launcher"; | ||
icon = "winapps"; | ||
comment = meta.description; | ||
desktopName = "WinApps"; | ||
categories = ["Utility"]; | ||
}) | ||
]; | ||
|
||
meta = with lib; { | ||
homepage = "https://github.com/winapps-org/WinApps-Launcher"; | ||
description = "Graphical launcher for WinApps. 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-launcher"; | ||
platforms = platforms.linux; | ||
license = licenses.gpl3; | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ | ||
stdenv, | ||
lib, | ||
fetchFromGitHub, | ||
makeWrapper, | ||
freerdp3, | ||
dialog, | ||
libnotify, | ||
netcat-gnu, | ||
iproute2, | ||
... | ||
}: let | ||
rev = "feat-install-script"; # "9417382ae73d2ae5ad69d1c5c407e8b1e5f001dc"; | ||
hash = "sha256-iasuufBu+DhulH/hj2uUaM/KzGO7241+PZXuujsT/qI="; | ||
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]; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
patchShebangs install/inquirer.sh | ||
sed -E -i \ | ||
-e 's/grep -q -E "\\blibvirt\\b"/grep -q -E "\\blibvirtd\\b"/' \ | ||
-e "$(printf "%s$out/src%s" 's|^readonly INQUIRER_PATH="./install/inquirer.sh"|readonly INQUIRER_PATH="' '/install/inquirer.sh"|')" \ | ||
-e "$(printf "%s$out/src%s" 's|^readonly SYS_SOURCE_PATH="(.*?)"|readonly SYS_SOURCE_PATH="' '"|')" \ | ||
-e "$(printf "%s$out/src%s" 's|^readonly USER_SOURCE_PATH="(.*?)"|readonly USER_SOURCE_PATH="' '"|')" \ | ||
-e 's/\$SUDO git -C "\$SOURCE_PATH" pull --no-rebase//g' \ | ||
-e 's|./setup.sh|winapps-setup|g' \ | ||
setup.sh | ||
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 | ||
patchShebangs $out/bin/$f | ||
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.gpl3; | ||
}; | ||
} |