Live data from Hacker News

Dotfiles Management

mitxela.com

121–130 of 143 posts

Re: Dotfiles Management

#121
I see a lot of people mentioning home-manager / nix in the comments. I tried drinking the nix kool-aid and home-manager and all that was a little too much more me and landed on a hybrid approach:

https://github.com/sontek/homies

1. I use a `justfile` that calls `nix profile install ...` to install my packages, rather than using a nix configuration file. This allows me to use a standard package manager workflow rather than going "all in".

https://github.com/sontek/homies/blob/master/justfile#L24-L2...

2. I then use GNU Stow to install my dotfile configuration:

https://github.com/sontek/homies/blob/master/justfile#L93-L9...

I think this is a great middle ground where I can utilize `nix` as my package manager across Linux and Mac and have consistency while not having to learn the whole configuration language or change my workflow.

The other tools I use heavily in my environment:

- https://asdf-vm.com/: I find this better than installing python/node/etc from nix.

- https://github.com/casey/just: I use this as my command runner (similar to make but cleaner in my opinion)

Re: Dotfiles Management

#123
post #10

Earlier quoted context omitted.

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'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)

Re: Dotfiles Management

#124
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...

they don't want you, but they also "allow you, in theory, to use chezmoi to manage any file in your filesystem, "

Re: Dotfiles Management

#125
post #21

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.

What happens when one of those computers blows up and you need to get back to being productive quickly?

I don't need to sync between computers to accomplish that. Could just use something as simple as Dropbox.

BUT ALSO: There's nothing that important in my personal dot files. And anything work related is in specific git repos. I could be productive with the default zsh on a fresh install of macOS by installing home brew and a few packages.

I also haven't had a mac "blow up" in... 20 years?

Re: Dotfiles Management

#126
I personally value Out Of Box Experience, and so, my personalization is more like installing software, instead of tweaking them. So I back up my /home, and on a new system, I just look at the backup, if I need settings for a program.

Re: Dotfiles Management

#127

Earlier quoted context omitted.

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…

https://snowflakeos.org/

That looks really cool, though for me it's the language and API that makes it awkward.

A really good LSP could do wonders for user experience.

Re: Dotfiles Management

#128
post #89

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

Any home-manager users on Nix OS here? Are there any killer features in home-manager for you? I tried home-manager for a bit, but just went back to plain NixOS after I couldn't find anything it did better than what I was already using ([1], [2]). [1] https://gitlab.com/engmark/tilde [2] https://gitlab.com/engmark/root

Easy integration between the two. I pass config from the system config to home config for some things and it’s quite seamless. Also one command to apply config for system and home is nice.

Re: Dotfiles Management

#129

Earlier quoted context omitted.

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…

I had problems installing python dependencies with compiled library dependencies this way, eg pandas. Does that generally work for you?

Pandas is one of those for which poetry alone doesn't do the job. So I have nix install pandas alongside poetry so that when poetry tries to install pandas, the non-python dependencies are all lined up.

Here's a (too verbose, sorry) example: https://stackoverflow.com/a/74944857/1054322

It works well on all of my linux boxes. On my mac it takes forever because it wants to rebuild the linux universe. Given that the system architecture is a parameter, I think there should be a way to rewrite my flake (or update the nixpkgs numpy) to just rely on bsd tools in those cases, but I haven't found it yet.

That's what's holding me up from recommending it to my team. I'm happy to just use linux everywhere, but they aren't.

Re: Dotfiles Management

#130
post #116

Earlier quoted context omitted.

Nix is building a package manager AND a programming language. Guix is building a package manager only. It's a resourcing thing.

And one might even argue the opposite, a DSL made for creating packages may well be better. Especially that plenty of package descriptions are basically reads like JSON.

Fair enough, that's a really good point.
Post reply on HN