-
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.
Merge pull request #234 from winapps-org/feat-nix-packaging
Package WinApps (and the Launcher) with Nix
- Loading branch information
Showing
12 changed files
with
580 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
name: "Update Flake Packages" | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 10 * * 0" # https://crontab.guru/#0_10_*_*_0 | ||
|
||
jobs: | ||
updateFlakePackages: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Install Nix | ||
uses: cachix/install-nix-action@v20 | ||
|
||
- name: Update flake packages | ||
uses: selfuryon/nix-update-action@v1 |
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
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
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
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,16 @@ | ||
# Copyright (c) 2024 Oskar Manhart | ||
# All rights reserved. | ||
# | ||
# SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
(import ( | ||
let | ||
lock = builtins.fromJSON (builtins.readFile ./flake.lock); | ||
in | ||
fetchTarball { | ||
url = | ||
lock.nodes.flake-compat.locked.url | ||
or "https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz"; | ||
sha256 = lock.nodes.flake-compat.locked.narHash; | ||
} | ||
) { src = ./.; }).defaultNix |
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,34 @@ | ||
# Copyright (c) 2024 Oskar Manhart | ||
# All rights reserved. | ||
# | ||
# SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
{ | ||
description = "WinApps Nix packages & NixOS module"; | ||
|
||
inputs = { | ||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable"; | ||
|
||
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz"; | ||
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.nixfmt-rfc-style; | ||
|
||
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,11 @@ | ||
--- a/WinAppsLauncher.sh | ||
+++ b/WinAppsLauncher.sh | ||
@@ -19,7 +19,7 @@ declare -rx EC_WIN_NOT_SPEC=6 | ||
declare -rx EC_NO_WIN_FOUND=7 | ||
|
||
# Paths | ||
-declare -rx ICONS_PATH="./Icons" | ||
+declare -rx ICONS_PATH="@out@/Icons" | ||
declare -rx APPDATA_PATH="${HOME}/.local/share/winapps" | ||
declare -rx CONFIG_PATH="${HOME}/.config/winapps" | ||
declare -rx CONFIG_FILE="${CONFIG_PATH}/winapps.conf" |
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,77 @@ | ||
# Copyright (c) 2024 Oskar Manhart | ||
# All rights reserved. | ||
# | ||
# SPDX-License-Identifier: AGPL-3.0-or-later | ||
|
||
{ | ||
stdenv, | ||
lib, | ||
fetchFromGitHub, | ||
makeWrapper, | ||
makeDesktopItem, | ||
callPackage, | ||
yad, | ||
... | ||
}: | ||
let | ||
rev = "9f5fbcb57f2932b260202fb582f9adcf28df5f1c"; | ||
hash = "sha256-cShXlcFHTryxKLKxdoqZSge2oyGgeuFPW9Nxg+gSjB4="; | ||
in | ||
stdenv.mkDerivation rec { | ||
pname = "winapps-launcher"; | ||
version = "0-unstable-2024-10-01"; | ||
|
||
src = fetchFromGitHub { | ||
owner = "winapps-org"; | ||
repo = "WinApps-Launcher"; | ||
|
||
inherit rev hash; | ||
}; | ||
|
||
nativeBuildInputs = [ makeWrapper ]; | ||
buildInputs = [ | ||
yad | ||
(callPackage ../winapps { }) | ||
]; | ||
|
||
patches = [ ./WinAppsLauncher.patch ]; | ||
|
||
postPatch = '' | ||
substituteAllInPlace WinAppsLauncher.sh | ||
''; | ||
|
||
installPhase = '' | ||
runHook preInstall | ||
mkdir -p $out | ||
cp -r ./Icons $out/Icons | ||
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; | ||
}; | ||
} |
Oops, something went wrong.