From f799364e50dff3963d88a84d41479a2d3908d527 Mon Sep 17 00:00:00 2001 From: Iker Date: Fri, 23 Jan 2026 06:58:19 +0700 Subject: [PATCH] Add Parsec Windows module Add a Parsec module for Windows workspaces that installs the Parsec host silently and exposes an external dashboard link for the client. --- registry/coder/modules/parsec/README.md | 45 +++++++++ .../coder/modules/parsec/install-parsec.ps1 | 12 +++ registry/coder/modules/parsec/main.tf | 92 +++++++++++++++++++ 3 files changed, 149 insertions(+) create mode 100644 registry/coder/modules/parsec/README.md create mode 100644 registry/coder/modules/parsec/install-parsec.ps1 create mode 100644 registry/coder/modules/parsec/main.tf diff --git a/registry/coder/modules/parsec/README.md b/registry/coder/modules/parsec/README.md new file mode 100644 index 000000000..b8af7f9d0 --- /dev/null +++ b/registry/coder/modules/parsec/README.md @@ -0,0 +1,45 @@ +--- +display_name: Parsec +description: Install Parsec host on Windows workspaces +icon: ../../../../.icons/desktop.svg +verified: false +tags: [windows, remote-desktop, parsec] +--- + +# Parsec + +Install Parsec on Windows workspaces and expose a dashboard link to launch the Parsec +client locally. + +```tf +module "parsec" { + count = data.coder_workspace.me.start_count + source = "registry.coder.com/coder/parsec/coder" + version = "1.0.0" + agent_id = coder_agent.main.id +} +``` + +> [!IMPORTANT] +> Parsec hosting is supported on Windows (and macOS). This module targets Windows +> workspaces and expects a desktop environment plus a compatible GPU. + +## Usage notes + +1. The module installs Parsec silently on the workspace. +2. Sign in to Parsec on the workspace once (RDP or other remote access) to enable hosting. +3. Use the Parsec client locally to connect to the workspace. + +## Configuration + +```tf +module "parsec" { + count = data.coder_workspace.me.start_count + source = "registry.coder.com/coder/parsec/coder" + version = "1.0.0" + agent_id = coder_agent.main.id + display_name = "Parsec" + installer_url = "https://builds.parsec.app/package/parsec-windows.exe" + installer_args = "/S" +} +``` diff --git a/registry/coder/modules/parsec/install-parsec.ps1 b/registry/coder/modules/parsec/install-parsec.ps1 new file mode 100644 index 000000000..592340853 --- /dev/null +++ b/registry/coder/modules/parsec/install-parsec.ps1 @@ -0,0 +1,12 @@ +$ProgressPreference = "SilentlyContinue" + +$installerUrl = "${INSTALLER_URL}" +$installerPath = Join-Path $env:TEMP "parsec-windows.exe" + +Write-Output "Downloading Parsec from $installerUrl" +Invoke-WebRequest -Uri $installerUrl -OutFile $installerPath + +Write-Output "Installing Parsec" +Start-Process -FilePath $installerPath -ArgumentList "${INSTALLER_ARGS}" -Wait + +Remove-Item $installerPath -Force diff --git a/registry/coder/modules/parsec/main.tf b/registry/coder/modules/parsec/main.tf new file mode 100644 index 000000000..7551dcf11 --- /dev/null +++ b/registry/coder/modules/parsec/main.tf @@ -0,0 +1,92 @@ +terraform { + required_version = ">= 1.0" + + required_providers { + coder = { + source = "coder/coder" + version = ">= 2.5" + } + } +} + +variable "agent_id" { + type = string + description = "The ID of a Coder agent." +} + +variable "display_name" { + type = string + description = "The display name for the Parsec app button." + default = "Parsec" +} + +variable "slug" { + type = string + description = "The slug for the Parsec app button." + default = "parsec" +} + +variable "icon" { + type = string + description = "The icon to use for the Parsec app button." + default = "/icon/desktop.svg" +} + +variable "order" { + type = number + description = "The order determines the position of app in the UI presentation. The lowest order is shown first and apps with equal order are sorted by name (ascending order)." + default = null +} + +variable "group" { + type = string + description = "The name of a group that this app belongs to." + default = null +} + +variable "installer_url" { + type = string + description = "Parsec installer URL." + default = "https://builds.parsec.app/package/parsec-windows.exe" +} + +variable "installer_args" { + type = string + description = "Installer arguments for silent install." + default = "/S" +} + +variable "app_url" { + type = string + description = "URL used for the Parsec app button." + default = "parsec://" +} + +variable "tooltip" { + type = string + description = "Tooltip shown for the Parsec app button." + default = "Install the Parsec client locally, then connect to this workspace after signing in on the host." +} + +resource "coder_script" "parsec_install" { + agent_id = var.agent_id + display_name = "Install Parsec" + icon = var.icon + run_on_start = true + script = templatefile("${path.module}/install-parsec.ps1", { + INSTALLER_URL = var.installer_url + INSTALLER_ARGS = var.installer_args + }) +} + +resource "coder_app" "parsec" { + agent_id = var.agent_id + slug = var.slug + display_name = var.display_name + url = var.app_url + icon = var.icon + external = true + order = var.order + group = var.group + tooltip = var.tooltip +}