Personalization

2 min read

Learn how to personalize your Environment to augment its base Image.

Your Coder development Environment strikes a balance between consistent team configuration and personal customization. While the Environment Image standardizes system dependencies for development, Coder offers a few different mechanisms for customizing the Environment to best fit your needs.

Persistent Home

The /home/<username> volume is bound to your Environment. Its contents are persisted between shutdowns and rebuilds. This ensures that personal configuration files like ~/.gitconfig and ~/.zshrc, as well as source code and project files, are not disrupted.

Data outside /home/<username> is provided by the Environment Image and is reset between by Environment rebuilds.

~/personalize

For cases where personal configuration of system files is needed, Environments expose the ~/personalize rebuild hook. Coder executes this script every time the Environment is rebuilt.

Consider the case where you want to use the fish shell as your default shell, but the Environment image doesn't include the package. The following ~/personalize scripts would install fish and change the default shell each time the environment is rebuilt.

#!/bin/bash

echo "--Starting personalize"

sudo apt-get update
sudo apt-get install -y fish
sudo chsh -s /usr/bin/fish $USER

The Environments page shows the log output of the ~/personalize script in the build log.

Enable privileged environment

Git Integration

Once your site manager has set up a Git service, you can link your Coder account. This will authenticate all git operations performed in your Environment. See how to link your account.

Dotfiles Repo

A dotfiles repository is a Git repository that contains your personal Environment preferences in the form of static files and setup scripts.

We recommend configuring a dotfiles repo (which Coder then clones to your home directory) to ensure that your preferences are applied whenever your Environment turns on or you create a new Environment.

At startup, Coder clones this repository into ~/dotfiles. If an executable ~/dotfiles/install.sh is present, it is executed. If not, all dot-prefixed files are symlinked into your home directory.

Read more about dotfiles repos here.

Adding Your Dotfiles Repo to Coder

You can provide a link to your dotfiles repo that's hosted with the Git provider of your choice under User Preferences:

Dotfiles Preferences

Our docs are open source. See something wrong or unclear? Make an edit.