From f5dfe78a1eb5ff8dfcc7ab37cfc132c5f31d3cef Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Sat, 17 Dec 2016 18:05:21 +0000 Subject: 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. --- pkgs/stdenv/cross/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'pkgs/stdenv/cross') diff --git a/pkgs/stdenv/cross/default.nix b/pkgs/stdenv/cross/default.nix index 359d45b78b9..16f41671b76 100644 --- a/pkgs/stdenv/cross/default.nix +++ b/pkgs/stdenv/cross/default.nix @@ -1,10 +1,10 @@ { lib -, system, platform, crossSystem, config +, system, platform, crossSystem, config, overlays }: let bootStages = import ../. { - inherit lib system platform; + inherit lib system platform overlays; crossSystem = null; # Ignore custom stdenvs when cross compiling for compatability config = builtins.removeAttrs config [ "replaceStdenv" ]; @@ -18,7 +18,7 @@ in bootStages ++ [ # should be used to build compilers and other such tools targeting the cross # platform. Then, `forceNativeDrv` can be removed. (vanillaPackages: { - inherit system platform crossSystem config; + inherit system platform crossSystem config overlays; # It's OK to change the built-time dependencies allowCustomOverrides = true; stdenv = vanillaPackages.stdenv // { @@ -30,7 +30,7 @@ in bootStages ++ [ # Run packages (buildPackages: { - inherit system platform crossSystem config; + inherit system platform crossSystem config overlays; stdenv = if crossSystem.useiOSCross or false then let inherit (buildPackages.darwin.ios-cross { -- cgit 1.4.1