mirror of
https://github.com/winapps-org/winapps.git
synced 2025-10-07 16:49:30 +02:00
Compare commits
20 Commits
legacy-ins
...
1c4b38b7ec
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1c4b38b7ec | ||
![]() |
34c8168548 | ||
![]() |
03dff50916 | ||
![]() |
4010972963 | ||
![]() |
01d72eac5b | ||
![]() |
223ba8ecb0 | ||
![]() |
8e0ef40b1f | ||
![]() |
8796615775 | ||
![]() |
e48d50ff78 | ||
![]() |
5908f88ac5 | ||
![]() |
ee967296a6 | ||
![]() |
abf4c7ae66 | ||
![]() |
d250907a3c | ||
![]() |
efa348d1b3 | ||
![]() |
17a511230c | ||
![]() |
8ea5c2e079 | ||
![]() |
3e84f5efdf | ||
![]() |
3a71065db7 | ||
![]() |
8b8e50aeaf | ||
![]() |
12dee36bdc |
40
.github/workflows/update-nix.yaml
vendored
40
.github/workflows/update-nix.yaml
vendored
@@ -1,40 +0,0 @@
|
|||||||
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
Normal file
3
.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
/.idea
|
||||||
|
/.vscode
|
||||||
|
/result
|
16
README.md
16
README.md
@@ -469,6 +469,11 @@ RDP_TIMEOUT="30"
|
|||||||
# DEFAULT VALUE: '60'
|
# DEFAULT VALUE: '60'
|
||||||
APP_SCAN_TIMEOUT="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]
|
> [!IMPORTANT]
|
||||||
@@ -484,6 +489,7 @@ APP_SCAN_TIMEOUT="60"
|
|||||||
- On high-resolution (UHD) displays, you can set `RDP_SCALE` to the scale you would like to use (100, 140 or 180).
|
- On high-resolution (UHD) displays, you can set `RDP_SCALE` to the scale you would like to use (100, 140 or 180).
|
||||||
- To add additional flags to the FreeRDP call (e.g. `/prevent-session-lock 120`), uncomment and use the `RDP_FLAGS` configuration option.
|
- To add additional flags to the FreeRDP call (e.g. `/prevent-session-lock 120`), uncomment and use the `RDP_FLAGS` configuration option.
|
||||||
- For multi-monitor setups, you can try adding `/multimon` to `RDP_FLAGS`. A FreeRDP bug may result in a black screen however, in which case you should revert this change.
|
- For multi-monitor setups, you can try adding `/multimon` to `RDP_FLAGS`. A FreeRDP bug may result in a black screen however, in which case you should revert this change.
|
||||||
|
- To enable non-English input and seamless language switching, you can try adding `/kbd:unicode` to `RDP_FLAGS`. This ensures client inputs are sent as Unicode sequences.
|
||||||
- If you enable `DEBUG`, a log will be created on each application start in `~/.local/share/winapps/winapps.log`.
|
- If you enable `DEBUG`, a log will be created on each application start in `~/.local/share/winapps/winapps.log`.
|
||||||
- If using a system on which the FreeRDP command is not `xfreerdp` or `xfreerdp3`, the correct command can be specified using `FREERDP_COMMAND`.
|
- If using a system on which the FreeRDP command is not `xfreerdp` or `xfreerdp3`, the correct command can be specified using `FREERDP_COMMAND`.
|
||||||
|
|
||||||
@@ -589,10 +595,6 @@ First, make sure Flakes and the `nix` command are enabled.
|
|||||||
In your `~/.config/nix/nix.conf`:
|
In your `~/.config/nix/nix.conf`:
|
||||||
```
|
```
|
||||||
experimental-features = nix-command flakes
|
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
|
```bash
|
||||||
@@ -639,12 +641,6 @@ 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 = [
|
environment.systemPackages = [
|
||||||
winapps.packages."${system}".winapps
|
winapps.packages."${system}".winapps
|
||||||
winapps.packages."${system}".winapps-launcher # optional
|
winapps.packages."${system}".winapps-launcher # optional
|
||||||
|
89
bin/winapps
89
bin/winapps
@@ -50,9 +50,11 @@ RDP_SCALE=100
|
|||||||
AUTOPAUSE="off"
|
AUTOPAUSE="off"
|
||||||
AUTOPAUSE_TIME="300"
|
AUTOPAUSE_TIME="300"
|
||||||
DEBUG="true"
|
DEBUG="true"
|
||||||
|
BOOT_TIMEOUT=120
|
||||||
|
|
||||||
# OTHER
|
# OTHER
|
||||||
FREERDP_PID=-1
|
FREERDP_PID=-1
|
||||||
|
NEEDED_BOOT=false
|
||||||
|
|
||||||
### TRAPS ###
|
### TRAPS ###
|
||||||
# Catch SIGINT (CTRL+C) to call 'waCleanUp'.
|
# Catch SIGINT (CTRL+C) to call 'waCleanUp'.
|
||||||
@@ -323,6 +325,7 @@ function waCheckVMRunning() {
|
|||||||
if (virsh list --state-shutoff --name | xargs | grep -wq "$VM_NAME"); then
|
if (virsh list --state-shutoff --name | xargs | grep -wq "$VM_NAME"); then
|
||||||
dprint "WINDOWS SHUT OFF. BOOTING WINDOWS."
|
dprint "WINDOWS SHUT OFF. BOOTING WINDOWS."
|
||||||
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "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
|
virsh start "$VM_NAME" &>/dev/null || EXIT_STATUS=$EC_FAIL_START
|
||||||
if (virsh list --state-paused --name | xargs | grep -wq "$VM_NAME"); then
|
if (virsh list --state-paused --name | xargs | grep -wq "$VM_NAME"); then
|
||||||
dprint "WINDOWS PAUSED. RESUMING WINDOWS."
|
dprint "WINDOWS PAUSED. RESUMING WINDOWS."
|
||||||
@@ -344,6 +347,7 @@ function waCheckVMRunning() {
|
|||||||
dprint "WINDOWS SHUT OFF. BOOTING WINDOWS."
|
dprint "WINDOWS SHUT OFF. BOOTING WINDOWS."
|
||||||
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "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
|
virsh start "$VM_NAME" &>/dev/null || EXIT_STATUS=$EC_FAIL_START
|
||||||
|
NEEDED_BOOT=true
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
sleep $TIME_INTERVAL
|
sleep $TIME_INTERVAL
|
||||||
@@ -357,6 +361,7 @@ function waCheckVMRunning() {
|
|||||||
dprint "WINDOWS DESTROYED. BOOTING WINDOWS."
|
dprint "WINDOWS DESTROYED. BOOTING WINDOWS."
|
||||||
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "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
|
virsh start "$VM_NAME" &>/dev/null || EXIT_STATUS=$EC_FAIL_START
|
||||||
|
NEEDED_BOOT=true
|
||||||
fi
|
fi
|
||||||
elif (virsh domstate "$VM_NAME" | xargs | grep -wq "dying"); then
|
elif (virsh domstate "$VM_NAME" | xargs | grep -wq "dying"); then
|
||||||
dprint "WINDOWS DYING. WAITING."
|
dprint "WINDOWS DYING. WAITING."
|
||||||
@@ -372,6 +377,7 @@ function waCheckVMRunning() {
|
|||||||
dprint "WINDOWS DESTROYED. BOOTING WINDOWS."
|
dprint "WINDOWS DESTROYED. BOOTING WINDOWS."
|
||||||
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "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
|
virsh start "$VM_NAME" &>/dev/null || EXIT_STATUS=$EC_FAIL_START
|
||||||
|
NEEDED_BOOT=true
|
||||||
fi
|
fi
|
||||||
break
|
break
|
||||||
elif (virsh list --state-shutoff --name | xargs | grep -wq "$VM_NAME"); then
|
elif (virsh list --state-shutoff --name | xargs | grep -wq "$VM_NAME"); then
|
||||||
@@ -379,6 +385,7 @@ function waCheckVMRunning() {
|
|||||||
dprint "WINDOWS SHUT OFF. BOOTING WINDOWS."
|
dprint "WINDOWS SHUT OFF. BOOTING WINDOWS."
|
||||||
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "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
|
virsh start "$VM_NAME" &>/dev/null || EXIT_STATUS=$EC_FAIL_START
|
||||||
|
NEEDED_BOOT=true
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
sleep $TIME_INTERVAL
|
sleep $TIME_INTERVAL
|
||||||
@@ -395,6 +402,45 @@ function waCheckVMRunning() {
|
|||||||
|
|
||||||
# Handle non-zero exit statuses.
|
# Handle non-zero exit statuses.
|
||||||
[ "$EXIT_STATUS" -ne 0 ] && waThrowExit "$EXIT_STATUS"
|
[ "$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'
|
# Name: 'waCheckContainerRunning'
|
||||||
@@ -426,6 +472,7 @@ function waCheckContainerRunning() {
|
|||||||
dprint "WINDOWS CREATED. BOOTING WINDOWS."
|
dprint "WINDOWS CREATED. BOOTING WINDOWS."
|
||||||
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "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
|
$COMPOSE_COMMAND --file "$COMPOSE_PATH" start &>/dev/null
|
||||||
|
NEEDED_BOOT=true
|
||||||
;;
|
;;
|
||||||
"restarting")
|
"restarting")
|
||||||
dprint "WINDOWS RESTARTING. WAITING."
|
dprint "WINDOWS RESTARTING. WAITING."
|
||||||
@@ -436,6 +483,7 @@ function waCheckContainerRunning() {
|
|||||||
EXIT_STATUS=0
|
EXIT_STATUS=0
|
||||||
dprint "WINDOWS RESTARTED."
|
dprint "WINDOWS RESTARTED."
|
||||||
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Restarted Windows."
|
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "Restarted Windows."
|
||||||
|
NEEDED_BOOT=true
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
sleep $TIME_INTERVAL
|
sleep $TIME_INTERVAL
|
||||||
@@ -451,11 +499,13 @@ function waCheckContainerRunning() {
|
|||||||
dprint "WINDOWS SHUT OFF. BOOTING WINDOWS."
|
dprint "WINDOWS SHUT OFF. BOOTING WINDOWS."
|
||||||
notify-send --expire-time=4000 --icon="dialog-info" --app-name="WinApps" --urgency="low" "WinApps" "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
|
$COMPOSE_COMMAND --file "$COMPOSE_PATH" start &>/dev/null
|
||||||
|
NEEDED_BOOT=true
|
||||||
;;
|
;;
|
||||||
"dead")
|
"dead")
|
||||||
dprint "WINDOWS DEAD. RECREATING WINDOWS CONTAINER."
|
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."
|
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
|
$COMPOSE_COMMAND --file "$COMPOSE_PATH" down &>/dev/null && $COMPOSE_COMMAND --file "$COMPOSE_PATH" up -d &>/dev/null
|
||||||
|
NEEDED_BOOT=true
|
||||||
;;
|
;;
|
||||||
"unknown")
|
"unknown")
|
||||||
EXIT_STATUS=$EC_UNKNOWN
|
EXIT_STATUS=$EC_UNKNOWN
|
||||||
@@ -464,6 +514,45 @@ function waCheckContainerRunning() {
|
|||||||
|
|
||||||
# Handle non-zero exit statuses.
|
# Handle non-zero exit statuses.
|
||||||
[ "$EXIT_STATUS" -ne 0 ] && waThrowExit "$EXIT_STATUS"
|
[ "$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'
|
# Name: 'waCheckPortOpen'
|
||||||
|
@@ -14,8 +14,8 @@ services:
|
|||||||
# Version of Windows to configure. For valid options, visit:
|
# Version of Windows to configure. For valid options, visit:
|
||||||
# https://github.com/dockur/windows?tab=readme-ov-file#how-do-i-select-the-windows-version
|
# https://github.com/dockur/windows?tab=readme-ov-file#how-do-i-select-the-windows-version
|
||||||
# https://github.com/dockur/windows?tab=readme-ov-file#how-do-i-install-a-custom-image
|
# https://github.com/dockur/windows?tab=readme-ov-file#how-do-i-install-a-custom-image
|
||||||
VERSION: "10"
|
VERSION: "11"
|
||||||
RAM_SIZE: "8G" # RAM allocated to the Windows VM.
|
RAM_SIZE: "4G" # RAM allocated to the Windows VM.
|
||||||
CPU_CORES: "4" # CPU cores allocated to the Windows VM.
|
CPU_CORES: "4" # CPU cores allocated to the Windows VM.
|
||||||
DISK_SIZE: "64G" # Size of the primary hard disk.
|
DISK_SIZE: "64G" # Size of the primary hard disk.
|
||||||
# DISK2_SIZE: "32G" # Uncomment to add an additional hard disk to the Windows VM. Ensure it is mounted as a volume below.
|
# DISK2_SIZE: "32G" # Uncomment to add an additional hard disk to the Windows VM. Ensure it is mounted as a volume below.
|
||||||
|
22
flake.lock
generated
22
flake.lock
generated
@@ -32,13 +32,28 @@
|
|||||||
"type": "github"
|
"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": {
|
"nixpkgs": {
|
||||||
"locked": {
|
"locked": {
|
||||||
"lastModified": 1724819573,
|
"lastModified": 1751984180,
|
||||||
"narHash": "sha256-GnR7/ibgIH1vhoy8cYdmXE6iyZqKqFxQSVkFgosBh6w=",
|
"narHash": "sha256-LwWRsENAZJKUdD3SpLluwDmdXY9F45ZEgCb0X+xgOL0=",
|
||||||
"owner": "NixOS",
|
"owner": "NixOS",
|
||||||
"repo": "nixpkgs",
|
"repo": "nixpkgs",
|
||||||
"rev": "71e91c409d1e654808b2621f28a327acfdad8dc2",
|
"rev": "9807714d6944a957c2e036f84b0ff8caf9930bc0",
|
||||||
"type": "github"
|
"type": "github"
|
||||||
},
|
},
|
||||||
"original": {
|
"original": {
|
||||||
@@ -52,6 +67,7 @@
|
|||||||
"inputs": {
|
"inputs": {
|
||||||
"flake-compat": "flake-compat",
|
"flake-compat": "flake-compat",
|
||||||
"flake-utils": "flake-utils",
|
"flake-utils": "flake-utils",
|
||||||
|
"nix-filter": "nix-filter",
|
||||||
"nixpkgs": "nixpkgs"
|
"nixpkgs": "nixpkgs"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
22
flake.nix
22
flake.nix
@@ -1,17 +1,29 @@
|
|||||||
{
|
{
|
||||||
description = "WinApps Nix packages & NixOS module";
|
description = "WinApps Nix packages";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
||||||
|
|
||||||
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
|
flake-compat.url = "https://flakehub.com/f/edolstra/flake-compat/1.tar.gz";
|
||||||
flake-utils.url = "github:numtide/flake-utils";
|
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 =
|
outputs =
|
||||||
{
|
{
|
||||||
nixpkgs,
|
nixpkgs,
|
||||||
flake-utils,
|
flake-utils,
|
||||||
|
nix-filter,
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
flake-utils.lib.eachDefaultSystem (
|
flake-utils.lib.eachDefaultSystem (
|
||||||
@@ -19,11 +31,13 @@
|
|||||||
let
|
let
|
||||||
pkgs = import nixpkgs { inherit system; };
|
pkgs = import nixpkgs { inherit system; };
|
||||||
in
|
in
|
||||||
{
|
rec {
|
||||||
formatter = pkgs.nixfmt-rfc-style;
|
formatter = pkgs.nixfmt-rfc-style;
|
||||||
|
|
||||||
packages.winapps = pkgs.callPackage ./packages/winapps { };
|
packages.winapps = pkgs.callPackage ./packages/winapps { inherit nix-filter; };
|
||||||
packages.winapps-launcher = pkgs.callPackage ./packages/winapps-launcher { };
|
packages.winapps-launcher = pkgs.callPackage ./packages/winapps-launcher {
|
||||||
|
inherit (packages) winapps;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@@ -1,134 +0,0 @@
|
|||||||
##################################
|
|
||||||
# WINAPPS CONFIGURATION FILE #
|
|
||||||
##################################
|
|
||||||
|
|
||||||
# INSTRUCTIONS
|
|
||||||
# - Leading and trailing whitespace are ignored.
|
|
||||||
# - Empty lines are ignored.
|
|
||||||
# - Lines starting with '#' are ignored.
|
|
||||||
# - All characters following a '#' are ignored.
|
|
||||||
|
|
||||||
# [WINDOWS USERNAME]
|
|
||||||
RDP_USER="docker"
|
|
||||||
|
|
||||||
# [WINDOWS PASSWORD]
|
|
||||||
# NOTES:
|
|
||||||
# - If using FreeRDP v3.9.0 or greater, you *have* to set a password
|
|
||||||
RDP_PASS="docker"
|
|
||||||
|
|
||||||
# [WINDOWS DOMAIN]
|
|
||||||
# DEFAULT VALUE: '' (BLANK)
|
|
||||||
RDP_DOMAIN=""
|
|
||||||
|
|
||||||
# [WINDOWS IPV4 ADDRESS]
|
|
||||||
# NOTES:
|
|
||||||
# - If using 'libvirt', 'RDP_IP' will be determined by WinApps at runtime if left unspecified.
|
|
||||||
# DEFAULT VALUE:
|
|
||||||
# - 'docker': '127.0.0.1'
|
|
||||||
# - 'podman': '127.0.0.1'
|
|
||||||
# - 'libvirt': '' (BLANK)
|
|
||||||
#RDP_IP="127.0.0.1"
|
|
||||||
|
|
||||||
# [VM NAME]
|
|
||||||
# NOTES:
|
|
||||||
# - Only applicable when using 'libvirt'
|
|
||||||
# - The libvirt VM name must match so that WinApps can determine VM IP, start the VM, etc.
|
|
||||||
# DEFAULT VALUE: 'RDPWindows'
|
|
||||||
#VM_NAME="RDPWindows"
|
|
||||||
|
|
||||||
# [WINAPPS BACKEND]
|
|
||||||
# DEFAULT VALUE: 'docker'
|
|
||||||
# VALID VALUES:
|
|
||||||
# - 'docker'
|
|
||||||
# - 'podman'
|
|
||||||
# - 'libvirt'
|
|
||||||
# - 'manual'
|
|
||||||
WAFLAVOR="docker"
|
|
||||||
|
|
||||||
# [DISPLAY SCALING FACTOR]
|
|
||||||
# NOTES:
|
|
||||||
# - If an unsupported value is specified, a warning will be displayed.
|
|
||||||
# - If an unsupported value is specified, WinApps will use the closest supported value.
|
|
||||||
# DEFAULT VALUE: '100'
|
|
||||||
# VALID VALUES:
|
|
||||||
# - '100'
|
|
||||||
# - '140'
|
|
||||||
# - '180'
|
|
||||||
RDP_SCALE="100"
|
|
||||||
|
|
||||||
# [MOUNTING REMOVABLE PATHS FOR FILES]
|
|
||||||
# NOTES:
|
|
||||||
# - By default, `udisks` (which you most likely have installed) uses /run/media for mounting removable devices.
|
|
||||||
# This improves compatibility with most desktop environments (DEs).
|
|
||||||
# ATTENTION: The Filesystem Hierarchy Standard (FHS) recommends /media instead. Verify your system's configuration.
|
|
||||||
# - To manually mount devices, you may optionally use /mnt.
|
|
||||||
# REFERRENCE: https://wiki.archlinux.org/title/Udisks#Mount_to_/media
|
|
||||||
REMOVABLE_MEDIA="/run/media"
|
|
||||||
|
|
||||||
# [ADDITIONAL FREERDP FLAGS & ARGUMENTS]
|
|
||||||
# NOTES:
|
|
||||||
# - You can try adding /network:lan to these flags in order to increase performance, however, some users have faced issues with this.
|
|
||||||
# DEFAULT VALUE: '/cert:tofu /sound /microphone +home-drive'
|
|
||||||
# VALID VALUES: See https://github.com/awakecoding/FreeRDP-Manuals/blob/master/User/FreeRDP-User-Manual.markdown
|
|
||||||
RDP_FLAGS="/cert:tofu /sound /microphone +home-drive"
|
|
||||||
|
|
||||||
# [DEBUG WINAPPS]
|
|
||||||
# NOTES:
|
|
||||||
# - Creates and appends to ~/.local/share/winapps/winapps.log when running WinApps.
|
|
||||||
# DEFAULT VALUE: 'true'
|
|
||||||
# VALID VALUES:
|
|
||||||
# - 'true'
|
|
||||||
# - 'false'
|
|
||||||
DEBUG="true"
|
|
||||||
|
|
||||||
# [AUTOMATICALLY PAUSE WINDOWS]
|
|
||||||
# NOTES:
|
|
||||||
# - This is currently INCOMPATIBLE with 'docker' and 'manual'.
|
|
||||||
# - See https://github.com/dockur/windows/issues/674
|
|
||||||
# DEFAULT VALUE: 'off'
|
|
||||||
# VALID VALUES:
|
|
||||||
# - 'on'
|
|
||||||
# - 'off'
|
|
||||||
AUTOPAUSE="off"
|
|
||||||
|
|
||||||
# [AUTOMATICALLY PAUSE WINDOWS TIMEOUT]
|
|
||||||
# NOTES:
|
|
||||||
# - This setting determines the duration of inactivity to tolerate before Windows is automatically paused.
|
|
||||||
# - This setting is ignored if 'AUTOPAUSE' is set to 'off'.
|
|
||||||
# - The value must be specified in seconds (to the nearest 10 seconds e.g., '30', '40', '50', etc.).
|
|
||||||
# - For RemoteApp RDP sessions, there is a mandatory 20-second delay, so the minimum value that can be specified here is '20'.
|
|
||||||
# - Source: https://techcommunity.microsoft.com/t5/security-compliance-and-identity/terminal-services-remoteapp-8482-session-termination-logic/ba-p/246566
|
|
||||||
# DEFAULT VALUE: '300'
|
|
||||||
# VALID VALUES: >=20
|
|
||||||
AUTOPAUSE_TIME="300"
|
|
||||||
|
|
||||||
# [FREERDP COMMAND]
|
|
||||||
# NOTES:
|
|
||||||
# - WinApps will attempt to automatically detect the correct command to use for your system.
|
|
||||||
# DEFAULT VALUE: '' (BLANK)
|
|
||||||
# VALID VALUES: The command required to run FreeRDPv3 on your system (e.g., 'xfreerdp', 'xfreerdp3', etc.).
|
|
||||||
FREERDP_COMMAND=""
|
|
||||||
|
|
||||||
# [TIMEOUTS]
|
|
||||||
# NOTES:
|
|
||||||
# - These settings control various timeout durations within the WinApps setup.
|
|
||||||
# - Increasing the timeouts is only necessary if the corresponding errors occur.
|
|
||||||
# - Ensure you have followed all the Troubleshooting Tips in the error message first.
|
|
||||||
|
|
||||||
# PORT CHECK
|
|
||||||
# - The maximum time (in seconds) to wait when checking if the RDP port on Windows is open.
|
|
||||||
# - Corresponding error: "NETWORK CONFIGURATION ERROR" (exit status 13).
|
|
||||||
# DEFAULT VALUE: '5'
|
|
||||||
PORT_TIMEOUT="5"
|
|
||||||
|
|
||||||
# RDP CONNECTION TEST
|
|
||||||
# - The maximum time (in seconds) to wait when testing the initial RDP connection to Windows.
|
|
||||||
# - Corresponding error: "REMOTE DESKTOP PROTOCOL FAILURE" (exit status 14).
|
|
||||||
# DEFAULT VALUE: '30'
|
|
||||||
RDP_TIMEOUT="30"
|
|
||||||
|
|
||||||
# APPLICATION SCAN
|
|
||||||
# - The maximum time (in seconds) to wait for the script that scans for installed applications on Windows to complete.
|
|
||||||
# - Corresponding error: "APPLICATION QUERY FAILURE" (exit status 15).
|
|
||||||
# DEFAULT VALUE: '60'
|
|
||||||
APP_SCAN_TIMEOUT="60"
|
|
@@ -4,8 +4,8 @@
|
|||||||
fetchFromGitHub,
|
fetchFromGitHub,
|
||||||
makeWrapper,
|
makeWrapper,
|
||||||
makeDesktopItem,
|
makeDesktopItem,
|
||||||
callPackage,
|
|
||||||
yad,
|
yad,
|
||||||
|
winapps ? throw "Pass in the winapps package",
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
|
|||||||
nativeBuildInputs = [ makeWrapper ];
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
yad
|
yad
|
||||||
(callPackage ../winapps { })
|
winapps
|
||||||
];
|
];
|
||||||
|
|
||||||
patches = [ ./WinApps-Launcher.patch ];
|
patches = [ ./WinApps-Launcher.patch ];
|
||||||
|
@@ -1,33 +1,36 @@
|
|||||||
{
|
{
|
||||||
stdenv,
|
stdenv,
|
||||||
lib,
|
lib,
|
||||||
fetchFromGitHub,
|
|
||||||
makeWrapper,
|
makeWrapper,
|
||||||
freerdp3,
|
freerdp,
|
||||||
dialog,
|
dialog,
|
||||||
libnotify,
|
libnotify,
|
||||||
netcat,
|
netcat,
|
||||||
iproute2,
|
iproute2,
|
||||||
|
writeShellScriptBin,
|
||||||
|
nix-filter ? throw "Pass github:numtide/nix-filter as an argument!",
|
||||||
...
|
...
|
||||||
}:
|
}:
|
||||||
let
|
|
||||||
rev = "ce9a84dc5294c45a4b69847f5164628f7d6a4ae1";
|
|
||||||
hash = "sha256-SsyJy9mCwBjKex8mfCnKrzKUM/+xws0EltI2aSkKTuM=";
|
|
||||||
in
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "winapps";
|
pname = "winapps";
|
||||||
version = "0-unstable-2025-07-02";
|
version = "0-unstable-2025-07-02";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = nix-filter {
|
||||||
owner = "winapps-org";
|
root = ./../..;
|
||||||
repo = "winapps";
|
include = [
|
||||||
|
"apps"
|
||||||
inherit rev hash;
|
"install"
|
||||||
|
"bin"
|
||||||
|
"icons"
|
||||||
|
"LICENSE.md"
|
||||||
|
"COPYRIGHT.md"
|
||||||
|
"setup.sh"
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [ makeWrapper ];
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
freerdp3
|
(writeShellScriptBin "xfreerdp3" ''${lib.getExe' freerdp "xfreerdp"} "$@"'')
|
||||||
libnotify
|
libnotify
|
||||||
dialog
|
dialog
|
||||||
netcat
|
netcat
|
||||||
|
Reference in New Issue
Block a user