Skip to content

sarandi/dotfiles

Repository files navigation

Sarandos's Dotfiles

  • These dotfiles are managed using dotbot and git submodules.
  • Feel free to skip the goals/requirements. It's mostly me rambling through my process to make sure I'm not forgetting things.
  • I maintain this repo as my dotfiles.
  • You're quite welcome to pick and choose from my settings, but you probably shouldn't use them as-is because they'll likely not suit your needs.
  • You're welcome to make suggestions/raise issues/etc.

Table of Contents

  1. Goals/Requirements
  2. Dependencies
  3. Setup
  4. Configuration
  5. Contributing
  6. Resources
  7. TODOs
  8. License

Goals/Requirements

I started this project as a section for a "book" (link someday?), the topic of which is how to improve processes endemic to software development.

Part of my process for any project, software or otherwise, is to establish a small set of goals that will help me get started. As I begin work, the complexities of the work unfold and I rework the goals as often as needed to keep things moving and focused on the next big task.

My initial goals were:

  1. Keep my secrets safe.
  2. Get my dotfiles on github.

I moved my secrets and cleaned up my files to some extent, but after a few days research into available dotfiles tools, my goals changed to:

  1. Be able to document/see changes (git).
  2. Load configs for multiple envs (dotbot).
  3. Keep secrets protected, yet in sync with the rest of the system (dotbot + custom bash functions).
  4. Allow for easy integration of other projects (git submodules).

Now almost 3 weeks later I finally have my secrets buttoned up and am making an initial commit

Dependencies

[TODO]

Setup

Installing

  • Fork this repo in github (unless you are me).

  • Clone the forked repo to $HOME/.dotfiles:

    ~$ git clone --recursive https://github.com/sarandi/dotfiles ~/.dotfiles

Using

To use these dotfiles, use dotbot to load a set of configuration files.

  • You can install one or more profiles with:

    ./install-profile <profile> [<configs...>]
  • Single configurations can be installed with:

    ./install-standalone <configs...>
  • To unload your current configs, simply install with the set you wish to be using; The install scripts are idempotent, so the old set will be cleaned and only the new set will be used.

Sourcing

My .bash_profile makes resources available by using the source command. I'm avoiding the use of source alias . <filename> in preference of clarity over arcanity.

  • Add/remove files by grouping them into arrays and passing to setSources() for example, in .bash_profile:

      main=($HOME/.{path,apps,filesystem,utils,macos});
      loadSources "$(echo ${main[*]})";
  • If you're updating already installed and sourced files, you don't need to run ./install-profile profile(s) but you do need to either:

    • Start a new shell
      • via your terminal (cmd+T in iTerm).
      • in the same shell: issue exec bash -l. 1
    • Source the file in manually if you don't want to start a new shell.
    • This also includes moving files.

Extras

[TODO]

Maintenance

  • Update meta/base.yaml to set defaults and any shared configurations.
  • Add/update meta/profiles/<profile> to define profile.
  • Add/update meta/configs/<config.yaml> to symlink configs.
  • Stage/commit/push changes
  • or cherrypick commits you like from others.

Configuration

Overview

Please refer to dotbot's configuration for how to structure your configuration files.

More specifically, I'm using the advanced setup outlined here. However, the initial install for this isn't yet documented completely, so I'm outlining it in the following section.

Advanced Dotbot Install

  1. Create your .dotfile directory - I use .dotfiles.

  2. In .dotfiles root, create and populate a .gitignore file.

  3. In .dotfiles root, initiate git with git init.

  4. Get the advanced dotbot install scripts and save them to .dotbot root.

    1. install-profile
    2. install-standalone
    3. N.B. Notice these don't use a file extension.
  5. In .dotfile root, create a config directory.

    1. The default name is meta.
    2. If you change from meta, you will have to update the META_DIR variables in both the install scripts.
  6. Inside of meta create two more directories: profiles and configs

  7. Your user should have read/write/execute privileges for all files and directories.

    1. You can set this recursively with chmod -R 700 ~/.dotfiles
    2. or you can alter to fit your needs - I usually use 755.
  8. In .dotfile root, install the dotbot git submodule:

    # Using ssh
    git submodule add [email protected]:anishathalye/dotbot.git meta
  9. Setup your configuration files as follows.

Advanced Dotbot Configuration

Dotbot accepts both YAML or JSON. My files exclusively use YAML because though it is whitespace dependent, I find managing whitespace easier than managing matching brackets. This is a personal preference, so feel free to change things for your own configurations.

  1. cd to the cloned directory

  2. Setup meta/configs/config.yaml files for each set of configurations.

    1. This follows the convention set by dotbot:

      - link:
        ~/.macos: os/macos/.macos
        ~/.tmux-os.conf: os/macos/.macos.tmux.conf
        #  vim: set filetype=yaml ts=4 sw=4 tw=0 et :
    2. Task options: default, link, clean, shell

  3. Setup meta/profiles/<profile> files for each profile.

    1. This is simply an extensionless list of config files:

      bin
      apps
      bash
      filesystem
      macos
      path
      utils
      vim
      
  4. Follow the directions in Setup#Installing and Setup#Using to test and use your configs.

Contributing

As stated initially I am completely open to constructive feedback and dialog. If you have a case to make for a particular change - especially if you think may improve this configuation - please feel free to open an issue.

If you want to do the work yourself, you can fork/clone/develop and issue a pull request. In any case I reserve the right to ultimately decline the change, though if so I'll do my best to provide a good reason.

Resources

This project is cobbled together by many ideas gleaned from the following sources. Thank you to all their authors and contributors.

  1. https://github.com/mathiasbynens/dotfiles
  2. https://github.com/paulirish/dotfiles
  3. https://github.com/magicmonty/dotfiles_dotbot
  4. https://github.com/vsund/dotfiles
  5. https://github.com/vbrandl/dotfiles

TODOs

TODOs are now being logged at [TODO.md]

License

Copyright (c) 2012-2019 Sarandos Klikizos. Released under the MIT License. See [LICENSE.md] for details.

Footnotes

  1. https://stackoverflow.com/a/26747607/2124430

About

configs, scripts, etc. managed with dotbot

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published