Installing Linux (Desktop) on a new machine can range from quick to time-consuming, depending on your configuration needs. After experimenting with various Linux distros, desktop environments, and terminal emulators, I eventually arrived at an ideal setup that I want to reuse repeatedly (famous last words). Reconfiguring all the configuration files in ~/.config
(dotfiles) and installing all the necessary packages took a lot of time. That’s when I started looking for a solution.
Initially, I used Stow to manage symlinks for my dotfiles, but I wanted to go further and automate more. After some research, I discovered Ansible: an open-source automation tool that simplifies configuration management and system settings. It works without additional software on target machines, uses SSH for communication, and writes configurations in readable YAML files.
Although Ansible is typically used for server management, I decided to use it locally on my desktop as well. This saves me a lot of manual work when setting up a new machine or restoring my configuration.
In my Ansible playbook, I define:
- The necessary packages
- Locations for configuration files
- Services that need to be enabled or disabled
- System settings that need to be adjusted
The great thing about Ansible is that it’s idempotent: it only makes the necessary changes when running the playbook (so you can specify when something should not be executed, preventing duplicate actions). This allows me to quickly restore my setup, without worrying about unexpected results.
My repository contains several roles for different aspects of my setup, from installing packages to configuring my favorite desktop environments like Hyprland, Sway, i3, and Cinnamon. My Ansible playbook supports both Debian and Arch Linux, depending on my need for stability or the latest features.
Since Ansible requires certain dependencies like Python, I wrote a script to install these first. Additionally, I use Bitwarden for password management, which I also integrate into my playbook.
This project saves me hours of work and allows me to set up a new machine in under an hour (excluding logging into accounts). Of course, it’s still an ongoing project, as whenever I want to add something new or make a change, I update my configuration files, commit them to the Dotfiles repository.
You can find the link to the repository at the top of the page.
Do you have feedback or questions about this project? Or are you looking for help with software development? Feel free to get in touch.