Skip to content

Commit 7f51b2f

Browse files
feat(dotfiles): add custom variable for the dotfiles parameter description (#151)
## Description When passing in custom dotfiles URIs, the format for those (`git@...` vs `https://...`) are going to be different for different environments, and admins are going to want to give their developers particular instructions. This PR makes the parameter `description` customizable so that we can change the default description a developer sees. --- ## Type of Change - [ ] New module - [ ] Bug fix - [x] Feature/enhancement - [ ] Documentation - [ ] Other --- ## Module Information <!-- Delete this section if not applicable --> **Path:** `registry/coder/modules/dotfiles` **New version:** `v1.2.0` **Breaking change:** [ ] Yes [X] No --- ## Testing & Validation - [X] Tests pass (`bun test`) - [X] Code formatted (`bun run fmt`) - [x] Changes tested locally --------- Co-authored-by: DevCats <[email protected]>
1 parent 8351e91 commit 7f51b2f

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

registry/coder/modules/dotfiles/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Under the hood, this module uses the [coder dotfiles](https://coder.com/docs/v2/
1919
module "dotfiles" {
2020
count = data.coder_workspace.me.start_count
2121
source = "registry.coder.com/coder/dotfiles/coder"
22-
version = "1.1.0"
22+
version = "1.2.0"
2323
agent_id = coder_agent.example.id
2424
}
2525
```
@@ -32,7 +32,7 @@ module "dotfiles" {
3232
module "dotfiles" {
3333
count = data.coder_workspace.me.start_count
3434
source = "registry.coder.com/coder/dotfiles/coder"
35-
version = "1.1.0"
35+
version = "1.2.0"
3636
agent_id = coder_agent.example.id
3737
}
3838
```
@@ -43,7 +43,7 @@ module "dotfiles" {
4343
module "dotfiles" {
4444
count = data.coder_workspace.me.start_count
4545
source = "registry.coder.com/coder/dotfiles/coder"
46-
version = "1.1.0"
46+
version = "1.2.0"
4747
agent_id = coder_agent.example.id
4848
user = "root"
4949
}
@@ -55,14 +55,14 @@ module "dotfiles" {
5555
module "dotfiles" {
5656
count = data.coder_workspace.me.start_count
5757
source = "registry.coder.com/coder/dotfiles/coder"
58-
version = "1.1.0"
58+
version = "1.2.0"
5959
agent_id = coder_agent.example.id
6060
}
6161
6262
module "dotfiles-root" {
6363
count = data.coder_workspace.me.start_count
6464
source = "registry.coder.com/coder/dotfiles/coder"
65-
version = "1.1.0"
65+
version = "1.2.0"
6666
agent_id = coder_agent.example.id
6767
user = "root"
6868
dotfiles_uri = module.dotfiles.dotfiles_uri
@@ -77,7 +77,7 @@ You can set a default dotfiles repository for all users by setting the `default_
7777
module "dotfiles" {
7878
count = data.coder_workspace.me.start_count
7979
source = "registry.coder.com/coder/dotfiles/coder"
80-
version = "1.1.0"
80+
version = "1.2.0"
8181
agent_id = coder_agent.example.id
8282
default_dotfiles_uri = "https://github.com/coder/dotfiles"
8383
}

registry/coder/modules/dotfiles/main.tf

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ variable "agent_id" {
2626
description = "The ID of a Coder agent."
2727
}
2828

29+
variable "description" {
30+
type = string
31+
description = "A custom description for the dotfiles parameter. This is shown in the UI - and allows you to customize the instructions you give to your users."
32+
default = "Enter a URL for a [dotfiles repository](https://dotfiles.github.io) to personalize your workspace"
33+
}
34+
2935
variable "default_dotfiles_uri" {
3036
type = string
3137
description = "The default dotfiles URI if the workspace user does not provide one"
@@ -64,7 +70,7 @@ data "coder_parameter" "dotfiles_uri" {
6470
display_name = "Dotfiles URL"
6571
order = var.coder_parameter_order
6672
default = var.default_dotfiles_uri
67-
description = "Enter a URL for a [dotfiles repository](https://dotfiles.github.io) to personalize your workspace"
73+
description = var.description
6874
mutable = true
6975
icon = "/icon/dotfiles.svg"
7076
}

0 commit comments

Comments
 (0)