Skip to content
Closed
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
Binary file added registry/Ashutosh0x/.images/avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions registry/Ashutosh0x/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
display_name: "Ashutosh Kumar"
bio: "Open source developer passionate about cloud infrastructure and developer tools"
avatar: "./.images/avatar.png"
github: "Ashutosh0x"
status: "community"
---

# Ashutosh Kumar

Open source developer passionate about cloud infrastructure and developer tools.
68 changes: 68 additions & 0 deletions registry/Ashutosh0x/modules/parsec/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
display_name: Parsec
description: Low-latency remote desktop access using Parsec for cloud gaming and remote work
icon: ../../../../.icons/desktop.svg
verified: false
tags: [remote-desktop, parsec, gaming, streaming, low-latency]
---

# Parsec

Enable low-latency remote desktop access to Coder workspaces using [Parsec](https://parsec.app/).

Parsec is a remote desktop solution optimized for low-latency streaming, making it ideal for:
- Cloud gaming
- Remote development with GPU-accelerated workloads
- Video editing and design work
- Any task requiring responsive remote access

```tf
module "parsec" {
source = "registry.coder.com/Ashutosh0x/parsec/coder"
version = "1.0.0"
agent_id = coder_agent.main.id
}
```

## Prerequisites

- A Parsec account (free or paid)
- Linux workspace with desktop environment (for GUI access)
- GPU recommended for optimal performance

## Examples

### Basic Usage

```tf
module "parsec" {
source = "registry.coder.com/Ashutosh0x/parsec/coder"
version = "1.0.0"
agent_id = coder_agent.main.id
}
```

### With Custom Configuration

```tf
module "parsec" {
source = "registry.coder.com/Ashutosh0x/parsec/coder"
version = "1.0.0"
agent_id = coder_agent.main.id
display_name = "Remote Desktop"
headless = true
}
```

## Features

- **Automatic Installation**: Parsec is installed automatically on workspace start
- **Headless Mode**: Run Parsec without a physical display attached
- **Auto-start**: Parsec service starts automatically with the workspace
- **Low Latency**: Optimized for responsive remote access

## Notes

- Users must authenticate with their Parsec account after first connection
- For best performance, use a workspace with a dedicated GPU
- Parsec supports both hardware and software encoding
159 changes: 159 additions & 0 deletions registry/Ashutosh0x/modules/parsec/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
terraform {
required_version = ">= 1.0"

required_providers {
coder = {
source = "coder/coder"
version = ">= 2.0"
}
}
}

variable "agent_id" {
type = string
description = "The ID of a Coder agent."
}

variable "display_name" {
type = string
description = "The display name for the Parsec application."
default = "Parsec"
}

variable "slug" {
type = string
description = "The slug for the Parsec application."
default = "parsec"
}

variable "icon" {
type = string
description = "The icon for the Parsec application."
default = "/icon/desktop.svg"
}

variable "order" {
type = number
description = "The order determines the position of app in the UI presentation."
default = null
}

variable "group" {
type = string
description = "The name of a group that this app belongs to."
default = null
}

variable "headless" {
type = bool
description = "Run Parsec in headless mode (without physical display)."
default = true
}

variable "auto_start" {
type = bool
description = "Automatically start Parsec service on workspace start."
default = true
}

resource "coder_script" "parsec" {
agent_id = var.agent_id
display_name = "Parsec Installation"
icon = var.icon

script = <<-EOT
#!/bin/bash
set -e

echo "=== Installing Parsec ==="

# Check if Parsec is already installed
if command -v parsecd &> /dev/null; then
echo "Parsec is already installed"
else
echo "Downloading and installing Parsec..."

# Detect architecture
ARCH=$(uname -m)
case $ARCH in
x86_64)
PARSEC_URL="https://builds.parsec.app/package/parsec-linux.deb"
;;
aarch64)
echo "ARM64 architecture detected, using alternative package"
PARSEC_URL="https://builds.parsec.app/package/parsec-linux.deb"
;;
*)
echo "Unsupported architecture: $ARCH"
exit 1
;;
esac

# Download Parsec
cd /tmp
curl -fsSL -o parsec-linux.deb "$PARSEC_URL"

