Skip to content
Merged
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
9 changes: 5 additions & 4 deletions dogfood/coder/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -336,10 +336,11 @@ module "windsurf" {
}

module "zed" {
count = data.coder_workspace.me.start_count
source = "./zed"
agent_id = coder_agent.dev.id
folder = local.repo_dir
count = data.coder_workspace.me.start_count
source = "./zed"
agent_id = coder_agent.dev.id
agent_name = "dev"
folder = local.repo_dir
}

resource "coder_agent" "dev" {
Expand Down
13 changes: 12 additions & 1 deletion dogfood/coder/zed/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,28 @@ variable "agent_id" {
type = string
}

variable "agent_name" {
type = string
default = ""
}

variable "folder" {
type = string
}

data "coder_workspace" "me" {}

locals {
workspace_name = lower(data.coder_workspace.me.name)
agent_name = lower(var.agent_name)
hostname = var.agent_name != "" ? "${local.agent_name}.${local.workspace_name}.me.coder" : "${local.workspace_name}.coder"
}

resource "coder_app" "zed" {
agent_id = var.agent_id
display_name = "Zed"
slug = "zed"
icon = "/icon/zed.svg"
external = true
url = "zed://ssh/${lower(data.coder_workspace.me.name)}.coder/${var.folder}"
url = "zed://ssh/${local.hostname}/${var.folder}"
}