TemplatesModules
Back to Modules
Dotfiles Icon

Dotfiles

By:
Allow developers to optionally bring their own dotfiles repository to customize their shell and IDE settings!
README
Variables (6)
Scripts (1)
Parameters (1)
Apps (1)
Source

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.

1module "dotfiles" {
2  source   = "registry.coder.com/modules/dotfiles/coder"
3  version  = "1.0.18"
4  agent_id = coder_agent.example.id
5}

Examples

Apply dotfiles as the current user

1module "dotfiles" {
2  source   = "registry.coder.com/modules/dotfiles/coder"
3  version  = "1.0.18"
4  agent_id = coder_agent.example.id
5}

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

1module "dotfiles" {
2  source   = "registry.coder.com/modules/dotfiles/coder"
3  version  = "1.0.18"
4  agent_id = coder_agent.example.id
5  user     = "root"
6}

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

1module "dotfiles" {
2  source   = "registry.coder.com/modules/dotfiles/coder"
3  version  = "1.0.18"
4  agent_id = coder_agent.example.id
5}
6
7module "dotfiles-root" {
8  source       = "registry.coder.com/modules/dotfiles/coder"
9  version      = "1.0.18"
10  agent_id     = coder_agent.example.id
11  user         = "root"
12  dotfiles_uri = module.dotfiles.dotfiles_uri
13}

Setting a default dotfiles repository

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

1module "dotfiles" {
2  source               = "registry.coder.com/modules/dotfiles/coder"
3  version              = "1.0.18"
4  agent_id             = coder_agent.example.id
5  default_dotfiles_uri = "https://github.com/coder/dotfiles"
6}