5 ms·
Kinda derailing the thread but might ask anyway, does anyone got recommendations on dot files synchronization through personal devices? I'm currently using a gi
by ulzeraj 6y ago
Kinda derailing the thread but might ask anyway, does anyone got recommendations on dot files synchronization through personal devices? I'm currently using a git+ss repo on a personal server.
I wonder if there are more convenient ways to do this.
- dbolgheroni 6y agoNot the simplest way of doing this, but ansible might be an option. IMO the advantage is being able to customize the configuration file depending on the host OS, IP address, attached filesystem, etc. This is useful because sometimes you want to use the same configuration file on different systems and they usually need some customizations to adapt to each one, which can be done automatically by ansible based on jinja2 templates.
- fpoling 6y agoI have a shell script that either symlinks dot files from my git repo or writes them. Then I use git normally.
- stonewareslord 6y agoI have tried a custom linking script, Ansible, and stow. The best I have found is to just use a bare git repo based off of: https://www.atlassian.com/git/tutorials/dotfiles https://www.atlassian.com/git/tutorials/dotfiles The idea is to make an alias that runs git so that it treats your home directory as a git repository and you can directly commit them. I would recommend bypassing that article's `config config --local status.showUntrackedFiles no` setting and setting a `~/.gitignore`. This way, git will never tinker with your home directory if you accidentally run the wrong command. So the complete list of setup commands is: # Only needs to be done the first time cat >~/.gitignore<<'EOF' * !/.bashrc !/.zshrc EOF # On subsequent runs git clone --bare ssh://git/cfg.git "${HOME}/.cfg" function config() { git --git-dir="${HOME}/.cfg/" --work-tree="${HOME}" "${@}" } config checkout -- ~/.gitignore config reset ~ config checkout -- ~ config submodule update --init --recursive --remote One caveat is adding files in subdirectories (`~/. config/...`), but just requires changes in your gitignore
- ulzeraj 6y agoThanks! Using Ansible sounds like a great idea, specially when it allows me to also match installed packages! Would be great if I could combine with a local secrets engine. Like Hashicorp Vault but local.
- sneak 6y agoI use syncthing to sync a directory, then symlink my dotfiles into place from the synced directory to the location where they are expected. A few are in a git repo, such as my homedir's Makefile: https://git.eeqj.de/sneak/hacks https://git.eeqj.de/sneak/hacks
- knoebber 6y agoI wrote a program to solve this: https://github.com/knoebber/dotfile/ https://github.com/knoebber/dotfile/ If I were on a fresh VM with an internet connection and wanted my vimrc, I would do curl https://dotfilehub.com/knoebber/vimrc >> ~/.vimrc