5 ms·
It's not about what is possible, it is about ergonomics. We could have used email for conversations online, yet we use Slack. Other tool require lots of thought
by rossmohax 5y ago
It's not about what is possible, it is about ergonomics. We could have used email for conversations online, yet we use Slack. Other tool require lots of thought and carefull execution for what Nix gives you for free.
- dmitriid 5y ago> Other tool require lots of thought and carefull execution for what Nix gives you for free. How do I pin ruby version to 2.6.3 in Nix? This is given to me for free in other tools. As are reproducible builds because all modern package/dependency managers lock versions.
- rossmohax 5y agoIt is not the same level of reproducibility like Nix and Bazel provides. You can pin ruby to exact version you want with https://nixos.wiki/wiki/Overlays https://nixos.wiki/wiki/Overlays
- dmitriid 5y ago> It is not the same level of reproducibility like Nix and Bazel provides. What is "the same level"? > You can pin ruby to exact version you want with https://nixos.wiki/wiki/Overlays https://nixos.wiki/wiki/Overlays That page says: "Overlays provide a method to extend and change nixpkgs" I don't want to change something. I want to simply pin a version. This is neither simple, nor scalable, nor maintainable (also here: https://news.ycombinator.com/item?id=28591202 https://news.ycombinator.com/item?id=28591202): Overriding a version self: super: { sl = super.sl.overrideAttrs (old: { src = super.fetchFromGitHub { owner = "mtoyoda"; repo = "sl"; rev = "923e7d7ebc5c1f009755bdeb789ac25658ccce03"; # If you don't know the hash, the first time, set: # sha256 = "0000000000000000000000000000000000000000000000000000"; # then nix will fail the build with such an error message: # hash mismatch in fixed-output derivation '/nix/store/m1ga09c0z1a6n7rj8ky3s31dpgalsn0n-source': # wanted: sha256:0000000000000000000000000000000000000000000000000000 # got: sha256:173gxk0ymiw94glyjzjizp8bv8g72gwkjhacigd1an09jshdrjb4 sha256 = "173gxk0ymiw94glyjzjizp8bv8g72gwkjhacigd1an09jshdrjb4"; }; }); }
- rvanlaar 5y agoReading your linked post, it seems you are wrestling with how Nix works. Nix is hard to learn. The concepts used are almost the same, but different. That's because it's solving slightly different problems than package managers currently do. As the overriding example shows, the versions are pinned by hash and are stored in a file. What about it is not maintainable or scalable?
- dmitriid 5y ago> Reading your linked post, it seems you are wrestling with how Nix works. Not only me. > That's because it's solving slightly different problems than package managers currently do. We keep hearing this claim, and hardly any proof of that. > As the overriding example shows, the versions are pinned by hash and are stored in a file. What about it is not maintainable or scalable? 1. Commit hashes are not versions 2. Hunting down every commit hash of every package to pin down the exact version is neither maintainable nor scalable
- jbboehr 5y ago> Hunting down every commit hash of every package to pin down the exact version is neither maintainable nor scalable I believe flakes will make this a lot easier, but it's not quite here yet.
- clhodapp 5y agoIn terms of version pinning, flakes are essentially just an in-tree equivalent of niv, I will say.
- dmitriid 5y ago> I believe flakes will make this a lot easier Somewhat, I guess? It will apparently let you write this: { inputs = { home-manager.url = "github:nix-community/home-manager"; }; } where you can manually point to a specific commit/branch for a tool. Better than nothing, I guess :)
- rvanlaar 5y agoLast week I had a problem with our CI/CD pipeline because an old package that's a sub dependency wouldn't install anymore. [1] See that `rev` line in the sources.json? The whole build system is pinned by on git commit. If it builds today, it will build tomorrow. No matter what. That alone resolves a huge category of potential problems. There's much, much more to it. Nix stores each package in its own path. [2] This makes it possible to install multiple versions of one application or library next to each other. With the power of direnv only the versions one needs are included. [1] https://github.com/tikitu/jsmin/issues/33 https://github.com/tikitu/jsmin/issues/33 [2] > ls /nix/store/ |head 000dm655691b5zis34klvhlil3hrv7j5-fftw-3.3.9.tar.gz.drv 005m4pqd29k976if66fpbggjsdxhchdg-python3.8-astroid-2.5.1.drv 007hqps3i495yjk223vhckin27vggk81-recode-3.7.8.tar.gz.drv 009815w1n26nl10rgffgahk7aka80p1m-nodejs-14.17.0 00a9nyyhwxisv4vc4rvwzp71nfip53x9-user-environment.drv 00m5h0pfzw2182qmyganlkaa9j4l2hps-vector-th-unbox-0.2.1.9.drv 010v6j5jjk2wpniznas31hbwvz1p1f5d-zapfding.r31835.tar.xz.drv 013sdi43bca33mnc3gn0v5r8lifrgcdj-hwdata-0.347.drv 01c3690lhmk0za0hnnh23n6mfgmiijpf-libdv-1.0.0.drv 01kc15hni6gff4z1p3y14v9f1395x2pf-python3.8-tap.py-3.0.drv
- dmitriid 5y ago> a problem with our CI/CD pipeline because an old package that's a sub dependency wouldn't install anymore > The whole build system is pinned by on git commit. If it builds today, it will build tomorrow. No matter what. If that commit is still available. This still doesn't answer the question of how I easily pin a version. The package versions in the post point to what amounts to a random package version. And that's on top the fact that "if you tried to follow this article step by step, you’ll have noticed that the versions of ruby and node you installed are probably slightly different from the ones above" > Nix stores each package in its own path. This is a part that I like.
- rvanlaar 5y ago> If that commit is still available. Why wouldn't it be available? Nix packages are on github. [1] > And that's on top the fact that "if you tried to follow this article step by step, you’ll have noticed that the versions of ruby and node you installed are probably slightly different from the ones above" That's the same as on any other host. If I write about installing ruby on ubuntu today and you read the blog post a whole later you'll probably get a newer version. [1]https://github.com/NixOS/nixpkgs https://github.com/NixOS/nixpkgs
- Arkh4m 5y agoHere is an example if you absolutely want to pin Ruby to 2.6.7 while pulling all other packages from a more recent set of packages https://gist.github.com/Arkham/31297c1d75fc59f723a50063bc0f5739 https://gist.github.com/Arkham/31297c1d75fc59f723a50063bc0f5... I found the nixpkgs version using this tool: https://lazamar.co.uk/nix-versions/?channel=nixpkgs-unstable&package=ruby https://lazamar.co.uk/nix-versions/?channel=nixpkgs-unstable...