Giter Club home page Giter Club logo

dotfiles2021's Introduction

Dotfiles 2021

Dotfile bankruptcy after a couple decades of cruft.

Lightweight mode, for servers:

wget -q -O- https://git.io/JY0Yx | bash -x
curl -Ls https://git.io/JY0Yx | bash -x

Heavyweight mode, for bastions and development workstations:

# TODO

Layout

DOTDIR specifies the location of the dotfiles repo clone. It's intended to be at ~/.dot for servers which have a clone. ~/dotfiles is intended for workstations which sync all dotfiles using a tool like syncthing.

All installations have ~/.dotenv which specifies the dotfile location and is written during initial installation. zshrc sources ~/.dotenv at login. Shim scripts source ~/.dotenv to find where asdf is installed, which is used to provide a single context for neovim providers.

# ~/.dotenv
export DOTDIR="${HOME}/.dot"

The ${DOTDIR}/bin directory is expected to be inserted at the front of the path and has a small number of shim commands. The primary use case is a nvim shim for neovim.

The ${DOTDIR}/env directory contains tools (Python, Node, NeoVim) installed by the setup process, nothing in this directory should be committed to the repository and the directory should be organized by OS and Architecture to enable syncronization across devices.

Neovim is installed by unpacking the appimage for the correct platform and architecture.

Shim scripts set the exact context needed. For example, neovim:

#! /bin/bash
# Neovim shim at ${DOTDIR}/bin/nvim
source "${HOME}/.dotdir" # Set DOTDIR
# Node context for neovim
: "${UNAME:=$(uname)}"
: "${ARCH:=$(uname -m)}"
export ASDF_DATA_DIR="${DOTDIR}/env/${UNAME}/${ARCH}/asdf"
source "${ASDF_DATA_DIR}/asdf.sh"
# Python context for neovim
source "${DOTDIR}/env/${UNAME}/${ARCH}/python3/bin/activate"
# Finally, with Python and Node in the path, launch neovim:
if [[ -x "${DOTDIR}/env/${UNAME}/${ARCH}/squashfs-root/usr/bin/nvim" ]]; then
  # Most linux systems will use appimage to get the latest nvim
  exec "${DOTDIR}/env/${UNAME}/${ARCH}/squashfs-root/usr/bin/nvim" "$@"
else
  # macOS will use brew to get nvim
  exec nvim "$@"
fi

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.