Commit Graph

11 Commits

Author SHA1 Message Date
Matthew Bauer
5c7815a388
impure.nix: add crossSystem as arg 2017-04-29 15:22:33 -05:00
Tom Hunger
4a524cf662 Allow directories with a default.nix to be imported as an overlay. Closes #23016.
Note that ${} substitution doesn't work because of the "cannot refer
to other paths" constraint. The paranthesis are needed to enforce
right-first evaluation.
2017-02-25 02:32:04 +01:00
John Ericson
d680f541bf top-level: Hack around Nix's --arg logic not handling unnamed params 2017-02-09 11:54:17 -05:00
John Ericson
8cd4c31d6b top-level: Allow nixpkgs to take localSystem directly
This is instead of both system and platform, which is kind of ugly.
2017-02-08 22:06:57 -05:00
Eelco Dolstra
b70a979c69
Remove unnecessary "sort" call
attrNames already returns names in sorted order.
2017-02-01 20:29:34 +01:00
Eelco Dolstra
9d6a55aefd
~/.nixpkgs -> ~/.config/nixpkgs
The former is still respected as a fallback for config.nix for
backwards compatibility (but not for overlays because they're a new
feature).
2017-02-01 16:07:55 +01:00
Eelco Dolstra
7dacca324d
$NIXPKGS_OVERLAYS -> <nixpkgs-overlays>
The Nix search path is the established mechanism for specifying the
location of Nix expressions, so let's use it instead of adding another
environment variable.
2017-02-01 16:07:54 +01:00
Eelco Dolstra
86fe7a40ac
Only read overlays ending in .nix
For example, this prevents Nix from barfing on editor backup files in
~/.nixpkgs/overlays.
2017-02-01 16:07:54 +01:00
Nicolas B. Pierron
f9da1fa957 Throw an error if NIXPKGS_OVERLAYS is invalid and improve documentation. 2017-01-16 01:17:33 +01:00
Nicolas B. Pierron
f5dfe78a1e Add overlays mechanism to Nixpkgs.
This patch add a new argument to Nixpkgs default expression named "overlays".

By default, the value of the argument is either taken from the environment variable `NIXPKGS_OVERLAYS`,
or from the directory `~/.nixpkgs/overlays/`.  If the environment variable does not name a valid directory
then this mechanism would fallback on the home directory.  If the home directory does not exists it will
fallback on an empty list of overlays.

The overlays directory should contain the list of extra Nixpkgs stages which would be used to extend the
content of Nixpkgs, with additional set of packages.  The overlays, i-e directory, files, symbolic links
are used in alphabetical order.

The simplest overlay which extends Nixpkgs with nothing looks like:

```nix
self: super: {
}
```

More refined overlays can use `super` as the basis for building new packages, and `self` as a way to query
the final result of the fix-point.

An example of overlay which extends Nixpkgs with a small set of packages can be found at:
  https://github.com/nbp/nixpkgs-mozilla/blob/nixpkgs-overlay/moz-overlay.nix

To use this file, checkout the repository and add a symbolic link to
the `moz-overlay.nix` file in `~/.nixpkgs/overlays` directory.
2017-01-16 01:17:33 +01:00
John Ericson
4af2bf6663 Separate fix-point from config importing hacks and other impurities 2016-07-14 14:33:23 -07:00