Live data from Hacker News

Dotfiles Management

mitxela.com

61–70 of 143 posts

Re: Dotfiles Management

#61
post #38

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.

Bare git repos have lots of limitations, namely: * Maintaining per-machine configurations is a hassle, usually involving a lot of manual branch juggling. * There's no support for storing secrets in a password manager or in encrypted files. Read more reasons why dotfile managers are better than bare git repos at https://www.chezmoi.io/why-use-chezmoi/#i-already-have-a-sys...

Been using chezmoi for years and it's great! If you are the person who created this I just want to say thank you! :)

Re: Dotfiles Management

#62

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

the read has “words of warning” almost immediately at the top about being familiar with nix first. it’s the gateway drug to nix? bad docs and difficult to grok error messages seem to be a consistent theme that comes up learning nix.

It's kind of like LSD, your just gonna be unprepared the first time, and the second time...

Re: Dotfiles Management

#63
post #53

I always start out with the best of intentions for dotfile mangement etc, using tools like stow, git and so on. Eventually I get lazy and don't bother checking stuff in and forget where half of the stuff is. Might try this solution but I'm too cynical to think it'll be something I'll stick with

Exactly the same for me, at some point I realized that just copying over some config files from a backup is easier than trying to keep things neat and tidy for years just to be prepared for setting up a new computer every few years.

It’s more for when you change a setting, that you don’t have to manually change it on n accounts/machines.

Re: Dotfiles Management

#64
post #30

How do people here handle secrets like e.g. passwords / env variables / ssh keys in their dotfiles? I've written simple encrypt/decrypt with PGP, but since I've kinda lost trust into Keybase I have no simple way to bootstrap PGP.

I do the same, just copy .gnupg folder over via ssh / usb / yubikey.

Re: Dotfiles Management

#65

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

Nix is like sailing from Oakland to San Francisco on an aircraft carrier for your daily commute. Most stuff I care about factors out into .config which I turn into a git repo, push to GitHub and slap on a CI checks for secrets. Most engineers don’t need to forge a demonic pact with the Nix gods who demand I upend and replace everything from my operating system to my wife.

95% of the time if I'm making nix a dependency it's just to install the correct version of python and poetry, then I let poetry handle the other dependencies. So it's totally possible to just use nix a little. My coworkers haven't even noticed the flake.nix in our repo, they just install those things by hand.

But then there's that 5% case where you do have to forge a demonic pact with the nix gods, and it's handy to have your summoning circle all warmed up and ready to go.

Re: Dotfiles Management

#66

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'm in the process of migrating over to this. I find it much simpler and easier to configure than dotbot (which I had be using for many years). If you're only using your dotfiles on one platform, really anything will work. Where things get hairy is when you want slight tweaks or configuration changes depending on platform. Chezmoi gets this right out of the box.

Re: Dotfiles Management

#67

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.

Fair point. If you're interested in why chezmoi took this particular approach, I wrote a few FAQs on its design:

Why chezmoi doesn't use symlinks: https://www.chezmoi.io/user-guide/frequently-asked-questions...

General design FAQs: https://www.chezmoi.io/user-guide/frequently-asked-questions...

Re: Dotfiles Management

#68

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

Nix is like sailing from Oakland to San Francisco on an aircraft carrier for your daily commute. Most stuff I care about factors out into .config which I turn into a git repo, push to GitHub and slap on a CI checks for secrets. Most engineers don’t need to forge a demonic pact with the Nix gods who demand I upend and replace everything from my operating system to my wife.

You win this thread.

Re: Dotfiles Management

#69

I always start out with the best of intentions for dotfile mangement etc, using tools like stow, git and so on. Eventually I get lazy and don't bother checking stuff in and forget where half of the stuff is. Might try this solution but I'm too cynical to think it'll be something I'll stick with

I often think I need to have weekly backups done for me so I can skip managing at times without accumulating too much untracked cruft.

Re: Dotfiles Management

#70
I do something similar, albeit a bit more bare-bones. I keep my dotfiles in a dotfiles folder that is a git repo and then just have a simple script to symlink everything.

I have a couple of submodules in there (zplug, pyenv) and a bash script to keep them up to date, and then a few self managed binaries, like fnm. That's about it.

I don't bother trying to manage anything outside of home or deal with secret values by using something like git-secret.

Overall, it works great and has allowed me to keep track of how my core tools are configured without too much hassle.

Post reply on HN