3 ms·
I'm trying to read the docs and understand how nix works. It seems really fantastic but at the same time so radically different that it seems like it would coll
by optforfon 10y ago
I'm trying to read the docs and understand how nix works. It seems really fantastic but at the same time so radically different that it seems like it would collide with a lot of built in assumptions of Linux development.
For example, does nix play nice with CMake or config files? ie. I can just point them at the packages in /nix/ and it'll work?
Or for example, I often find myself wanting to have a few different version of OpenCV around (with different build flags) - but all version 3.0. Nix seems to make a new hash/folder when the dependencies change. Can you make make a new build/folder when the dependencies stay the same? (or specify to NOT make a new folder and to overwrite the previous compiled version - ex: you fix a bug)
I have a ton of overlapping dependencies between contracts and projects and this would be a cool tool to keep it all organized (right now in my workflow each project/contract would have it's own copy of OpenCV.. which is a bit of a mess)
(I'm totally cheering for this - hope it becomes mainstream, just wondering how "prime-time" is it)
- aristidb 10y agoNix supports CMake fine. In my experience adding new packages is not too hard as long as they're not GnuCash 2.6 ;) Any change will lead to a new output folder, there is no option of reusing them. Why not just give it a try in VirtualBox to see for yourself how far along it is?
- optforfon 10y agoI guess I understand why it has to make a new folder - it just seems that that would means you have to redirect (and relink) anything that uses a recompiled library. Okay, I'll definitely start to dive into this. I was asking around to see if it fits my workflow. thanks!
- Filligree 10y agoYes, that's exactly true. There are some workarounds, but they're a bit hacky and don't normally get used... Luckily there's a NixOS build cluster, so you don't normally need to recompile glibc yourself. :)
- cwp 10y agoYeah, there's a learning curve. No doubt about that. It does sound like nix is a good fit for your use case. You could certainly create separate environments each with a slightly different build of OpenCV. They'd share dependencies where possible, but not step on each other where they differ. Nix provides a tool called the standard environment (stdenv), which makes compiling classical unix software pretty easy. It assumes the typical download, configure, compile, install sequence and provides the right environment to make that work. It's really flexible, with lots of hooks that let you override the default behaviour and customize the build. The Nix manual has a pretty good overview of it. https://nixos.org/nixpkgs/manual/#chap-stdenv https://nixos.org/nixpkgs/manual/#chap-stdenv
- optforfon 10y agooh, very interesting! I'm definitely going to look into this further. Thanks for the pointers