Work Machine
A work kit lives alongside your personal one. It can share folders and common config while overriding anything specific to your work context.
Two targets, one repo
Section titled “Two targets, one repo”The simplest version is two dotkit files in the same directory:
Directorydotkit/
- personal.dotkit
- work.dotkit
- dotkit.env
Directoryconfigs/
- …
Directorypackages/
- brew.md
- brew-work.md
Directorygit/
- …
Directorydotfiles/
- …
DOTKIT_DEV_DIR=~/workGITHUB_ORG=acme---map dotkit run {{item}}
configspackages/brew-workgit---dotkit link dotfilesBecause neither file is named after the directory, dotkit run ~/dotkit asks which one:
Dotkit files in /home/you/dotkit:
1) personal 2) work 3) entire folder (ignore dotkits) 0) cancel
Which one? [0-3]:Overriding variables
Section titled “Overriding variables”A target can set its own variables in a block before anything else runs. They persist through the rest of the file and into everything it calls:
DOTKIT_DEV_DIR=~/workGITHUB_ORG=acme---map dotkit run {{item}}
gitFor values shared by several files in a folder, use an .env file instead. Nearer files win, so git/git.env overrides the kit root’s dotkit.env.
Separate directories
Section titled “Separate directories”If the two contexts share little, give each its own directory:
Directorydotkit/
Directorypersonal/
- personal.dotkit
Directorypackages/
- …
Directorywork/
- work.dotkit
- dotkit.env
Directorypackages/
- …
Each directory is now its own kit, so work/dotkit.env is invisible to personal/. That isolation is the point: a variable meant for work can never leak into your personal machine.
Work-specific packages
Section titled “Work-specific packages”# Work packages
## map
- brew install **1**- awscli- terraform- kubectl
## map
- brew install --cask **1**- zoom- slack- dockerWork git config
Section titled “Work git config”WORK_DIR=$DOTKIT_DEV_DIRGITHUB_ORG=acmemap git config --global {{key}} {{value}}
user.email = [email protected]---map git clone [email protected]:{{key}}/{{2}}.git $WORK_DIR/{{2}}
#acme = backend#acme = frontendSelecting at bootstrap
Section titled “Selecting at bootstrap”The installer lists every *.dotkit it finds and prompts:
1) personal 2) work 0) skipWhich dotkit? [0-2]:Or pass it directly:
curl -fsSL dotkit.run/sh | sh -s -- --username yourname --dotkit work --defaultsLater, on the machine
Section titled “Later, on the machine”dotkit run ~/dotkit/work.dotkitNaming the file skips the prompt. Alternatively, name one of them default.dotkit and it runs without asking, while the other stays available by path.