How I store my dotfiles and automate the setup.
The setup is based on stow to manage the configuation files
and simple bash scripts to automate the setup.
To setup these dotfiles, there are two options:
- Using a the convenience script
init.sh. This is fully automatic, but requires eitherwgetorcurl. - Manually cloning the repo.
If curl is available run
curl -s https://raw.githubusercontent.com/pbignardi/dotfiles/refs/heads/main/init.sh | bashIf wget is available run
wget -qO- https://raw.githubusercontent.com/pbignardi/dotfiles/refs/heads/main/init.sh | bashIf git is already installed, clone the repository and run the bootstrap.sh script with bash.
git clone https://github.com/pbignardi/dotfiles $HOME/dotfiles
cd dotfiles
bash bootstrap.shThe bootstrap.sh script, performs some basic setup, to automate some of the configuration steps that are required on each system.
Dotfiles are assumed to be stored in the ~/dotfiles directory,
and each program has its own Stow package.
The bootstrap.sh script performs the following actions:
- Preliminary steps
- For each system, configure the package manager and install the required packages
- On Arch, run
packages/pacman.sh - On Mac, run
packages/brew.sh - On Debian/Ubuntu, run
packages/apt.sh - On Fedora, run
packages/dnf.sh - On desktop linux, run
packages/flatpak.sh - On Windows, run
packages/winget.sh
- On Arch, run
- Install Bitwarden password manager (CLI).
- TODO: Install
uv - Install
oh-my-posh - Change shell to ZSH
- Copy public SSH keys from the Bitwarden vault if variable
USE_SECRETSis true. - Set SSH remote to dotfiles repo.
- Pull dotfiles from Github
- Delete files that conflicts with
stowpackages stowdotfiles.- TODO: copy Windows config files
Why not using a dotfile manager?
Well there are some good ones, but I feel like they are mostly overkill for what I actually need.
After having tried chezmoi I figured it was probably easier to maintain a simple script with all the steps I need to perform to setup a new computer with the software and configuration I need.
Thankfullly there is a way to use Linux on Windows, using WSL. Below I report some instructions on how to setup Archlinux on WSL, as instructed on the ArchWiki.
Installation is straightforward using
wsl --install archlinuxAfterwards, install sudo, sed and create a user to avoid having to use root.
pacman -Syu sudo vi
useradd -m -G wheel -s /bin/bash USERNAMEAllow the wheel group to use sudo
visudoModify /etc/wsl.conf and add
[user]
default=USERNAME
Finally exit WSL and terminate it:
wsl --terminate archlinux