I’m having a hard time wrapping my head around the entirety of nix and how I should/shouldn’t be doing things. I’m trying to figure out the best way of setting up development environments with a flake. I hop between different languages/pkg managers but my general question remains the same. How do I manage dependencies?
Currently I’m trying to setup an OCaml project and install dream via opam. It’s not in the ocamlPackages so I figure I have to build it. I’m not really sure the idiomatic way to setup a flake with a devshell that can build a package. Should I even bother trying to do that or just install a package like normal?
First off, that website is super cool! Thanks for that. I tried the opam-nix and it seems like it might do what I want but going to take a little more fiddling around. If I don’t get any replies on this thread and I figure it out I’ll update with my findings.
For other languages, well, every lang does its own thing. Doing things via nix will therefore always require some language-specific support, because there are no programming-wide standards for this.
For a lot of languages, such support exists. It’s most mature for traditional C/C++, because they’re so fundamental - much of distro packaging consists of wrangling basic shared libs to allow higher level builds to work at all.
Most other languages have some support somewhere, but flexibility, support and usage varies. Some live in nixpkgs, some are documented, many are neither.
This sucks, but it’s an artefact of the general heterogenity in the programming world.
I figured there would need to be different implementations on how to use/install packages per language. What’s challenging is trying to figure out how to do it myself if no solution exists or I’m unable to find one. I’ve been using NixOS for about a month and I’m starting to somewhat get a grasp on it but there is still a lot I don’t understand or is unclear.
Documentation seems kind of fragmented and even trying to sort through source code isn’t much clearer. It’s a struggle to just figure out what my expected inputs are and what my outputs needs to be. Nix syntax is easy enough but figuring out the “std lib” and conventions of the language is kind of a nightmare.
Yeah, unfortunately there isn’t much beyond that. Personally I find the source code clear enough when I can find what I’m looking for, but that’s not always a given.
The ecosystem is young and fragmented. Projects like dream2nix give me hope it’s all going somewhere though