Skip to content

Instantly share code, notes, and snippets.

@bpmct
Last active May 13, 2022 15:50
Show Gist options
  • Save bpmct/0b2a2d43a8b63d192580a65022b35f5b to your computer and use it in GitHub Desktop.
Save bpmct/0b2a2d43a8b63d192580a65022b35f5b to your computer and use it in GitHub Desktop.
Example with Coder dotfiles command
# ex. user manually applies dotfiles once logged in to workspace
$ coder dotfiles apply https://github.com/bpmct/dot
# Found install.sh. Run (yes/no): yes
# Copying files...
$ coder dotfiles apply https://github.com/holman/dotfiles
# Found script/bootstrap. Run (yes/no): yes
# Installing package x, y, and z...
# Running script a, b, c...
$ coder dotfiles apply https://github.com/craftzdog/dotfiles-public
# Cloning to $HOME/dotfiles
# Create symlink (yes/no): yes
# ✅ Symlinked $HOME/dotfiles to $HOME
# ex. dotfiles built in to template
variable "dotfiles_uri" {
description = <<EOT
Optional: specify a URL for your dotfiles repo
- see: https://dotfiles.github.io
EOT
sensitive = false # user-level variable
}
resource "coder_agent" "dev" {
arch = "amd64"
auth = "aws-instance-identity"
os = "linux"
init_script<<EOT
# add dotfiles
if [ -n "${var.dotfiles_uri}" ]; then
coder dotfiles apply ${var.dotfiles_uri} --yes
fi
EOT
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment