3 ms·
The more I see posts praising nix, the more I am confused by the decisions made. In this post: --- start quote --- How about a different version of Ruby or N
by dmitriid 5y ago
The more I see posts praising nix, the more I am confused by the decisions made.
In this post:
--- start quote ---
How about a different version of Ruby or Node? Let’s say that our project depends on Ruby 2.6 and Node 10. We can go and search for those specific versions
--- end quote ---
So, to begin with, we still need a "version manager", because we want specific package versions. But look at how this is implemented in nix:
let
pkgs = import <nixpkgs> { };
in
pkgs.mkShell {
buildInputs = [
pkgs.hello
pkgs.ruby_2_6
pkgs.nodejs-10_x
];
}
Why? Because unlike every sane package/dependency manager where you specify a package and a version, nix pretends each version is a separate package.
And these packages aren't even correct. If you do go and search for ruby, for example [1], you get the following:
ruby Version: 2.7.4
ruby_3_0 Version: 3.0.2
ruby_2_6 Version: 2.6.8
This... This is laughable. How do I install ruby 2.6.8? Oh, there's no ruby_2_6_8, because of course there isn't. And this could be difference between a secure system and all your base are belong to us.
And they call this reproducible builds?
And that's before getting into the ridiculous
--- start quote ---
All the software that we installed depends on the specific version of the nixpkgs channel that we installed on our system [whose only version is a commit hash in a git repo]
--- end quote ---
So you need an extra tool [2] for, quote, "painless dependencies for Nix projects."
Yes, sure. I'm definitely ditching my version managers in favor of this tool, that hasn't solved these issues in 18 years of its existence.
[1] https://search.nixos.org/packages?channel=21.05&from=0&size=50&sort=relevance&type=packages&query=ruby https://search.nixos.org/packages?channel=21.05&from=0&size=...
[2] https://github.com/nmattia/niv https://github.com/nmattia/niv
- rvanlaar 5y agoNix is not easy nor simple. It's complicated but not complex. re: ruby version In ubuntu I can only install ruby2.7 and I don't which minor version. [1] I would need to use rvm anyway. It's the same with nix. What is possible is to pin the version you need by specifying the commit. [2] shows the diff of the commit that moved ruby_2_7 from 2.7.3 to 2.7.4. Say for example ruby 2.7.4 has a regression and the project needs to stay on 2.7.3. The revision has for 2.7.3 is used. [1] > apt search ruby |egrep "^ruby2|^ruby3" WARNING: apt does not have a stable CLI interface. Use with caution in scripts. ruby2.7/hirsute-updates,hirsute-security 2.7.2-4ubuntu1.2 amd64 ruby2.7-dev/hirsute-updates,hirsute-security 2.7.2-4ubuntu1.2 amd64 ruby2.7-doc/hirsute-updates,hirsute-updates,hirsute-security,hirsute-security 2.7.2-4ubuntu1.2 all [2] https://github.com/NixOS/nixpkgs/commit/5f9f17cc11caa07e4a9faa68d308d86e16d0f930 https://github.com/NixOS/nixpkgs/commit/5f9f17cc11caa07e4a9f...
- dmitriid 5y ago> re: ruby version I hoped you would tell me how to pin a specific version in nix, and you didn't. So far, I've asked this question at least three times. This question is either avoided or ignored. Ah yes. There's one "solution" with overlays which is neither maintainable nor scalable. > ruby version In ubuntu Is nix ubuntu? > What is possible is to pin the version you need by specifying the commit. Commit hashes are not versions > I would need to use rvm anyway. It's the same with nix We keep hearing the claim that nix is about builds. Builds often need their dependencies pinned to specific versions. If I still need to use rvm with nix, what's the point? This is especially funny in the context: we're in the comment section to a post claiming that we should ditch our "version managers" while providing an alternative that, so far, looks to be significantly worse at what it claims to do.