Skip to content

Commit dbc46ee

Browse files
committed
docs: nest the Customize workspace startup guides and apply review feedback
- Move the four Part 2 guides and the Part 2 hub into a customize-workspace-startup/ folder so the file layout matches the sidebar hierarchy. The hub becomes customize-workspace-startup/index.md. - Update manifest.json paths and every relative link affected by the move. - install-command-line-tools: drop the internal "dogfood" reference from the Step 4 intro. - personalize-with-dotfiles: pull the module block into Step 1, and add a step that updates the existing workspace and sets the new dotfiles parameters instead of creating a fresh workspace. - authenticate-to-github: move the coder_external_auth block into Step 1 so it reads as an instruction rather than sample code. - launch-workspace: promote "What's next?" from h3 to h2 so it is a top-level section rather than nesting under Troubleshooting. - Reflow the rewritten guides to one sentence per line per the style guide. Filed via Coder Agents on Nick's behalf. Refs: DOCS-458, DOCS-470
1 parent 9bfa93c commit dbc46ee

9 files changed

Lines changed: 168 additions & 179 deletions

File tree

‎docs/manifest.json‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,27 +25,27 @@
2525
{
2626
"title": "Customize workspace startup",
2727
"description": "Add support for dotfiles personalization, modify workspace parameters, and add external authentication",
28-
"path": "./tutorials/quickstart/customize-workspace-startup.md",
28+
"path": "./tutorials/quickstart/customize-workspace-startup/index.md",
2929
"children": [
3030
{
3131
"title": "Add a programming language",
3232
"description": "Expose a language through a parameter and install it when the workspace starts",
33-
"path": "./tutorials/quickstart/add-a-language.md"
33+
"path": "./tutorials/quickstart/customize-workspace-startup/add-a-language.md"
3434
},
3535
{
3636
"title": "Install your own command-line tools",
3737
"description": "Install personal command-line tools that persist across a workspace rebuild",
38-
"path": "./tutorials/quickstart/install-command-line-tools.md"
38+
"path": "./tutorials/quickstart/customize-workspace-startup/install-command-line-tools.md"
3939
},
4040
{
4141
"title": "Personalize with dotfiles",
4242
"description": "Pull in a dotfiles repository with a registry module",
43-
"path": "./tutorials/quickstart/personalize-with-dotfiles.md"
43+
"path": "./tutorials/quickstart/customize-workspace-startup/personalize-with-dotfiles.md"
4444
},
4545
{
4646
"title": "Authenticate to GitHub",
4747
"description": "Clone private repositories with an external-auth data source",
48-
"path": "./tutorials/quickstart/authenticate-to-github.md"
48+
"path": "./tutorials/quickstart/customize-workspace-startup/authenticate-to-github.md"
4949
}
5050
]
5151
}

docs/tutorials/quickstart/add-a-language.md renamed to docs/tutorials/quickstart/customize-workspace-startup/add-a-language.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Add a programming language to your template
22

3-
Now that you've finished [Launch your first workspace](./launch-workspace.md),
3+
Now that you've finished [Launch your first workspace](../launch-workspace.md),
44
you can add another language toolchain to every workspace you create.
55

66
The Quickstart template installs a language only when the workspace owner
@@ -9,7 +9,7 @@ In this guide, you add Ruby as an option.
99

1010
> [!NOTE]
1111
> This guide assumes your Quickstart template is open for editing.
12-
> If it's not, refer to [Customize workspace startup](./customize-workspace-startup.md#open-the-template-for-editing).
12+
> If it's not, refer to [Customize workspace startup](./index.md#open-the-template-for-editing).
1313
1414
## What you'll do
1515

