Live data from Hacker News

Migrating from GNU Stow to Chezmoi

rednafi.com

71–80 of 152 posts

Re: Migrating from GNU Stow to Chezmoi

#71

I had similar problems with GNU Stow, but switched to Nix and Home Manager instead. I think Chezmoi's templates and file naming conventions don't click for me, but it's nice to see a good variety in this problem space.

[flagged]

Mommy, the Nix Reformationist is scaring me

Re: Migrating from GNU Stow to Chezmoi

#72
post #21

I had similar problems with GNU Stow, but switched to Nix and Home Manager instead. I think Chezmoi's templates and file naming conventions don't click for me, but it's nice to see a good variety in this problem space.

I didn't even know that managing dotfiles was a "problem space".

It's dead simple to manage files in git or such. What Chezmoi adds over that are niceties like:

* Permission management, so that ssh wouldn't refuse to log you in because ~/.ssh/authorized_keys is 0755 instead of 0644.

* Templating, because ~/.ssh/config has slightly different options on Mac and Linux, so you can't use the exact same file contents as-is on both systems.

I can run `chezmoi apply` and get all the files in the right places and they're all setup just right. Like so many others, I'd previously built my own ad-hoc system to handle these things, and it ended up looking like a crappy, half-baked version of Chezmoi. When it came up on my radar I immediately ported my own system over to it and never looked back.

Re: Migrating from GNU Stow to Chezmoi

#73

Earlier quoted context omitted.

[flagged]

What a snakepit of a comment! I know there are tensions within nix but this feels like a classic case of Chestertons fence at a big scale.

These things really do not have an actual reason. Take for example the Nic people who go to every project with a bash script that uses #!/bin/bash and tells them to use #!/usr/bin/env bash. There is no justification for trying to fix every bash script in existence over the operating system being able to resolve what the "current" bash version should be (/usr/bin/env already has to pick a version). This is pointless O(n) busy work Nix people have created for themselves when an O(1) solution exists.

Re: Migrating from GNU Stow to Chezmoi

#74
post #58

Earlier quoted context omitted.

I am genuinely confused. Are you saying dotfile managers need to be more complex? Or that nix's problem space is the only solution for the things in nix's domain? (of which dotfiles are just one—via home manager) I thought it was the former but "just pulling a precompiled, dynamically linked binary and hoping it works" makes me think we're not on the same page since to me that has nothing to do with dotfiles.

I'm saying that I value the completeness (thoroughness may be a better word) as well as the reproducability and portability that nix ensures over convenience. I cant tell you the amount of times I've pulled a precompiled tool and it just doesnt work because of one quirk of their packaging or another. Also noting that I don't see the problem as "dotfile management" but as "system AND user configuration management" whi…

> I can't tell you the amount of times I've pulled a precompiled tool and it just doesnt work because of one quirk of their packaging or another.

This is a serious problem in Nix too. I often trip over buggy and abandoned Nix packages. Nix often makes it easy to roll back or work around them, but they're absolutely there.

Re: Migrating from GNU Stow to Chezmoi

#75

I had similar problems with GNU Stow, but switched to Nix and Home Manager instead. I think Chezmoi's templates and file naming conventions don't click for me, but it's nice to see a good variety in this problem space.

If you like home manager but also like to understand how your "home"/user programs are configured, take a look at hjem!

Last time I looked, it only worked with NixOS.

I don't understand what makes it more understandable than Home Manager, though.

If you look at the source of a Home Manager `programs.foo` module, it should look mostly like this:

  home.packages = [ cfg.package ];
  xdg.configFile."foo/config.yaml".source = yamlFormat.generate "config.yaml" cfg.settings;
Which is pretty much exactly the same syntax you get with Hjem, but with more optional features. So you could just write that instead whenever you want full control :)

Re: Migrating from GNU Stow to Chezmoi

#76

Earlier quoted context omitted.

I've bounced off Nix every time I tried it, before I even started trying something like Home Manager. I've been using (and contributing to) chezmoi for ~6 years now. Given that it has first-class integration with secrets managers, I suspect that it does things that Home Manager can't.

>I've bounced off Nix every time I tried it, before I even started trying something like Home Manager. I did too. Until I tried configuring it with Claude Code. I'll give you my money back guarantee on it.

Vibed infrastructure? That sounds like it undoes a lot of Nix's advantages.

Re: Migrating from GNU Stow to Chezmoi

#77

I had similar problems with GNU Stow, but switched to Nix and Home Manager instead. I think Chezmoi's templates and file naming conventions don't click for me, but it's nice to see a good variety in this problem space.

[flagged]

Worse is better.

Re: Migrating from GNU Stow to Chezmoi

#78

Earlier quoted context omitted.

If you like home manager but also like to understand how your "home"/user programs are configured, take a look at hjem!

Last time I looked, it only worked with NixOS. I don't understand what makes it more understandable than Home Manager, though. If you look at the source of a Home Manager `programs.foo` module, it should look mostly like this: home.packages = [ cfg.package ]; xdg.configFile."foo/config.yaml".source = yamlFormat.generate "config.yaml" cfg.settings; Which is pretty much exactly the same syntax you get with Hjem, but wi…

It works on darwin and any linux just fine. Theyre even working on a "standalone" like HMs, if you really want to decouple your user programs from your system.

With some programs it is as simple as you show, but with others there are options around the config and other nix module nasties that I avoid if I can. hjem-rum is a sister project to hjem that provides some similar modules.

Re: Migrating from GNU Stow to Chezmoi

#79
Ok, I came into this thread intending to say “I’ve been using stow for years and am perfectly happy with it”, started RTFA and the comments, realised that I was actually not happy with it, started considering chezmoi then remembered that I had had a pretty great experience building a Nix VM recently.

Now I want to use Nix* to manage my multi-machine MacOS and Linux setup (with lots of dotfile config overlap, of course).

That’s the HN experience for you.

Kind souls: what is currently the blessed way to manage MacOS dots with Nix? I recall there is more than one paradigm - what’s the approach that simplest, most robust and can be adopted incrementally?

Edit: Just to say that I think Atuin now also plays in this space. Haven’t checked it out, though.

Re: Migrating from GNU Stow to Chezmoi

#80
post #28

It’s quite new but I’ve been cooking up some new bootstrapping features with mise which people may find relevant here: https://mise.jdx.dev/bootstrap.html It’s for things like dotfiles, apt/brew packages, and LaunchAgents/systemd. EDIT: I feel a little bad having hijacked this, as someone that hears a lot of opinions about devtools I can definitely say chezmoi is a darling of the community and I highly recommend chec…

I am quite intrigued. With the sorry state of security, I am doing everything in VMs and have been trying to settle on the best way to setup a new machine. The process is so clunky that I end up defaulting to bigger instances than I should (more pets than cattle). Being able to centralize this config is far more attractive than having a separate Ansible or pyinfra process. Edit: The docs on this are very encouraging!…

ALL mise features are experimental until the design is finalized. I don’t do breaking changes except in exceptional circumstances with a long procedure, so experimental means I have the liberty of making them in any release. It is not at all any marker of quality. That said, in practice I don’t make them often.

I’d argue it’s a good time to play with features since if you have any ideas on how it might better fit your workflow I still have the ability to change the design before it’s largely frozen.

Post reply on HN