logoalt Hacker News

ljm12/09/20241 replyview on HN

Count of grey hairs on my head and face is only increasing so I'm gonna be that guy:

Nix/NixOS and Guix are two solid solutions to the problem, because they spin up completely independent, immutable, environments. You don't need to mess around with shell hacks to swap out the correct `npm` or `ruby` binary based on a string in one of several dozen dotfiles.

More or less python-style virtual envs on steroids where it's not just python stuff that isolated, but the entire setup. All your tools, all your config. Throw in `direnv` so you can make your editor and GUI tools aware of it.

The only initial headache is making sure the package is available to pull in -it's easy when it's distributed, but when tools are published through NPM or RubyGems or Crates or just on github that you have to run `go install` to get, then it's a bit of faff. But the same faff that distro managers have keeping, say, debian's sources up to date.


Replies

syhol12/09/2024

I feel like nix has been thoroughly discussed in this post already, so you're not the only guy.

> You don't need to mess around with shell hacks

Shell integration is optional, you can use `mise en` just like `nix-shell` or `nix develop`. You could also just invoke commands/scripts through mise tasks or mise exec.

> based on a string in one of several dozen dotfiles

The "Idiomatic" files like .nvmrc, .python-version, etc are supported but most people just use a mise.toml, which (a bit like flake files) contains all the config for the environment.

> but when tools are published through NPM or RubyGems or Crates or just on github that you have to run `go install` to get, then it's a bit of faff

And this is what mise excels at: `mise use npm:cowsay` or `mise use ubi:junegunn/fzf`

I think Nix/Guix are great, but also terrible. For me today, it's not worth the pain.