From 252d08ccecb9ba13b3c6b8d707b8ff0307236170 Mon Sep 17 00:00:00 2001 From: Koury Lape Date: Thu, 29 Jan 2026 13:54:54 -0500 Subject: [PATCH 1/5] Fix dotfiles module for Fish shell compatibility --- registry/coder/modules/dotfiles/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/coder/modules/dotfiles/main.tf b/registry/coder/modules/dotfiles/main.tf index 9dfb7240e..22c61dcf1 100644 --- a/registry/coder/modules/dotfiles/main.tf +++ b/registry/coder/modules/dotfiles/main.tf @@ -99,10 +99,10 @@ resource "coder_app" "dotfiles" { icon = "/icon/dotfiles.svg" order = var.order group = var.group - command = templatefile("${path.module}/run.sh", { + command = "/usr/bin/env bash -c ${shellquote(templatefile("${path.module}/run.sh", { DOTFILES_URI : local.dotfiles_uri, DOTFILES_USER : local.user - }) + }))}" } output "dotfiles_uri" { From ef2727f392473aaf0122caceadbfc96dadc2dc8c Mon Sep 17 00:00:00 2001 From: Koury Lape Date: Thu, 29 Jan 2026 14:18:03 -0500 Subject: [PATCH 2/5] Add basic test --- registry/coder/modules/dotfiles/main.test.ts | 15 +++++++++++++++ registry/coder/modules/dotfiles/main.tf | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/registry/coder/modules/dotfiles/main.test.ts b/registry/coder/modules/dotfiles/main.test.ts index 8c82cd1e0..f13c86633 100644 --- a/registry/coder/modules/dotfiles/main.test.ts +++ b/registry/coder/modules/dotfiles/main.test.ts @@ -28,6 +28,21 @@ describe("dotfiles", async () => { expect(state.outputs.dotfiles_uri.value).toBe(default_dotfiles_uri); }); + it("command uses bash for fish shell compatibility", async () => { + const state = await runTerraformApply(import.meta.dir, { + agent_id: "foo", + manual_update: "true", + dotfiles_uri: "https://github.com/test/dotfiles", + }); + + const app = state.resources.find( + (r) => r.type === "coder_app" && r.name === "dotfiles" + ); + + expect(app).toBeDefined(); + expect(app?.instances[0]?.attributes?.command).toContain("/bin/bash -c"); + }); + it("set custom order for coder_parameter", async () => { const order = 99; const state = await runTerraformApply(import.meta.dir, { diff --git a/registry/coder/modules/dotfiles/main.tf b/registry/coder/modules/dotfiles/main.tf index 22c61dcf1..fbf395dfc 100644 --- a/registry/coder/modules/dotfiles/main.tf +++ b/registry/coder/modules/dotfiles/main.tf @@ -99,7 +99,7 @@ resource "coder_app" "dotfiles" { icon = "/icon/dotfiles.svg" order = var.order group = var.group - command = "/usr/bin/env bash -c ${shellquote(templatefile("${path.module}/run.sh", { + command = "/bin/bash -c ${jsonencode(templatefile("${path.module}/run.sh", { DOTFILES_URI : local.dotfiles_uri, DOTFILES_USER : local.user }))}" From d401399c9fbbd7c428359309a2b051fba526353e Mon Sep 17 00:00:00 2001 From: Koury Lape Date: Thu, 29 Jan 2026 14:21:26 -0500 Subject: [PATCH 3/5] Bump version in README --- registry/coder/modules/dotfiles/README.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/registry/coder/modules/dotfiles/README.md b/registry/coder/modules/dotfiles/README.md index e35033a65..7d994c1e6 100644 --- a/registry/coder/modules/dotfiles/README.md +++ b/registry/coder/modules/dotfiles/README.md @@ -18,7 +18,7 @@ Under the hood, this module uses the [coder dotfiles](https://coder.com/docs/v2/ module "dotfiles" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/dotfiles/coder" - version = "1.2.3" + version = "1.2.4" agent_id = coder_agent.example.id } ``` @@ -31,7 +31,7 @@ module "dotfiles" { module "dotfiles" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/dotfiles/coder" - version = "1.2.3" + version = "1.2.4" agent_id = coder_agent.example.id } ``` @@ -42,7 +42,7 @@ module "dotfiles" { module "dotfiles" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/dotfiles/coder" - version = "1.2.3" + version = "1.2.4" agent_id = coder_agent.example.id user = "root" } @@ -54,14 +54,14 @@ module "dotfiles" { module "dotfiles" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/dotfiles/coder" - version = "1.2.3" + version = "1.2.4" agent_id = coder_agent.example.id } module "dotfiles-root" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/dotfiles/coder" - version = "1.2.3" + version = "1.2.4" agent_id = coder_agent.example.id user = "root" dotfiles_uri = module.dotfiles.dotfiles_uri @@ -76,7 +76,7 @@ You can set a default dotfiles repository for all users by setting the `default_ module "dotfiles" { count = data.coder_workspace.me.start_count source = "registry.coder.com/coder/dotfiles/coder" - version = "1.2.3" + version = "1.2.4" agent_id = coder_agent.example.id default_dotfiles_uri = "https://github.com/coder/dotfiles" } From d60546d4c436c506a431a0f4df1521048aa680dd Mon Sep 17 00:00:00 2001 From: Koury Lape Date: Thu, 29 Jan 2026 14:36:43 -0500 Subject: [PATCH 4/5] Use base64 to preserve newlines --- registry/coder/modules/dotfiles/main.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/registry/coder/modules/dotfiles/main.tf b/registry/coder/modules/dotfiles/main.tf index fbf395dfc..5b0c656cc 100644 --- a/registry/coder/modules/dotfiles/main.tf +++ b/registry/coder/modules/dotfiles/main.tf @@ -99,10 +99,10 @@ resource "coder_app" "dotfiles" { icon = "/icon/dotfiles.svg" order = var.order group = var.group - command = "/bin/bash -c ${jsonencode(templatefile("${path.module}/run.sh", { + command = "/bin/bash -c \"$(echo ${base64encode(templatefile("${path.module}/run.sh", { DOTFILES_URI : local.dotfiles_uri, DOTFILES_USER : local.user - }))}" + }))} | base64 -d)\"" } output "dotfiles_uri" { From cbcb5b702b2f79d3cf3c7686736911be6f8be953 Mon Sep 17 00:00:00 2001 From: Koury Lape Date: Thu, 29 Jan 2026 15:18:26 -0500 Subject: [PATCH 5/5] Run format on spec --- registry/coder/modules/dotfiles/main.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/registry/coder/modules/dotfiles/main.test.ts b/registry/coder/modules/dotfiles/main.test.ts index f13c86633..6144e2b81 100644 --- a/registry/coder/modules/dotfiles/main.test.ts +++ b/registry/coder/modules/dotfiles/main.test.ts @@ -36,7 +36,7 @@ describe("dotfiles", async () => { }); const app = state.resources.find( - (r) => r.type === "coder_app" && r.name === "dotfiles" + (r) => r.type === "coder_app" && r.name === "dotfiles", ); expect(app).toBeDefined();