Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions registry/coder/modules/parsec/README.md
Original file line number Diff line number Diff line change
@@ -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"
}
```
12 changes: 12 additions & 0 deletions registry/coder/modules/parsec/install-parsec.ps1
Original file line number Diff line number Diff line change
@@ -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
92 changes: 92 additions & 0 deletions registry/coder/modules/parsec/main.tf
Original file line number Diff line number Diff line change
@@ -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
}