Have a dotfiles directory with all your stuff in it? Have homemaker put everything in its right place.
homemaker in action
- from crates.io:
cargo install hm
- from github (may be in some state of flux):
cargo install --git https://github.com/hlmtre/homemaker
- cloned locally:
cargo install --path .
- create a
config.toml
file either anywhere (and specify it when you runhm
) or in~/.config/homemaker/
. - enter things to do things to in the file. example:
## config.toml
[[obj]]
file = 'tmux.conf'
source = '~/dotfiles/.tmux.conf'
destination = '~/.tmux.conf'
method = 'symlink'
[[obj]]
task = 'zt'
solution = 'cd ~/dotfiles/zt && git pull'
dependencies = 'maim, slop'
[[obj]]
task = 'maim_dependencies'
solution = 'sudo apt install -y libxfixes-dev libglm-dev libxrandr-dev libglew-dev libegl1-mesa-dev libxcomposite-dev'
[[obj]]
task = 'maim'
source = '~/dotfiles/zt/maim'
solution = 'cd ~/dotfiles/zt/maim; make clean; cmake -DCMAKE_INSTALL_PREFIX="/usr" ./ && make && sudo make install'
method = 'execute'
dependencies = 'maim_dependencies'
[[obj]]
task = 'slop'
source = '~/dotfiles/zt/slop'
solution = 'cd ~/dotfiles/zt/slop; make clean; cmake -DCMAKE_INSTALL_PREFIX="/usr" ./ && make && sudo make install'
method = 'execute'
[[obj]]
task = 'slop'
source = '~/dotfiles/zt/slop'
solution = 'cd ~/dotfiles/zt/slop; make clean; cmake -DCMAKE_INSTALL_PREFIX="/usr" ./ && make && sudo make install'
method = 'execute'
hm ~/path/to/your/config.toml
- compared to say, gnu stow, homemaker supports more than just creating a mirrored symlinked filesystem.
- dependency resolution:
- specify a set of tasks to complete, each with their own dependencies, and watch as it completes them in some order that satisfies each task's dependencies.
- for example, in the sample
config.toml
(the one i use, actually),maim
depends on having some graphics libraries installed. i created a task calledmaim_dependencies
, andhm
will completemaim_dependencies
before attempting to completemaim
. zt
has two dependencies:maim
andslop
.hm
will complete the entire dependency tree belowzt
before atttemptingzt
.homemaker
complains if the dependency tree cannot be solved, and hopefully shows you a handy explanation why.
thanks to actual good code:
serde
toml
symlink
solvent
indicatif
console