Config files. For use with GNU stow on supported platforms.
|
3 weeks ago | |
---|---|---|
alacritty | 3 weeks ago | |
neofetch | 3 weeks ago | |
vim | 3 weeks ago | |
.gitignore | 3 weeks ago | |
Readme.md | 3 weeks ago | |
dot | 3 weeks ago |
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.
All config files for a specific program are kept together in a package.
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.
Each package may have files that target the system or the user file heirarchy. Therefore, each package may have a subdirectory containing any of:
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:
/home/acme/.config
)/home/acme/.local
)/opt
)/usr/local
)/usr/local/lib
)For now, to ensure maximum compatibility, it's more flexable to require each package to supply the specific heirarchy.
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
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