Live data from Hacker News

Dotfiles Management

mitxela.com

131–140 of 143 posts

Re: Dotfiles Management

#131
Cool, but I don't need everything versioned and I like it simple.

    ~/usr/src/p/dotfiles  git worktree list                                                   
  /home/matt/usr/src/p/dotfiles  160721b5e3 [master]
  /home/matt/.config             e195a59c7b [config]
  /home/matt/.gnupg              b50725b47c [gnupg]
  /home/matt/.mozilla            b5d0d07b74 [mozilla]
  /home/matt/.mutt               f3d4a14d99 [mutt]
  /home/matt/.tmux               a93aa509af [tmux]
  /home/matt/.vim                68fd61921c [vim]
  /home/matt/.weechat            ef3d4c761f [weechat]
  /home/matt/.zsh                228ee42367 [zsh]
  /home/matt/bin                 b05de7d9d7 [bin]
  /home/matt/usr/venvs/shell     6a3b7e4c6a [shell/venv]
  /home/matt/usr/venvs/npm       d2065c68bf [shell/npm]
And only two symlinks I manually manage

  /home/matt/.vimrc -> .vim/.vimrc
  /home/matt/.zshrc -> .zsh/zshrc

Everything else isn't versioned. I rely on btrfs snapshots and back ups.

Re: Dotfiles Management

#133

Earlier quoted context omitted.

I'm curious about, specifically, which files you (and the sibling commenter) want to manage outside of the home directory. Is it OS package-manager configs? This is highly dependent on distro, but for any use-cases where editing /etc/ is the recommendation, I have found that either: (a) It's a development environment thing (e.g. httpd vhosts) & thus I see it as quite separate to "my dotfiles" (a personal machine env…

On macOS I often have the need to place stuff in /Library.

these go in ~/Library/LaunchAgents

Re: Dotfiles Management

#134
post #123

Earlier quoted context omitted.

I'm curious about, specifically, which files you (and the sibling commenter) want to manage outside of the home directory. Is it OS package-manager configs? This is highly dependent on distro, but for any use-cases where editing /etc/ is the recommendation, I have found that either: (a) It's a development environment thing (e.g. httpd vhosts) & thus I see it as quite separate to "my dotfiles" (a personal machine env…

regular config files in ~/Library/Application Support/ Sure there are (b) workarounds, including chezmoi templates and run_ scripts with symlinks, but that's cumbersome (and some issues were only resolved recently)

Not sure what you mean? That is in your home directory...

Re: Dotfiles Management

#135

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…

Stow ( https://www.gnu.org/software/stow/ ) may be useful for the linking part

Related:

Using GNU Stow to manage your dotfiles (2022) https://news.ycombinator.com/item?id=32253018

Re: Dotfiles Management

#136
post #105

Earlier quoted context omitted.

been using chezmoi for the past 3 months across 4 machines. i like the template support, but i constantly feel like there's complexity hiding. im finding myself needing to relearn various bits of how it works after not touching it for a few weeks at a time. by far, my favorite thing about chezmoi is that you're managing a separate set of files and syncing then to your homedir, making it reallllllly easy to switch too…

My homebrew solution uses comments surrounding or in-line with the code that is machine-specific. The program then uncomments/comments the code appropriately as it is backed up and restored. What do you think of this approach? Would that remove the complexity hiding?

i'd have to see it to have much of an opinion. have a GitHub link by chance?

Re: Dotfiles Management

#138

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.

I started out with yadm but ended up symlinking its .git directory to ~/.git to be able to browse/stage/commit in Fork (https://fork.dev).

To make this manageable, I added this .gitignore:

  \*
  !.\*
  !.hammerspoon/\*/\*
  !.config/\*/\*
  !.ssh/config
  .DS_Store
  .bash_history
  .tig_history
  .lesshst
  .python_history
  .wget-hsts
  .zsh_history
  .CFUserTextEncoding
  .Xauthority
  /.config/mcd/.cache/
  /.config/mcd/.local/
  /.config/legendary/
This makes use of the fact that .gitignore patterns are evaluated in order. It basically makes git only care about dotfiles in the home directory, files under .config, .ssh and .hammerspoon. Specific files/dirs that match that filter can still be ignored (e.g. .bash_history).

This is very straightforward and works quite well, so I don't see the need for yadm anymore. The one issue I have with it, is that in the terminal I'm always in a git context (shown in the shell prompt) in any directory under $HOME.

Re: Dotfiles Management

#140
post #105

Earlier quoted context omitted.

My homebrew solution uses comments surrounding or in-line with the code that is machine-specific. The program then uncomments/comments the code appropriately as it is backed up and restored. What do you think of this approach? Would that remove the complexity hiding?

i'd have to see it to have much of an opinion. have a GitHub link by chance?

See the example usage via the link below.

https://github.com/k4j8/filetailor#example-usage

The program works great for my use case, but I don't have a CS background and this was my first big project, so I'm sure it's full of bugs and poor coding practices.

Post reply on HN