feat: add dotfiles support
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Peter 2023-06-15 22:02:08 +02:00
parent 0cf60f2942
commit afd4540dc7
Signed by: prskr
GPG key ID: C1DB5D2E8DB512F9

View file

@ -44,6 +44,19 @@ variable "private_network_id" {
default = "" default = ""
} }
data "coder_parameter" "dotfiles_uri" {
name = "dotfiles_uri"
display_name = "Dotfiles URI"
description = <<-EOF
Dotfiles repo URI (optional)
see https://dotfiles.github.io
EOF
default = ""
mutable = true
}
data "coder_parameter" "instance_location" { data "coder_parameter" "instance_location" {
name = "instance_location" name = "instance_location"
display_name = "Instance location" display_name = "Instance location"
@ -251,6 +264,12 @@ data "coder_workspace" "me" {
resource "coder_agent" "dev" { resource "coder_agent" "dev" {
arch = "amd64" arch = "amd64"
os = "linux" os = "linux"
startup_script = data.coder_parameter.dotfiles_uri.value != "" ? "coder dotfiles -y ${data.coder_parameter.dotfiles_uri.value}" : null
env = {
DOCKER_HOST= data.coder_parameter.install_podman.value == "true" ? "unix:///run/user/1000/podman/podman.sock" : "unix:///var/run/docker.sock"
}
} }
resource "coder_app" "code-server" { resource "coder_app" "code-server" {