Live data from Hacker News

Dotfiles Management

mitxela.com

11–20 of 143 posts

Re: Dotfiles Management

#11
I'm a fan of just having my $HOME as a plain git repo with "*" in ~/.gitignore. Having to force add new files is a minor chore but one I'm more than happy to live with.

Re: Dotfiles Management

#12

Checkout chezmoi, I’ve been using it for a few years and it ticks every box for me - various machines, different configs, scripts, passwords etc https://www.chezmoi.io/

settled on this as well because of its very good cross-platform support. Only thing that took some time getting used to was the model of having a source directory distinct from your actual dotfiles unlike most of the symlink based tools.

Re: Dotfiles Management

#13

I'm a fan of just having my $HOME as a plain git repo with "*" in ~/.gitignore. Having to force add new files is a minor chore but one I'm more than happy to live with.

That's clever, but it also seems like a bit of a hassle. It also seems incredibly non-hermetic and prone to accidental pollution.

What about putting all configs into a single git managed directory and using tooling to install the appropriate symlinks?

Re: Dotfiles Management

#14
post #10

Checkout chezmoi, I’ve been using it for a few years and it ticks every box for me - various machines, different configs, scripts, passwords etc https://www.chezmoi.io/

I was interested in chezmoi, but they don't want you[1] managing files outside your home directory which made it a non-starter. I need to manage /etc/ and /usr/local/ too. [1] https://www.chezmoi.io/user-guide/frequently-asked-questions...

I've been using chezmoi too and this is the only feature I miss. It'd be interesting to know what solutions folks are using. Chezmoi has some discussions around it, mostly recommending to use run scripts.

Re: Dotfiles Management

#15
post #13

I'm a fan of just having my $HOME as a plain git repo with "*" in ~/.gitignore. Having to force add new files is a minor chore but one I'm more than happy to live with.

That's clever, but it also seems like a bit of a hassle. It also seems incredibly non-hermetic and prone to accidental pollution. What about putting all configs into a single git managed directory and using tooling to install the appropriate symlinks?

The git ignore file set up prevents accidental pollution.

A script and/or symlinks is overhead.

Re: Dotfiles Management

#16

Nice hack, but I still believe that home-manager [0] should be the way to go. It's the gateway drug to the Nix ecosystem and cleanly solves the composability problem which this "one-size-fits-all repo checked out to root" approach will have some trouble with. [0] https://github.com/nix-community/home-manager

It's definitely a gateway drug worth taking since Nix solves all kinds of other problems too. Just don't expect to become an expert overnight, it takes a while to sink in (or it did for me).

It's sad though - there's almost nothing in Nix (in my experience) that has to be that difficult if you know any programming. It's a perfect storm of bad documentation, bad tooling and unintuitive UX.

I've been half tempted to try and bridge Nix with some simplified UX. Something resembling blasphemy but nonetheless focused on user experience above all else. At least doing that would be a natural project to learn Nix better, too heh.

(disclaimer: I use Nix[OS] on two machines and my macbook. I know it decently.. but far from where i'd expect given it's my primary OS and package manager)

Re: Dotfiles Management

#17

I'm a fan of just having my $HOME as a plain git repo with "*" in ~/.gitignore. Having to force add new files is a minor chore but one I'm more than happy to live with.

"yadm" effectively does this, just replace "git" with "yadm" and it'll act on your $HOME

Has a couple of other nice things specific to this use case, like letting you have slightly different files based on username or platform.

https://yadm.io/

Re: Dotfiles Management

#18
I also track my dotfiles in a Git repo, but I only track my home directory. Made a tool to help out with some of the more arcane commands: https://github.com/tubbo/homer. I'm currently rewriting it in Rust, which is mostly done but I still have to work out a couple kinks on Linux machines . So far, I haven't needed to mess with too many top-level configs on each machine, most of the stuff I do is relatively contained (and uses the XDG standards thankfully). It got a little hairy when I tried to configure certain file paths on both a Linux and macOS environment, as there are different default conventions and other nuances that make the two not fully compatible at times. But it definitely saves a lot of time when setting up a new machine from scratch, `homer bootstrap $REPO_URL` does all the hard work and gets my home directory loaded up with configuration the way I'd expect.

Re: Dotfiles Management

#19
In case it's useful for someone (xkcd.com/1053) I use stow for handling config files. Lastly featured in HN here: https://news.ycombinator.com/item?id=32253018

It does however need a bit of preparation for complex things like Electron-based apps. I don't want to stow non-essential files and dirs, so I ended complementing it with a small script to do some preparation before the stowing itself.

Re: Dotfiles Management

#20
I used to put a lot of effort into trying to sync dot files. And you know what? I don't see a reason to do it. I only have one work computer and one personal computer.
Post reply on HN