Skip to content

Commit af79d0a

Browse files
committed
feat: add group attributes to all modules
1 parent 8b6a80b commit af79d0a

File tree

16 files changed

+195
-58
lines changed

16 files changed

+195
-58
lines changed

registry/coder/modules/aider/main.tf

Lines changed: 39 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ variable "order" {
2424
default = null
2525
}
2626

27+
variable "group" {
28+
type = string
29+
description = "The name of a group that this app belongs to."
30+
default = null
31+
}
32+
2733
variable "icon" {
2834
type = string
2935
description = "The icon to use for the app."
@@ -224,17 +230,17 @@ resource "coder_script" "aider" {
224230
}
225231
226232
echo "Setting up Aider AI pair programming..."
227-
233+
228234
if [ "${var.use_screen}" = "true" ] && [ "${var.use_tmux}" = "true" ]; then
229235
echo "Error: Both use_screen and use_tmux cannot be enabled at the same time."
230236
exit 1
231237
fi
232-
238+
233239
mkdir -p "${var.folder}"
234240
235241
if [ "$(uname)" = "Linux" ]; then
236242
echo "Checking dependencies for Linux..."
237-
243+
238244
if [ "${var.use_tmux}" = "true" ]; then
239245
if ! command_exists tmux; then
240246
echo "Installing tmux for persistent sessions..."
@@ -296,7 +302,7 @@ resource "coder_script" "aider" {
296302
297303
if [ "${var.install_aider}" = "true" ]; then
298304
echo "Installing Aider..."
299-
305+
300306
if ! command_exists python3 || ! command_exists pip3; then
301307
echo "Installing Python dependencies required for Aider..."
302308
if command -v apt-get >/dev/null 2>&1; then
@@ -319,67 +325,67 @@ resource "coder_script" "aider" {
319325
else
320326
echo "Python is already installed, skipping installation."
321327
fi
322-
328+
323329
if ! command_exists aider; then
324330
curl -LsSf https://aider.chat/install.sh | sh
325331
fi
326-
332+
327333
if [ -f "$HOME/.bashrc" ]; then
328334
if ! grep -q 'export PATH="$HOME/bin:$PATH"' "$HOME/.bashrc"; then
329335
echo 'export PATH="$HOME/bin:$PATH"' >> "$HOME/.bashrc"
330336
fi
331337
fi
332-
338+
333339
if [ -f "$HOME/.zshrc" ]; then
334340
if ! grep -q 'export PATH="$HOME/bin:$PATH"' "$HOME/.zshrc"; then
335341
echo 'export PATH="$HOME/bin:$PATH"' >> "$HOME/.zshrc"
336342
fi
337343
fi
338-
344+
339345
fi
340-
346+
341347
if [ -n "${local.encoded_post_install_script}" ]; then
342348
echo "Running post-install script..."
343349
echo "${local.encoded_post_install_script}" | base64 -d > /tmp/post_install.sh
344350
chmod +x /tmp/post_install.sh
345351
/tmp/post_install.sh
346352
fi
347-
353+
348354
if [ "${var.experiment_report_tasks}" = "true" ]; then
349355
echo "Configuring Aider to report tasks via Coder MCP..."
350-
356+
351357
mkdir -p "$HOME/.config/aider"
352-
358+
353359
cat > "$HOME/.config/aider/config.yml" << EOL
354360
${trimspace(local.combined_extensions)}
355361
EOL
356362
echo "Added Coder MCP extension to Aider config.yml"
357363
fi
358364
359365
echo "Starting persistent Aider session..."
360-
366+
361367
touch "$HOME/.aider.log"
362-
368+
363369
export LANG=en_US.UTF-8
364370
export LC_ALL=en_US.UTF-8
365-
371+
366372
export PATH="$HOME/bin:$PATH"
367-
373+
368374
if [ "${var.use_tmux}" = "true" ]; then
369375
if [ -n "${var.task_prompt}" ]; then
370376
echo "Running Aider with message in tmux session..."
371-
377+
372378
# Configure tmux for shared sessions
373379
if [ ! -f "$HOME/.tmux.conf" ]; then
374380
echo "Creating ~/.tmux.conf with shared session settings..."
375381
echo "set -g mouse on" > "$HOME/.tmux.conf"
376382
fi
377-
383+
378384
if ! grep -q "^set -g mouse on$" "$HOME/.tmux.conf"; then
379385
echo "Adding 'set -g mouse on' to ~/.tmux.conf..."
380386
echo "set -g mouse on" >> "$HOME/.tmux.conf"
381387
fi
382-
388+
383389
echo "Starting Aider using ${var.ai_provider} provider and model: ${var.ai_model}"
384390
tmux new-session -d -s ${var.session_name} -c ${var.folder} "export ${local.env_var_name}=\"${var.ai_api_key}\"; aider --architect --yes-always ${local.model_flag} ${var.ai_model} --message \"${local.combined_prompt}\""
385391
echo "Aider task started in tmux session '${var.session_name}'. Check the UI for progress."
@@ -389,25 +395,25 @@ EOL
389395
echo "Creating ~/.tmux.conf with shared session settings..."
390396
echo "set -g mouse on" > "$HOME/.tmux.conf"
391397
fi
392-
398+
393399
if ! grep -q "^set -g mouse on$" "$HOME/.tmux.conf"; then
394400
echo "Adding 'set -g mouse on' to ~/.tmux.conf..."
395401
echo "set -g mouse on" >> "$HOME/.tmux.conf"
396402
fi
397-
403+
398404
echo "Starting Aider using ${var.ai_provider} provider and model: ${var.ai_model}"
399405
tmux new-session -d -s ${var.session_name} -c ${var.folder} "export ${local.env_var_name}=\"${var.ai_api_key}\"; aider --architect --yes-always ${local.model_flag} ${var.ai_model} --message \"${var.system_prompt}\""
400406
echo "Tmux session '${var.session_name}' started. Access it by clicking the Aider button."
401407
fi
402408
else
403409
if [ -n "${var.task_prompt}" ]; then
404410
echo "Running Aider with message in screen session..."
405-
411+
406412
if [ ! -f "$HOME/.screenrc" ]; then
407413
echo "Creating ~/.screenrc and adding multiuser settings..."
408414
echo -e "multiuser on\nacladd $(whoami)" > "$HOME/.screenrc"
409415
fi
410-
416+
411417
if ! grep -q "^multiuser on$" "$HOME/.screenrc"; then
412418
echo "Adding 'multiuser on' to ~/.screenrc..."
413419
echo "multiuser on" >> "$HOME/.screenrc"
@@ -417,7 +423,7 @@ EOL
417423
echo "Adding 'acladd $(whoami)' to ~/.screenrc..."
418424
echo "acladd $(whoami)" >> "$HOME/.screenrc"
419425
fi
420-
426+
421427
echo "Starting Aider using ${var.ai_provider} provider and model: ${var.ai_model}"
422428
screen -U -dmS ${var.session_name} bash -c "
423429
cd ${var.folder}
@@ -426,15 +432,15 @@ EOL
426432
aider --architect --yes-always ${local.model_flag} ${var.ai_model} --message \"${local.combined_prompt}\"
427433
/bin/bash
428434
"
429-
435+
430436
echo "Aider task started in screen session '${var.session_name}'. Check the UI for progress."
431437
else
432-
438+
433439
if [ ! -f "$HOME/.screenrc" ]; then
434440
echo "Creating ~/.screenrc and adding multiuser settings..."
435441
echo -e "multiuser on\nacladd $(whoami)" > "$HOME/.screenrc"
436442
fi
437-
443+
438444
if ! grep -q "^multiuser on$" "$HOME/.screenrc"; then
439445
echo "Adding 'multiuser on' to ~/.screenrc..."
440446
echo "multiuser on" >> "$HOME/.screenrc"
@@ -444,7 +450,7 @@ EOL
444450
echo "Adding 'acladd $(whoami)' to ~/.screenrc..."
445451
echo "acladd $(whoami)" >> "$HOME/.screenrc"
446452
fi
447-
453+
448454
echo "Starting Aider using ${var.ai_provider} provider and model: ${var.ai_model}"
449455
screen -U -dmS ${var.session_name} bash -c "
450456
cd ${var.folder}
@@ -456,7 +462,7 @@ EOL
456462
echo "Screen session '${var.session_name}' started. Access it by clicking the Aider button."
457463
fi
458464
fi
459-
465+
460466
echo "Aider setup complete!"
461467
EOT
462468
run_on_start = true
@@ -471,12 +477,12 @@ resource "coder_app" "aider_cli" {
471477
command = <<-EOT
472478
#!/bin/bash
473479
set -e
474-
480+
475481
export PATH="$HOME/bin:$HOME/.local/bin:$PATH"
476-
482+
477483
export LANG=en_US.UTF-8
478484
export LC_ALL=en_US.UTF-8
479-
485+
480486
if [ "${var.use_tmux}" = "true" ]; then
481487
if tmux has-session -t ${var.session_name} 2>/dev/null; then
482488
echo "Attaching to existing Aider tmux session..."
@@ -499,4 +505,5 @@ resource "coder_app" "aider_cli" {
499505
fi
500506
EOT
501507
order = var.order
508+
group = var.group
502509
}

registry/coder/modules/amazon-dcv-windows/main.tf

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@ terraform {
99
}
1010
}
1111

12+
variable "order" {
13+
type = number
14+
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)."
15+
default = null
16+
}
17+
18+
variable "group" {
19+
type = string
20+
description = "The name of a group that this app belongs to."
21+
default = null
22+
}
23+
1224
variable "agent_id" {
1325
type = string
1426
description = "The ID of a Coder agent."
@@ -45,6 +57,8 @@ resource "coder_app" "web-dcv" {
4557
url = "https://localhost:${var.port}${local.web_url_path}?username=${local.admin_username}&password=${var.admin_password}"
4658
icon = "/icon/dcv.svg"
4759
subdomain = var.subdomain
60+
order = var.order
61+
group = var.group
4862
}
4963

5064
resource "coder_script" "install-dcv" {

registry/coder/modules/amazon-q/main.tf

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ variable "order" {
2424
default = null
2525
}
2626

27+
variable "group" {
28+
type = string
29+
description = "The name of a group that this app belongs to."
30+
default = null
31+
}
32+
2733
variable "icon" {
2834
type = string
2935
description = "The icon to use for the app."
@@ -213,7 +219,7 @@ resource "coder_script" "amazon_q" {
213219
fi
214220
215221
if [ "${var.experiment_report_tasks}" = "true" ]; then
216-
echo "Configuring Amazon Q to report tasks via Coder MCP..."
222+
echo "Configuring Amazon Q to report tasks via Coder MCP..."
217223
mkdir -p ~/.aws/amazonq
218224
echo "${local.encoded_mcp_json}" | base64 -d > ~/.aws/amazonq/mcp.json
219225
echo "Created the ~/.aws/amazonq/mcp.json configuration file"
@@ -227,27 +233,27 @@ resource "coder_script" "amazon_q" {
227233
228234
if [ "${var.experiment_use_tmux}" = "true" ]; then
229235
echo "Running Amazon Q in the background with tmux..."
230-
236+
231237
if ! command_exists tmux; then
232238
echo "Error: tmux is not installed. Please install tmux manually."
233239
exit 1
234240
fi
235241
236242
touch "$HOME/.amazon-q.log"
237-
243+
238244
export LANG=en_US.UTF-8
239245
export LC_ALL=en_US.UTF-8
240-
246+
241247
tmux new-session -d -s amazon-q -c "${var.folder}" "q chat --trust-all-tools | tee -a "$HOME/.amazon-q.log" && exec bash"
242-
248+
243249
tmux send-keys -t amazon-q "${local.full_prompt}"
244250
sleep 5
245251
tmux send-keys -t amazon-q Enter
246252
fi
247253
248254
if [ "${var.experiment_use_screen}" = "true" ]; then
249255
echo "Running Amazon Q in the background..."
250-
256+
251257
if ! command_exists screen; then
252258
echo "Error: screen is not installed. Please install screen manually."
253259
exit 1
@@ -259,7 +265,7 @@ resource "coder_script" "amazon_q" {
259265
echo "Creating ~/.screenrc and adding multiuser settings..." | tee -a "$HOME/.amazon-q.log"
260266
echo -e "multiuser on\nacladd $(whoami)" > "$HOME/.screenrc"
261267
fi
262-
268+
263269
if ! grep -q "^multiuser on$" "$HOME/.screenrc"; then
264270
echo "Adding 'multiuser on' to ~/.screenrc..." | tee -a "$HOME/.amazon-q.log"
265271
echo "multiuser on" >> "$HOME/.screenrc"
@@ -271,7 +277,7 @@ resource "coder_script" "amazon_q" {
271277
fi
272278
export LANG=en_US.UTF-8
273279
export LC_ALL=en_US.UTF-8
274-
280+
275281
screen -U -dmS amazon-q bash -c '
276282
cd ${var.folder}
277283
q chat --trust-all-tools | tee -a "$HOME/.amazon-q.log
@@ -326,4 +332,6 @@ resource "coder_app" "amazon_q" {
326332
fi
327333
EOT
328334
icon = var.icon
335+
order = var.order
336+
group = var.group
329337
}

0 commit comments

Comments
 (0)