Config files. For use with GNU stow on supported platforms.

Daniel Sheffield 0a9d3810fc update ./dot to support removing and updating 3 weeks ago
alacritty 0a9d3810fc update ./dot to support removing and updating 3 weeks ago
neofetch dc57e0106b add neofetch config 3 weeks ago
vim 21b4e44398 pull in vim plug 3 weeks ago
.gitignore 0cf9f01c6f add .gitignore 3 weeks ago
Readme.md 77a17ce984 link to GNU Stow manual 3 weeks ago
dot 0a9d3810fc update ./dot to support removing and updating 3 weeks ago

Readme.md

Personal dotfiles (eg .config)

The files here are structured for compatibility with GNU Stow to keep things as simple as possible and reduce reliance on custom logic.

The config for each program is stored in a single subdirectory (a package).

I've added the notion of package targets to handle config for programs that do not store all config in a single location.

Packages

All config files for a specific program are kept together in a package.

  • Each subdirectory of this repo represents a different dotfiles package.
  • The directory structure is compatible with GNU stow.

There is a custom wrapper bash script (uses GNU Stow) that you can use to easily install a config package:

Example Install the config for the vim package:

./dot apply vim

Or, if the vim package has no other targets, you can use GNU Stow directly:

stow -t "$HOME" vim

Multiple targets are supported in the case a given package has a mix of user config and system config.

Example Install only system config for the ssh package:

./dot apply ssh system

Example Install all config for the ssh package:

./dot apply ssh

You can still use GNU Stow directly, with just a minor tweak to the stow options to support the multi-target directory structure:

stow -d ssh -t "/" system
stow -d ssh -t "$HOME" user

NOTE: the package name is now passed to stow as the stow directory and the package target is passed as the package name.

Targets

Each package may have files that target the system or the user file heirarchy. Therefore, each package may have a subdirectory containing any of:

  • system
  • user

Example with dotfiles repo checked out to ./dotfiles (DOTFILES_DIR):

./dotfiles
├── Readme.md
├── ssh
│   ├── system
│   │   └── etc
│   │       └── ssh
│   │           ├── ssh_config
│   │           └── sshd_config
│   └── user
│       └── .ssh
│           └── config
└── vim
    └── .vimrc

In the case no target subdirectories are present for a given package, then the target is assumed to be the user target.

More targets may be added in the future:

  • user-config (/home/acme/.config)
  • user-local (/home/acme/.local)
  • system-opt (/opt)
  • system-local (/usr/local)
  • system-lib (/usr/local/lib)

For now, to ensure maximum compatibility, it's more flexable to require each package to supply the specific heirarchy.

User Target

All directories under the user target are relative to $HOME.

Example Stow the .vimrc at $HOME:

./dot apply vim

On GNU Stow compatible system this is equivalent to:

stow -d "$DOTFILES_DIR" -t "/home/$USER" vim

System Target

All directories under the system targt are relative to /.

Example Stow system/user ssh config at $HOME and / respectively:

./dot apply ssh

On GNU Stow compatible system this is equivalent to:

stow -d "$DOTFILES_DIR/ssh" -t "/home/$USER" user
stow -d "$DOTFILES_DIR/ssh" -t / system # needs root permissions obviously