# Install Parsec
if command -v apt-get &> /dev/null; then
sudo apt-get update
sudo apt-get install -y ./parsec-linux.deb
elif command -v dpkg &> /dev/null; then
sudo dpkg -i parsec-linux.deb || sudo apt-get install -f -y
else
echo "Unsupported package manager. Please install Parsec manually."
exit 1
fi

rm -f parsec-linux.deb
echo "Parsec installed successfully"
fi

# Configure headless mode if enabled
if [ "${var.headless}" = "true" ]; then
echo "Configuring headless mode..."
mkdir -p ~/.parsec

# Create config for headless operation
cat > ~/.parsec/config.txt <<EOF
# Parsec headless configuration
host_virtual_monitor = true
host_privacy_mode = true
EOF
fi

# Start Parsec service if auto_start is enabled
if [ "${var.auto_start}" = "true" ]; then
echo "Starting Parsec service..."

# Start parsecd in background
if command -v parsecd &> /dev/null; then
nohup parsecd app_daemon=1 &> /tmp/parsec.log &
echo "Parsec daemon started"
else
echo "Warning: parsecd not found in PATH"
fi
fi

echo "=== Parsec setup complete ==="
echo "Open the Parsec app on your local machine to connect"
echo "You will need to log in with your Parsec account"
EOT

run_on_start = true
}

resource "coder_app" "parsec_docs" {
agent_id = var.agent_id
display_name = "Parsec Docs"
slug = "parsec-docs"
icon = var.icon
url = "https://support.parsec.app/hc/en-us"
external = true
order = var.order
group = var.group
}

output "parsec_status" {
value = "Parsec is configured. Connect using the Parsec app."
description = "Status message for Parsec module"
}
45 changes: 45 additions & 0 deletions registry/Ashutosh0x/modules/parsec/main.tftest.hcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
run "test_parsec_defaults" {
command = plan

variables {
agent_id = "test-agent-id"
}

assert {
condition = coder_script.parsec.display_name == "Parsec Installation"
error_message = "Display name should be 'Parsec Installation'"
}

assert {
condition = coder_script.parsec.run_on_start == true
error_message = "Script should run on start"
}
}

run "test_parsec_custom_display_name" {
command = plan

variables {
agent_id = "test-agent-id"
display_name = "Custom Parsec"
}

assert {
condition = coder_app.parsec_docs.display_name == "Parsec Docs"
error_message = "Docs app display name should be 'Parsec Docs'"
}
}

run "test_parsec_headless_disabled" {
command = plan

variables {
agent_id = "test-agent-id"
headless = false
}

assert {
condition = var.headless == false
error_message = "Headless should be false"
}
}
21 changes: 21 additions & 0 deletions registry/coder/modules/jetbrains/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,27 @@ module "jetbrains" {
}
```

### Plugin Pre-installation

Automatically pre-install JetBrains IDE plugins on workspace start. Find plugin IDs at [JetBrains Marketplace](https://plugins.jetbrains.com/):

```tf
module "jetbrains" {
count = data.coder_workspace.me.start_count
source = "registry.coder.com/coder/jetbrains/coder"
version = "1.3.0"
agent_id = coder_agent.main.id
folder = "/home/coder/project"
default = ["IU"]

# Pre-install GitHub and Kubernetes plugins
plugins = [
"org.jetbrains.plugins.github",
"com.intellij.kubernetes"
]
}
```

### Accessing the IDE Metadata

You can now reference the output `ide_metadata` as a map.
Expand Down
32 changes: 32 additions & 0 deletions registry/coder/modules/jetbrains/jetbrains.tftest.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -351,3 +351,35 @@ run "validate_output_schema" {
error_message = "The ide_metadata output schema has changed. Please update the 'main.tf' and this test."
}
}

run "plugins_script_created_when_plugins_provided" {
command = plan

variables {
agent_id = "foo"
folder = "/home/coder"
default = ["IU"]
plugins = ["org.jetbrains.plugins.github"]
}

assert {
condition = length(resource.coder_script.jetbrains_plugins) == 1
error_message = "Expected coder_script.jetbrains_plugins to be created when plugins are provided"
}
}

run "plugins_script_not_created_when_no_plugins" {
command = plan

variables {
agent_id = "foo"
folder = "/home/coder"
default = ["IU"]
plugins = []
}

assert {
condition = length(resource.coder_script.jetbrains_plugins) == 0
error_message = "Expected coder_script.jetbrains_plugins not to be created when no plugins are provided"
}
}
Loading