Add pre-commit
checks
The big ones here are `trim-trailing-whitespace` and `end-of-file-fixer`
(which makes sure that every file ends with exactly one newline
character).
Change-Id: Idca73b640883188f068f9903e013cf0d82aa1123
This commit is contained in:
parent
a4f5bb951d
commit
2a98ba8b97
|
@ -48,4 +48,3 @@ PointerAlignment: Middle
|
|||
SortIncludes: Never
|
||||
SpaceAfterCStyleCast: true
|
||||
SpaceAfterTemplateKeyword: false
|
||||
|
||||
|
|
1
.github/workflows/hydra_status.yml
vendored
1
.github/workflows/hydra_status.yml
vendored
|
@ -17,4 +17,3 @@ jobs:
|
|||
with:
|
||||
fetch-depth: 0
|
||||
- run: bash scripts/check-hydra-status.sh
|
||||
|
||||
|
|
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -159,3 +159,5 @@ result-*
|
|||
buildtime.bin
|
||||
|
||||
.envrc.local
|
||||
# We generate this with a Nix shell hook
|
||||
/.pre-commit-config.yaml
|
||||
|
|
22
COPYING
22
COPYING
|
@ -55,7 +55,7 @@ modified by someone else and passed on, the recipients should know
|
|||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
|
@ -111,7 +111,7 @@ modification follow. Pay close attention to the difference between a
|
|||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
|
@ -146,7 +146,7 @@ such a program is covered only if its contents constitute a work based
|
|||
on the Library (independent of the use of the Library in a tool for
|
||||
writing it). Whether that is true depends on what the Library does
|
||||
and what the program that uses the Library does.
|
||||
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Library's
|
||||
complete source code as you receive it, in any medium, provided that
|
||||
you conspicuously and appropriately publish on each copy an
|
||||
|
@ -158,7 +158,7 @@ Library.
|
|||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
|
@ -216,7 +216,7 @@ instead of to this License. (If a newer version than version 2 of the
|
|||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
|
@ -267,7 +267,7 @@ Library will still fall under Section 6.)
|
|||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
|
@ -329,7 +329,7 @@ restrictions of other proprietary libraries that do not normally
|
|||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
|
@ -370,7 +370,7 @@ subject to these terms and conditions. You may not impose any further
|
|||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
|
@ -422,7 +422,7 @@ conditions either of that version or of any later version published by
|
|||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
|
@ -456,7 +456,7 @@ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
|||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
|
@ -500,5 +500,3 @@ necessary. Here is a sample; alter the names:
|
|||
Ty Coon, President of Vice
|
||||
|
||||
That's all there is to it!
|
||||
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ index 0468aaec..b348d869 100644
|
|||
+ size_t stack_limit;
|
||||
if (!EXPECT(GC_thr_initialized, TRUE))
|
||||
GC_thr_init();
|
||||
|
||||
|
||||
@@ -411,6 +412,19 @@ GC_INNER void GC_push_all_stacks(void)
|
||||
GC_push_all_stack_sections(lo, hi, p->traced_stack_sect);
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ index edab6c22..f2c61282 100644
|
|||
@@ -2172,6 +2172,11 @@ GC_API void GC_CALL GC_win32_free_heap(void);
|
||||
(*GC_amiga_allocwrapper_do)(a,GC_malloc_atomic_ignore_off_page)
|
||||
#endif /* _AMIGA && !GC_AMIGA_MAKINGLIB */
|
||||
|
||||
|
||||
+#if !__APPLE__
|
||||
+/* Patch doesn't work on apple */
|
||||
+#define NIX_BOEHM_PATCH_VERSION 1
|
||||
|
|
|
@ -3,7 +3,7 @@ index 597c7f13..587286be 100644
|
|||
--- a/include/gc_allocator.h
|
||||
+++ b/include/gc_allocator.h
|
||||
@@ -312,6 +312,7 @@ public:
|
||||
|
||||
|
||||
template<>
|
||||
class traceable_allocator<void> {
|
||||
+public:
|
||||
|
|
0
doc/manual/anchors.jq
Executable file → Normal file
0
doc/manual/anchors.jq
Executable file → Normal file
|
@ -37,4 +37,3 @@ error:
|
|||
|
||||
error: uh oh!
|
||||
```
|
||||
|
||||
|
|
|
@ -27,4 +27,3 @@
|
|||
/package-management/channels* /command-ref/nix-channel 301!
|
||||
|
||||
/package-management/s3-substituter* /command-ref/new-cli/nix3-help-stores#s3-binary-cache-store 301!
|
||||
|
||||
|
|
|
@ -102,13 +102,13 @@ In particular, notice the
|
|||
has copied the build results to that directory where you can examine it.
|
||||
|
||||
> []{#check-dirs-are-unregistered} **Note**
|
||||
>
|
||||
>
|
||||
> Check paths are not protected against garbage collection, and this
|
||||
> path will be deleted on the next garbage collection.
|
||||
>
|
||||
>
|
||||
> The path is guaranteed to be alive for the duration of
|
||||
> the `diff-hook`'s execution, but may be deleted any time after.
|
||||
>
|
||||
>
|
||||
> If the comparison is performed as part of automated tooling, please
|
||||
> use the diff-hook or author your tooling to handle the case where the
|
||||
> build was not deterministic and also a check path does not exist.
|
||||
|
@ -117,7 +117,7 @@ has copied the build results to that directory where you can examine it.
|
|||
already. If the derivation has not been built Nix will fail with the
|
||||
error:
|
||||
|
||||
error: some outputs of '/nix/store/hzi1h60z2qf0nb85iwnpvrai3j2w7rr6-unstable.drv'
|
||||
error: some outputs of '/nix/store/hzi1h60z2qf0nb85iwnpvrai3j2w7rr6-unstable.drv'
|
||||
are not valid, so checking is not possible
|
||||
|
||||
Run the build without `--check`, and then try with `--check` again.
|
||||
|
|
|
@ -112,4 +112,3 @@ Build inputs used as instructions to a build task are marked accordingly:
|
|||
| |
|
||||
+--------------------------------------------------------------------+
|
||||
```
|
||||
|
||||
|
|
|
@ -67,4 +67,3 @@ Configuration options can be set on the command line, overriding the values set
|
|||
The `extra-` prefix is supported for settings that take a list of items (e.g. `--extra-trusted users alice` or `--option extra-trusted-users alice`).
|
||||
|
||||
# Available settings
|
||||
|
||||
|
|
|
@ -184,4 +184,3 @@ channel:
|
|||
```console
|
||||
$ nix-env --file https://github.com/NixOS/nixpkgs/archive/nixos-14.12.tar.gz --install --attr firefox
|
||||
```
|
||||
|
||||
|
|
|
@ -30,4 +30,3 @@ $ nix-env --list-generations
|
|||
97 2004-02-06 16:22:45
|
||||
98 2004-02-06 16:24:33 (current)
|
||||
```
|
||||
|
||||
|
|
|
@ -212,4 +212,3 @@ To show all packages in the latest revision of the Nixpkgs repository:
|
|||
```console
|
||||
$ nix-env --file https://github.com/NixOS/nixpkgs/archive/master.tar.gz --query --available
|
||||
```
|
||||
|
||||
|
|
|
@ -79,4 +79,3 @@ To make files from `binutils` take precedence over files from `gcc`:
|
|||
$ nix-env --set-flag priority 5 binutils
|
||||
$ nix-env --set-flag priority 10 gcc
|
||||
```
|
||||
|
||||
|
|
|
@ -27,4 +27,3 @@ contain just Firefox:
|
|||
```console
|
||||
$ nix-env --profile /nix/var/nix/profiles/browser --set firefox
|
||||
```
|
||||
|
||||
|
|
|
@ -30,4 +30,3 @@ Switching will fail if the specified generation does not exist.
|
|||
$ nix-env --switch-generation 42
|
||||
switching from generation 50 to 42
|
||||
```
|
||||
|
||||
|
|
|
@ -138,4 +138,3 @@ This is illustrated by the following examples:
|
|||
2.3a < 2.3c
|
||||
2.3pre1 < 2.3c
|
||||
2.3pre1 < 2.3q
|
||||
|
||||
|
|
|
@ -32,4 +32,3 @@ This operation has the following options:
|
|||
$ nix-store --add-fixed sha256 ./hello-2.10.tar.gz
|
||||
/nix/store/3x7dwzq014bblazs7kq20p9hyzz0qh8g-hello-2.10.tar.gz
|
||||
```
|
||||
|
||||
|
|
|
@ -69,4 +69,3 @@ To delete at least 100 MiBs of unreachable paths:
|
|||
```console
|
||||
$ nix-store --gc --max-freed $((100 * 1024 * 1024))
|
||||
```
|
||||
|
||||
|
|
|
@ -33,4 +33,3 @@ The following options are allowed for all `nix-store` operations, but may not al
|
|||
If there are multiple results, then multiple symlinks will be
|
||||
created by sequentially numbering symlinks beyond the first one
|
||||
(e.g., `foo`, `foo-2`, `foo-3`, and so on).
|
||||
|
||||
|
|
|
@ -37,4 +37,3 @@ hashing files in `/nix/store/qhqx7l2f1kmwihc9bnxs7rc159hsxnf3-gcc-4.1.1'
|
|||
541838819 bytes (516.74 MiB) freed by hard-linking 54143 files;
|
||||
there are 114486 files with equal contents out of 215894 files in total
|
||||
```
|
||||
|
||||
|
|
|
@ -28,4 +28,3 @@ export stdenv; stdenv='/nix/store/7c8asx3yfrg5dg1gzhzyq2236zfgibnn-stdenv'
|
|||
export system; system='x86_64-linux'
|
||||
export _args; _args='-e /nix/store/9krlzvny65gdc8s7kpb6lkx8cd02c25c-default-builder.sh'
|
||||
```
|
||||
|
||||
|
|
|
@ -225,4 +225,3 @@ $ nix-store --query --roots $(which svn)
|
|||
/nix/var/nix/profiles/default-82-link
|
||||
/home/eelco/.local/state/nix/profiles/profile-97-link
|
||||
```
|
||||
|
||||
|
|
|
@ -35,4 +35,3 @@ ktorrent-2.2.1/
|
|||
ktorrent-2.2.1/NEWS
|
||||
...
|
||||
```
|
||||
|
||||
|
|
|
@ -32,4 +32,3 @@ $ nix-store --repair-path /nix/store/dj7a81wsm1ijwwpkks3725661h3263p5-glibc-2.13
|
|||
fetching path `/nix/store/d7a81wsm1ijwwpkks3725661h3263p5-glibc-2.13'...
|
||||
…
|
||||
```
|
||||
|
||||
|
|
|
@ -35,4 +35,3 @@ $ cat <<EOF >>/root/.ssh/authorized_keys
|
|||
command="nice -n20 nix-store --serve --write" ssh-rsa AAAAB3NzaC1yc2EAAAA...
|
||||
EOF
|
||||
```
|
||||
|
||||
|
|
|
@ -26,4 +26,3 @@ To verify the integrity of the `svn` command and all its dependencies:
|
|||
```console
|
||||
$ nix-store --verify-path $(nix-store --query --requisites $(which svn))
|
||||
```
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ Most Nix commands accept the following command-line options:
|
|||
Print even more informational messages.
|
||||
|
||||
- `4` “Debug”
|
||||
|
||||
|
||||
Print debug information.
|
||||
|
||||
- `5` “Vomit”
|
||||
|
|
|
@ -289,4 +289,3 @@ search/replaced in it for each new build.
|
|||
The installer now supports a `--tarball-url-prefix` flag which _may_ have
|
||||
solved this need?
|
||||
-->
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ Nix keeps its *store* (the place where packages are stored) in
|
|||
`--with-store-dir=path`.
|
||||
|
||||
> **Warning**
|
||||
>
|
||||
>
|
||||
> It is best *not* to change the Nix store from its default, since doing
|
||||
> so makes it impossible to use pre-built binaries from the standard
|
||||
> Nixpkgs channels — that is, all packages will need to be built from
|
||||
|
|
|
@ -14,7 +14,7 @@ builds) are forwarded to a *Nix daemon* running under the owner of the
|
|||
Nix store/database that performs the operation.
|
||||
|
||||
> **Note**
|
||||
>
|
||||
>
|
||||
> Multi-user mode has one important limitation: only root and a set of
|
||||
> trusted users specified in `nix.conf` can specify arbitrary binary
|
||||
> caches. So while unprivileged users may install packages from
|
||||
|
|
|
@ -145,4 +145,3 @@ which you may remove.
|
|||
> complete. macOS (Catalina+) directly controls root directories and its
|
||||
> read-only root will prevent you from manually deleting the empty `/nix`
|
||||
> mountpoint.
|
||||
|
||||
|
|
|
@ -146,65 +146,65 @@ three kinds of patterns:
|
|||
|
||||
- If a pattern is a single identifier, then the function matches any
|
||||
argument. Example:
|
||||
|
||||
|
||||
```nix
|
||||
let negate = x: !x;
|
||||
concat = x: y: x + y;
|
||||
in if negate true then concat "foo" "bar" else ""
|
||||
```
|
||||
|
||||
|
||||
Note that `concat` is a function that takes one argument and returns
|
||||
a function that takes another argument. This allows partial
|
||||
parameterisation (i.e., only filling some of the arguments of a
|
||||
function); e.g.,
|
||||
|
||||
|
||||
```nix
|
||||
map (concat "foo") [ "bar" "bla" "abc" ]
|
||||
```
|
||||
|
||||
|
||||
evaluates to `[ "foobar" "foobla" "fooabc" ]`.
|
||||
|
||||
- A *set pattern* of the form `{ name1, name2, …, nameN }` matches a
|
||||
set containing the listed attributes, and binds the values of those
|
||||
attributes to variables in the function body. For example, the
|
||||
function
|
||||
|
||||
|
||||
```nix
|
||||
{ x, y, z }: z + y + x
|
||||
```
|
||||
|
||||
|
||||
can only be called with a set containing exactly the attributes `x`,
|
||||
`y` and `z`. No other attributes are allowed. If you want to allow
|
||||
additional arguments, you can use an ellipsis (`...`):
|
||||
|
||||
|
||||
```nix
|
||||
{ x, y, z, ... }: z + y + x
|
||||
```
|
||||
|
||||
|
||||
This works on any set that contains at least the three named
|
||||
attributes.
|
||||
|
||||
|
||||
It is possible to provide *default values* for attributes, in
|
||||
which case they are allowed to be missing. A default value is
|
||||
specified by writing `name ? e`, where *e* is an arbitrary
|
||||
expression. For example,
|
||||
|
||||
|
||||
```nix
|
||||
{ x, y ? "foo", z ? "bar" }: z + y + x
|
||||
```
|
||||
|
||||
|
||||
specifies a function that only requires an attribute named `x`, but
|
||||
optionally accepts `y` and `z`.
|
||||
|
||||
- An `@`-pattern provides a means of referring to the whole value
|
||||
being matched:
|
||||
|
||||
|
||||
```nix
|
||||
args@{ x, y, z, ... }: z + y + x + args.a
|
||||
```
|
||||
|
||||
|
||||
but can also be written as:
|
||||
|
||||
|
||||
```nix
|
||||
{ x, y, z, ... } @ args: z + y + x + args.a
|
||||
```
|
||||
|
|
|
@ -24,22 +24,22 @@ the attributes of which specify the inputs of the build.
|
|||
|
||||
- Every attribute is passed as an environment variable to the builder.
|
||||
Attribute values are translated to environment variables as follows:
|
||||
|
||||
|
||||
- Strings and numbers are just passed verbatim.
|
||||
|
||||
|
||||
- A *path* (e.g., `../foo/sources.tar`) causes the referenced file
|
||||
to be copied to the store; its location in the store is put in
|
||||
the environment variable. The idea is that all sources should
|
||||
reside in the Nix store, since all inputs to a derivation should
|
||||
reside in the Nix store.
|
||||
|
||||
|
||||
- A *derivation* causes that derivation to be built prior to the
|
||||
present derivation; its default output path is put in the
|
||||
environment variable.
|
||||
|
||||
|
||||
- Lists of the previous types are also allowed. They are simply
|
||||
concatenated, separated by spaces.
|
||||
|
||||
|
||||
- `true` is passed as the string `1`, `false` and `null` are
|
||||
passed as an empty string.
|
||||
|
||||
|
@ -56,36 +56,36 @@ the attributes of which specify the inputs of the build.
|
|||
library doesn’t need the header files and documentation at runtime,
|
||||
and it doesn’t need the documentation at build time. Thus, the
|
||||
library package could specify:
|
||||
|
||||
|
||||
```nix
|
||||
outputs = [ "lib" "headers" "doc" ];
|
||||
```
|
||||
|
||||
|
||||
This will cause Nix to pass environment variables `lib`, `headers`
|
||||
and `doc` to the builder containing the intended store paths of each
|
||||
output. The builder would typically do something like
|
||||
|
||||
|
||||
```bash
|
||||
./configure \
|
||||
--libdir=$lib/lib \
|
||||
--includedir=$headers/include \
|
||||
--docdir=$doc/share/doc
|
||||
```
|
||||
|
||||
|
||||
for an Autoconf-style package. You can refer to each output of a
|
||||
derivation by selecting it as an attribute, e.g.
|
||||
|
||||
|
||||
```nix
|
||||
buildInputs = [ pkg.lib pkg.headers ];
|
||||
```
|
||||
|
||||
|
||||
The first element of `outputs` determines the *default output*.
|
||||
Thus, you could also write
|
||||
|
||||
|
||||
```nix
|
||||
buildInputs = [ pkg pkg.headers ];
|
||||
```
|
||||
|
||||
|
||||
since `pkg` is equivalent to `pkg.lib`.
|
||||
|
||||
The function `mkDerivation` in the Nixpkgs standard environment is a
|
||||
|
@ -103,24 +103,24 @@ The builder is executed as follows:
|
|||
specified above.
|
||||
|
||||
- In addition, the following variables are set:
|
||||
|
||||
|
||||
- `NIX_BUILD_TOP` contains the path of the temporary directory for
|
||||
this build.
|
||||
|
||||
|
||||
- Also, `TMPDIR`, `TEMPDIR`, `TMP`, `TEMP` are set to point to the
|
||||
temporary directory. This is to prevent the builder from
|
||||
accidentally writing temporary files anywhere else. Doing so
|
||||
might cause interference by other processes.
|
||||
|
||||
|
||||
- `PATH` is set to `/path-not-set` to prevent shells from
|
||||
initialising it to their built-in default value.
|
||||
|
||||
|
||||
- `HOME` is set to `/homeless-shelter` to prevent programs from
|
||||
using `/etc/passwd` or the like to find the user's home
|
||||
directory, which could cause impurity. Usually, when `HOME` is
|
||||
set, it is used as the location of the home directory, even if
|
||||
it points to a non-existent path.
|
||||
|
||||
|
||||
- `NIX_STORE` is set to the path of the top-level Nix store
|
||||
directory (typically, `/nix/store`).
|
||||
|
||||
|
@ -128,7 +128,7 @@ The builder is executed as follows:
|
|||
is set to `true` for the dervation. A detailed explanation of this
|
||||
behavior can be found in the
|
||||
[section about structured attrs](./advanced-attributes.md#adv-attr-structuredAttrs).
|
||||
|
||||
|
||||
- For each output declared in `outputs`, the corresponding
|
||||
environment variable is set to point to the intended path in the
|
||||
Nix store for that output. Each output path is a concatenation
|
||||
|
|
|
@ -161,4 +161,3 @@ All comparison operators are implemented in terms of `<`, and the following equi
|
|||
Equivalent to `!`*b1* `||` *b2*.
|
||||
|
||||
[Logical implication]: #logical-implication
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ $ nix-channel --update
|
|||
```
|
||||
|
||||
> **Note**
|
||||
>
|
||||
>
|
||||
> On NixOS, you’re automatically subscribed to a NixOS channel
|
||||
> corresponding to your NixOS major release (e.g.
|
||||
> <http://nixos.org/channels/nixos-21.11>). A NixOS channel is identical
|
||||
|
@ -120,7 +120,7 @@ will install the package called `subversion` from `nixpkgs` channel (which is, o
|
|||
[Subversion version management system](http://subversion.tigris.org/)).
|
||||
|
||||
> **Note**
|
||||
>
|
||||
>
|
||||
> When you ask Nix to install a package, it will first try to get it in
|
||||
> pre-compiled form from a *binary cache*. By default, Nix will use the
|
||||
> binary cache <https://cache.nixos.org>; it contains binaries for most
|
||||
|
|
|
@ -16,7 +16,7 @@ it will fall back to using the binary cache substituter, and then to
|
|||
building from source.
|
||||
|
||||
> **Note**
|
||||
>
|
||||
>
|
||||
> The SSH substituter currently does not allow you to enter an SSH
|
||||
> passphrase interactively. Therefore, you should use `ssh-add` to load
|
||||
> the decrypted private key into `ssh-agent`.
|
||||
|
|
|
@ -1,67 +1,67 @@
|
|||
# Release 0.10 (2006-10-06)
|
||||
|
||||
> **Note**
|
||||
>
|
||||
>
|
||||
> This version of Nix uses Berkeley DB 4.4 instead of 4.3. The database
|
||||
> is upgraded automatically, but you should be careful not to use old
|
||||
> versions of Nix that still use Berkeley DB 4.3. In particular, if you
|
||||
> use a Nix installed through Nix, you should run
|
||||
>
|
||||
>
|
||||
> $ nix-store --clear-substitutes
|
||||
>
|
||||
>
|
||||
> first.
|
||||
|
||||
> **Warning**
|
||||
>
|
||||
>
|
||||
> Also, the database schema has changed slighted to fix a performance
|
||||
> issue (see below). When you run any Nix 0.10 command for the first
|
||||
> time, the database will be upgraded automatically. This is
|
||||
> irreversible.
|
||||
|
||||
- `nix-env` usability improvements:
|
||||
|
||||
|
||||
- An option `--compare-versions` (or `-c`) has been added to
|
||||
`nix-env
|
||||
--query` to allow you to compare installed versions of packages
|
||||
to available versions, or vice versa. An easy way to see if you
|
||||
are up to date with what’s in your subscribed channels is
|
||||
`nix-env -qc \*`.
|
||||
|
||||
|
||||
- `nix-env --query` now takes as arguments a list of package names
|
||||
about which to show information, just like `--install`, etc.:
|
||||
for example, `nix-env -q gcc`. Note that to show all
|
||||
derivations, you need to specify `\*`.
|
||||
|
||||
|
||||
- `nix-env -i
|
||||
pkgname` will now install the highest available version of
|
||||
*pkgname*, rather than installing all available versions (which
|
||||
would probably give collisions) (`NIX-31`).
|
||||
|
||||
|
||||
- `nix-env (-i|-u) --dry-run` now shows exactly which missing
|
||||
paths will be built or substituted.
|
||||
|
||||
|
||||
- `nix-env -qa --description` shows human-readable descriptions of
|
||||
packages, provided that they have a `meta.description` attribute
|
||||
(which most packages in Nixpkgs don’t have yet).
|
||||
|
||||
- New language features:
|
||||
|
||||
|
||||
- Reference scanning (which happens after each build) is much
|
||||
faster and takes a constant amount of memory.
|
||||
|
||||
|
||||
- String interpolation. Expressions like
|
||||
|
||||
|
||||
"--with-freetype2-library=" + freetype + "/lib"
|
||||
|
||||
|
||||
can now be written as
|
||||
|
||||
|
||||
"--with-freetype2-library=${freetype}/lib"
|
||||
|
||||
|
||||
You can write arbitrary expressions within `${...}`, not just
|
||||
identifiers.
|
||||
|
||||
|
||||
- Multi-line string literals.
|
||||
|
||||
|
||||
- String concatenations can now involve derivations, as in the
|
||||
example `"--with-freetype2-library="
|
||||
+ freetype + "/lib"`. This was not previously possible because
|
||||
|
@ -69,17 +69,17 @@
|
|||
dependent on `freetype`. The evaluator now properly propagates
|
||||
this information. Consequently, the subpath operator (`~`) has
|
||||
been deprecated.
|
||||
|
||||
|
||||
- Default values of function arguments can now refer to other
|
||||
function arguments; that is, all arguments are in scope in the
|
||||
default values (`NIX-45`).
|
||||
|
||||
|
||||
- Lots of new built-in primitives, such as functions for list
|
||||
manipulation and integer arithmetic. See the manual for a
|
||||
complete list. All primops are now available in the set
|
||||
`builtins`, allowing one to test for the availability of primop
|
||||
in a backwards-compatible way.
|
||||
|
||||
|
||||
- Real let-expressions: `let x = ...;
|
||||
... z = ...; in ...`.
|
||||
|
||||
|
@ -89,15 +89,15 @@
|
|||
your machine and you want to copy it somewhere else.
|
||||
|
||||
- XML support:
|
||||
|
||||
|
||||
- `nix-env -q --xml` prints the installed or available packages in
|
||||
an XML representation for easy processing by other tools.
|
||||
|
||||
|
||||
- `nix-instantiate --eval-only
|
||||
--xml` prints an XML representation of the resulting term. (The
|
||||
new flag `--strict` forces ‘deep’ evaluation of the result,
|
||||
i.e., list elements and attributes are evaluated recursively.)
|
||||
|
||||
|
||||
- In Nix expressions, the primop `builtins.toXML` converts a term
|
||||
to an XML representation. This is primarily useful for passing
|
||||
structured information to builders.
|
||||
|
@ -133,21 +133,21 @@
|
|||
something other than `result`.
|
||||
|
||||
- Platform support:
|
||||
|
||||
|
||||
- Support for 64-bit platforms, provided a [suitably patched ATerm
|
||||
library](http://bugzilla.sen.cwi.nl:8080/show_bug.cgi?id=606) is
|
||||
used. Also, files larger than 2 GiB are now supported.
|
||||
|
||||
|
||||
- Added support for Cygwin (Windows, `i686-cygwin`), Mac OS X on
|
||||
Intel (`i686-darwin`) and Linux on PowerPC (`powerpc-linux`).
|
||||
|
||||
|
||||
- Users of SMP and multicore machines will appreciate that the
|
||||
number of builds to be performed in parallel can now be
|
||||
specified in the configuration file in the `build-max-jobs`
|
||||
setting.
|
||||
|
||||
- Garbage collector improvements:
|
||||
|
||||
|
||||
- Open files (such as running programs) are now used as roots of
|
||||
the garbage collector. This prevents programs that have been
|
||||
uninstalled from being garbage collected while they are still
|
||||
|
@ -155,17 +155,17 @@
|
|||
(`find-runtime-roots.pl`) is inherently system-specific, but it
|
||||
should work on Linux and on all platforms that have the `lsof`
|
||||
utility.
|
||||
|
||||
|
||||
- `nix-store --gc` (a.k.a. `nix-collect-garbage`) prints out the
|
||||
number of bytes freed on standard output. `nix-store
|
||||
--gc --print-dead` shows how many bytes would be freed by an
|
||||
actual garbage collection.
|
||||
|
||||
|
||||
- `nix-collect-garbage -d` removes all old generations of *all*
|
||||
profiles before calling the actual garbage collector (`nix-store
|
||||
--gc`). This is an easy way to get rid of all old packages in
|
||||
the Nix store.
|
||||
|
||||
|
||||
- `nix-store` now has an operation `--delete` to delete specific
|
||||
paths from the Nix store. It won’t delete reachable
|
||||
(non-garbage) paths unless `--ignore-liveness` is specified.
|
||||
|
@ -192,13 +192,13 @@
|
|||
memoisation of path hashing.
|
||||
|
||||
- Lots of bug fixes, notably:
|
||||
|
||||
|
||||
- Make sure that the garbage collector can run successfully when
|
||||
the disk is full (`NIX-18`).
|
||||
|
||||
|
||||
- `nix-env` now locks the profile to prevent races between
|
||||
concurrent `nix-env` operations on the same profile (`NIX-7`).
|
||||
|
||||
|
||||
- Removed misleading messages from `nix-env -i` (e.g.,
|
||||
``installing
|
||||
`foo'`` followed by ``uninstalling
|
||||
|
|
|
@ -50,7 +50,7 @@ on Nix. Here is an (incomplete) list:
|
|||
multiple packages with the same name, then pick the package with the
|
||||
highest priority, and only use the version if there are multiple
|
||||
packages with the same priority.
|
||||
|
||||
|
||||
This makes it possible to mark specific versions/variant in Nixpkgs
|
||||
more or less desirable than others. A typical example would be a
|
||||
beta version of some package (e.g., `gcc-4.2.0rc1`) which should not
|
||||
|
@ -62,14 +62,14 @@ on Nix. Here is an (incomplete) list:
|
|||
be modified. There are several attributes that can be usefully
|
||||
modified, because they affect the behaviour of `nix-env` or the user
|
||||
environment build script:
|
||||
|
||||
|
||||
- `meta.priority` can be changed to resolve filename clashes (see
|
||||
above).
|
||||
|
||||
|
||||
- `meta.keep` can be set to `true` to prevent the package from
|
||||
being upgraded or replaced. Useful if you want to hang on to an
|
||||
older version of a package.
|
||||
|
||||
|
||||
- `meta.active` can be set to `false` to “disable” the package.
|
||||
That is, no symlinks will be generated to the files of the
|
||||
package, but it remains part of the profile (so it won’t be
|
||||
|
|
|
@ -7,23 +7,23 @@
|
|||
Nix process crashes; no write access is needed for read-only
|
||||
operations; no more running out of Berkeley DB locks on certain
|
||||
operations.
|
||||
|
||||
|
||||
You still need to compile Nix with Berkeley DB support if you want
|
||||
Nix to automatically convert your old Nix store to the new schema.
|
||||
If you don’t need this, you can build Nix with the `configure`
|
||||
option `--disable-old-db-compat`.
|
||||
|
||||
|
||||
After the automatic conversion to the new schema, you can delete the
|
||||
old Berkeley DB files:
|
||||
|
||||
|
||||
$ cd /nix/var/nix/db
|
||||
$ rm __db* log.* derivers references referrers reserved validpaths DB_CONFIG
|
||||
|
||||
|
||||
The new metadata is stored in the directories `/nix/var/nix/db/info`
|
||||
and `/nix/var/nix/db/referrer`. Though the metadata is stored in
|
||||
human-readable plain-text files, they are not intended to be
|
||||
human-editable, as Nix is rather strict about the format.
|
||||
|
||||
|
||||
The new storage schema may or may not require less disk space than
|
||||
the Berkeley DB environment, mostly depending on the cluster size of
|
||||
your file system. With 1 KiB clusters (which seems to be the `ext3`
|
||||
|
@ -50,11 +50,11 @@
|
|||
last access time. This allows non-recently used stuff to be deleted.
|
||||
The option `--max-atime time` specifies an upper limit to the last
|
||||
accessed time of paths that may be deleted. For instance,
|
||||
|
||||
```
|
||||
|
||||
```
|
||||
$ nix-store --gc -v --max-atime $(date +%s -d "2 months ago")
|
||||
```
|
||||
|
||||
|
||||
deletes everything that hasn’t been accessed in two months.
|
||||
|
||||
- `nix-env` now uses optimistic profile locking when performing an
|
||||
|
@ -73,7 +73,7 @@
|
|||
now always shown by `nix-env`, `nix-store -r` and `nix-build`. The
|
||||
total download size of substitutable paths is now also shown. For
|
||||
instance, a build will show something like
|
||||
|
||||
|
||||
the following derivations will be built:
|
||||
/nix/store/129sbxnk5n466zg6r1qmq1xjv9zymyy7-activate-configuration.sh.drv
|
||||
/nix/store/7mzy971rdm8l566ch8hgxaf89x7lr7ik-upstart-jobs.drv
|
||||
|
@ -84,24 +84,24 @@
|
|||
...
|
||||
|
||||
- Language features:
|
||||
|
||||
|
||||
- @-patterns as in Haskell. For instance, in a function definition
|
||||
|
||||
|
||||
f = args @ {x, y, z}: ...;
|
||||
|
||||
|
||||
`args` refers to the argument as a whole, which is further
|
||||
pattern-matched against the attribute set pattern `{x, y, z}`.
|
||||
|
||||
|
||||
- “`...`” (ellipsis) patterns. An attribute set pattern can now
|
||||
say `...` at the end of the attribute name list to specify that
|
||||
the function takes *at least* the listed attributes, while
|
||||
ignoring additional attributes. For instance,
|
||||
|
||||
|
||||
{stdenv, fetchurl, fuse, ...}: ...
|
||||
|
||||
|
||||
defines a function that accepts any attribute set that includes
|
||||
at least the three listed attributes.
|
||||
|
||||
|
||||
- New primops: `builtins.parseDrvName` (split a package name
|
||||
string like `"nix-0.12pre12876"` into its name and version
|
||||
components, e.g. `"nix"` and `"0.12pre12876"`),
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
This is primarily a bug fix release. It has some new features:
|
||||
|
||||
- Syntactic sugar for writing nested attribute sets. Instead of
|
||||
|
||||
|
||||
{
|
||||
foo = {
|
||||
bar = 123;
|
||||
|
@ -11,15 +11,15 @@ This is primarily a bug fix release. It has some new features:
|
|||
};
|
||||
a = { b = { c = "d"; }; };
|
||||
}
|
||||
|
||||
|
||||
you can write
|
||||
|
||||
|
||||
{
|
||||
foo.bar = 123;
|
||||
foo.xyzzy = true;
|
||||
a.b.c = "d";
|
||||
}
|
||||
|
||||
|
||||
This is useful, for instance, in NixOS configuration files.
|
||||
|
||||
- Support for Nix channels generated by Hydra, the Nix-based
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
# Release 0.6 (2004-11-14)
|
||||
|
||||
- Rewrite of the normalisation engine.
|
||||
|
||||
|
||||
- Multiple builds can now be performed in parallel (option `-j`).
|
||||
|
||||
|
||||
- Distributed builds. Nix can now call a shell script to forward
|
||||
builds to Nix installations on remote machines, which may or may
|
||||
not be of the same platform type.
|
||||
|
||||
|
||||
- Option `--fallback` allows recovery from broken substitutes.
|
||||
|
||||
|
||||
- Option `--keep-going` causes building of other (unaffected)
|
||||
derivations to continue if one failed.
|
||||
|
||||
|
@ -28,32 +28,32 @@
|
|||
- Manual updates.
|
||||
|
||||
- `nix-env` changes:
|
||||
|
||||
|
||||
- Derivations for other platforms are filtered out (which can be
|
||||
overridden using `--system-filter`).
|
||||
|
||||
|
||||
- `--install` by default now uninstall previous derivations with
|
||||
the same name.
|
||||
|
||||
|
||||
- `--upgrade` allows upgrading to a specific version.
|
||||
|
||||
|
||||
- New operation `--delete-generations` to remove profile
|
||||
generations (necessary for effective garbage collection).
|
||||
|
||||
|
||||
- Nicer output (sorted, columnised).
|
||||
|
||||
- More sensible verbosity levels all around (builder output is now
|
||||
shown always, unless `-Q` is given).
|
||||
|
||||
- Nix expression language changes:
|
||||
|
||||
|
||||
- New language construct: `with
|
||||
E1;
|
||||
E2` brings all attributes defined in the attribute set *E1* in
|
||||
scope in *E2*.
|
||||
|
||||
|
||||
- Added a `map` function.
|
||||
|
||||
|
||||
- Various new operators (e.g., string concatenation).
|
||||
|
||||
- Expression evaluation is much faster.
|
||||
|
|
|
@ -39,29 +39,29 @@ Nix 0.8 has the following improvements:
|
|||
notion of “closure store expressions” is gone (and so is the notion
|
||||
of “successors”); the file system references of a store path are now
|
||||
just stored in the database.
|
||||
|
||||
|
||||
For instance, given any store path, you can query its closure:
|
||||
|
||||
|
||||
$ nix-store -qR $(which firefox)
|
||||
... lots of paths ...
|
||||
|
||||
|
||||
Also, Nix now remembers for each store path the derivation that
|
||||
built it (the “deriver”):
|
||||
|
||||
|
||||
$ nix-store -qR $(which firefox)
|
||||
/nix/store/4b0jx7vq80l9aqcnkszxhymsf1ffa5jd-firefox-1.0.1.drv
|
||||
|
||||
|
||||
So to see the build-time dependencies, you can do
|
||||
|
||||
|
||||
$ nix-store -qR $(nix-store -qd $(which firefox))
|
||||
|
||||
|
||||
or, in a nicer format:
|
||||
|
||||
|
||||
$ nix-store -q --tree $(nix-store -qd $(which firefox))
|
||||
|
||||
|
||||
File system references are also stored in reverse. For instance, you
|
||||
can query all paths that directly or indirectly use a certain Glibc:
|
||||
|
||||
|
||||
$ nix-store -q --referrers-closure \
|
||||
/nix/store/8lz9yc6zgmc0vlqmn2ipcpkjlmbi51vv-glibc-2.3.4
|
||||
|
||||
|
@ -92,28 +92,28 @@ Nix 0.8 has the following improvements:
|
|||
- `nix-channel` has new operations `--list` and `--remove`.
|
||||
|
||||
- New ways of installing components into user environments:
|
||||
|
||||
|
||||
- Copy from another user environment:
|
||||
|
||||
|
||||
$ nix-env -i --from-profile .../other-profile firefox
|
||||
|
||||
|
||||
- Install a store derivation directly (bypassing the Nix
|
||||
expression language entirely):
|
||||
|
||||
|
||||
$ nix-env -i /nix/store/z58v41v21xd3...-aterm-2.3.1.drv
|
||||
|
||||
|
||||
(This is used to implement `nix-install-package`, which is
|
||||
therefore immune to evolution in the Nix expression language.)
|
||||
|
||||
|
||||
- Install an already built store path directly:
|
||||
|
||||
|
||||
$ nix-env -i /nix/store/hsyj5pbn0d9i...-aterm-2.3.1
|
||||
|
||||
|
||||
- Install the result of a Nix expression specified as a
|
||||
command-line argument:
|
||||
|
||||
|
||||
$ nix-env -f .../i686-linux.nix -i -E 'x: x.firefoxWrapper'
|
||||
|
||||
|
||||
The difference with the normal installation mode is that `-E`
|
||||
does not use the `name` attributes of derivations. Therefore,
|
||||
this can be used to disambiguate multiple derivations with the
|
||||
|
@ -127,7 +127,7 @@ Nix 0.8 has the following improvements:
|
|||
- Implemented a concurrent garbage collector. It is now always safe to
|
||||
run the garbage collector, even if other Nix operations are
|
||||
happening simultaneously.
|
||||
|
||||
|
||||
However, there can still be GC races if you use `nix-instantiate`
|
||||
and `nix-store
|
||||
--realise` directly to build things. To prevent races, use the
|
||||
|
@ -147,13 +147,13 @@ Nix 0.8 has the following improvements:
|
|||
|
||||
- The behaviour of the garbage collector can be changed globally by
|
||||
setting options in `/nix/etc/nix/nix.conf`.
|
||||
|
||||
|
||||
- `gc-keep-derivations` specifies whether deriver links should be
|
||||
followed when searching for live paths.
|
||||
|
||||
|
||||
- `gc-keep-outputs` specifies whether outputs of derivations
|
||||
should be followed when searching for live paths.
|
||||
|
||||
|
||||
- `env-keep-derivations` specifies whether user environments
|
||||
should store the paths of derivations when they are added (thus
|
||||
keeping the derivations alive).
|
||||
|
|
|
@ -18,36 +18,36 @@ first.
|
|||
derivations can mutually refer to each other (as long as there are
|
||||
no data dependencies on the `outPath` and `drvPath` attributes
|
||||
computed by `derivation`).
|
||||
|
||||
|
||||
For example, the expression `derivation
|
||||
attrs` now evaluates to (essentially)
|
||||
|
||||
|
||||
attrs // {
|
||||
type = "derivation";
|
||||
outPath = derivation! attrs;
|
||||
drvPath = derivation! attrs;
|
||||
}
|
||||
|
||||
|
||||
where `derivation!` is a primop that does the actual derivation
|
||||
instantiation (i.e., it does what `derivation` used to do). The
|
||||
advantage is that it allows commands such as `nix-env -qa` and
|
||||
`nix-env -i` to be much faster since they no longer need to
|
||||
instantiate all derivations, just the `name` attribute.
|
||||
|
||||
|
||||
Also, it allows derivations to cyclically reference each other, for
|
||||
example,
|
||||
|
||||
|
||||
webServer = derivation {
|
||||
...
|
||||
hostName = "svn.cs.uu.nl";
|
||||
services = [svnService];
|
||||
};
|
||||
|
||||
|
||||
svnService = derivation {
|
||||
...
|
||||
hostName = webServer.hostName;
|
||||
};
|
||||
|
||||
|
||||
Previously, this would yield a black hole (infinite recursion).
|
||||
|
||||
- `nix-build` now defaults to using `./default.nix` if no Nix
|
||||
|
|
|
@ -5,26 +5,26 @@ This release has the following improvements:
|
|||
- On Linux, when doing a chroot build, Nix now uses various namespace
|
||||
features provided by the Linux kernel to improve build isolation.
|
||||
Namely:
|
||||
|
||||
|
||||
- The private network namespace ensures that builders cannot talk
|
||||
to the outside world (or vice versa): each build only sees a
|
||||
private loopback interface. This also means that two concurrent
|
||||
builds can listen on the same port (e.g. as part of a test)
|
||||
without conflicting with each other.
|
||||
|
||||
|
||||
- The PID namespace causes each build to start as PID 1. Processes
|
||||
outside of the chroot are not visible to those on the inside. On
|
||||
the other hand, processes inside the chroot *are* visible from
|
||||
the outside (though with different PIDs).
|
||||
|
||||
|
||||
- The IPC namespace prevents the builder from communicating with
|
||||
outside processes using SysV IPC mechanisms (shared memory,
|
||||
message queues, semaphores). It also ensures that all IPC
|
||||
objects are destroyed when the builder exits.
|
||||
|
||||
|
||||
- The UTS namespace ensures that builders see a hostname of
|
||||
`localhost` rather than the actual hostname.
|
||||
|
||||
|
||||
- The private mount namespace was already used by Nix to ensure
|
||||
that the bind-mounts used to set up the chroot are cleaned up
|
||||
automatically.
|
||||
|
|
|
@ -5,23 +5,23 @@ features:
|
|||
|
||||
- `nix-prefetch-url` can now download URLs specified in a Nix
|
||||
expression. For example,
|
||||
|
||||
|
||||
$ nix-prefetch-url -A hello.src
|
||||
|
||||
|
||||
will prefetch the file specified by the `fetchurl` call in the
|
||||
attribute `hello.src` from the Nix expression in the current
|
||||
directory, and print the cryptographic hash of the resulting file on
|
||||
stdout. This differs from `nix-build -A
|
||||
hello.src` in that it doesn't verify the hash, and is thus useful
|
||||
when you’re updating a Nix expression.
|
||||
|
||||
|
||||
You can also prefetch the result of functions that unpack a tarball,
|
||||
such as `fetchFromGitHub`. For example:
|
||||
|
||||
|
||||
$ nix-prefetch-url --unpack https://github.com/NixOS/patchelf/archive/0.8.tar.gz
|
||||
|
||||
|
||||
or from a Nix expression:
|
||||
|
||||
|
||||
$ nix-prefetch-url -A nix-repl.src
|
||||
|
||||
- The builtin function `<nix/fetchurl.nix>` now supports downloading
|
||||
|
@ -49,12 +49,12 @@ features:
|
|||
same derivation and `-K` is given, will make the output of the other
|
||||
run available under `store-path-check`. This makes it easier to
|
||||
investigate the non-determinism using tools like `diffoscope`, e.g.,
|
||||
|
||||
|
||||
$ nix-build pkgs/stdenv/linux -A stage1.pkgs.zlib --check -K
|
||||
error: derivation ‘/nix/store/l54i8wlw2265…-zlib-1.2.8.drv’ may not
|
||||
be deterministic: output ‘/nix/store/11a27shh6n2i…-zlib-1.2.8’
|
||||
differs from ‘/nix/store/11a27shh6n2i…-zlib-1.2.8-check’
|
||||
|
||||
|
||||
$ diffoscope /nix/store/11a27shh6n2i…-zlib-1.2.8 /nix/store/11a27shh6n2i…-zlib-1.2.8-check
|
||||
…
|
||||
├── lib/libz.a
|
||||
|
|
|
@ -8,9 +8,9 @@ This release has the following improvements and changes:
|
|||
binary caches to see if any of them has a pre-built binary of that
|
||||
path. The configuration setting `binary-caches` contains a list of
|
||||
URLs of binary caches. For instance, doing
|
||||
|
||||