diff options
Diffstat (limited to 'doc/manual/src')
-rw-r--r-- | doc/manual/src/expressions/language-constructs.md | 16 | ||||
-rw-r--r-- | doc/manual/src/expressions/language-values.md | 6 | ||||
-rw-r--r-- | doc/manual/src/installation/multi-user.md | 6 |
3 files changed, 28 insertions, 0 deletions
diff --git a/doc/manual/src/expressions/language-constructs.md b/doc/manual/src/expressions/language-constructs.md index 121e4d998..20d003348 100644 --- a/doc/manual/src/expressions/language-constructs.md +++ b/doc/manual/src/expressions/language-constructs.md @@ -1,5 +1,7 @@ # Language Constructs +## Recursive sets + Recursive sets are just normal sets, but the attributes can refer to each other. For example, @@ -24,6 +26,8 @@ example, does not terminate\[1\]. +## Let-expressions + A let-expression allows you to define local variables for an expression. For instance, @@ -34,6 +38,8 @@ For instance, evaluates to `"foobar"`. +## Inheriting attributes + When defining a set or in a let-expression it is often convenient to copy variables from the surrounding lexical scope (e.g., when you want to propagate attributes). This can be shortened using the `inherit` @@ -95,6 +101,8 @@ is equivalent to when used while defining local variables in a let-expression or while defining a set. +## Functions + Functions have the following form: pattern: body @@ -187,6 +195,8 @@ you can bind them to an attribute, e.g., let concat = { x, y }: x + y; in concat { x = "foo"; y = "bar"; } +## Conditionals + Conditionals look like this: if e1 then e2 else e3 @@ -194,6 +204,8 @@ Conditionals look like this: where e1 is an expression that should evaluate to a Boolean value (`true` or `false`). +## Assertions + Assertions are generally used to check that certain requirements on or between features and dependencies hold. They look like this: @@ -257,6 +269,8 @@ The points of interest are: non-`null` value was passed. This prevents an unnecessary rebuild of Subversion if OpenSSL changes. +## With-expressions + A *with-expression*, with e1; e2 @@ -285,6 +299,8 @@ establishes the same scope as let a = 1; in let a = 2; in let a = 3; in let a = 4; in ... +## Comments + Comments can be single-line, started with a `#` character, or inline/multi-line, enclosed within `/* ... */`. diff --git a/doc/manual/src/expressions/language-values.md b/doc/manual/src/expressions/language-values.md index fac0be47e..8ffe2f0f9 100644 --- a/doc/manual/src/expressions/language-values.md +++ b/doc/manual/src/expressions/language-values.md @@ -1,5 +1,7 @@ # Values +## Simple Values + Nix has the following basic data types: - *Strings* can be written in three ways. @@ -127,6 +129,8 @@ Nix has the following basic data types: - The null value, denoted as `null`. +## Lists + Lists are formed by enclosing a whitespace-separated list of values between square brackets. For example, @@ -143,6 +147,8 @@ function and the fifth being a set. Note that lists are only lazy in values, and they are strict in length. +## Sets + Sets are really the core of the language, since ultimately the Nix language is all about creating derivations, which are really just sets of attributes to be passed to build scripts. diff --git a/doc/manual/src/installation/multi-user.md b/doc/manual/src/installation/multi-user.md index 6493e717b..4a861691d 100644 --- a/doc/manual/src/installation/multi-user.md +++ b/doc/manual/src/installation/multi-user.md @@ -20,6 +20,8 @@ Nix store/database that performs the operation. > caches. So while unprivileged users may install packages from > arbitrary Nix expressions, they may not get pre-built binaries. +## Setting up the build users + The *build users* are the special UIDs under which builds are performed. They should all be members of the *build users group* `nixbld`. This group should have no other members. The build users should not be @@ -35,6 +37,8 @@ This creates 10 build users. There can never be more concurrent builds than the number of build users, so you may want to increase this if you expect to do many builds at the same time. +## Running the daemon + The [Nix daemon](#sec-nix-daemon) should be started as follows (as `root`): @@ -50,6 +54,8 @@ should put a line like into the users’ login scripts. +## Restricting access + To limit which users can perform Nix operations, you can use the permissions on the directory `/nix/var/nix/daemon-socket`. For instance, if you want to restrict the use of Nix to the members of a group called |