diff --git a/dotfiles/README.md b/dotfiles/README.md index 8a33e45..fb990dc 100644 --- a/dotfiles/README.md +++ b/dotfiles/README.md @@ -10,7 +10,3 @@ tags: [helper] # Dotfiles Allow developers to optionally bring their own [dotfiles repository](https://dotfiles.github.io)! Under the hood, this module uses the [coder dotfiles](https://coder.com/docs/v2/latest/dotfiles) command. - -TODO: - -- [ ] Test it \ No newline at end of file diff --git a/dotfiles/main.tf b/dotfiles/main.tf index fc07e79..c1479eb 100644 --- a/dotfiles/main.tf +++ b/dotfiles/main.tf @@ -10,28 +10,28 @@ terraform { } variable "agent_id" { - type = string - description = "The ID of a Coder agent." + type = string + description = "The ID of a Coder agent." } data "coder_parameter" "dotfiles_uri" { - type = "string" + type = "string" display_name = "Dotfiles URL (optional)" - default = "" - description = "Enter a URL for a [dotfiles repository](https://dotfiles.github.io) to personalize your workspace" - mutable = true - icon = "https://raw.githubusercontent.com/jglovier/dotfiles-logo/main/dotfiles-logo-icon.svg" + default = "" + description = "Enter a URL for a [dotfiles repository](https://dotfiles.github.io) to personalize your workspace" + mutable = true + icon = "https://raw.githubusercontent.com/jglovier/dotfiles-logo/main/dotfiles-logo-icon.svg" } resource "coder_script" "personalize" { - agent_id = var.agent_id - script =<<-EOT + agent_id = var.agent_id + script = <<-EOT DOTFILES_URI="${data.coder_parameter.dotfiles_uri.value}" if [ -n "$${DOTFILES_URI// }" ]; then coder dotfiles "$DOTFILES_URI" -y 2>&1 | tee -a ~/.dotfiles.log fi EOT - display_name = "Dotfiles" - icon = "https://raw.githubusercontent.com/jglovier/dotfiles-logo/main/dotfiles-logo-icon.svg" - run_on_start = true + display_name = "Dotfiles" + icon = "https://raw.githubusercontent.com/jglovier/dotfiles-logo/main/dotfiles-logo-icon.svg" + run_on_start = true }