3

It seems Nix should be able to install and build 32-bit packages on 64-bit systems. It's caches already store whole nixpkgs tree built for i686 architecture, and there should be no problem to download and install them, but I can't see the way to do so.

3

If you don't already know how to build separate package with nix, here is instruction.

nixpkgs define special variable pkgsi686Linux for i686 packages tree and callPackage_i686 for invoking arbitrary nix-expression with overrided system="i686-linux". Their usage is pretty straightforward.

Method one:

jsoncpp06_32 = nixpkgs.callPackage_i686 ./jsoncpp06.nix { };

method two:

myPackage32 = pkgs.pkgsi686Linux.stdenv.mkDerivation {
    name = "myPackage-i686-0.0.1";

    boost155 = nixpkgs.pkgsi686Linux.boost155;
    buildInputs = [
        pkgs.gcc_multi
        pkgs.python2
        pkgs.pkgconfig

        pkgs.pkgsi686Linux.ffmpeg_2_2
        pkgs.pkgsi686Linux.boost155
        pkgs.pkgsi686Linux.openssl
        pkgs.pkgsi686Linux.curl
        pkgs.pkgsi686Linux.opencv

        jsoncpp06_32
    ];

};
2

Maybe this is also a viable solution.

default.nix

{ system ? builtins.currentSystem }:
let pkgs = import <nixpkgs> { inherit system; }
in pkgs.stdout.mkDerivation {
   # ... as usual
}

then you run

% nix-build default.nix --argstr "x86_64-linux"

and

% nix-build default.nix --argstr "i686-linux"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.