@@ -117,6 +117,14 @@ let
117117 lib.optionalAttrs allowCustomOverrides
118118 ((config.packageOverrides or (super: {})) super);
119119
120+ # Override system. This is useful to build i686 packages on x86_64-linux.
121+ forceSystem = system: kernel: nixpkgsFun {
122+ localSystem = {
123+ inherit system;
124+ platform = stdenv.hostPlatform.platform // { kernelArch = kernel; };
125+ };
126+ };
127+
120128 # Convenience attributes for instantitating nixpkgs. Each of these
121129 # will instantiate a new version of allPackages. They map example
122130 # attributes to their own thing.
@@ -127,6 +135,13 @@ let
127135 pkgsLocal = lib.mapAttrs (n: localSystem:
128136 nixpkgsFun { inherit localSystem; })
129137 lib.systems.examples;
138+
139+ # Used by wine, firefox with debugging version of Flash, ...
140+ pkgsi686Linux = forceSystem "i686-linux" "i386";
141+
142+ callPackage_i686 = if stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux"
143+ then self.pkgsi686Linux.callPackage
144+ else throw "callPackage_i686 not supported on system '${stdenv.system}'";
130145 };
131146
132147 # The complete chain of package set builders, applied from top to bottom.