Live data from Hacker News

Dotfiles: Unofficial Guide to Dotfiles on GitHub

dotfiles.github.io

21–30 of 74 posts

Re: Dotfiles: Unofficial Guide to Dotfiles on GitHub

#21
post #7

Gnu stow has finally been updated to fix a long standing issue so I can once again wholeheartedly recommend it again! It’s lightweight and uses symlinks. Last I checked, chezmoi has a symlink mode but it’s a bit worse.

What's the issue? I've been using stow for a decade now and can't recall ever running into problems

Re: Dotfiles: Unofficial Guide to Dotfiles on GitHub

#22
post #19
post #16

Earlier quoted context omitted.

Using the GNU stow utility makes this super easy. It even has a --dotfiles flag so you can author your dotfiles as dot-zshrc and when the utility symlinks it, it will be .zshrc. Makes it nice so your source files are not hidden but the actual dotfiles are (as expected).

Although GNU stow is very interesting, I like this simple script because it has no external dependencies. Stow is not available on macos by default, for example.

It is available though in every package manager for macOS except the App Store, and any user of a script like this on macOS is probably also using Homebrew, macports, Nix, or srcpkg.

Re: Dotfiles: Unofficial Guide to Dotfiles on GitHub

#23
post #11

All you need is a symlink script that symlinks files in ~ to ~/path/to/your/dotfiles https://github.com/pprotas/dotfiles/blob/main/symlink.sh That's it.

Sure, maybe. Though eventually one may find lots of edge cases. What about files in the root that get deleted? What about programs that put wanted state within config dirs? What about programs that ignore symlinked files? What about when you’re hacking on your dotfiles and break everything because the active config is the config being edited? What about when you need to vary based on system? What about…

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.

Re: Dotfiles: Unofficial Guide to Dotfiles on GitHub

#24
post #11

All you need is a symlink script that symlinks files in ~ to ~/path/to/your/dotfiles https://github.com/pprotas/dotfiles/blob/main/symlink.sh That's it.

I made it Python, added a simple json-config and mustache-templating. Very portable (where symlinks are), very flexible (also used it for termux for a bit) and very simple.

Re: Dotfiles: Unofficial Guide to Dotfiles on GitHub

#25
I'm currently using a git based approach for my dotfiles, similar to the one notes here[1]. I've got one significant change, though: All my dotfile management works over my cfg[2] script that helps me maintain a main branch for dotfiles for all machines and then branches that branch off of that main like 'main.arch.MACHINE_NAME' that are merged like a waterfall during sync (main -[merge]-> main.arch -[merge]-> main.arch.MACHINE_NAME). (I can also cherry pick up the waterfall)

[1]: https://www.atlassian.com/git/tutorials/dotfiles [2]: https://gist.github.com/tionis/a0f23a7a33b0e289f1b03cc6ff503...

Re: Dotfiles: Unofficial Guide to Dotfiles on GitHub

#26
post #9
post #5

This site seems much more like an some of the awesome- repositories on github than a guide. Although it does give some extra information on the packages. 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 you…

Seconding Chezmoi, it's what I use, and it works well.

Third here, it's the easiest tool to setup dotfiles that work on machines ranging from RHEL7 to latest MacOS. Haven't dealt with Windows dotfiles though.

Re: Dotfiles: Unofficial Guide to Dotfiles on GitHub

#27
post #20

I started managing my dotfiles in git and followed the pattern I found in Anders Knudsen's repository below. The most painful thing has been coming up with config that works across Linux and MacOS, but that's been chosen pain that can easily be avoided. https://github.com/andersix/dotfiles

I have been keeping them in separate branches because I have had macOS with intel and arm because there were differences in the config.

Re: Dotfiles: Unofficial Guide to Dotfiles on GitHub

#28
post #11

All you need is a symlink script that symlinks files in ~ to ~/path/to/your/dotfiles https://github.com/pprotas/dotfiles/blob/main/symlink.sh That's it.

Yeah, same: https://github.com/vbezhenar/dotfiles/blob/main/ln-all

No need for those complex software, just shell script is enough for me.

Re: Dotfiles: Unofficial Guide to Dotfiles on GitHub

#29
post #11

All you need is a symlink script that symlinks files in ~ to ~/path/to/your/dotfiles https://github.com/pprotas/dotfiles/blob/main/symlink.sh That's it.

This will not handle cases other targets than $HOME. The automatic deletion seems also very risky. In my own script, I move all pre-existing targets to a separate directory, so I can check later.

[deleted]
Post reply on HN