Simple dotfiles with an installation script.
This repository uses git-crypt for encrypting sensitive files. The following files are encrypted:
.vsnip/global.json- VSCode snippets file
After cloning the repository, you'll need the encryption key to decrypt these files:
# Install git-crypt
sudo apt install git-crypt
# Copy the encryption key to your new machine
# (securely transfer the .keys/git-crypt-key file)
# Unlock the repository with the key
git-crypt unlock /path/to/git-crypt-keyOnce unlocked, encrypted files will automatically be decrypted when checked out and encrypted when committed.
Installation steps for Ubuntu/Pop!_OS:
- Clone the repository:
git clone https://github.com/Piotr1215/dotfiles.git
cd dotfiles/install- Run the installation:
chmod +x install.sh
./install.shThe installation script will:
- Install Ansible if not present
- Run the ansible playbook which will:
- Configure git with your credentials
- Install and configure all necessary tools and programs
- Set up development environment (neovim, tmux, etc.)
- Configure shell environment (zsh, oh-my-zsh)
- Install DevOps tools (kubectl, helm, etc.)
You can run specific parts of the installation using Ansible tags:
# List all available tasks
ansible-playbook install.yml --list-tasks
# Install specific components (e.g., just Alacritty)
ansible-playbook install.yml --tags "alacritty"Or run remotely:
-
bash -c "$(curl -fsSL https://raw.githubusercontent.com/Piotr1215/dotfiles/master/install.sh)" -
curl https://raw.githubusercontent.com/Piotr1215/dotfiles/master/install.sh | bash -s -- ${GIT_USERNAME} ${GIT_EMAIL} ${GPG_KEY}
- configure git with given user and email (default values point to my user)
- install bunch of programs and symlink them using stow
- most notably, install neovim and configure its plugins
Note
Symlinks:
Any existing dotfiles will be pulled into the dotfiles repo, please make sure that you are not overwriting anything you don't want to. Check git status before committing.
The install script is using stow to symlink whole directories and exclude others.
You can symlink additional directories like so:
stow --target=/home/decoder/.config/tmuxinator tmuxinatorAdding new directory or file to the dotfiles repo can be done with the __dotfiles_adder.sh script
Once the dotfiles are symlinked, it is easy to forget to commit them do the repo (there is no indicator on the symlinked file).
Important
Once a file is added to the repo folder, it will be auto-committed.
Use this systemd service to automate this process
touch ~/.config/systemd/user/checkfile.service
vim ~/.config/systemd/user/checkfile.service
[Unit]
Description = Run inotify-hookable in background to always sync my dotfiles with github repo
[Service]
User=decoder
Group=decoder
ExecStart=/bin/bash /home/decoder/dev/dotfiles/scripts/__zshsync.sh
RestartSec=10
[Install]
WantedBy=default.targetsudo apt install inotify-hookable -y
This script watches a folder with dotfiles and every time a change to a file is made or a new file is created, commits everything and pushes to git. This also works of course if the changes are made on the symlinked files.
cd /home/decoder/dev/dotfiles
while true; do
inotify-hookable \
--watch-files ./ \
--on-modify-command "git add . && git commit -m 'auto commit' && git push origin master"
donesystemctl --user daemon-reloadsystemctl --user enable checkfilesystemctl --user start checkfile
journalctl -fu checkfile.service
Creating user is only required for testing, in real installation you should already have a user (the script assumes you are running as a user).
Create a user, in my case user name is decoder, and switch to the user
directory.
For testing purposes, password is "test", use real password for real installation ofc :)
wget https://raw.githubusercontent.com/Piotr1215/dotfiles/master/create-test-user.shsudo chmod +x chreate-test-user.sh
./create-test-user.sh -u "decoder" -p "testingme"
sudo passwd decoder
su decoder
cdThe setup was tested on:
Last test date: 2024-12-29
- Ubuntu 20.04 vm
All files and scripts in this repo are released CC0 / kopimi! in the spirit of freedom of information, i encourage you to fork, modify, change, share, or do whatever you like with this project!

