Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As someone with only a little experience with Nix, the points here don’t really seem right?

> This approach isn’t clear or maintainable, especially for contributors unfamiliar with Nix’s version management.

> For languages like Node and Python, we ended up only supporting their latest major version.

What is not maintainable about this? That they need to make a list of available versions? So, can this not be automated?

Furthermore, why is Railway defining how a user uses Nix?

Surely one of the points of Nix is that you can take a bare machine and have it configured with exactly what versions of packages you want? Why would Railway need to get in the way of the user and limit their versions anyway?

Or did I misunderstand and they don’t even expose Nix to the user? If so, the original question still stands: can’t they automate that list of package versions?



The version limits come from the fact that the Nix cache doesn't maintain older versions. So, if you use an older version, you will have to compile from sources. It sounds like they didn't want to take it upon themselves and provide a cache with older versions, even though it doesn't sound like much effort.

Honestly, the reasons given don't feel very solid. Maybe the person who introduced Nix left and the ones remaining didn't like it very much (the language itself is not very nice, the docs weren't great either in the past).

Still, I'm not familiar enough with the stack they chose, but does it provide a level of determinism close to Nix? If not, it might come to bite them or make their life harder later on.


Nix cache (cache.nixos.org) does in fact maintain older versions[0]. In fact, they maintain so much older stuff (binaries and associated source), that they are used in both research[1][2] and are having issues with gigantic cache size[3][4].

And yes, their reasoning implies NIH and just unfamiliarity combined with unwillingness to really understand Nix.

[0]: https://discourse.nixos.org/t/how-long-is-binary-cache-kept-...

[1]: https://hal.science/hal-04913007

[2]: https://luj.fr/blog/is-nixos-truly-reproducible.html

[3]: https://discourse.nixos.org/t/nixos-foundations-financial-su...

[4]: https://discourse.nixos.org/t/the-nixos-foundations-call-to-...


Even if this weren’t true, setting up their own binary cache on S3 would have been trivial. It took me half a day to get it set up for our CI pipeline.


Nix cache does provide old versions. What they seem to want is old versions built with new versions of dependencies. That's also possible, but you will have to build things.


Patching old software with newer components? Does another tool really offer that automatically? This article is a promotion for their tool that does?


That’s what dynamic linking does in most linux distributions.


From the article:

> The way Nixpacks uses Nix to pull in dependencies often results in massive image sizes with a single /nix/store layer ... all Nix and related packages and libraries needed for both the build and runtime are here.

This statement is kinda like “I’m giving up on automobiles because I can’t make them go forward”. This is one of the things Nix can do most reliably. It automates the detection of which runtime dependencies are actually referenced in the resulting binary, using string matching on /nix/store hashes. If they couldn’t make it do that, they’re doing something pretty weird or gravely wrong. I wouldn’t even know where to start to try to stop Nix from solving this automatically!

I wouldn’t read too much into their experience with it. The stuff about versioning is a very normal problem everyone has, would have been more interesting if they attempted to solve it.


To be fair to the authors, this IS a problem, albeit one they phrased poorly, especially with building docker images via nix. The store winds up containing way more than you need (eg all of postgres, not just psql), and it can be quite difficult to patch individual packages. Derivations are also not well-pruned in my experience, leading to very bloated docker images relative to using a staged Dockerfile.

Image size isn’t something we’ve focused a lot on, so I haven’t spent a ton of time on it, but searching for “nix docker image size” shows it to be a pretty commonly encountered thing.


> Or did I misunderstand and they don’t even expose Nix to the user?

That's at least my understanding, yes.


you can not have a dockerfile in your project at all, push your code to them, and they’d build an image for it with nixpacks. you’d see nix stuff in your build logs, but it’s behind the scenes for the most part.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: