5 ms·
Nix (the language, not to be confused with NixOS, the operating system) is not that hard to pickup, if you already know a programming language or two. Read thro
by capableweb 5y ago
Nix (the language, not to be confused with NixOS, the operating system) is not that hard to pickup, if you already know a programming language or two. Read through about the syntax and you'll get the gist in a couple of hours, and you basically know it inside out if you spend a day or two reading and experimenting with it. You just need to spend the time to understand it, and it's no longer a hurdle.
What I think really stops NixOS from gaining mainstream popularity (eh, mainstream like in the Linux ecosystem, not mainstream-mainstream) is the inability of just downloading binaries and running them, when you have to. It's a huge hurdle to try to figure out the right incarnation to set the lib paths correctly for the binaries but woops, it's actually using something else and now you need to do some other hacky thing. nix-autobahn et al exists but are also hacky and sometimes outright doesn't work, and then you're basically lost, unless you can rebuild the binary yourself, which unless it's free/open source software, you're unlikely to be able to do.
This, I think is the real reason people are avoiding to adopt it, because there is no easy solution to this problem, unlike the problem of syntax which can be solved by simply learning it.
- Ericson2314 5y agoYeah absolutely Don't get me wrong, Nix can and should be better in many respects, but: > Second, Nix surfaces all the complexity involved in building software and forces you to deal with it. Yes, and If you can't deal with the simple functional language Nix happens to come with, you will never be able to deal all that surfaced complexity. The latter is 10x worse more challenging. So in some sense the language is a decent filter for people who won't like the inevitable rest anyways.
- southerntofu 5y ago> So in some sense the language is a decent filter for people who won't like the inevitable rest anyways. I'm not saying i'd like to package complex systems with nix/guix, but i certainly would use them more to package my own projects if the ecosystem had better docs and error messages in regards to typing/syntax. I'm ready to carefully read through a 20 pages manual if that's what it takes, but i personally find the documentation and diagnostics of both projects to be sub-par compared to my expectations (looks really clear on paper, now why doesn't my declaration work?). Granted, i'm not a skilled engineer so maybe i'm not your target audience, but i believe as an amateur programmer/sysadmin i'm part of the target audience to package anything i find useful and/or my own programs.
- Ericson2314 5y agoYes, we should have types! Yes, we should have better docs! (I think we have a bad mix of authoritative reference and tutorial that fails on both counts.) But if you want types, I daresay you are already understanding the basics of how the functional language works :). I imagine your problems are less: wtf is: ((x: x x) (y: y y)) and more: wtf is stdenv, wtf is mkDerivation, wtf is a setup hook, why are othre build systems hacks on top of the autotools defaults, and not clean alternatives? etc. etc.
- southerntofu 5y ago> wtf is: ((x: x x) (y: y y)) Well to be fair i don't understand this syntax. But i guess i should be able to learn it in under one page of docs. > wtf is stdenv, wtf is mkDerivation, wtf is a setup hook, why are othre build systems hacks on top of the autotools defaults, and not clean alternatives? etc. etc. But yes my problem is that i don't have a list of standard options and their types so i end up doing copy-pasta of what works in another package and adjust until it works. On a higher level, i've found it harder than expected to turn an existing package declaration from nixOS into a source-provided build file to try and build a specific branch. Or to use an existing NixOS declaration to build a reproducible (and installable) liveUSB as there seems to be various tools doing this job but i couldn't get any of them to build successfully. I'm interested if you have good learning resources to share!
- Arubis 5y ago> Nix (the language, not to be confused with NixOS, the operating system) I do wish the documentation made this division clearer. Currently they’re a bit muddled together.
- capableweb 5y agoYeah, sometimes you have to rely a lot on context to understand if they're talking about Nix the package manager or Nix the language, but the documentation does mostly do it well by strictly saying things like "Nix package manager", "Nix Expression Language", "Nix Packages collection (Nixpkgs)" and "NixOS Linux distribution" so it's mostly clear, I think. The first guide you come across (https://nixos.org/guides/how-nix-works.html https://nixos.org/guides/how-nix-works.html) also shares the differences between them all. > Nix is a purely functional package manager > Packages are built from Nix expressions, which is a simple functional language > We provide a large set of Nix expressions containing thousands of existing Unix packages, the Nix Packages collection (Nixpkgs). > NixOS is based on Nix, a purely functional package management system. Nix stores all packages in isolation from each other under paths > In NixOS, the entire operating system — the kernel, applications, system packages, configuration files, and so on — is built by the Nix package manager from a description in a purely functional build language Lastly, the learn page (https://nixos.org/learn.html https://nixos.org/learn.html) links to three different manuals in the bottom, titled "Nix Manual", "Nixpkgs Manual" and "NixOS Manual" respectively. I'm sure if you find specific places in the manuals/guides/wikis where it's unclear which one is being referred to, they would really appreciate your help in fixing it, or at least pointing out it's not clear. They tend to be really responsive in the IRC channel the times I've talked with Nix people.
- bpye 5y agoI would be surprised if there are any binaries that are outright impossible to run under Nix. I spent a weekend getting Xilinx ISE to run in Nix [0], that is a binary behemoth. It uses bubblewrap (already used in Nixpkgs) to setup a bunch of bind mounts so that the binaries see a standard FHS Linux layout. [0] - https://github.com/benpye/nix-fpga-tools https://github.com/benpye/nix-fpga-tools
- capableweb 5y agoYeah, nothing is impossible if you have the time/energy to spend the effort :) I'm not saying there are binaries that are impossible to run, just that some of them are very hard to get running correctly if they have some special setup where the automated tools don't work very well with it. Things like Java programs that are wrapped in a shell-file that gets called from a binary tend to be a huge hassle to get setup correctly, while on other OSes like Arch Linux, you simply run the binary and it works. Again, not impossible to get them running, just a huge timesink.
- kfajdsl 5y ago> What I think really stops NixOS from gaining mainstream popularity ... is the inability of just downloading binaries and running them This is THE reason I switched from NixOS back to a mainstream distro (Fedora). However, I still use Nix for my development environments and builds for a lot of projects. I think adoption of Nix itself is more important than NixOS.