1 Commits

Author SHA1 Message Date
github-actions[bot]
89956aac44 winapps: 0-unstable-2025-07-02 -> 0-unstable-2025-07-10
Diff: ce9a84dc52...e48d50ff78
2025-07-13 10:03:57 +00:00
8 changed files with 72 additions and 152 deletions

40
.github/workflows/update-nix.yaml vendored Normal file
View File

@@ -0,0 +1,40 @@
name: "Update Flake Packages"
permissions:
contents: write
pull-requests: write
on:
pull_request:
branches: [main]
types: [labeled]
schedule:
- cron: "0 10 * * 0" # https://crontab.guru/#0_10_*_*_0
jobs:
build:
if: github.event_name != 'pull_request' || contains(github.event.pull_request.labels.*.name, 'rebuild nix')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@main
with:
trust-runner-user: true
- name: Set up cache
uses: cachix/cachix-action@v15
with:
name: winapps
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"
- name: Update flake packages
uses: winapps-org/nix-update-action@v1.4.0
with:
extra-args: --version=branch
skip-pr: "${{ github.event_name == 'pull_request' }}"
- name: Build packages
run: nix build .#winapps .#winapps-launcher

3
.gitignore vendored
View File

@@ -1,3 +0,0 @@
/.idea
/.vscode
/result

View File

