/dotFiles

.files to operate

Primary LanguageShell

.Files

This repository contains my .Files an Ansible playbook and a custom Python script for deployment.

Sample cli setup

Usage

  1. Run sh -c "$(curl -sSL https://raw.githubusercontent.com/lony/dotFiles/master/setup.sh)"
  • Executes setup script
  • Download repository to home folder
  • Install ansible prerequisites
  • Run Ansible
  1. Customize ansible/roles/dotfiles/src/bash_zsh/all_secret.sh and maybe .ssh/config (see SSH guide)
  2. Execute ./setup.sh again
  3. Switch repo back git remote set-url origin git@github.com:lony/dotFiles.git
  4. Generate SSH key in /Users/<home>/.ssh using ssh-keygen -t rsa -b 4096 -C "<YOUR@EMAIL.COM>" -N ""
  5. Add public SSH key to Github https://github.com/settings/keys

Hint: To install the corporate subset just clone the repository and run ansible-playbook --ask-become-pass --inventory localhost, ansible/site.yml --skip-tags corporate-do-not.

Feature

  • Setup script to prepare Ansible
  • oh-my-zsh setup
  • dotfiles setup, optimizations
  • .gitconfig
  • vim setup incl. vim-plug + plugins
  • tmux setup incl. tpm + plugins
  • Sublime setup
  • Beyond Compare config
  • Python simple setup
  • OSX Homebrew setup
  • OSX Homebrew Cask setup
  • OSX Homebrew cleanup
  • OSX cli configuration see this
  • OSX Dock configuration using dockutil
  • OSX Apple store installation
  • OSX iTerm2 configuration see here
  • OSX file associations using duti
  • OSX configure display arrangement
  • OSX configure loginitems
  • OSX system configuration scutil see here
  • OSX Hardening https://blog.bejarano.io/hardening-macos.html
  • VSCode config setup
  • VSCode install extensions
  • Testing with Travis CI support
  • Testing using Packer to build image see this
  • Testing with local VirtualBox see this and this
  • Ansible installation for OSX
  • Ansible installation for Linux
  • Ansible installation for Windows [really?]

Architecture

  1. The setup.sh installs OS specific Ansible prerequisites and starts Ansible
  2. Ansible has multiple roles which each are triggered
  3. The dotfile role contains a Python script which creates shell scripts for bash, zsh and fish

Structure

❯ tree  -L 5 (custom)
.
├── README.md                     - This readme
├── ansible
│   ├── README.md                 - Ansible links
│   ├── roles
│   │   ├── dotfiles              - First role for dotfiles
│   │   │   ├── bin
│   │   │   │   └── bootstrap.py  - Custom Python script
│   │   │   ├── src               - Dotfiles
│   │   │   └── tasks
│   │   │       └── main.yml      - Task executed by Ansible
│   │   ├── homebrew
│   │   │   ├── tasks
│   │   │   └── vars
│   │   │       └── main.yml      - Variables used by Ansible
│   │   ├── homebrew_cleanup
│   │   ├── python
│   │   ├── tmux
│   │   ├── vim
│   │   └── zsh_oh-my-zsh
│   └── site.yml                  - Ansible playbook definition
└── setup.sh                      - Script to prepare OS for Ansible

Testing

  • Amazon Linux
    • Go into ~/dotFiles
    • docker pull amazonlinux
    • DIR=/root/dotFiles; docker run -it --mount src="$(pwd)",target=$DIR,type=bind --rm amazonlinux bash -c "cd $DIR; ./setup.sh; exec \"\$0\""

Thanks

This is heavily inspired by the work of the following people:

  • Dominik's - basic idea for bash, zsh, vim and tmux
  • Christopher - vim plugins
  • Michael - cli tooling e.g. httpie, jq
  • Sebastian's - homebrew setup, tmux enhancing
  • Florian - fish support
  • Jeff's, 2 - Ansible deployment, testing, mas
  • Chavez's - Ansible bootstrapping and vim, tmux enhanced setup
  • Richard's - Dock configuration
  • Fotis's - File associations