Closed ayekat closed 5 years ago
Being able to move the dotfiles repo elsewhere would also allow symlinking just the entire XDG_LIB_HOME
to the one in the dotfiles repo, rather than having to do it individually.
The places where we need to get rid of the "hard path assumption" are:
etc/dunst/dunstrc
(for launching qutebrowser)etc/mutt/muttrc
(for launching msmtp) — f53db0f6e695c07f3d15132c446826088e1fbc66etc/sh/profile.d/dotfiles.sh
(for expanding PATH
)etc/vim/vimrc
(for setting filetypes for files within the dotfiles repo) — 7ca6529c031bae99dc4d22f0794c36c0ebd4049eetc/zsh/.zshrc
(for watching the dotfiles repo) — 02d3c69f29263c4928d508cb9256c2ceac9b6d88I'm wondering if exporting a special DOTFILES
environment variable holding a path to the
dotfiles repo would solve this...
Alright, here's a slightly crazy idea: Let's clone the dotfiles repo as ~/.local
itself.
This way, we also get to set the desired structure of ~/.local
(so we could create ~/.local/var/{cache,lib,log}
) and wouldn't need to symlink all the stuff around (if I'm not mistaken, the only symlink required would be for .pam_environment
).
I'll see if this is doable.
Not quite as crazy as I initially feared.
Commit 584c44b implements this, and then for machines that pull it, the only thing initially breaking is just the .pam_environment
symlink, which is not too much of an issue as long as we don't log out.
The required steps are then:
XDG_RUNTIME_DIR
symlink inside the repo.~/.local
that's not in the repo):
git checkout
the deleted .gitignore
file in the previously deleted dummy directory.In the end there should only be symlinks pointing into ~/.local/lib/dotfiles/{…}
. So we can (in a single line) rename ~/.local
to something else and rename-move {somethingelse}/lib/dotfiles
to ~/.local
.
Voilà!
I've updated this on most of my (important) hosts, and nothing has broken so far, so I'm gonna close this as a non-issue now (since we now expect the dotfiles repo to be cloned as ~/.local
directly, and this directory is kinda expected to exist anyway).
Who knows, maybe in the future I will want to rename ~/.local
to something else, but for the time being, I'm fine with it.
Currently, there are a few configuration files and shell snippets that assume that the dotfiles repository has been cloned into
$XDG_LIB_HOME/dotfiles
. Allowing the repo to reside anywhere else would add flexibility to the user (especially when tinkering around in the dotfiles repo itself).