4 ms·
Perhaps it is just me. But after so many attempts of trying to getting started with Nix, it is still not clear to me how to *author* Nix packages. My mental m
by RyEgswuCsn 3y ago
Perhaps it is just me. But after so many attempts of trying to getting started with Nix, it is still not clear to me how to *author* Nix packages. My mental model about Nix is that it resembles make, but for the whole dependency graph. I kind of hoped that the Nix language is more sane. I think there is a project of similar goals but the script is in Python? I remember finding it once, but couldn't recall its name.
- SkyMarshal 3y agoAre you thinking of Dhall? https://dhall-lang.org/ https://dhall-lang.org/ https://news.ycombinator.com/item?id=32102203 https://news.ycombinator.com/item?id=32102203 https://news.ycombinator.com/item?id=31658638 https://news.ycombinator.com/item?id=31658638
- RyEgswuCsn 3y agoFound it: https://github.com/spack/spack https://github.com/spack/spack
- rgoulter 3y ago> My mental model about Nix is that it resembles make, but for the whole dependency graph. Perhaps "Docker, without containers" would be a closer way to convey what Nix does. With Docker, images get built in a fresh/sandbox environment, and the resulting image is easy to distribute to other systems running Docker. > I kind of hoped that the Nix language is more sane. I think there is a project of similar goals but the script is in Python? A project quite related to "Nix (but not using a bespoke DSL)" is Guix, which uses Scheme. Perhaps you're thinking of Bazel? Which uses a Python-like language, and (AFAIU) is much closer to "like make, but for the whole dependency graph".
- RyEgswuCsn 3y agoMy understanding is that Nix was initially invented to solved the "producing builds with a fully specified dependencies graph" problem; people then figured out that it can dub as a package manager to support a better developer experience. Docker, on the other hand, was introduced to solve the deployment problem --- it provides light-weight isolation so that you get boggled in resolving dependency conflicts. Of course, people later also use it drive development environments, which I find quite sensible.
- Smaug123 3y agoPersonally I think of Nix mainly as analogous to "the part of Docker which concerns itself with producing the OCI artefact", but in a much less cursed way than via Dockerfile and `docker build`. (`docker build` is inherently cursed by design; `nix build` is cursed only through incidental facts about Nix, and it would be possible in principle to write a non-cursed frontend for it.)
- rgoulter 3y agoThe nix PhD is titled "The Purely Functional Software Deployment Model", which suggests that deployment was very much in mind with Nix. https://edolstra.github.io/pubs/phd-thesis.pdf https://edolstra.github.io/pubs/phd-thesis.pdf
- RyEgswuCsn 3y agoThat is very interesting. Skimming through the thesis, I find it fascinating introductory material to Nix. And you are correct, Nix started as a deployment tool. Although I'd argue in an era (1978!) when software are mostly distributed as source, reliable deployment largely implies reliable building from source.
- Macha 3y ago1978 is not the publish date of the thesis. The examples (Firefox, JDK 5, OpenSSL 0.9.7) should give away that it's newer, and also the most recent citation is from 2006. I'm not sure why the title page has a 1978 as I can't read Dutch. Google Translate indicates it might be a date of birth of the author, but that's a weird thing for the title page.
- jaculabilis 3y agonix.dev added a new tutorial for that recently: https://nix.dev/tutorials/learning-journey/packaging-existing-software https://nix.dev/tutorials/learning-journey/packaging-existin...
- lagrange77 3y ago> My mental model about Nix is that it resembles make, but for the whole dependency graph. I just started learning about nix a few days ago. I'm still a little bit confused and flakes are an abstraction, i didn't tackle so far. My mental model is, that it resembles sth. like virtual environments for python or nvm for node.js installations. At least that's what i want to use it for.