48

I'm wondering if there is a new tool out there that I'm missing out on.

all 38 comments
sorted by: hot top controversial new old
[-] spesk@programming.dev 19 points 1 year ago

Git and symbolic links still.

Ive heard good things about GNU Stow.

[-] jmondi@programming.dev 7 points 1 year ago

If you’re using symlinks, you should definitely check out Stow.

[-] yads@lemmy.ca 3 points 1 year ago

That's the way I do it, although I have a custom script that generates the symlinks for me. Not sure why I'd need anything more

[-] cd_slash_rmrf@programming.dev 12 points 1 year ago

https://www.chezmoi.io/ if you've got some complexity with your setup. otherwise, could be overkill.

[-] outcide@lemmy.world 3 points 1 year ago

Had a homebrew Git setup for ages and recently started using Chezmoi. It's only been a few weeks, but so far it's been pretty great!

[-] proton_lynx@lemmy.world 3 points 1 year ago

What I really like about chezmoi is how it can retrieve secrets stored on Bitwarden. Your git history is clean of secrets but you can have them referenced on your dotfiles.

[-] Hexarei@programming.dev 2 points 1 year ago
[-] cd_slash_rmrf@programming.dev 2 points 1 year ago

it's so useful! I used to have some terrible setup going with branches for different OSes in my dotfiles, and chezmoi really simplified the whole thing

[-] Hexarei@programming.dev 1 points 1 year ago

Indeed, I use my dotfiles across several machines, architectures, and distributions and it's fantastic

[-] kuresov@lemmy.ml 2 points 11 months ago

I use Chezmoi but I have to point out some of its downfalls vs. other dotfile managers, particularly if someone is looking to migrate to it.

  • Go's templating lib is incredibly unergonomic.
  • Identifying file perms and visibility in by special naming convention is pretty gross. Also makes it more difficult to migrate to another solution.
  • If you're deleting files, you need to remember to do it through chezmoi remove .... You can't just rm them from your dotfiles directory, because chezmoi does not sync state; it simply applies what's currently in your repo.
  • Handling multiple systems through .chezmoiignore ends up being overly verbose and unintuitive vs. the approach used by other dotfile managers

Despite these gripes I still use it because deployment via a single binary is convenient, and there's enough control through the generated config file + system info to handle multiple kinds of deployments sort-of-sensibly (see point 4 above).

[-] demesisx@programming.dev 12 points 1 year ago
[-] philm@programming.dev 6 points 1 year ago

Like to see so many fellow nix(os)ers here, I think the amount/ratio of nixers here is quite a bit higher than previously on reddit.

[-] codemonk@programming.dev 11 points 1 year ago

I prefer to keep tooling for that at a minimum. Therefore I use git only. My approach is taken from here: https://www.atlassian.com/git/tutorials/dotfiles The only difference: My git alias is dotfiles not config. I find that to be less confusing. Additionally, I source system-specific configs, where appropriate. These are not stored in dotfiles. There is a small todo section in my readme.

[-] o_o@programming.dev 0 points 1 year ago

I do the same! It works quite well.

[-] varsock@programming.dev 9 points 1 year ago* (last edited 1 year ago)

i take a Phoenix approach with my dotfiles.

Once a decade when my computer crashes and burns, from the ashes emerges a blank slate of dotfiles that is purged of all unnecessary hacks that have accumulated. With a tear and a hopeful outlook, I rush to set the settings I am actually dependent on.

I really need to take more interest in backing up my dotfiles 😭

[-] Andy@programming.dev 9 points 1 year ago

I'm surprised it's not already mentioned in these comments: https://yadm.io/

[-] natecox@programming.dev 8 points 1 year ago

I’m all in on nix with home-manager these days. Really seems like an ideal framework for my dotfiles and of all the systems I’ve tried over the years this is the one I’m happiest with.

Hell of a learning curve, though.

[-] philm@programming.dev 5 points 1 year ago

Yep it's like maintaining a codebase that's getting increasingly better. It's a rabbit-hole and a timesink (kind of because you're trying to get the best out of it, and thus configure likely more) but I think it's worth it. It gets better overtime as well

[-] raspberry_confetti@lemmy.ml 6 points 1 year ago

They're in git

[-] EvanHahn@bigshoulders.city 6 points 1 year ago

@no_sle3p I have them in a Git repo and I use GNU Stow to symlink things. I also wrote a blog post about this with more details: https://evanhahn.com/a-decade-of-dotfiles/

[-] mrkite@programming.dev 3 points 1 year ago* (last edited 1 year ago)

