Coder Social home page Coder Social logo

dotfiles's Introduction

Dotfiles

Dotfiles for Linux and MacOS.

Structure

  • At the top level are directories for each operating system:

    • common: Contains dotfiles common to MacOS and Linux.
    • linux: Contains dotfiles specific to Linux.
    • macos: Contains dotfiles specific to MacOS.
  • Within each OS directory, each subdirectory is a parcel, containing dotfiles, setup, and install commands for a program or related set of programs.

Deployment

Deploying With Robot

Setting Up Robot

  • Install dependencies and bring them into the current shell's PATH.

    • Option 1: Run the following in your shell:
    DOTFILES=<path to git root directory of this repo>
    source bootstrap.sh
    • Option 2: If you are already using direnv, you can enable the repo's .envrc file to automatically load and unload the dependencies from your PATH when you enter and leave the directory.

      • The dotfiles contain a parcel to set up direnv once they are deployed.
  • Both options will run the following steps:

    1. Install asdf from source to ~/.asdf.
    2. Use asdf to install the latest version of python.
    3. Create and load a python virtual environment.
    4. Install pip packages from requirements.txt to the virtual environment.
    5. Set default options for the robot command when invoked.
    • On future runs, the installation steps will be skipped. Only the dependencies will be added to the PATH.

Invoking Robot

  • Each parcel contains a .robot file with commands for linking dotfiles, installing programs, and other general setup for that parcel.

  • All .robot setup files are idempotent.

  • Tags are applied to Robot tasks to select which parcels to deploy. Current tags are:

    • macos: works on MacOS.
    • linux: works on Linux.
      • xorg: requires X window system on Linux.
      • no-de: Intended for use only on a Linux installation without a desktop environment.
    • headless: only requires a shell to work.
  • Default options for Robot are set automatically in .envrc and bootstrap.sh, but more options can be added when Robot is run.

    • The linux or macos tag will be included automatically based on the result of uname -s.
    • The output directory for Robot logs is set to .logs.
    • Variables will be set to configure execution of the DotfilesLibrary.
  • To deploy all dotfiles for the current OS with symlinks, run robot . from the top level directory.

  • To additionally install required programs, run robot -v INSTALL_WITH:<package manager> .

    • <package manager> must be one of the functions defined in installer.sh corresponding to a package manager to use.
  • After installing, some configurations will require logging out and back in to take effect.

Manual Deployment

  • In some cases, like sshing to a server, installing new packages may not be desired or permitted.

  • The headless.sh script can be run from the top level directory to only symlink configs for headless dotfiles without installing anything.

    • This is a pure shell script with no dependencies.
  • This is useful to configure common programs like bash and vim that most machines already have, even if you cannot or do not want to install anything new.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.