3 ms·
It is not necessary what it can do the problem, but how it does it. Looking at the page you link for example: https://nixos.org/manual/nix/stable/expressions/e
by greatgib 5y ago
It is not necessary what it can do the problem, but how it does it.
Looking at the page you link for example:
https://nixos.org/manual/nix/stable/expressions/expression-syntax.html https://nixos.org/manual/nix/stable/expressions/expression-s...
<<{ stdenv, fetchurl, perl }:>>
<<
Nix functions generally have the form { x, y, ..., z }: e where x, y, etc. are the names of the expected arguments, and where e is the body of the function.
>>
Strange, but let's say ok. But then, in the example, where does the function end?
Then,
<<"So we have to build a package. Building something from other stuff is called a derivation in Nix (as opposed to sources, which are built by humans instead of computers). >>
Looking at that, I say whaaaattt? "derivation" does not mean anything obvious to anyone used to build packages. And then, as the subtitle said, did they decide to use a weird name just to confuse everyone for the pleasure?
Then:
<<
A set is just a list of key/value pairs where each key is a string and each value is an arbitrary Nix expression. They take the general form { name1 = expr1; ... nameN = exprN; }.
>>
So, looking at the code, from far, function, sets, everything looks mixup ...
- soraminazuki 5y agoThe section you linked to was not specifically about syntax, but a high level overview that is explained in detail later on. For syntax, you should look at https://nixos.org/manual/nix/stable/expressions/expression-language.html https://nixos.org/manual/nix/stable/expressions/expression-l.... It should explain things like where how you write functions. > Looking at that, I say whaaaattt? "derivation" does not mean anything obvious to anyone used to build packages. And then, as the subtitle said, did they decide to use a weird name just to confuse everyone for the pleasure? The same kind of reaction can be made to any programming concept introduced in an introductory material. I don't think it's fair to ridicule Nix for defining its own technical terms, especially when the writing you referred to explains what it is. It is somewhat light on details, but you can't possibly expect an introductory section to explain it all at once. It should be enough to keep you going. But to answer your question, a derivation is the low-level build instruction that Nix's package builder can parse and build packages out of. You use the Nix language to convert high level package definitions to Nix derivations before feeding it to the package builders.