@@ -557,7 +557,7 @@ resource "docker_container" "workspace" {
557557

558558
## Step 2: Add Ruby to your workspace
559559

560-
Your workspace from [Launch your first workspace](./launch-workspace.md) is
560+
Your workspace from [Launch your first workspace](../launch-workspace.md) is
561561
still on the old template version.
562562
Update it to the version you just published,
563563
and add Ruby to its **Programming Languages** selection:
@@ -842,6 +842,6 @@ Now that you added a language, [install your own command-line tools](./install-c
842842
843843
## Learn more
844844
845-
- [Parameters](../../admin/templates/extending-templates/parameters.md) in the Coder documentation
845+
- [Parameters](../../../admin/templates/extending-templates/parameters.md) in the Coder documentation
846846
- [Terraform data sources](https://developer.hashicorp.com/terraform/language/data-sources)
847847
- [Terraform types](https://developer.hashicorp.com/terraform/language/expressions/types) for parameter values

docs/tutorials/quickstart/authenticate-to-github.md renamed to docs/tutorials/quickstart/customize-workspace-startup/authenticate-to-github.md

Lines changed: 27 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
11
# Authenticate to GitHub from your workspace
22

3-
Now that you've finished [Launch your first workspace](./launch-workspace.md),
4-
you can let your workspaces clone private GitHub repositories without a manual login each time.
3+
Now that you've finished [Launch your first workspace](../launch-workspace.md), you can let your workspaces clone private GitHub repositories without a manual login each time.
54

6-
The Quickstart template clones public repositories,
7-
but a private repository needs authentication.
8-
This guide uses GitHub,
9-
and the same external-auth pattern works for other providers.
10-
In this guide, you add the `coder_external_auth` data source,
11-
watch the build stop when the provider is missing,
12-
and connect a configured GitHub provider so private clones work.
5+
The Quickstart template clones public repositories, but a private repository needs authentication.
6+
This guide uses GitHub, and the same external-auth pattern works for other providers.
7+
In this guide, you add the `coder_external_auth` data source, watch the build stop when the provider is missing, and connect a configured GitHub provider so private clones work.
138

149
> [!NOTE]
1510
> This guide assumes your Quickstart template is open for editing.
16-
> If it's not, refer to [Customize workspace startup](./customize-workspace-startup.md#open-the-template-for-editing).
11+
> If it's not, refer to [Customize workspace startup](./index.md#open-the-template-for-editing).
1712
1813
## What you'll do
1914

@@ -23,23 +18,23 @@ and connect a configured GitHub provider so private clones work.
2318

2419
## Data sources for their side effect
2520

26-
You already met one [data source](https://developer.hashicorp.com/terraform/language/data-sources) in [Add a programming language](./add-a-language.md):
27-
`coder_parameter` reads a choice from the workspace owner.
21+
You already met one [data source](https://developer.hashicorp.com/terraform/language/data-sources) in [Add a programming language](./add-a-language.md): `coder_parameter` reads a choice from the workspace owner.
2822

2923
`coder_external_auth` is a data source you add for its side effect rather than its value.
3024
Its presence tells Coder that a workspace requires an authenticated session with an external provider before it starts.
31-
The `id` points at a provider configured on the Coder deployment:
25+
The `id` points at a provider configured on the Coder deployment.
26+
27+
## Step 1: Require GitHub authentication
28+
29+
Add this `coder_external_auth` block to `main.tf`:
3230

3331
```tf
3432
data "coder_external_auth" "github" {
3533
id = "github"
3634
}
3735
```
3836

39-
## Step 1: Require GitHub authentication
40-
41-
Add the `coder_external_auth` block to `main.tf`,
42-
then publish a new version of the template:
37+
Then publish a new version of the template:
4338

4439
<div class="tabs">
4540

@@ -50,8 +45,7 @@ Select **Build**, wait for the build to pass, then select **Publish**.
5045

5146
### CLI
5247

53-
Add the block to `~/coder-quickstart/main.tf`,
54-
then publish a new version:
48+
Add the block to `~/coder-quickstart/main.tf`, then publish a new version:
5549

5650
```sh
5751
coder templates push -d ~/coder-quickstart -y quickstart
@@ -62,35 +56,28 @@ coder templates push -d ~/coder-quickstart -y quickstart
6256
## Step 2: Watch the build wait on a missing provider
6357

6458
Create a workspace from the new template version.
65-
Unless your deployment already has a GitHub external-auth provider with the `id` `github`,
66-
the workspace can't start.
59+
Unless your deployment already has a GitHub external-auth provider with the `id` `github`, the workspace can't start.
6760
Coder reports that the template requires an external authentication provider that doesn't exist:
6861

6962
```text
7063
external auth provider "github" is not configured
7164
```
7265

7366
The data source did its job.
74-
It declared a requirement,
75-
and Coder enforced it.
76-
A data source like this depends on configuration that lives outside the template,
77-
on the Coder deployment itself.
78-
The template names the provider;
79-
the deployment must provide it.
67+
It declared a requirement, and Coder enforced it.
68+
A data source like this depends on configuration that lives outside the template, on the Coder deployment itself.
69+
The template names the provider; the deployment must provide it.
8070

8171
## Step 3: Connect a configured provider
8272

83-
Configure a GitHub external-auth provider on the Coder deployment,
84-
with an `id` that matches the `id` in the data source.
73+
Configure a GitHub external-auth provider on the Coder deployment, with an `id` that matches the `id` in the data source.
8574
This is a one-time deployment setting that connects a GitHub OAuth app to Coder.
8675

8776
1. In GitHub, go to **Settings** > **Developer settings** > **OAuth Apps** > **New OAuth App**.
88-
Set the **Authorization callback URL** to `https://coder.example.com/external-auth/github/callback`,
89-
replacing `coder.example.com` with your Coder access URL.
77+
Set the **Authorization callback URL** to `https://coder.example.com/external-auth/github/callback`, replacing `coder.example.com` with your Coder access URL.
9078
The `github` segment matches the provider `id`.
9179
2. Copy the app's client ID, then generate a client secret.
92-
3. Set the provider's environment variables on the Coder server,
93-
using `github` as the `id` so it matches the template:
80+
3. Set the provider's environment variables on the Coder server, using `github` as the `id` so it matches the template:
9481

9582
```env
9683
CODER_EXTERNAL_AUTH_0_ID="github"
@@ -101,14 +88,11 @@ This is a one-time deployment setting that connects a GitHub OAuth app to Coder.
10188

10289
4. Restart the Coder server so it loads the variables.
10390

104-
To use a different provider, or for fine-grained GitHub permissions,
105-
refer to [External authentication](../../admin/external-auth/index.md).
91+
To use a different provider, or for fine-grained GitHub permissions, refer to [External authentication](../../../admin/external-auth/index.md).
10692

107-
With the provider in place,
108-
create the workspace again.
93+
With the provider in place, create the workspace again.
10994
The creation flow now prompts you to authenticate with GitHub.
110-
After you authorize Coder,
111-
the workspace starts and can clone your private GitHub repositories.
95+
After you authorize Coder, the workspace starts and can clone your private GitHub repositories.
11296

11397
## What just happened
11498

@@ -119,14 +103,14 @@ You added one data source and changed when a workspace is allowed to start:
119103

120104
A `coder_parameter` reads an answer from the workspace owner.
121105
A `coder_external_auth` data source reaches outside the template for a prerequisite the deployment provides.
122-
Both are data sources,
123-
and neither creates infrastructure.
106+
Both are data sources, and neither creates infrastructure.
124107

125108
## What's next?
126109

127-
You finished Customize workspace startup. Return to the [Quickstart overview](./index.md) to see the rest of the series.
110+
You finished Customize workspace startup.
111+
Return to the [Quickstart overview](../index.md) to see the rest of the series.
128112

129113
## Learn more
130114

131-
- [External authentication](../../admin/external-auth/index.md) in the Coder documentation
115+
- [External authentication](../../../admin/external-auth/index.md) in the Coder documentation
132116
- [Terraform data sources](https://developer.hashicorp.com/terraform/language/data-sources)

docs/tutorials/quickstart/customize-workspace-startup.md renamed to docs/tutorials/quickstart/customize-workspace-startup/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Customize workspace startup
22

3-
In [Launch your first workspace](./launch-workspace.md), you installed the `coder` CLI,
3+
In [Launch your first workspace](../launch-workspace.md), you installed the `coder` CLI,
44
started the Coder server,
55
and built a workspace from the Quickstart template.
66
That template is a good starting point,
@@ -112,6 +112,6 @@ publish the new version from the editor each time a guide tells you to push.
112112

113113
## Learn more
114114

115-
- [Extending templates](../../admin/templates/extending-templates/index.md) in the Coder documentation
115+
- [Extending templates](../../../admin/templates/extending-templates/index.md) in the Coder documentation
116116
- [Terraform documentation](https://developer.hashicorp.com/terraform) from HashiCorp
117117
- First guide: [Add a programming language](./add-a-language.md)

docs/tutorials/quickstart/install-command-line-tools.md renamed to docs/tutorials/quickstart/customize-workspace-startup/install-command-line-tools.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Install your own command-line tools
22

3-
Now that you've finished [Launch your first workspace](./launch-workspace.md),
3+
Now that you've finished [Launch your first workspace](../launch-workspace.md),
44
you can add your favorite command-line tools to every workspace.
55

66
The Quickstart template installs system languages through the **Programming Languages** parameter,
@@ -183,13 +183,12 @@ which is why your shell still tries to load the missing `brew` and prints the er
183183

184184
## Step 4: Make Homebrew survive restarts
185185

186-
Homebrew survives a restart only if `/home/linuxbrew` survives the rebuild.
187-
Give it a persistent volume in the template, the way the Coder dogfood template does,
188-
so Homebrew and its formulae stay between restarts.
186+
To make Homebrew survive a restart, you'll edit the template and add a persistent volume.
187+
The volume backs `/home/linuxbrew`, the prefix where Homebrew installs, so Homebrew and its formulae stay between restarts.
189188

190189
> [!NOTE]
191190
> This step edits the template.
192-
> If it isn't open for editing, refer to [Customize workspace startup](./customize-workspace-startup.md#open-the-template-for-editing).
191+
> If it isn't open for editing, refer to [Customize workspace startup](./index.md#open-the-template-for-editing).
193192
194193
In `main.tf`, add a volume for Homebrew's directory next to the existing `home_volume`:
195194

@@ -275,7 +274,7 @@ To keep a tool, choose the approach that matches who needs it:
275274
- For a tool everyone needs preinstalled, add it to the startup script with `apt-get`, as in [Add a programming language](./add-a-language.md), or bake it into the workspace image.
276275

277276
The rule underneath all of these: a tool persists when it lives in a part of the workspace that persists.
278-
Refer to [Resource persistence](../../admin/templates/extending-templates/resource-persistence.md) for how Coder decides what survives a restart.
277+
Refer to [Resource persistence](../../../admin/templates/extending-templates/resource-persistence.md) for how Coder decides what survives a restart.
279278

280279
## What's next?
281280

@@ -285,5 +284,5 @@ Now that you can install your own tools, [personalize your workspace with dotfil
285284

286285
- [Homebrew documentation](https://brew.sh/) for the package manager
287286
- [mise documentation](https://mise.jdx.dev/) for the version manager
288-
- [Resource persistence](../../admin/templates/extending-templates/resource-persistence.md) in the Coder documentation
289-
- [Dotfiles](../../user-guides/workspace-dotfiles.md) in the Coder documentation
287+
- [Resource persistence](../../../admin/templates/extending-templates/resource-persistence.md) in the Coder documentation
288+
- [Dotfiles](../../../user-guides/workspace-dotfiles.md) in the Coder documentation
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
# Personalize your workspace with dotfiles
2+
3+
Now that you've finished [Launch your first workspace](../launch-workspace.md), you can make every workspace start with your own shell, editor, and Git configuration.
4+
5+
[Dotfiles](https://dotfiles.github.io/) are the hidden configuration files in your home directory, such as `.bashrc`, `.gitconfig`, and `.vimrc`.
6+
In this guide, you add the Coder dotfiles module to the template, point your workspace at your dotfiles repository, and apply your shell and editor settings every time the workspace starts.
7+
8+
> [!NOTE]
9+
> This guide assumes your Quickstart template is open for editing.
10+
> If it's not, refer to [Customize workspace startup](./index.md#open-the-template-for-editing).
11+
12+
## What you'll do
13+
14+
- ✅ Add the Coder dotfiles module to the template.
15+
- ✅ Point your workspace at your dotfiles repository.
16+
- ✅ Apply your shell and editor settings when a workspace starts.
17+
18+
## Modules in brief
19+
20+
A [module](https://developer.hashicorp.com/terraform/language/modules) is a reusable bundle of Terraform you pull in by reference instead of writing it yourself.
21+
The [Coder Registry](https://registry.coder.com/modules) publishes modules for common workspace features, and the [dotfiles module](https://registry.coder.com/modules/coder/dotfiles) is one of them.
22+
23+
## Step 1: Add the dotfiles module
24+
25+
Add this `module` block anywhere in `main.tf`:
26+
27+
```tf
28+
# --- Dotfiles ---
29+
30+
module "dotfiles" {
31+
count = data.coder_workspace.me.start_count
32+
source = "registry.coder.com/coder/dotfiles/coder"
33+
version = "1.4.2"
34+
agent_id = coder_agent.main.id
35+
}
36+
```
37+
38+
`count = data.coder_workspace.me.start_count` builds the module only when the workspace is running, and `agent_id` attaches it to the workspace agent so the module runs inside the workspace.
39+
40+
Then publish a new version of the template:
41+
42+
<div class="tabs">
43+
44+
### UI
45+
46+
In the web editor, add the `module` block to `main.tf`.
47+
Select **Build**, wait for the build to pass, then select **Publish**.
48+
49+
### CLI
50+
51+
Add the `module` block to `~/coder-quickstart/main.tf`, then publish a new version:
52+
53+
```sh
54+
coder templates push -d ~/coder-quickstart -y quickstart
55+
```
56+
57+
</div>
58+
59+
## Step 2: Apply your dotfiles to your workspace
60+
61+
Adding the module gives your workspace two new parameters:
62+
63+
- **Dotfiles URL**: the repository to clone. The module accepts SSH (`git@host:user/repo`) and HTTPS (`https://host/user/repo`) URLs.
64+
- **Dotfiles Branch**: the branch to apply.
65+
66+
Update the workspace you built in [Launch your first workspace](../launch-workspace.md) to the version you just published, and set those parameters:
67+
68+
<div class="tabs">
69+
70+
### UI
71+
72+
On your workspace, set **Dotfiles URL** to your repository in the update form, then select **Update and restart**.
73+
74+
### CLI
75+
76+
Update the workspace and re-select its parameters.
77+
Replace `<your-workspace>` with your workspace's name (run `coder list` to see it):
78+
79+
```sh
80+
coder update <your-workspace> --always-prompt
81+
```
82+
83+
When prompted for **Dotfiles URL**, enter your repository, then let the workspace rebuild.
84+
85+
</div>
86+
87+
When the workspace restarts, the module clones your repository and applies it.
88+
89+
## Step 3: Configuration first, tools optional
90+
91+
Dotfiles are mainly for configuration that lives in your home directory, the part of the workspace that [persists across rebuilds](./install-command-line-tools.md#what-persists-in-a-workspace).
92+
Symlinking `.bashrc`, `.gitconfig`, and editor settings is exactly what the dotfiles module is for.
93+
94+
Dotfiles can install tools too.
95+
A repository can run an `install.sh` script, and many people drive tool installs from one, such as a Brewfile or a [mise](./install-command-line-tools.md) config.
96+
That works, as long as each tool lands somewhere that persists.
97+
The persistence rules from [Install your own command-line tools](./install-command-line-tools.md) still apply: a tool in your home directory survives a restart, and a tool outside it is rebuilt away unless the template keeps its location.
98+
99+
Whether your dotfiles carry only configuration or tools as well, they apply every time a workspace starts, so your settings are there from the first prompt.
100+
101+
## What just happened
102+
103+
You pulled a whole feature into the template with a few lines by referencing a module:
104+
105+
- The dotfiles module clones your repository and applies it inside the workspace at startup.
106+
- Dotfiles apply your configuration at startup, and can install tools too when each tool lands somewhere that persists.
107+
108+
## What's next?
109+
110+
Now that your workspaces start with your own configuration, [authenticate to GitHub](./authenticate-to-github.md) to clone private repositories.
111+
112+
## Learn more
113+
114+
- [Dotfiles](../../../user-guides/workspace-dotfiles.md) in the Coder documentation
115+
- [Dotfiles module](https://registry.coder.com/modules/coder/dotfiles) in the Coder Registry
116+
- [Terraform modules](https://developer.hashicorp.com/terraform/language/modules)

0 commit comments

Comments
 (0)