From 1d62eb70d8a7b6283aed1c1d2d701ae6c88dcd8b Mon Sep 17 00:00:00 2001 From: Phorcys <57866459+phorcys420@users.noreply.github.com> Date: Tue, 30 Jan 2024 14:01:21 +0000 Subject: [PATCH] chore(dotfiles): document the newly created `user` and `dotfiles_uri` parameters --- dotfiles/README.md | 47 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/dotfiles/README.md b/dotfiles/README.md index 9ffac02..ef6b058 100644 --- a/dotfiles/README.md +++ b/dotfiles/README.md @@ -9,7 +9,44 @@ tags: [helper] # Dotfiles -Allow developers to optionally bring their own [dotfiles repository](https://dotfiles.github.io)! Under the hood, this module uses the [coder dotfiles](https://coder.com/docs/v2/latest/dotfiles) command. +Allow developers to optionally bring their own [dotfiles repository](https://dotfiles.github.io). + +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](https://coder.com/docs/v2/latest/dotfiles) command. + +```tf +module "dotfiles" { + source = "registry.coder.com/modules/dotfiles/coder" + version = "1.0.0" + agent_id = coder_agent.example.id +} +``` + +## Examples + +### Apply dotfiles as the current user + +```tf +module "dotfiles" { + source = "registry.coder.com/modules/dotfiles/coder" + version = "1.0.0" + agent_id = coder_agent.example.id +} +``` + +### Apply dotfiles as root (only works if sudo is passwordless) + +```tf +module "dotfiles" { + source = "registry.coder.com/modules/dotfiles/coder" + version = "1.0.0" + agent_id = coder_agent.example.id + user = "root" +} +``` + +### Apply dotfiles as the current user and root (only works if sudo is passwordless) ```tf module "dotfiles" { @@ -17,4 +54,12 @@ module "dotfiles" { version = "1.0.0" agent_id = coder_agent.example.id } + +module "dotfiles-root" { + source = "registry.coder.com/modules/dotfiles/coder" + version = "1.0.0" + agent_id = coder_agent.example.id + user = "root" + dotfiles_uri = module.dotfiles.dotfiles_uri +} ```