Are you me? I do the exact same thing.. only I also made a Makefile to do all the stow commands for me.

https://github.com/mrkite/dotfiles/blob/master/Makefile

[-] EvanHahn@bigshoulders.city 3 points 1 year ago

@mrkite Ooh, I like this makefile...I might steal it.

[-] stephenc@waveform.social 2 points 1 year ago

Or maybe you're me, because that's what I do. Git + Stow + Makefile.

[-] corytheboyd@kbin.social 6 points 1 year ago* (last edited 1 year ago)

Tried all the fancy ideas, never stuck with it. I just use git to track changes now and move on with my life. There are like four functions I carry around with me, then whatever path additions and init scripts I pile up. It’s so light it doesn’t really matter when I move to a new machine

[-] gamma@programming.dev 4 points 1 year ago* (last edited 1 year ago)

I've done symlinks into a separate directory before, but by far my favorite method is to just let ~ be a git repo. It's maximally simple, no other tooling needed besides git.

There are a few key steps to making this work well:

  • echo '*' > ~/.gitignore: This way git status isn't full of untracked files. I can still git add -f what I actually want to track.
  • git branch -m dots: For clarity in my shell prompt.
  • [ -d "$HOME/.local/$(hostname)/bin" ] && PATH=$PATH:$HOME/.local/$(hostname)/bin and similar if there's config I want to apply only to certain hosts.
[-] drdnl@programming.dev 3 points 1 year ago

Pretty happy with nixos these days, after the initial (crazy) learning curve. But I really like the creative simplicity of this idea

[-] gamma@programming.dev 2 points 1 year ago

~~Stole~~ Forked this idea from Drew Devault.

I'm looking at NixOS now for my server, and while I understand the host config, I'm curious whether I could integrate this into my config in some way.

[-] demesisx@lemmy.world 4 points 1 year ago

I use NixOS with Home Manager and flakes.

[-] howarddo@programming.dev 4 points 1 year ago

I used bare git repo before, then switch to GNU Stow + Nix home-manager.

[-] kersplort@programming.dev 3 points 1 year ago

I still put them in gists, with no real tooling. I pull them in selectively when I get a new machine.

[-] anzo@programming.dev 3 points 1 year ago* (last edited 1 year ago)

I use git (without remote repo, but could be easily added). Actually this simple bare git repo technique is something I enjoy doing in lots of places where config files lie.

Basically, it's only: alias config="/usr/bin/git --git-dir=\${HOME}/.myconf/ --work-tree=\${HOME}"

Of course, a first time setup is required:

git init --bare $HOME/.myconf
config config status.showUntrackedFiles no

I got this setup from a comment on HackerNews long ago. OP comment was rather insightful: "No extra tooling, no symlinks, files are tracked on a version control system, you can use different branches for different computers, you can replicate you configuration easily on new installation."

But I never used any branches, prefer to keep it extremely KISS. I even avoid commiting, just staging area that I keep updating with each OS upgrade. Only this bit of extension I use... since I don't push to any remotes (prefer keeping dotfiles private), I needed a way to copy all of the tracked files (e.g. to have my settings on a work laptop, of course I then go ahead and clean any boilerplate before moving such an 'exported' folder)...

config_export() {
    echo "Copying only staged files, it is recommended to run beforehand: $ config add -u ~"
    mkdir -p ~/.config_export/
    CONFIG_FILES=$(config status | /usr/bin/grep 'new file:' | cut -d':' -f2 | sed -E 's/^ +//')
    printf "%s\n" "${CONFIG_FILES[@]}" | xargs -I {} cp --parent '{}' ~/.config_export/
    ls -halt ~/.config_export/
}
[-] mr47@kbin.social 2 points 1 year ago

https://github.com/technicalpickles/homesick
It's a bit old (hasn't been updated in 4 years), but works great.

[-] 6xpipe_@lemmy.world 1 points 1 year ago

I store them in Dropbox and symlink them to their correct location.

I do that instead of the standard Git method because it means I don't have to worry about remembering to sync each computer. Everything syncs immediately.

[-] mortonfox@pawb.social 1 points 11 months ago

I use yadm. It's a wrapper around git with a few extra commands for dotfile management.

this post was submitted on 18 Jul 2023
48 points (100.0% liked)

Experienced Devs

3854 readers
1 users here now

A community for discussion amongst professional software developers.

Posts should be relevant to those well into their careers.

For those looking to break into the industry, are hustling for their first job, or have just started their career and are looking for advice, check out:

founded 1 year ago
MODERATORS