From 915ab72d316fccb1f1a8c6d45f3b00d70a185bc5 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 9 Dec 2016 08:21:16 -0800 Subject: [PATCH 1/4] Separate truely top-level code from indices used per bootstrapping stage - Truely top level stays in `pkgs/top-level` - Indices go in `pkgs/indices` --- pkgs/{top-level => indices}/aliases.nix | 0 pkgs/{top-level => indices}/all-packages.nix | 0 pkgs/{top-level/stage.nix => indices/default.nix} | 0 pkgs/{top-level => indices}/dotnet-packages.nix | 0 pkgs/{top-level => indices}/emacs-packages.nix | 0 pkgs/{top-level => indices}/emscripten-packages.nix | 0 pkgs/{top-level => indices}/haskell-packages.nix | 0 pkgs/{top-level => indices}/lua-packages.nix | 0 pkgs/{top-level => indices}/node-packages-generated.nix | 0 pkgs/{top-level => indices}/node-packages.json | 0 pkgs/{top-level => indices}/node-packages.nix | 0 pkgs/{top-level => indices}/ocaml-packages.nix | 0 pkgs/{top-level => indices}/perl-packages.nix | 0 pkgs/{top-level => indices}/php-packages.nix | 0 pkgs/{top-level => indices}/pure-packages.nix | 0 pkgs/{top-level => indices}/python-packages.nix | 0 pkgs/{top-level => indices}/rust-packages.nix | 0 pkgs/top-level/default.nix | 2 +- 18 files changed, 1 insertion(+), 1 deletion(-) rename pkgs/{top-level => indices}/aliases.nix (100%) rename pkgs/{top-level => indices}/all-packages.nix (100%) rename pkgs/{top-level/stage.nix => indices/default.nix} (100%) rename pkgs/{top-level => indices}/dotnet-packages.nix (100%) rename pkgs/{top-level => indices}/emacs-packages.nix (100%) rename pkgs/{top-level => indices}/emscripten-packages.nix (100%) rename pkgs/{top-level => indices}/haskell-packages.nix (100%) rename pkgs/{top-level => indices}/lua-packages.nix (100%) rename pkgs/{top-level => indices}/node-packages-generated.nix (100%) rename pkgs/{top-level => indices}/node-packages.json (100%) rename pkgs/{top-level => indices}/node-packages.nix (100%) rename pkgs/{top-level => indices}/ocaml-packages.nix (100%) rename pkgs/{top-level => indices}/perl-packages.nix (100%) rename pkgs/{top-level => indices}/php-packages.nix (100%) rename pkgs/{top-level => indices}/pure-packages.nix (100%) rename pkgs/{top-level => indices}/python-packages.nix (100%) rename pkgs/{top-level => indices}/rust-packages.nix (100%) diff --git a/pkgs/top-level/aliases.nix b/pkgs/indices/aliases.nix similarity index 100% rename from pkgs/top-level/aliases.nix rename to pkgs/indices/aliases.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/indices/all-packages.nix similarity index 100% rename from pkgs/top-level/all-packages.nix rename to pkgs/indices/all-packages.nix diff --git a/pkgs/top-level/stage.nix b/pkgs/indices/default.nix similarity index 100% rename from pkgs/top-level/stage.nix rename to pkgs/indices/default.nix diff --git a/pkgs/top-level/dotnet-packages.nix b/pkgs/indices/dotnet-packages.nix similarity index 100% rename from pkgs/top-level/dotnet-packages.nix rename to pkgs/indices/dotnet-packages.nix diff --git a/pkgs/top-level/emacs-packages.nix b/pkgs/indices/emacs-packages.nix similarity index 100% rename from pkgs/top-level/emacs-packages.nix rename to pkgs/indices/emacs-packages.nix diff --git a/pkgs/top-level/emscripten-packages.nix b/pkgs/indices/emscripten-packages.nix similarity index 100% rename from pkgs/top-level/emscripten-packages.nix rename to pkgs/indices/emscripten-packages.nix diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/indices/haskell-packages.nix similarity index 100% rename from pkgs/top-level/haskell-packages.nix rename to pkgs/indices/haskell-packages.nix diff --git a/pkgs/top-level/lua-packages.nix b/pkgs/indices/lua-packages.nix similarity index 100% rename from pkgs/top-level/lua-packages.nix rename to pkgs/indices/lua-packages.nix diff --git a/pkgs/top-level/node-packages-generated.nix b/pkgs/indices/node-packages-generated.nix similarity index 100% rename from pkgs/top-level/node-packages-generated.nix rename to pkgs/indices/node-packages-generated.nix diff --git a/pkgs/top-level/node-packages.json b/pkgs/indices/node-packages.json similarity index 100% rename from pkgs/top-level/node-packages.json rename to pkgs/indices/node-packages.json diff --git a/pkgs/top-level/node-packages.nix b/pkgs/indices/node-packages.nix similarity index 100% rename from pkgs/top-level/node-packages.nix rename to pkgs/indices/node-packages.nix diff --git a/pkgs/top-level/ocaml-packages.nix b/pkgs/indices/ocaml-packages.nix similarity index 100% rename from pkgs/top-level/ocaml-packages.nix rename to pkgs/indices/ocaml-packages.nix diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/indices/perl-packages.nix similarity index 100% rename from pkgs/top-level/perl-packages.nix rename to pkgs/indices/perl-packages.nix diff --git a/pkgs/top-level/php-packages.nix b/pkgs/indices/php-packages.nix similarity index 100% rename from pkgs/top-level/php-packages.nix rename to pkgs/indices/php-packages.nix diff --git a/pkgs/top-level/pure-packages.nix b/pkgs/indices/pure-packages.nix similarity index 100% rename from pkgs/top-level/pure-packages.nix rename to pkgs/indices/pure-packages.nix diff --git a/pkgs/top-level/python-packages.nix b/pkgs/indices/python-packages.nix similarity index 100% rename from pkgs/top-level/python-packages.nix rename to pkgs/indices/python-packages.nix diff --git a/pkgs/top-level/rust-packages.nix b/pkgs/indices/rust-packages.nix similarity index 100% rename from pkgs/top-level/rust-packages.nix rename to pkgs/indices/rust-packages.nix diff --git a/pkgs/top-level/default.nix b/pkgs/top-level/default.nix index 658f149908c76..7fa227573b113 100644 --- a/pkgs/top-level/default.nix +++ b/pkgs/top-level/default.nix @@ -72,7 +72,7 @@ in let # Partially apply some arguments for building bootstraping stage pkgs # sets. Only apply arguments which no stdenv would want to override. - allPackages = newArgs: import ./stage.nix ({ + allPackages = newArgs: import ../indices ({ inherit lib nixpkgsFun; } // newArgs); From c33c3cc8b59fbe10685c9813f32d376c790d5845 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 16 Dec 2016 11:19:07 -0500 Subject: [PATCH 2/4] top-level: Big sed to fix fallout of reorg The command that did this was: (cd pkgs/indices; find -type f) | grep -v 'default\.nix' | cut -d/ -f2 | xargs -n1 -I % bash -c "git ls-files | xargs sed -i -e 's_top-level/%_indices/%_g'" --- .mention-bot | 4 +- asdf.nix | 1 + doc/coding-conventions.xml | 2 +- doc/languages-frameworks/lua.xml | 2 +- doc/languages-frameworks/perl.xml | 4 +- doc/languages-frameworks/python.md | 16 ++--- doc/quick-start.xml | 6 +- doc/release-notes.xml | 2 +- doc/submitting-changes.xml | 2 +- .../audio/groovebasin/default.nix | 2 +- pkgs/applications/editors/zed/default.nix | 2 +- .../irc/quassel-webserver/default.nix | 2 +- .../networking/irc/shout/default.nix | 2 +- pkgs/development/compilers/ghcjs/base.nix | 2 +- pkgs/development/compilers/uhc/default.nix | 2 +- .../python/cpython/2.6/default.nix | 2 +- .../python/cpython/2.7/default.nix | 2 +- .../python/cpython/3.3/default.nix | 2 +- .../python/cpython/3.4/default.nix | 2 +- .../python/cpython/3.5/default.nix | 2 +- .../python/cpython/3.6/default.nix | 2 +- .../interpreters/python/pypy/2.7/default.nix | 2 +- pkgs/development/interpreters/python/wrap.sh | 2 +- .../libraries/qt-5/5.6/default.nix | 2 +- .../libraries/qt-5/5.7/default.nix | 2 +- .../development/libraries/subunit/default.nix | 2 +- pkgs/tools/networking/airfield/default.nix | 2 +- pkgs/tools/networking/statsd/default.nix | 2 +- test.nix | 58 +++++++++++++++++++ 29 files changed, 97 insertions(+), 38 deletions(-) create mode 100644 asdf.nix create mode 100644 test.nix diff --git a/.mention-bot b/.mention-bot index d8529bd9123e3..d4e20f44807bb 100644 --- a/.mention-bot +++ b/.mention-bot @@ -5,9 +5,9 @@ "shlevy" ], "alwaysNotifyForPaths": [ - { "name": "FRidh", "files": ["pkgs/top-level/python-packages.nix", "pkgs/development/interpreters/python/*", "pkgs/development/python-modules/*" ] }, + { "name": "FRidh", "files": ["pkgs/indices/python-packages.nix", "pkgs/development/interpreters/python/*", "pkgs/development/python-modules/*" ] }, { "name": "LnL7", "files": ["pkgs/stdenv/darwin/*", "pkgs/os-specific/darwin/*"] }, { "name": "copumpkin", "files": ["pkgs/stdenv/darwin/*", "pkgs/os-specific/darwin/apple-source-releases/*"] } ], - "fileBlacklist": ["pkgs/top-level/all-packages.nix"] + "fileBlacklist": ["pkgs/indices/all-packages.nix"] } diff --git a/asdf.nix b/asdf.nix new file mode 100644 index 0000000000000..0967ef424bce6 --- /dev/null +++ b/asdf.nix @@ -0,0 +1 @@ +{} diff --git a/doc/coding-conventions.xml b/doc/coding-conventions.xml index 4348dc8bf720f..7acdcdf54a225 100644 --- a/doc/coding-conventions.xml +++ b/doc/coding-conventions.xml @@ -615,7 +615,7 @@ evaluate correctly. You can find many source fetch helpers in pkgs/build-support/fetch*. - In the file pkgs/top-level/all-packages.nix you can + In the file pkgs/indices/all-packages.nix you can find fetch helpers, these have names on the form fetchFrom*. The intention of these are to provide snapshot fetches but using the same api as some of the version controlled diff --git a/doc/languages-frameworks/lua.xml b/doc/languages-frameworks/lua.xml index 39b086af4cb13..1b61afd84f3c2 100644 --- a/doc/languages-frameworks/lua.xml +++ b/doc/languages-frameworks/lua.xml @@ -15,7 +15,7 @@ Lua packages are defined - in pkgs/top-level/lua-packages.nix. + in pkgs/indices/lua-packages.nix. Most of them are simple. For example: diff --git a/doc/languages-frameworks/perl.xml b/doc/languages-frameworks/perl.xml index dfb463b999126..1b1c3d5572423 100644 --- a/doc/languages-frameworks/perl.xml +++ b/doc/languages-frameworks/perl.xml @@ -10,7 +10,7 @@ standard Makefile.PL. It’s implemented in pkgs/development/perl-modules/generic. Perl packages from CPAN are defined in pkgs/top-level/perl-packages.nix, +xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/indices/perl-packages.nix">pkgs/indices/perl-packages.nix, rather than pkgs/all-packages.nix. Most Perl packages are so straight-forward to build that they are defined here directly, rather than having a separate function for each package @@ -172,7 +172,7 @@ $ nix-generate-from-cpan XML::Simple The output can be pasted into -pkgs/top-level/perl-packages.nix or wherever else +pkgs/indices/perl-packages.nix or wherever else you need it. diff --git a/doc/languages-frameworks/python.md b/doc/languages-frameworks/python.md index e7a8b034a112f..1bf04420d06e3 100644 --- a/doc/languages-frameworks/python.md +++ b/doc/languages-frameworks/python.md @@ -98,7 +98,7 @@ We will first have a look at how Python packages are packaged on Nix. Then, we w #### Python packaging on Nix On Nix all packages are built by functions. The main function in Nix for building Python packages is [`buildPythonPackage`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/python-modules/generic/default.nix). -Let's see how we would build the `toolz` package. According to [`python-packages.nix`](https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/python-packages.nix) `toolz` is build using +Let's see how we would build the `toolz` package. According to [`python-packages.nix`](https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/indices/python-packages.nix) `toolz` is build using ```nix toolz = buildPythonPackage rec{ @@ -132,7 +132,7 @@ The output of the function is a derivation, which is an attribute with the name so `python27Packages`, `python34Packages`, `python35Packages` and `pypyPackages`. The above example works when you're directly working on -`pkgs/top-level/python-packages.nix` in the Nixpkgs repository. Often though, +`pkgs/indices/python-packages.nix` in the Nixpkgs repository. Often though, you will want to test a Nix expression outside of the Nixpkgs tree. If you create a `shell.nix` file with the following contents @@ -442,15 +442,15 @@ Python libraries and applications that use `setuptools` or `distutils` are typically build with respectively the `buildPythonPackage` and `buildPythonApplication` functions. These two functions also support installing a `wheel`. -All Python packages reside in `pkgs/top-level/python-packages.nix` and all +All Python packages reside in `pkgs/indices/python-packages.nix` and all applications elsewhere. In case a package is used as both a library and an application, -then the package should be in `pkgs/top-level/python-packages.nix` since only those packages are made +then the package should be in `pkgs/indices/python-packages.nix` since only those packages are made available for all interpreter versions. The preferred location for library expressions is in `pkgs/development/python-modules`. It is important that these packages are -called from `pkgs/top-level/python-packages.nix` and not elsewhere, to guarantee +called from `pkgs/indices/python-packages.nix` and not elsewhere, to guarantee the right version of the package is built. -Based on the packages defined in `pkgs/top-level/python-packages.nix` an +Based on the packages defined in `pkgs/indices/python-packages.nix` an attribute set is created for each available Python interpreter. The available sets are @@ -516,7 +516,7 @@ as the interpreter unless overriden otherwise. All parameters from `mkDerivation` function are still supported. * `namePrefix`: Prepended text to `${name}` parameter. Defaults to `"python3.3-"` for Python 3.3, etc. Set it to `""` if you're packaging an application or a command line tool. -* `disabled`: If `true`, package is not build for particular python interpreter version. Grep around `pkgs/top-level/python-packages.nix` for examples. +* `disabled`: If `true`, package is not build for particular python interpreter version. Grep around `pkgs/indices/python-packages.nix` for examples. * `setupPyBuildFlags`: List of flags passed to `setup.py build_ext` command. * `pythonPath`: List of packages to be added into `$PYTHONPATH`. Packages in `pythonPath` are not propagated (contrary to `propagatedBuildInputs`). * `preShellHook`: Hook to execute commands before `shellHook`. @@ -812,5 +812,5 @@ Following rules are desired to be respected: * Make sure package builds for all python interpreters. Use `disabled` argument to `buildPythonPackage` to set unsupported interpreters. * If tests need to be disabled for a package, make sure you leave a comment about reasoning. -* Packages in `pkgs/top-level/python-packages.nix` are sorted quasi-alphabetically to avoid merge conflicts. +* Packages in `pkgs/indices/python-packages.nix` are sorted quasi-alphabetically to avoid merge conflicts. * Python libraries are supposed to be in `python-packages.nix` and packaged with `buildPythonPackage`. Python applications live outside of `python-packages.nix` and are packaged with `buildPythonApplication`. diff --git a/doc/quick-start.xml b/doc/quick-start.xml index 5ed959abacec5..5dc168cf9f0df 100644 --- a/doc/quick-start.xml +++ b/doc/quick-start.xml @@ -109,7 +109,7 @@ $ git add pkgs/development/libraries/libfoo/default.nix XML::Simple, a Perl module: pkgs/top-level/perl-packages.nix + xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/indices/perl-packages.nix">pkgs/indices/perl-packages.nix (search for the XMLSimple attribute). Most Perl modules are so simple to build that they are defined directly in perl-packages.nix; @@ -171,12 +171,12 @@ $ git add pkgs/development/libraries/libfoo/default.nix Add a call to the function defined in the previous step to pkgs/top-level/all-packages.nix + xlink:href="https://github.com/NixOS/nixpkgs/blob/master/pkgs/indices/all-packages.nix">pkgs/indices/all-packages.nix with some descriptive name for the variable, e.g. libfoo. -$ emacs pkgs/top-level/all-packages.nix +$ emacs pkgs/indices/all-packages.nix diff --git a/doc/release-notes.xml b/doc/release-notes.xml index a50ee877acdda..8f1afbc362d62 100644 --- a/doc/release-notes.xml +++ b/doc/release-notes.xml @@ -346,7 +346,7 @@ xlink:href='http://nixos.org/releases/nix/nix-0.10/'>Nix pkgs/system/all-packages-generic.nix is gone, we now just have - pkgs/top-level/all-packages.nix that contains + pkgs/indices/all-packages.nix that contains all available packages. This should cause much less confusion with users. all-packages.nix is a function that by default returns packages for the current platform, but you can diff --git a/doc/submitting-changes.xml b/doc/submitting-changes.xml index 0b09dffbb2d33..84a2f8664e56a 100644 --- a/doc/submitting-changes.xml +++ b/doc/submitting-changes.xml @@ -125,7 +125,7 @@ Additional information. -Make sure it's in pkgs/top-level/all-packages.nix +Make sure it's in pkgs/indices/all-packages.nix diff --git a/pkgs/applications/audio/groovebasin/default.nix b/pkgs/applications/audio/groovebasin/default.nix index 7eb2e85f7bedf..b42bb4286654b 100644 --- a/pkgs/applications/audio/groovebasin/default.nix +++ b/pkgs/applications/audio/groovebasin/default.nix @@ -3,7 +3,7 @@ with stdenv.lib; let - nodePackages = callPackage (import ../../../top-level/node-packages.nix) { + nodePackages = callPackage (import ../../../indices/node-packages.nix) { inherit nodejs; neededNatives = [ libgroove python utillinux ]; self = nodePackages; diff --git a/pkgs/applications/editors/zed/default.nix b/pkgs/applications/editors/zed/default.nix index 0170319871f06..062938ce101b0 100644 --- a/pkgs/applications/editors/zed/default.nix +++ b/pkgs/applications/editors/zed/default.nix @@ -9,7 +9,7 @@ let # fetch package.json from Zed's repository # run `npm2nix package.json node.nix` # and replace node.nix with new one - nodePackages = import ../../../../pkgs/top-level/node-packages.nix { + nodePackages = import ../../../../pkgs/indices/node-packages.nix { inherit pkgs; inherit (pkgs) stdenv nodejs fetchurl fetchgit; neededNatives = [ pkgs.python ] ++ pkgs.lib.optional pkgs.stdenv.isLinux pkgs.utillinux; diff --git a/pkgs/applications/networking/irc/quassel-webserver/default.nix b/pkgs/applications/networking/irc/quassel-webserver/default.nix index 4ca3d619aa694..dbdd0abe92d4c 100644 --- a/pkgs/applications/networking/irc/quassel-webserver/default.nix +++ b/pkgs/applications/networking/irc/quassel-webserver/default.nix @@ -3,7 +3,7 @@ with lib; let - nodePackages = callPackage ../../../../top-level/node-packages.nix { + nodePackages = callPackage ../../../../indices/node-packages.nix { neededNatives = [ python ]; self = nodePackages; generated = ./quassel-webserver.nix; diff --git a/pkgs/applications/networking/irc/shout/default.nix b/pkgs/applications/networking/irc/shout/default.nix index 9d3e3ba449c3b..95e2e946661f6 100644 --- a/pkgs/applications/networking/irc/shout/default.nix +++ b/pkgs/applications/networking/irc/shout/default.nix @@ -3,7 +3,7 @@ with stdenv.lib; let - nodePackages = callPackage (import ../../../../top-level/node-packages.nix) { + nodePackages = callPackage (import ../../../../indices/node-packages.nix) { neededNatives = [ python ] ++ optional (stdenv.isLinux) utillinux; self = nodePackages; generated = ./package.nix; diff --git a/pkgs/development/compilers/ghcjs/base.nix b/pkgs/development/compilers/ghcjs/base.nix index f8b861311d601..e634ea72a68e3 100644 --- a/pkgs/development/compilers/ghcjs/base.nix +++ b/pkgs/development/compilers/ghcjs/base.nix @@ -161,7 +161,7 @@ in mkDerivation (rec { --with-gmp-libraries ${gmp.out}/lib ''; passthru = let - ghcjsNodePkgs = callPackage ../../../top-level/node-packages.nix { + ghcjsNodePkgs = callPackage ../../../indices/node-packages.nix { generated = ./node-packages-generated.nix; self = ghcjsNodePkgs; }; diff --git a/pkgs/development/compilers/uhc/default.nix b/pkgs/development/compilers/uhc/default.nix index d200579168059..f394daa64e95d 100644 --- a/pkgs/development/compilers/uhc/default.nix +++ b/pkgs/development/compilers/uhc/default.nix @@ -1,5 +1,5 @@ # Note: The Haskell package set used for building UHC is -# determined in the file top-level/haskell-packages.nix. +# determined in the file indices/haskell-packages.nix. { stdenv, coreutils, m4, libtool, clang, ghcWithPackages, fetchFromGitHub }: let wrappedGhc = ghcWithPackages (hpkgs: with hpkgs; [fgl vector syb uulib network binary hashable uhc-util mtl transformers directory containers array process filepath shuffle uuagc] ); diff --git a/pkgs/development/interpreters/python/cpython/2.6/default.nix b/pkgs/development/interpreters/python/cpython/2.6/default.nix index 9a4c2d5b39818..5427b76b55595 100644 --- a/pkgs/development/interpreters/python/cpython/2.6/default.nix +++ b/pkgs/development/interpreters/python/cpython/2.6/default.nix @@ -103,7 +103,7 @@ let ''; passthru = let - pythonPackages = callPackage ../../../../../top-level/python-packages.nix {python=self; overrides=packageOverrides;}; + pythonPackages = callPackage ../../../../../indices/python-packages.nix {python=self; overrides=packageOverrides;}; in rec { inherit libPrefix; inherit zlibSupport; diff --git a/pkgs/development/interpreters/python/cpython/2.7/default.nix b/pkgs/development/interpreters/python/cpython/2.7/default.nix index 4a25382997c36..5c682927ca733 100644 --- a/pkgs/development/interpreters/python/cpython/2.7/default.nix +++ b/pkgs/development/interpreters/python/cpython/2.7/default.nix @@ -182,7 +182,7 @@ in stdenv.mkDerivation { ''; passthru = let - pythonPackages = callPackage ../../../../../top-level/python-packages.nix {python=self; overrides=packageOverrides;}; + pythonPackages = callPackage ../../../../../indices/python-packages.nix {python=self; overrides=packageOverrides;}; in rec { inherit libPrefix sitePackages x11Support hasDistutilsCxxPatch; executable = libPrefix; diff --git a/pkgs/development/interpreters/python/cpython/3.3/default.nix b/pkgs/development/interpreters/python/cpython/3.3/default.nix index 6a543a8a0ee0c..bfcc17c2a3a61 100644 --- a/pkgs/development/interpreters/python/cpython/3.3/default.nix +++ b/pkgs/development/interpreters/python/cpython/3.3/default.nix @@ -104,7 +104,7 @@ in stdenv.mkDerivation { ''; passthru = let - pythonPackages = callPackage ../../../../../top-level/python-packages.nix {python=self; overrides=packageOverrides;}; + pythonPackages = callPackage ../../../../../indices/python-packages.nix {python=self; overrides=packageOverrides;}; in rec { inherit libPrefix sitePackages x11Support; executable = "${libPrefix}m"; diff --git a/pkgs/development/interpreters/python/cpython/3.4/default.nix b/pkgs/development/interpreters/python/cpython/3.4/default.nix index 623fa5d74f648..0d8dda4418c8d 100644 --- a/pkgs/development/interpreters/python/cpython/3.4/default.nix +++ b/pkgs/development/interpreters/python/cpython/3.4/default.nix @@ -113,7 +113,7 @@ in stdenv.mkDerivation { ''; passthru = let - pythonPackages = callPackage ../../../../../top-level/python-packages.nix {python=self; overrides=packageOverrides;}; + pythonPackages = callPackage ../../../../../indices/python-packages.nix {python=self; overrides=packageOverrides;}; in rec { inherit libPrefix sitePackages x11Support; executable = "${libPrefix}m"; diff --git a/pkgs/development/interpreters/python/cpython/3.5/default.nix b/pkgs/development/interpreters/python/cpython/3.5/default.nix index 7172e429f236a..43965b27226fd 100644 --- a/pkgs/development/interpreters/python/cpython/3.5/default.nix +++ b/pkgs/development/interpreters/python/cpython/3.5/default.nix @@ -112,7 +112,7 @@ in stdenv.mkDerivation { ''; passthru = let - pythonPackages = callPackage ../../../../../top-level/python-packages.nix {python=self; overrides=packageOverrides;}; + pythonPackages = callPackage ../../../../../indices/python-packages.nix {python=self; overrides=packageOverrides;}; in rec { inherit libPrefix sitePackages x11Support; executable = "${libPrefix}m"; diff --git a/pkgs/development/interpreters/python/cpython/3.6/default.nix b/pkgs/development/interpreters/python/cpython/3.6/default.nix index 4654a6e1cb61a..d3872c841261c 100644 --- a/pkgs/development/interpreters/python/cpython/3.6/default.nix +++ b/pkgs/development/interpreters/python/cpython/3.6/default.nix @@ -101,7 +101,7 @@ in stdenv.mkDerivation { ''; passthru = let - pythonPackages = callPackage ../../../../../top-level/python-packages.nix {python=self; overrides=packageOverrides;}; + pythonPackages = callPackage ../../../../../indices/python-packages.nix {python=self; overrides=packageOverrides;}; in rec { inherit libPrefix sitePackages x11Support; executable = "${libPrefix}m"; diff --git a/pkgs/development/interpreters/python/pypy/2.7/default.nix b/pkgs/development/interpreters/python/pypy/2.7/default.nix index 1fd9eaee43037..addb0b6a81cb4 100644 --- a/pkgs/development/interpreters/python/pypy/2.7/default.nix +++ b/pkgs/development/interpreters/python/pypy/2.7/default.nix @@ -124,7 +124,7 @@ let ''; passthru = let - pythonPackages = callPackage ../../../../../top-level/python-packages.nix {python=self; overrides=packageOverrides;}; + pythonPackages = callPackage ../../../../../indices/python-packages.nix {python=self; overrides=packageOverrides;}; in rec { inherit zlibSupport libPrefix; executable = "pypy"; diff --git a/pkgs/development/interpreters/python/wrap.sh b/pkgs/development/interpreters/python/wrap.sh index f4b63b826403b..6e97a8acd5eda 100644 --- a/pkgs/development/interpreters/python/wrap.sh +++ b/pkgs/development/interpreters/python/wrap.sh @@ -30,7 +30,7 @@ patchPythonScript() { # The magicalSedExpression will invoke a "$(basename "$f")", so # if you change $f to something else, be sure to also change it - # in pkgs/top-level/python-packages.nix! + # in pkgs/indices/python-packages.nix! # It also uses $program_PYTHONPATH. sed -i "$f" -re '@magicalSedExpression@' } diff --git a/pkgs/development/libraries/qt-5/5.6/default.nix b/pkgs/development/libraries/qt-5/5.6/default.nix index 687708d98efa5..fc860ac8cbe62 100644 --- a/pkgs/development/libraries/qt-5/5.6/default.nix +++ b/pkgs/development/libraries/qt-5/5.6/default.nix @@ -4,7 +4,7 @@ Before a major version update, make a copy of this directory. (We like to keep the old version around for a short time after major updates.) Add a -top-level attribute to `top-level/all-packages.nix`. +top-level attribute to `indices/all-packages.nix`. 1. Update the URL in `maintainers/scripts/generate-qt.sh`. 2. From the top of the Nixpkgs tree, run diff --git a/pkgs/development/libraries/qt-5/5.7/default.nix b/pkgs/development/libraries/qt-5/5.7/default.nix index 9c35e814a04e4..5c0397666810b 100644 --- a/pkgs/development/libraries/qt-5/5.7/default.nix +++ b/pkgs/development/libraries/qt-5/5.7/default.nix @@ -4,7 +4,7 @@ Before a major version update, make a copy of this directory. (We like to keep the old version around for a short time after major updates.) Add a -top-level attribute to `top-level/all-packages.nix`. +top-level attribute to `indices/all-packages.nix`. 1. Update the URL in `maintainers/scripts/generate-qt.sh`. 2. From the top of the Nixpkgs tree, run diff --git a/pkgs/development/libraries/subunit/default.nix b/pkgs/development/libraries/subunit/default.nix index e4a767579ab78..32ed65befe0d4 100644 --- a/pkgs/development/libraries/subunit/default.nix +++ b/pkgs/development/libraries/subunit/default.nix @@ -1,6 +1,6 @@ { stdenv, fetchurl, pkgconfig, check, cppunit, perl, pythonPackages }: -# NOTE: for subunit python library see pkgs/top-level/python-packages.nix +# NOTE: for subunit python library see pkgs/indices/python-packages.nix stdenv.mkDerivation rec { name = "subunit-${version}"; diff --git a/pkgs/tools/networking/airfield/default.nix b/pkgs/tools/networking/airfield/default.nix index 3c8e965472594..7eb87ea830ff3 100644 --- a/pkgs/tools/networking/airfield/default.nix +++ b/pkgs/tools/networking/airfield/default.nix @@ -3,7 +3,7 @@ with stdenv.lib; let - nodePackages = callPackage (import ../../../top-level/node-packages.nix) { + nodePackages = callPackage (import ../../../indices/node-packages.nix) { neededNatives = [python] ++ optional (stdenv.isLinux) utillinux; self = nodePackages; generated = ./package.nix; diff --git a/pkgs/tools/networking/statsd/default.nix b/pkgs/tools/networking/statsd/default.nix index 6f909a915ae3b..6951bacf848fa 100644 --- a/pkgs/tools/networking/statsd/default.nix +++ b/pkgs/tools/networking/statsd/default.nix @@ -3,7 +3,7 @@ let self = recurseIntoAttrs ( - callPackage ../../../top-level/node-packages.nix { + callPackage ../../../indices/node-packages.nix { inherit nodejs self; generated = callPackage ./node-packages.nix { inherit self; }; overrides = { diff --git a/test.nix b/test.nix new file mode 100644 index 0000000000000..0d2dde1ce4c87 --- /dev/null +++ b/test.nix @@ -0,0 +1,58 @@ +{ me ? "0e4fbc0d4821f4b2c89b2f9c54f9da398753ae1e" +, base ? "1c50bdd928cec055d2ca842e2cf567aba2584efc" +}: + +rec { + inherit me base; + + myNixpkgsFunc = import ./.; #import (builtins.fetchTarball "https://github.com/Ericson2314/nixpkgs/archive/${me}.tar.gz"); + myNixpkgs = myNixpkgsFunc {}; + + baseNixpkgsFunc = import ; #import (builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/${base}.tar.gz"); + baseNixpkgs = baseNixpkgsFunc {}; + + #myTestsPass = (import ./nixpkgs/test/cross_system.nix).testsPass; + + gcc6Same = myNixpkgs.gcc6 == baseNixpkgs.gcc6; + gcc5Same = myNixpkgs.gcc5 == baseNixpkgs.gcc5; + gcc49Same = myNixpkgs.gcc49 == baseNixpkgs.gcc49; + gcc48Same = myNixpkgs.gcc48 == baseNixpkgs.gcc48; + gcc45Same = myNixpkgs.gcc45 == baseNixpkgs.gcc45; + gccSame = gcc6Same && gcc5Same && gcc49Same && gcc45Same; + + helloSame = rpiHello myNixpkgsFunc == rpiHello baseNixpkgsFunc; + + customStdenv = npf: args: npf ({ config.replaceStdenv = { pkgs }: pkgs.stdenv // { inherit (pkgs) asdf; }; } // args); + + helloCustomStdenv = rpiHello (customStdenv myNixpkgsFunc) == rpiHello (customStdenv baseNixpkgsFunc); + ghcCustomStdenv = (customStdenv myNixpkgsFunc {}).ghc == (customStdenv baseNixpkgsFunc {}).ghc; + + darwinArgs = { system = "x86_64-darwin"; }; + linuxArgs = { system = "x86_64-linux"; }; + ghcDarwin = (myNixpkgsFunc darwinArgs).ghc == (baseNixpkgsFunc darwinArgs).ghc; + ghcLinux = (myNixpkgsFunc linuxArgs).ghc == (baseNixpkgsFunc linuxArgs).ghc; + + testsPass = gccSame && helloSame && helloCustomStdenv && ghcCustomStdenv + && ghcDarwin && ghcLinux; + + rpiHello = nixpkgsFunc: let + rpiCrossSystem = { + config = "armv6l-unknown-linux-gnueabi"; + bigEndian = false; + arch = "arm"; + float = "hard"; + fpu = "vfp"; + withTLS = true; + libc = "glibc"; + platform = myNixpkgs.platforms.raspberrypi; + openssl.system = "linux-generic32"; + gcc = { + arch = "armv6"; + fpu = "vfp"; + float = "softfp"; + abi = "aapcs-linux"; + }; + }; + rpiPkgs = nixpkgsFunc { crossSystem = rpiCrossSystem; }; + in rpiPkgs.hello.crossDrv; +} From e28853adf2ba4c86b42c378435b3168ed998ce3d Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sun, 18 Dec 2016 00:25:31 -0800 Subject: [PATCH 3/4] top-level: Manually fix more fallout --- pkgs/indices/all-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/indices/all-packages.nix b/pkgs/indices/all-packages.nix index e2502d36dbfaf..e91fc3aa18bb9 100644 --- a/pkgs/indices/all-packages.nix +++ b/pkgs/indices/all-packages.nix @@ -313,7 +313,7 @@ in composableDerivation = callPackage ../../lib/composable-derivation.nix { }; - platforms = import ./platforms.nix; + platforms = import ../top-level/platforms.nix; setJavaClassPath = makeSetupHook { } ../build-support/setup-hooks/set-java-classpath.sh; From 61926203d5e79b2045d5b76940126aab9c840c08 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sun, 18 Dec 2016 00:38:44 -0800 Subject: [PATCH 4/4] top-level: Update comment at top of `indices/default.nix` to match new layout --- pkgs/indices/default.nix | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/pkgs/indices/default.nix b/pkgs/indices/default.nix index 1d6305151ca63..e1411cb98b015 100644 --- a/pkgs/indices/default.nix +++ b/pkgs/indices/default.nix @@ -1,12 +1,15 @@ -/* This file composes a single bootstrapping stage of the Nix Packages - collection. That is, it imports the functions that build the various - packages, and calls them with appropriate arguments. The result is a set of - all the packages in the Nix Packages collection for some particular platform - for some particular stage. - - Default arguments are only provided for bootstrapping - arguments. Normal users should not import this directly but instead - import `pkgs/default.nix` or `default.nix`. */ +/* This file composes all package indices into a single unified collection. + Each index, in turn, imports the functions that build the various packages, + and calls them with appropriate arguments. The result is a set of all the + packages in the Nix Packages collection given some arguments. + + In practice, the aggregated index is used as a single stage when + bootstrapping. To see how the stages themselves are composed, took at + `pkgs/top-level` and `pkgs/stdenv`. + + Default arguments are only provided for bootstrapping arguments. Normal users + should not import this directly but instead import `pkgs/default.nix` or + `default.nix`. */ { # The system (e.g., `i686-linux') for which to build the packages.