divnix / nix-book Goto Github PK
View Code? Open in Web Editor NEWThe Nix Package Manager
Home Page: https://book.divnix.com
License: Creative Commons Zero v1.0 Universal
The Nix Package Manager
Home Page: https://book.divnix.com
License: Creative Commons Zero v1.0 Universal
Somewhere in section 3. The Nix Language
, IFD should probably be explained. What it is, why it's useful, why it's problematic, and the fact that it's not allowed in nixpkgs.
Just need to write these down before I forget:
In https://book.divnix.com/ch05-01-language-basics.html#strings, it should probably mention that the maximum indentation level common across all lines in a ''
string is stripped.
This section:
nix-book/src/ch02-00-introduction.md
Lines 12 to 18 in f6448f4
The "Phases" chapter seems to be empty. If that's expected, it might help to have a note in there about it.
With Nix and its ecosystem evolving, I expect regular updates of the book.
Consider using https://semverdoc.org/ from the beginning to avoid confusion in the future.
Somewhere in https://book.divnix.com/ch05-01-language-basics.html inherit foo;
and inherit (foo) bar baz;
should probably be explained, as well as the fact that they can be used in both let
s and attrsets.
At this point:
nix-book/src/ch02-00-introduction.md
Lines 61 to 62 in f6448f4
In https://book.divnix.com/ch05-02-functions.html#functions, it should probably mention that the space after the :
in function syntax is not optional, especially since it doesn't mention url literal syntax. It's one of the aspects of syntax I found most confusing when learning nix, but as long as url literal syntax is still accepted, we can't do anything about it other than warn about it preemptively.
(x: x)
is the identity function, (x:x)
is the string "x:x".
Somewhere in https://book.divnix.com/ch04-00-derivations.html#fixed-output-derivations-fods it should probably mention the dangers of doing complex things inside FODs, given that this is a common newbie trap.
Maybe something like:
You may be tempted to put your build process itself into a FOD, particularly if your build system expects network access, but this is generally a bad idea in practice, as it results in fragile hashes, which make the resultant derivation impossible to reproduce before long. FODs should really only be used for processes that can be reasonably expected to produce bit-for-bit identical results, even across updates of the involved software and expected changes in the responses to network requests. Downloading a url, for example.
This:
nix-book/src/ch05-01-language-basics.md
Line 15 in f6448f4
foo/bar
is a valid path type, and .
is not. The core thing that makes something a path type is the inclusion of a /
, which is why starting with ./
is necessary for files in the current directory, and .
has to be represented as ./.
.This:
nix-book/src/ch05-01-language-basics.md
Lines 19 to 20 in f6448f4
import
, not path-types in general. It should go where imports are being discussed.There may be an upstream nomenclature emerging. When it does, shall we adopt?
Let me find the link, again...
A couple of code examples make use of classical nix, such as import <nixpkgs>
.
Since it's already hard to teach nix, it's probably even harder to teach a mixed syntax.
Don't have a strong opinion, this just jumped to my eyes, while flying over the text.
https://book.divnix.com/ch05-01-language-basics.html#attribute-set-attr-set should probably mention that you can set keys in nested attrsets with foo.bar =
, and that you can set multiple keys under the same top-level key with multiple lines, not necessarily grouped together:
{
foo.bar = 1;
quux = 2;
foo.baz = 3;
}
The fact that this also works for let
s... we can probably skip. :-P
Here are some typos that you can easily find with search:
Should be "its":
because it's assumptions
Typo:
Sytems
Should have capital "D"
Fixed-Output derivations
Misspelling:
yeild the store path that they create
This:
nix-book/src/ch04-00-derivations.md
Lines 15 to 16 in f6448f4
pkgs.fetchurl {...}
refers to pkgs.curl
, for example.A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.