Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split all-packages.nix #10307

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion default.nix
Expand Up @@ -4,4 +4,4 @@ if ! builtins ? nixVersion || builtins.compareVersions "1.8" builtins.nixVersion

else

import ./pkgs/top-level/all-packages.nix
import ./pkgs/top-level/all-packages-wrapper.nix
2 changes: 1 addition & 1 deletion lib/strings-with-deps.nix
Expand Up @@ -15,7 +15,7 @@ Usage:
Attention:

let
pkgs = (import /etc/nixos/nixpkgs/pkgs/top-level/all-packages.nix) {};
pkgs = (import <nixpkgs>) {};
in let
inherit (pkgs.stringsWithDeps) fullDepEntry packEntry noDepEntry textClosureMap;
inherit (pkgs.lib) id;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/build-support/vm/windows/cygwin-iso/default.nix
Expand Up @@ -16,7 +16,7 @@ let
sha256 = "1slyj4qha7x649ggwdski9spmyrbs04z2d46vgk8krllg0kppnjv";
};

cygwinCross = (import ../../../../top-level/all-packages.nix {
cygwinCross = (import ../../../../top-level/all-packages-wrapper.nix {
inherit (stdenv) system;
crossSystem = {
libc = "msvcrt";
Expand Down
4 changes: 2 additions & 2 deletions pkgs/stdenv/darwin/default.nix
@@ -1,11 +1,11 @@
{ system ? builtins.currentSystem
, allPackages ? import ../../top-level/all-packages.nix
, allPackages ? import ../../top-level/all-packages-wrapper.nix
, platform ? null
, config ? {}
}:

rec {
allPackages = import ../../top-level/all-packages.nix;
allPackages = import ../../top-level/all-packages-wrapper.nix;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not refer to ../../.. (i.e. the top-level default.nix)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. I will do that.


bootstrapTools = derivation {
inherit system;
Expand Down
2 changes: 1 addition & 1 deletion pkgs/stdenv/darwin/make-bootstrap-tools.nix
@@ -1,6 +1,6 @@
{system ? builtins.currentSystem}:

with import ../../top-level/all-packages.nix {inherit system;};
with import ../../top-level/all-packages-wrapper.nix {inherit system;};

rec {
# We want coreutils without ACL support.
Expand Down
4 changes: 2 additions & 2 deletions pkgs/stdenv/linux/make-bootstrap-tools-cross.nix
Expand Up @@ -3,9 +3,9 @@
let buildFor = toolsArch: (

let
pkgsFun = import ../../top-level/all-packages.nix;
pkgsFun = import ../../top-level/all-packages-wrapper.nix;
pkgsNoParams = pkgsFun {};

sheevaplugCrossSystem = {
crossSystem = rec {
config = "armv5tel-unknown-linux-gnueabi";
Expand Down
2 changes: 1 addition & 1 deletion pkgs/stdenv/linux/make-bootstrap-tools.nix
@@ -1,6 +1,6 @@
{ system ? builtins.currentSystem }:

with import ../../top-level/all-packages.nix {inherit system;};
with import ../../top-level/all-packages-wrapper.nix {inherit system;};

rec {

Expand Down
4 changes: 2 additions & 2 deletions pkgs/stdenv/pure-darwin/default.nix
@@ -1,5 +1,5 @@
{ system ? builtins.currentSystem
, allPackages ? import ../../top-level/all-packages.nix
, allPackages ? import ../../top-level/all-packages-wrapper.nix
, platform ? null
, config ? {}
}:
Expand Down Expand Up @@ -34,7 +34,7 @@ let
};
tarball = fetch { file = "bootstrap-tools.9.cpio.bz2"; sha256 = "1xim0wm4ld45ysdmgpsa6b1f6srdnfj054ilv86k0pa5plvcmsf4"; };
in rec {
allPackages = import ../../top-level/all-packages.nix;
allPackages = import ../../top-level/all-packages-wrapper.nix;

commonPreHook = ''
export NIX_ENFORCE_PURITY=1
Expand Down
2 changes: 1 addition & 1 deletion pkgs/stdenv/pure-darwin/make-bootstrap-tools.nix
@@ -1,6 +1,6 @@
{system ? builtins.currentSystem}:

with import ../../top-level/all-packages.nix {inherit system;};
with import ../../top-level/all-packages-wrapper.nix {inherit system;};

rec {
# We want coreutils without ACL support.
Expand Down
2 changes: 1 addition & 1 deletion pkgs/test/mkOption/keep.nix
@@ -1,5 +1,5 @@
let
pkgs = import ../../top-level/all-packages.nix {};
pkgs = import ../../top-level/all-packages-wrapper.nix {};
config = import ./declare.nix;
in
with (pkgs.lib);
Expand Down
2 changes: 1 addition & 1 deletion pkgs/test/mkOption/merge.nix
@@ -1,5 +1,5 @@
let
pkgs = import ../../top-level/all-packages.nix {};
pkgs = import ../../top-level/all-packages-wrapper.nix {};
config = import ./declare.nix;

# Define the handler of unbound options.
Expand Down
44 changes: 44 additions & 0 deletions pkgs/top-level/all-packages-aliases.nix
@@ -0,0 +1,44 @@
pkgs: with pkgs;

### Deprecated aliases - for backward compatibility

rec {
adobeReader = adobe-reader;
arduino_core = arduino-core; # added 2015-02-04
asciidocFull = asciidoc-full; # added 2014-06-22
bridge_utils = bridge-utils; # added 2015-02-20
buildbotSlave = buildbot-slave; # added 2014-12-09
cheetahTemplate = pythonPackages.cheetah; # 2015-06-15
clangAnalyzer = clang-analyzer; # added 2015-02-20
cool-old-term = cool-retro-term; # added 2015-01-31
cv = progress; # added 2015-09-06
enblendenfuse = enblend-enfuse; # 2015-09-30
exfat-utils = exfat; # 2015-09-11
firefoxWrapper = firefox-wrapper;
fuse_exfat = exfat; # 2015-09-11
haskell-ng = haskell; # 2015-04-19
haskellngPackages = haskellPackages; # 2015-04-19
htmlTidy = html-tidy; # added 2014-12-06
inherit (haskell.compiler) jhc uhc; # 2015-05-15
inotifyTools = inotify-tools;
jquery_ui = jquery-ui; # added 2014-09-07
libtidy = html-tidy; # added 2014-12-21
lttngTools = lttng-tools; # added 2014-07-31
lttngUst = lttng-ust; # added 2014-07-31
nfsUtils = nfs-utils; # added 2014-12-06
quassel_qt5 = kf5Packages.quassel_qt5; # added 2015-09-30
quasselClient_qt5 = kf5Packages.quasselClient_qt5; # added 2015-09-30
quasselDaemon_qt5 = kf5Packages.quasselDaemon; # added 2015-09-30
quassel_kf5 = kf5Packages.quassel; # added 2015-09-30
quasselClient_kf5 = kf5Packages.quasselClient; # added 2015-09-30
rdiff_backup = rdiff-backup; # added 2014-11-23
rssglx = rss-glx; #added 2015-03-25
rxvt_unicode_with-plugins = rxvt_unicode-with-plugins; # added 2015-04-02
speedtest_cli = speedtest-cli; # added 2015-02-17
sqliteInteractive = sqlite-interactive; # added 2014-12-06
x11 = xlibsWrapper; # added 2015-09
xf86_video_nouveau = xorg.xf86videonouveau; # added 2015-09
xlibs = xorg; # added 2015-09
youtube-dl = pythonPackages.youtube-dl; # added 2015-06-07
youtubeDL = youtube-dl; # added 2014-10-26
}
134 changes: 134 additions & 0 deletions pkgs/top-level/all-packages-wrapper.nix
@@ -0,0 +1,134 @@
/* This file composes 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. */


{ # The system (e.g., `i686-linux') for which to build the packages.
system ? builtins.currentSystem

, # The standard environment to use. Only used for bootstrapping. If
# null, the default standard environment is used.
bootStdenv ? null

, # Non-GNU/Linux OSes are currently "impure" platforms, with their libc
# outside of the store. Thus, GCC, GFortran, & co. must always look for
# files in standard system directories (/usr/include, etc.)
noSysDirs ? (system != "x86_64-freebsd" && system != "i686-freebsd"
&& system != "x86_64-kfreebsd-gnu")

# More flags for the bootstrapping of stdenv.
, gccWithCC ? true
, gccWithProfiling ? true

, # Allow a configuration attribute set to be passed in as an
# argument. Otherwise, it's read from $NIXPKGS_CONFIG or
# ~/.nixpkgs/config.nix.
config ? null

, crossSystem ? null
, platform ? null
}:


let config_ = config; platform_ = platform; in # rename the function arguments

let

lib = import ../../lib;

# The contents of the configuration file found at $NIXPKGS_CONFIG or
# $HOME/.nixpkgs/config.nix.
# for NIXOS (nixos-rebuild): use nixpkgs.config option
config =
let
toPath = builtins.toPath;
getEnv = x: if builtins ? getEnv then builtins.getEnv x else "";
pathExists = name:
builtins ? pathExists && builtins.pathExists (toPath name);

configFile = getEnv "NIXPKGS_CONFIG";
homeDir = getEnv "HOME";
configFile2 = homeDir + "/.nixpkgs/config.nix";

configExpr =
if config_ != null then config_
else if configFile != "" && pathExists configFile then import (toPath configFile)
else if homeDir != "" && pathExists configFile2 then import (toPath configFile2)
else {};

in
# allow both:
# { /* the config */ } and
# { pkgs, ... } : { /* the config */ }
if builtins.isFunction configExpr
then configExpr { inherit pkgs; }
else configExpr;

# Allow setting the platform in the config file. Otherwise, let's use a reasonable default (pc)

platformAuto = let
platforms = (import ./platforms.nix);
in
if system == "armv6l-linux" then platforms.raspberrypi
else if system == "armv7l-linux" then platforms.armv7l-hf-multiplatform
else if system == "armv5tel-linux" then platforms.sheevaplug
else if system == "mips64el-linux" then platforms.fuloong2f_n32
else if system == "x86_64-linux" then platforms.pc64
else if system == "i686-linux" then platforms.pc32
else platforms.pcBase;

platform = if platform_ != null then platform_
else config.platform or platformAuto;

# Allow packages to be overriden globally via the `packageOverrides'
# configuration option, which must be a function that takes `pkgs'
# as an argument and returns a set of new or overriden packages.
# The `packageOverrides' function is called with the *original*
# (un-overriden) set of packages, allowing packageOverrides
# attributes to refer to the original attributes (e.g. "foo =
# ... pkgs.foo ...").
pkgs = applyGlobalOverrides (config.packageOverrides or (pkgs: {}));

mkOverrides = pkgsOrig: overrides: overrides //
(lib.optionalAttrs (pkgsOrig.stdenv ? overrides && crossSystem == null) (pkgsOrig.stdenv.overrides pkgsOrig));

# Return the complete set of packages, after applying the overrides
# returned by the `overrider' function (see above). Warning: this
# function is very expensive!
applyGlobalOverrides = overrider:
let
# Call the overrider function. We don't want stdenv overrides
# in the case of cross-building, or otherwise the basic
# overrided packages will not be built with the crossStdenv
# adapter.
overrides = mkOverrides pkgsOrig (overrider pkgsOrig);

# The un-overriden packages, passed to `overrider'.
pkgsOrig = pkgsFun pkgs {};

# The overriden, final packages.
pkgs = pkgsFun pkgs overrides;
in pkgs;

# The package compositions.
pkgsFun = pkgs: overrides:
let
self = self_ // overrides;
self_ = import ./all-packages.nix {
inherit self pkgs;
inherit system crossSystem platform bootStdenv noSysDirs gccWithCC
gccWithProfiling config;
};

aliases = import ./all-packages-aliases.nix self;

tweakAlias = _n: alias: with lib;
if alias.recurseForDerivations or false then
removeAttrs alias ["recurseForDerivations"]
else alias;

in lib.mapAttrs tweakAlias aliases // self;

in pkgs