Skip to content
forked from sloria/dotfiles

levko's dotfiles as Ansible roles

Notifications You must be signed in to change notification settings

lewkoo/dotfiles

 
 

Repository files navigation

Levko's dotfiles

Unit Tests Integration Tests Verify Install

Sets up a full local development environment with a single command.

Support for OS X and Debian.

Tested on:

https://en.wikipedia.org/wiki/Ubuntu_version_history#Ubuntu_16.04_LTS_(Xenial_Xerus)

https://en.wikipedia.org/wiki/Ubuntu_version_history#Ubuntu_18.04_LTS_(Bionic_Beaver)

https://en.wikipedia.org/wiki/Ubuntu_version_history#Ubuntu_20.04_LTS_(Focal_Fossa)

Installs and configures

  • fish shell with ohmyfish and bobthefish theme
  • nice fonts for the terminal and coding
  • python2, python3, pipx (for managing python CLIs), pyenv (for managing Python versions), and pyenv-virtualenv (for managing virtualenvs)
  • a tmux.conf that's pretty neat.
  • bat as a more modern replacement for cat
  • exa as a more modern replacement for ls
  • docker
  • go-lang
  • github hub tool
  • node-js
  • jetbrains-toolbox and pycharm
  • Mac packages installed with [homebrew][https://brew.sh/]. Mac apps installed with [homebrew-cask][https://github.com/Homebrew/homebrew-cask] and mas.
  • Basic Ubuntu packages from both APT and Snap and ROS setup
  • Useful git aliases
  • Optional git commit signing with GPG
  • Roles are unit tested and integration tested by molecule.
  • Pluggable. Everything is optional. Fork this. Remove what you don't use. Configure what you do use.

prerequisites

Ansible version >= 2.8 is required.

OS X:

  • homebrew (If on macOS) - Install this first
  • git: brew install git
  • ansible >= 1.6: brew install ansible

Ubuntu:

  • Updated apt cache: apt update
  • git: apt install git
  • ansible: apt install ansible

Note: On Ubuntu systems, Ansible can be updated as follows:

sudo apt-add-repository -yu ppa:ansible/ansible
sudo apt-get install ansible

install

  • Fork this repo.
  • Clone your fork.
# Replace git url with your fork
# NOTE: It is important that you clone to ~/dotfiles
git clone https://github.com/YOU/dotfiles.git ~/dotfiles
cd ~/dotfiles
  • Update the following variables in group_vars/local (at a minimum)
    • full_name: Your name, which will be attached to commit messages, e.g. "Levko Ivanchuk"
    • git_user: Your Github username.
    • git_email: Your git email address.
  • Optional, but recommended: Update group_vars/local with the programs you want installed by homebrew, homebrew-cask, and npm.
    • mac_homebrew_packages: Utilities that don't get installed by the roles.
    • mac_cask_packages: Mac Apps you want installed with homebrew-cask.
  • Optional, but recommended: Update group_vars/local with the programs you want installed by APT and Snap (when running on Ubuntu).
    • ubuntu_apt_packages: Utilities that don't get installed by the roles.
    • ubuntu_snap_packages: Ubuntu apps you want installed with snap.
  • Edit local_env.yml as you see fit. Remove any roles you don't use. Edit roles that you do use.

GPG Signature setup

On source machine with your private key, do the following:

# Bash syntax here
ID=FF7E2F5B2137632F # Replace this with your key ID
gpg --export ${ID} > public.asc
gpg --export-secret-key ${ID} > private.asc

Transfer those two two files to your target machine and run:

# Bash syntax here
gpg --import public.asc
gpg --import private.asc
export GIT_SIGNING_KEY_ID=FF7E2F5B2137632F # Same key ID as on source machine

Note: After running the dot-bootstrap script, you should put

export GIT_SIGNING_KEY_ID=FF7E2F5B2137632F

line in ~/.localrc or ~/.config/fish/config.fish.

Run the installation script

./bin/dot-bootstrap

Updating your local environment

Once you have the dotfiles installed you can run the following command to rerun the ansible playbook:

dot-update

You can optionally pass role names

dot-update git python

Updating your dotfiles repo

To keep your fork up to date with the lewkoo fork:

git remote add lewkoo https://github.com/lewkoo/dotfiles.git
git pull lewkoo master

Test

All tests must be run under a new virtual environment with these installed:

pip install "molecule[docker,lint]"

Run Unit tests:

./bin/test

Run Integration tests:

./bin/test

Commands

There are three main commands in the bin directory for setting up and updating development environments:

  • dot-bootstrap: sets up local environment by executing all roles in local_env.yml.
  • dot-update: updates local environment by executing all roles in local_env.yml except for the ones tagged with "bootstrap".

special files

All configuration is done in ~/dotfiles. Each role may contain (in addition to the typical ansible directories and files) a number of special files

  • role/*.zsh: Any files ending in .zsh get loaded into your environment.
  • bin/: Anything in bin/ will get added to your $PATH and be made available everywhere.

TODO

  • Full testing on Mac OS X

license

MIT Licensed.

About

levko's dotfiles as Ansible roles

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 67.5%
  • Python 26.7%
  • PowerShell 2.7%
  • Jinja 1.5%
  • Dockerfile 1.2%
  • Makefile 0.4%