pull/33/head
Muhammad Atif Ali 2 years ago
parent 2302892929
commit 50eac40f8b

@ -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

@ -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
}

Loading…
Cancel
Save