You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit dbc46ee
Browse filesBrowse the repository at this point in the historyBrowse files
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
Your workspace from [Launch your first workspace](./launch-workspace.md) is
560
+
Your workspace from [Launch your first workspace](../launch-workspace.md) is
561
561
still on the old template version.
562
562
Update it to the version you just published,
563
563
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
842
842
843
843
## Learn more
844
844
845
-
- [Parameters](../../admin/templates/extending-templates/parameters.md) in the Coder documentation
845
+
- [Parameters](../../../admin/templates/extending-templates/parameters.md) in the Coder documentation
846
846
- [Terraform data sources](https://developer.hashicorp.com/terraform/language/data-sources)
847
847
- [Terraform types](https://developer.hashicorp.com/terraform/language/expressions/types) for parameter values
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.
5
4
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.
13
8
14
9
> [!NOTE]
15
10
> 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).
17
12
18
13
## What you'll do
19
14
@@ -23,23 +18,23 @@ and connect a configured GitHub provider so private clones work.
23
18
24
19
## Data sources for their side effect
25
20
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.
28
22
29
23
`coder_external_auth` is a data source you add for its side effect rather than its value.
30
24
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`:
32
30
33
31
```tf
34
32
data "coder_external_auth" "github" {
35
33
id = "github"
36
34
}
37
35
```
38
36
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:
43
38
44
39
<divclass="tabs">
45
40
@@ -50,8 +45,7 @@ Select **Build**, wait for the build to pass, then select **Publish**.
50
45
51
46
### CLI
52
47
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:
## Step 2: Watch the build wait on a missing provider
63
57
64
58
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.
67
60
Coder reports that the template requires an external authentication provider that doesn't exist:
68
61
69
62
```text
70
63
external auth provider "github" is not configured
71
64
```
72
65
73
66
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.
80
70
81
71
## Step 3: Connect a configured provider
82
72
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.
85
74
This is a one-time deployment setting that connects a GitHub OAuth app to Coder.
86
75
87
76
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.
90
78
The `github` segment matches the provider `id`.
91
79
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:
94
81
95
82
```env
96
83
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.
101
88
102
89
4. Restart the Coder server so it loads the variables.
103
90
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).
106
92
107
-
With the provider in place,
108
-
create the workspace again.
93
+
With the provider in place, create the workspace again.
109
94
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.
112
96
113
97
## What just happened
114
98
@@ -119,14 +103,14 @@ You added one data source and changed when a workspace is allowed to start:
119
103
120
104
A `coder_parameter` reads an answer from the workspace owner.
121
105
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.
124
107
125
108
## What's next?
126
109
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.
128
112
129
113
## Learn more
130
114
131
-
-[External authentication](../../admin/external-auth/index.md) in the Coder documentation
115
+
-[External authentication](../../../admin/external-auth/index.md) in the Coder documentation
132
116
-[Terraform data sources](https://developer.hashicorp.com/terraform/language/data-sources)
Copy file name to clipboardExpand all lines: docs/tutorials/quickstart/customize-workspace-startup/install-command-line-tools.md
+7-8Lines changed: 7 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Install your own command-line tools
2
2
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),
4
4
you can add your favorite command-line tools to every workspace.
5
5
6
6
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
183
183
184
184
## Step 4: Make Homebrew survive restarts
185
185
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.
189
188
190
189
> [!NOTE]
191
190
> 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).
193
192
194
193
In `main.tf`, add a volume for Homebrew's directory next to the existing `home_volume`:
195
194
@@ -275,7 +274,7 @@ To keep a tool, choose the approach that matches who needs it:
275
274
- 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.
276
275
277
276
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.
279
278
280
279
## What's next?
281
280
@@ -285,5 +284,5 @@ Now that you can install your own tools, [personalize your workspace with dotfil
285
284
286
285
-[Homebrew documentation](https://brew.sh/) for the package manager
287
286
-[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
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.
`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
+
<divclass="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:
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
+
<divclass="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
0 commit comments