GithubHelp home page GithubHelp logo

dotfiles's Introduction

dotfiles with GNU/Stow

A collection of configuration files for a *nix-like OS intended for use with the GNU/Stow.

Installation

On the "old" machine:

  1. Prepare an archive with private repos not included to the git index:
make archive

On the "new" machine (from this step onward):

  1. Install GNU/Stow:
  • Fedora Linux:
sudo dnf install -y stow
  • MacOS with homebrew:
brew install stow
  1. Clone the repo:
git clone --recurse-submodules [email protected]:pilosus/dotfiles.git
  1. Unpack the archive from the step 0:
cd dotfiles
cp ~/Downloads/archive.tar.gz .
tar xzf --keep-newer-files archive.tar.gz
rm archive.tar.gz

Alternatively, instead of step 2, re-create dotfiles repo from the archive:

  • Create mkdir dotfiles
  • Follow step 3
  • Clone and init submodules with:
make clone
make submodule

Stow Manual

Definitions

A stow directory is a root directory of this repo, containing all the packages.

A package is directory in a stow directory containing all the necessary files and direcotories to be installed into a target directory.

A target directory is a directory the packages will be installed into via the symlink creation.

Installing or stowing is a process of a symlink creation, when content of the package directory get symlinked to a target directory.

Deletion or unstowing is a process of removing symlinks.

Packaging

To create a package, create a directory in the stow directory with the proper files and directories layout that is expected to be installed to the target directory.

E.g. these directories in the root of the repo are packages:

tree
.
├── bash
├── clojure
├── emacs
├── gpg
├── pypi
└── ssh

Package as a git-submodule

Some packages are stand-alone repos. These can be installed using git-submodule. E.g. let's create a clojure package from the dot-clojure repo:

pwd
your-stow-directory

git submodule add [email protected]:pilosus/dot-clojure.git clojure/.clojure

The new submodule is added to the .gitmodules file as well to the ~/.git/config. In the submodule directory do the things needed, e.g. pull the updates:

cd .clojure
git pull

NB! Converting existing directory to a submodule discussion

Cloning the repo

To clone the repo along with the submodules, use --recurse-submodules option to git clone:

git clone --recurse-submodules https://github.com/pilosus/dotfiles

Usage

See manual for definitions, usage examples and more.

Stowing: creating symlinks for a package

stow --target=$HOME ansible

Unstowing: removing symlimks for a package

stow --target=$HOME --delete ansible/

Bulk operations: stow, unstow

Stow all packages at once, pruning obsolete symlinks:

stow --verbose --target=$HOME --restow */

or simply:

make stow

Unstow all the packages:

stow --verbose --target=$HOME --delete */

or simply:

make unstow

Prepare archive with the secret repos

When moving files to a new machine, create an archive with:

make archive

dotfiles's People

Contributors

pilosus avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.