How Dotfiles Installs Applications and Configurations with One Line of Command
Written by Jun Chatani, Developer
In this blog, you can find how Dotfiles can install all applications and programs on a brand new machine; this will help you have a unified configuration on every device. No more: “it works on my machine”!
Imagine it’s the first day of work. You are handed a new computer, and it’s time to start working, but wait a minute, you still do not have the necessary applications. So now you have to install them one by one. Afterward, you are all set to go; time to start working. It took a while to get up and running, but you are finally there… or not? You are missing yet another application to join meetings, which you again will have to download and install. And so the list goes on.
Furthermore, as a developer, you need specific Java, Node.js, or Python versions. So for these languages, you will again need to install version managers such as SDKMAN!, nvm, and pyenv. Installing these one by one through the command line is a very time-consuming and tedious process. You have to look up the documentation and configure it to your team’s needs.
Here is where Dotfiles come in handy. You can basically run one line of command, which will do the above process almost automatically for you. One of our previous technical coaches inspired the idea, who wanted a streamlined way to onboard a new developer or help a team member set up a new device. The original idea of the Dotfiles is accredited to Dries Vints, who has a more elaborate blog.
How Does it Work?
We wanted a way to easily onboard new people to our team or when developers receive a new device. It needed not to be a black box that does things you have no clue about. Therefore, we kept it very simple, only installing the necessary tools used in our team.
On a high level, the process goes as follows: you first run a script that will install Homebrew and then Git. This will allow you to clone the rest of the script. You can either curl the script from an open Git repository or just copy-paste it from wherever you have it saved:
- First, it will install all necessary applications through Homebrew and then some configurations for your terminal, such as p10k. The terminal can later further be configured to your liking.
- Aside from that, the script will then install the necessary version management tools for your programming languages and configure them in your .zshrc so that all paths are set correctly.
- Lastly, we have some team-specific scripts, such as cloning all our mighty repositories to a folder in /projects.
There are a lot of advantages to using Dotfiles, and we hope this can accelerate your team onboarding new members or simply setting up a new device. A special thanks to Dries Vints, the original blog writer, and our past technical coach, Michel Grootjans, for the awesome idea.