@ -10,28 +10,28 @@ terraform {
}
}
variable " agent_id " {
variable " agent_id " {
type = string
type = string
description = " The ID of a Coder agent. "
description = " The ID of a Coder agent. "
}
}
data " coder_parameter " " dotfiles_uri " {
data " coder_parameter " " dotfiles_uri " {
type = " string "
type = " string "
display_name = " Dotfiles URL (optional) "
display_name = " Dotfiles URL (optional) "
default = " "
default = " "
description = " Enter a URL for a [dotfiles repository](https://dotfiles.github.io) to personalize your workspace "
description = " Enter a URL for a [dotfiles repository](https://dotfiles.github.io) to personalize your workspace "
mutable = true
mutable = true
icon = " https://raw.githubusercontent.com/jglovier/dotfiles-logo/main/dotfiles-logo-icon.svg "
icon = " https://raw.githubusercontent.com/jglovier/dotfiles-logo/main/dotfiles-logo-icon.svg "
}
}
resource " coder_script " " personalize " {
resource " coder_script " " personalize " {
agent_id = var . agent_id
agent_id = var . agent_id
script =< < - EOT
script = < < - EOT
DOTFILES_URI =" ${ data . coder_parameter . dotfiles_uri . value } "
DOTFILES_URI =" ${ data . coder_parameter . dotfiles_uri . value } "
if [ - n " $ ${ DOTFILES_URI / / } " ] ; then
if [ - n " $ ${ DOTFILES_URI / / } " ] ; then
coder dotfiles " $ DOTFILES_URI " - y 2 > & 1 | tee - a ~ / . dotfiles . log
coder dotfiles " $ DOTFILES_URI " - y 2 > & 1 | tee - a ~ / . dotfiles . log
fi
fi
EOT
EOT
display_name = " Dotfiles "
display_name = " Dotfiles "
icon = " https://raw.githubusercontent.com/jglovier/dotfiles-logo/main/dotfiles-logo-icon.svg "
icon = " https://raw.githubusercontent.com/jglovier/dotfiles-logo/main/dotfiles-logo-icon.svg "
run_on_start = true
run_on_start = true
}
}