@@ -469,11 +469,6 @@ RDP_TIMEOUT="30"
# DEFAULT VALUE: '60'
APP_SCAN_TIMEOUT="60"
# WINDOWS BOOT
# - The maximum time (in seconds) to wait for the Windows VM to boot if it is not running, before attempting to launch an application.
# DEFAULT VALUE: '120'
BOOT_TIMEOUT="120"
```
> [!IMPORTANT]
@@ -595,6 +590,10 @@ First, make sure Flakes and the `nix` command are enabled.
In your `~/.config/nix/nix.conf`:
```
experimental-features = nix-command flakes
# specify to use binary cache (optional)
extra-substituters = https://winapps.cachix.org/
extra-trusted-public-keys = winapps.cachix.org-1:HI82jWrXZsQRar/PChgIx1unmuEsiQMQq+zt05CD36g=
extra-trusted-users = <your-username> # replace with your username
```
```bash
@@ -641,6 +640,12 @@ nix profile install github:winapps-org/winapps#winapps-launcher # optional
...
}:
{
# set up binary cache (optional)
nix.settings = {
substituters = [ "https://winapps.cachix.org/" ];
trusted-public-keys = [ "winapps.cachix.org-1:HI82jWrXZsQRar/PChgIx1unmuEsiQMQq+zt05CD36g=" ];
};
environment.systemPackages = [
winapps.packages."${system}".winapps
winapps.packages."${system}".winapps-launcher # optional

View File

@@ -50,11 +50,9 @@ RDP_SCALE=100
AUTOPAUSE="off"
AUTOPAUSE_TIME="300"
DEBUG="true"
BOOT_TIMEOUT=120
# OTHER
FREERDP_PID=-1
NEEDED_BOOT=false
### TRAPS ###
# Catch SIGINT (CTRL+C) to call 'waCleanUp'.
@@ -325,7 +323,6 @@ function waCheckVMRunning() {
if (virsh list --state-shutoff --name | xargs | grep -wq "$VM_NAME"); then
dprint "WINDOWS SHUT OFF. BOOTING WINDOWS."
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Booting Windows."
NEEDED_BOOT=true
virsh start "$VM_NAME" &>/dev/null || EXIT_STATUS=$EC_FAIL_START
if (virsh list --state-paused --name | xargs | grep -wq "$VM_NAME"); then
dprint "WINDOWS PAUSED. RESUMING WINDOWS."
@@ -347,7 +344,6 @@ function waCheckVMRunning() {
dprint "WINDOWS SHUT OFF. BOOTING WINDOWS."
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Booting Windows."
virsh start "$VM_NAME" &>/dev/null || EXIT_STATUS=$EC_FAIL_START
NEEDED_BOOT=true
break
fi
sleep $TIME_INTERVAL
@@ -361,7 +357,6 @@ function waCheckVMRunning() {
dprint "WINDOWS DESTROYED. BOOTING WINDOWS."
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Booting Windows."
virsh start "$VM_NAME" &>/dev/null || EXIT_STATUS=$EC_FAIL_START
NEEDED_BOOT=true
fi
elif (virsh domstate "$VM_NAME" | xargs | grep -wq "dying"); then
dprint "WINDOWS DYING. WAITING."
@@ -377,7 +372,6 @@ function waCheckVMRunning() {
dprint "WINDOWS DESTROYED. BOOTING WINDOWS."
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Booting Windows."
virsh start "$VM_NAME" &>/dev/null || EXIT_STATUS=$EC_FAIL_START
NEEDED_BOOT=true
fi
break
elif (virsh list --state-shutoff --name | xargs | grep -wq "$VM_NAME"); then
@@ -385,7 +379,6 @@ function waCheckVMRunning() {
dprint "WINDOWS SHUT OFF. BOOTING WINDOWS."
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Booting Windows."
virsh start "$VM_NAME" &>/dev/null || EXIT_STATUS=$EC_FAIL_START
NEEDED_BOOT=true
break
fi
sleep $TIME_INTERVAL
@@ -402,45 +395,6 @@ function waCheckVMRunning() {
# Handle non-zero exit statuses.
[ "$EXIT_STATUS" -ne 0 ] && waThrowExit "$EXIT_STATUS"
# Wait for VM to be fully ready
if [[ "$NEEDED_BOOT" == "true" ]]; then
dprint "WAITING FOR VM TO BE FULLY READY..."
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Waiting for Windows to be ready..."
TIME_ELAPSED=0
while (( TIME_ELAPSED < BOOT_TIMEOUT )); do
# Check if VM is running
if (virsh list --state-running --name | xargs | grep -wq "$VM_NAME"); then
# Try to connect to RDP port to verify it's ready
if timeout 1 bash -c ">/dev/tcp/$RDP_IP/$RDP_PORT" 2>/dev/null; then
dprint "VM IS READY"
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Windows is ready."
# Add a delay after Windows is ready
if [ "$NEEDED_BOOT" = "true" ]; then
sleep 10
fi
break
fi
fi
sleep 5
TIME_ELAPSED=$((TIME_ELAPSED + 5))
# Show progress every 30 seconds
if (( TIME_ELAPSED % 30 == 0 )); then
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Still waiting for Windows to be ready... ($TIME_ELAPSED seconds elapsed)"
fi
done
# If we timed out waiting for the VM
if (( TIME_ELAPSED >= BOOT_TIMEOUT )); then
dprint "TIMEOUT WAITING FOR VM TO BE READY"
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Timeout waiting for Windows to be ready. Please try again."
waThrowExit $EC_FAIL_START
fi
fi
}
# Name: 'waCheckContainerRunning'
@@ -472,7 +426,6 @@ function waCheckContainerRunning() {
dprint "WINDOWS CREATED. BOOTING WINDOWS."
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Booting Windows."
$COMPOSE_COMMAND --file "$COMPOSE_PATH" start &>/dev/null
NEEDED_BOOT=true
;;
"restarting")
dprint "WINDOWS RESTARTING. WAITING."
@@ -483,7 +436,6 @@ function waCheckContainerRunning() {
EXIT_STATUS=0
dprint "WINDOWS RESTARTED."
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Restarted Windows."
NEEDED_BOOT=true
break
fi
sleep $TIME_INTERVAL
@@ -499,13 +451,11 @@ function waCheckContainerRunning() {
dprint "WINDOWS SHUT OFF. BOOTING WINDOWS."
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Booting Windows."
$COMPOSE_COMMAND --file "$COMPOSE_PATH" start &>/dev/null
NEEDED_BOOT=true
;;
"dead")
dprint "WINDOWS DEAD. RECREATING WINDOWS CONTAINER."
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Re-creating and booting Windows."
$COMPOSE_COMMAND --file "$COMPOSE_PATH" down &>/dev/null && $COMPOSE_COMMAND --file "$COMPOSE_PATH" up -d &>/dev/null
NEEDED_BOOT=true
;;
"unknown")
EXIT_STATUS=$EC_UNKNOWN
@@ -514,45 +464,6 @@ function waCheckContainerRunning() {
# Handle non-zero exit statuses.
[ "$EXIT_STATUS" -ne 0 ] && waThrowExit "$EXIT_STATUS"
# Wait for container to be fully ready
if [[ "$CONTAINER_STATE" == "created" || "$CONTAINER_STATE" == "exited" || "$CONTAINER_STATE" == "dead" || "$CONTAINER_STATE" == "restarting" ]]; then
dprint "WAITING FOR CONTAINER TO BE FULLY READY..."
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Waiting for Windows to be ready..."
TIME_ELAPSED=0
while (( TIME_ELAPSED < BOOT_TIMEOUT )); do
# Check if container is running
if [[ $("$WAFLAVOR" inspect --format='{{.State.Status}}' "$CONTAINER_NAME") == "running" ]]; then
# Try to connect to RDP port to verify it's ready
if timeout 1 bash -c ">/dev/tcp/$RDP_IP/$RDP_PORT" 2>/dev/null; then
dprint "CONTAINER IS READY"
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Windows is ready."
# Add a delay after Windows is ready
if [ "$NEEDED_BOOT" = "true" ]; then
sleep 10
fi
break
fi
fi
sleep 5
TIME_ELAPSED=$((TIME_ELAPSED + 5))
# Show progress every 30 seconds
if (( TIME_ELAPSED % 30 == 0 )); then
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Still waiting for Windows to be ready... ($TIME_ELAPSED seconds elapsed)"
fi
done
# If we timed out waiting for the container
if (( TIME_ELAPSED >= BOOT_TIMEOUT )); then
dprint "TIMEOUT WAITING FOR CONTAINER TO BE READY"
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Timeout waiting for Windows to be ready. Please try again."
waThrowExit $EC_FAIL_START
fi
fi
}
# Name: 'waCheckPortOpen'

22
flake.lock generated
View File

@@ -32,28 +32,13 @@
"type": "github"
}
},
"nix-filter": {
"locked": {
"lastModified": 1731533336,
"narHash": "sha256-oRam5PS1vcrr5UPgALW0eo1m/5/pls27Z/pabHNy2Ms=",
"owner": "numtide",
"repo": "nix-filter",
"rev": "f7653272fd234696ae94229839a99b73c9ab7de0",
"type": "github"
},
"original": {
"owner": "numtide",
"repo": "nix-filter",
"type": "github"
}
},
"nixpkgs": {
"locked": {
"lastModified": 1751984180,
"narHash": "sha256-LwWRsENAZJKUdD3SpLluwDmdXY9F45ZEgCb0X+xgOL0=",
"lastModified": 1724819573,
"narHash": "sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w=",
"owner": "NixOS",
"repo": "nixpkgs",
"rev": "9807714d6944a957c2e036f84b0ff8caf9930bc0",
"rev": "71e91c409d1e654808b2621f28a327acfdad8dc2",
"type": "github"
},
"original": {
@@ -67,7 +52,6 @@
"inputs": {
"flake-compat": "flake-compat",
"flake-utils": "flake-utils",
"nix-filter": "nix-filter",
"nixpkgs": "nixpkgs"
}
},

View File

@@ -1,29 +1,17 @@
{
description = "WinApps Nix packages";
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";
nix-filter.url = "github:numtide/nix-filter";
};
nixConfig = {
extra-substituters = [
"https://cache.garnix.io"
];
extra-trusted-public-keys = [
"cache.garnix.io:CTFPyKSLcx5RMJKfLo5EEPUObbA78b0YQ2DTCJXqr9g="
];
};
outputs =
{
nixpkgs,
flake-utils,
nix-filter,
...
}:
flake-utils.lib.eachDefaultSystem (
@@ -31,13 +19,11 @@
let
pkgs = import nixpkgs { inherit system; };
in
rec {
{
formatter = pkgs.nixfmt-rfc-style;
packages.winapps = pkgs.callPackage ./packages/winapps { inherit nix-filter; };
packages.winapps-launcher = pkgs.callPackage ./packages/winapps-launcher {
inherit (packages) winapps;
};
packages.winapps = pkgs.callPackage ./packages/winapps { };
packages.winapps-launcher = pkgs.callPackage ./packages/winapps-launcher { };
}
);
}

View File

@@ -4,8 +4,8 @@
fetchFromGitHub,
makeWrapper,
makeDesktopItem,
callPackage,
yad,
winapps ? throw "Pass in the winapps package",
...
}:
let
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ makeWrapper ];
buildInputs = [
yad
winapps
(callPackage ../winapps { })
];
patches = [ ./WinApps-Launcher.patch ];

View File

@@ -1,36 +1,33 @@
{
stdenv,
lib,
fetchFromGitHub,
makeWrapper,
freerdp,
freerdp3,
dialog,
libnotify,
netcat,
iproute2,
writeShellScriptBin,
nix-filter ? throw "Pass github:numtide/nix-filter as an argument!",
...
}:
let
rev = "e48d50ff7879ed43bb4e4153d463aa0bf127b278";
hash = "sha256-RAP5QpACWIsuVLtwKWpUwmJ2G4HJpkEwdxOjMVY6JM0=";
in
stdenv.mkDerivation rec {
pname = "winapps";
version = "0-unstable-2025-07-02";
version = "0-unstable-2025-07-10";
src = nix-filter {
root = ./../..;
include = [
"apps"
"install"
"bin"
"icons"
"LICENSE.md"
"COPYRIGHT.md"
"setup.sh"
];
src = fetchFromGitHub {
owner = "winapps-org";
repo = "winapps";
inherit rev hash;
};
nativeBuildInputs = [ makeWrapper ];
buildInputs = [
(writeShellScriptBin "xfreerdp3" ''${lib.getExe' freerdp "xfreerdp"} "$@"'')
freerdp3
libnotify
dialog
netcat