From d1bd9faf6199096adc547ccd60ca850ef18324e4 Mon Sep 17 00:00:00 2001 From: Matthew Bauer Date: Mon, 25 Jun 2018 14:32:35 -0400 Subject: [PATCH] stage: move old stuff to stage.nix --- pkgs/top-level/all-packages.nix | 17 ----------------- pkgs/top-level/stage.nix | 15 +++++++++++++++ 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d3d40662053..f8a814ebf05 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12,25 +12,8 @@ with pkgs; { - # Allow callPackage to fill in the pkgs argument inherit pkgs; - - # Override system. This is useful to build i686 packages on x86_64-linux. - forceSystem = system: kernel: nixpkgsFun { - localSystem = { - inherit system; - platform = platform // { kernelArch = kernel; }; - }; - }; - - # Used by wine, firefox with debugging version of Flash, ... - pkgsi686Linux = forceSystem "i686-linux" "i386"; - - callPackage_i686 = if stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux" - then pkgsi686Linux.callPackage - else throw "callPackage_i686 not supported on system '${stdenv.system}'"; - # A stdenv capable of building 32-bit binaries. On x86_64-linux, # it uses GCC compiled with multilib support; on i686-linux, it's # just the plain stdenv. diff --git a/pkgs/top-level/stage.nix b/pkgs/top-level/stage.nix index a9d1988ad5f..551a4a6945b 100644 --- a/pkgs/top-level/stage.nix +++ b/pkgs/top-level/stage.nix @@ -117,6 +117,14 @@ let lib.optionalAttrs allowCustomOverrides ((config.packageOverrides or (super: {})) super); + # Override system. This is useful to build i686 packages on x86_64-linux. + forceSystem = system: kernel: nixpkgsFun { + localSystem = { + inherit system; + platform = stdenv.hostPlatform.platform // { kernelArch = kernel; }; + }; + }; + # Convenience attributes for instantitating nixpkgs. Each of these # will instantiate a new version of allPackages. They map example # attributes to their own thing. @@ -127,6 +135,13 @@ let pkgsLocal = lib.mapAttrs (n: localSystem: nixpkgsFun { inherit localSystem; }) lib.systems.examples; + + # Used by wine, firefox with debugging version of Flash, ... + pkgsi686Linux = forceSystem "i686-linux" "i386"; + + callPackage_i686 = if stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux" + then self.pkgsi686Linux.callPackage + else throw "callPackage_i686 not supported on system '${stdenv.system}'"; }; # The complete chain of package set builders, applied from top to bottom.