Dotfiles: Unofficial Guide to Dotfiles on GitHub
dotfiles.github.io
dotfiles.github.io
To not make it took negative. I personally use Chezmoi, which I've been super happy with. The ability to maintain files in a central repository and then pull them into the file system on an update is quite nice.
You can handle merge conflicts and whatnot between your local copy and the upstream dot files. You can opt your files into using go templates in your files which is useful when I need to maintain differences in configs between mac and linux, or in general for just storing secrets out of your dotfiles.
There are some small annoyances but overall it is the only dotfile manager, I've managed to stick with.
Being able to run `chezmoi diff` and `chezmoi apply` are game changers.
One of chezmoi killer features is how it handles secrets. Either the secret can be encrypted using age/gpg or (super cool) it integrates with you password manager (I used Bitwarden).
This is super useful for me, as I pair chezmoi with dotenv, so when I switch directories, my environment variables are auto populated, including secrets that are pulled directly from my password manager.
My complex use case is that I use all three of the main OS' and so there are some dotfiles for desktop apps that live in Windows' home directory and some that live in WSL, so having something manage that for me is pretty nice.
https://github.com/pprotas/dotfiles/blob/main/symlink.sh
That's it.
https://brandon.invergo.net/news/2012-05-26-using-gnu-stow-t...
I mean, yea, if it works for you, great! But all of the above are problems I did have. I grew a custom install script for years. Now I use Home Manager and the impermanence module.
No need for those complex software, just shell script is enough for me.
Maybe you haven't lost data from this yet, but this is where Chezmoi has nice guardrails and protects against, e.g., modifications or additions accidentally being made to $HOME instead of the dotfiles dir, which look like they would be silently blown out by your current process.
Just my 2¢ from someone who used to do it this way and lost data because of it.
EDIT: Unless I have a dir called "*" in my dotfiles, but at that point I deserve to have my home dir removed :P ZSH also asks for confirmation first
https://github.com/matheusmoreira/.files/blob/master/GNUmake...
https://www.matheusmoreira.com/articles/managing-dotfiles-wi...
It even supports the XDG stuff as well as variables like GNUPGHOME.
It came down to the fact that it's easy to install and easy to bootstrap as long as your dotfiles are in a public Github repo. It also integrates with a bunch of password managers to grab any secrets you might need in addition.
I use the "run_onchange_install-packages.sh.tmpl" to install basic packages to computers I bootstrap chezmoi on, it adapts based on the operating system using chezmoi's templating system[1]
It takes a few tries to remember the flow of "chezmoi add"ing a file after editing it so that you can push it to Github. After that it's just a matter of chezmoi update on your other computers to bring them up to date.
For .gitconfig I use a .gitconfig.local file on my work computer to override my personal credentials and not have to mess with templating the file.
[0] https://www.chezmoi.io [1] https://www.chezmoi.io/user-guide/advanced/install-packages-...
https://www.atlassian.com/git/tutorials/dotfiles
original thread on HN: https://news.ycombinator.com/item?id=11070797
I imagine these solutions would scale poorly if I had a large number (dozens? hundreds?) of machines which all needed unique configurations, or if I used more tools which needed per-machine configuration, or if I needed to stick secrets in configuration files for some reason. Luckily for me, that's not the case, and my system has served me quite well as a result.
if “$TERM_PROGRAM” != “”; then
# think diff’rnt
else
# tron leotards
endThe migration process was easy, and I was able to use it to replace my sim link script with it's file directives.
It also integrates well with my Nixos Systems.
The added bonus is:
1. No need for complicated directory structures that a symlink-like script needs to manage.
2. Dotfile management coupled with package management. Dotfiles only make sense as configuration to packages you have - why would you not tie these together?
3. Minor-to-no tweaks required to have a fully reproduced setup on any machine.
Seriously, I transitioned my dotfiles from my NixOS machine at home to my work-issued M2 within... an hour?
I will never not evangelize Nix.
On the upside: you do get a whole purpose-build language for configuring your system, piecing together your configurations dynamically, installing your packages and so much more.
Ability to install packages is another huge thing. Home-Manager does not just configure my tools, it also installs them (including my DE), so I can get started with my custom config on a new system in a matter of minutes.
In the end, how you do it is personal pref. I liken it to editor wars, vim vs emacs, etc. What works for me, may not work for you.
PS: these are my dotfiles (link is my repo), and I've used this method for some 5 plus yrs now and it works well for me. I really like how easy it is to spool up a new linux instance and have my config ready to go in mere seconds.
I've not used branches yet, for different OS'en, so my zshrc and bashrc have conditional checks for OS. I will be looking at using branches in the future since it does sound like it would make shell rc files cleaner.
I didn’t store my dotfiles on GitHub because they didn’t used to have free private repositories. (Why would I share my dotfiles?)
Basically, the --dotfiles option was not working with directories so you had to have things that look like this: lazygit/.config/lazygit and now it looks like: lazygit/dot-config/lazygit.
Really a small issue that bugged me forever - shouldn't have made it seem like it was core a problem with stow!
Basically, the --dotfiles option was not working with directories so you had to have things that look like this: lazygit/.config/lazygit and now it looks like: lazygit/dot-config/lazygit.
Really a small issue that bugged me forever - shouldn't have made it seem like it was core a problem with stow!
[1]: https://www.atlassian.com/git/tutorials/dotfiles [2]: https://gist.github.com/tionis/a0f23a7a33b0e289f1b03cc6ff503...
git-crypt allows me to protect sensitive files while still tracking them in a git repo. I don't think I'd rely on it for shared projects, but it works well for me.
I'm impressed by the dedication of anyone who has enough dotfile config to use a submodule!
I still like Vorta for dotfiles, just because it's trivial to set up and only uses tools I already use for other things. Most of the dotfiles I want to back up have secrets, so GitHub isn't really an option.
SyncThing seems like it could work well for dotfiles too, with some kind of frontend that copied stuff to a sync folder.
My own dotfiles: https://github.com/epiccoleman/dotfiles
2. man stow
3. git init ~/dotfiles
have at'er
alias homegit="git --work-tree=$HOME --git-dir=$HOME/.dotfiles.git"