A collection of configuration files for a *nix-like OS intended for use with the GNU/Stow.
On the "old" machine:
- Prepare an archive with private repos not included to the git index:
make archive
On the "new" machine (from this step onward):
- Install GNU/Stow:
- Fedora Linux:
sudo dnf install -y stow
- MacOS with homebrew:
brew install stow
- Clone the repo:
git clone --recurse-submodules [email protected]:pilosus/dotfiles.git
- 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
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.
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
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
To clone the repo along with the submodules, use
--recurse-submodules
option to git clone
:
git clone --recurse-submodules https://github.com/pilosus/dotfiles
See manual for definitions, usage examples and more.
stow --target=$HOME ansible
stow --target=$HOME --delete ansible/
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
When moving files to a new machine, create an archive with:
make archive