Automatically install code-server in a workspace, create an app to access it via the dashboard, install extensions, and pre-configure editor settings.
1module "code-server" { 2 source = "registry.coder.com/modules/code-server/coder" 3 version = "1.0.18" 4 agent_id = coder_agent.example.id 5}
1module "code-server" { 2 source = "registry.coder.com/modules/code-server/coder" 3 version = "1.0.18" 4 agent_id = coder_agent.example.id 5 install_version = "4.8.3" 6}
Install the Dracula theme from OpenVSX:
1module "code-server" { 2 source = "registry.coder.com/modules/code-server/coder" 3 version = "1.0.18" 4 agent_id = coder_agent.example.id 5 extensions = [ 6 "dracula-theme.theme-dracula" 7 ] 8}
Enter the <author>.<name>
into the extensions array and code-server will automatically install on start.
Configure VS Code's settings.json file:
1module "code-server" { 2 source = "registry.coder.com/modules/code-server/coder" 3 version = "1.0.18" 4 agent_id = coder_agent.example.id 5 extensions = ["dracula-theme.theme-dracula"] 6 settings = { 7 "workbench.colorTheme" = "Dracula" 8 } 9}
Just run code-server in the background, don't fetch it from GitHub:
1module "code-server" { 2 source = "registry.coder.com/modules/code-server/coder" 3 version = "1.0.18" 4 agent_id = coder_agent.example.id 5 extensions = ["dracula-theme.theme-dracula", "ms-azuretools.vscode-docker"] 6}
By default the module looks for code-server at /tmp/code-server
but this can be changed with install_prefix
.
Run an existing copy of code-server if found, otherwise download from GitHub:
1module "code-server" { 2 source = "registry.coder.com/modules/code-server/coder" 3 version = "1.0.18" 4 agent_id = coder_agent.example.id 5 use_cached = true 6 extensions = ["dracula-theme.theme-dracula", "ms-azuretools.vscode-docker"] 7}
Just run code-server in the background, don't fetch it from GitHub:
1module "code-server" { 2 source = "registry.coder.com/modules/code-server/coder" 3 version = "1.0.18" 4 agent_id = coder_agent.example.id 5 offline = true 6}