Skip to content

Latest commit

 

History

History
84 lines (68 loc) · 2.3 KB

README.md

File metadata and controls

84 lines (68 loc) · 2.3 KB
display_name description icon maintainer_github verified tags
Dotfiles
Allow developers to optionally bring their own dotfiles repository to customize their shell and IDE settings!
../.icons/dotfiles.svg
coder
true
helper

Dotfiles

Allow developers to optionally bring their own dotfiles repository.

This will prompt the user for their dotfiles repository URL on template creation using a coder_parameter.

Under the hood, this module uses the coder dotfiles command.

module "dotfiles" {
  count    = data.coder_workspace.me.start_count
  source   = "registry.coder.com/modules/dotfiles/coder"
  version  = "1.0.28"
  agent_id = coder_agent.example.id
}

Examples

Apply dotfiles as the current user

module "dotfiles" {
  count    = data.coder_workspace.me.start_count
  source   = "registry.coder.com/modules/dotfiles/coder"
  version  = "1.0.28"
  agent_id = coder_agent.example.id
}

Apply dotfiles as another user (only works if sudo is passwordless)

module "dotfiles" {
  count    = data.coder_workspace.me.start_count
  source   = "registry.coder.com/modules/dotfiles/coder"
  version  = "1.0.28"
  agent_id = coder_agent.example.id
  user     = "root"
}

Apply the same dotfiles as the current user and root (the root dotfiles can only be applied if sudo is passwordless)

module "dotfiles" {
  count    = data.coder_workspace.me.start_count
  source   = "registry.coder.com/modules/dotfiles/coder"
  version  = "1.0.28"
  agent_id = coder_agent.example.id
}

module "dotfiles-root" {
  count        = data.coder_workspace.me.start_count
  source       = "registry.coder.com/modules/dotfiles/coder"
  version      = "1.0.28"
  agent_id     = coder_agent.example.id
  user         = "root"
  dotfiles_uri = module.dotfiles.dotfiles_uri
}

Setting a default dotfiles repository

You can set a default dotfiles repository for all users by setting the default_dotfiles_uri variable:

module "dotfiles" {
  count                = data.coder_workspace.me.start_count
  source               = "registry.coder.com/modules/dotfiles/coder"
  version              = "1.0.28"
  agent_id             = coder_agent.example.id
  default_dotfiles_uri = "https://github.com/coder/dotfiles"
}