diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index 91844bdb9dd..ce95f31112d 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -2,7 +2,7 @@ , pkgconfig, boehmgc, perlPackages, libsodium, aws-sdk-cpp, brotli , autoreconfHook, autoconf-archive, bison, flex, libxml2, libxslt, docbook5, docbook5_xsl , libseccomp, busybox-sandbox-shell -, hostPlatform +, hostPlatform, buildPlatform , storeDir ? "/nix/store" , stateDir ? "/nix/var" , confDir ? "/etc" @@ -52,35 +52,22 @@ let "--with-www-curl=${perlPackages.WWWCurl}/${perl.libPrefix}" ] ++ lib.optionals (is20 && stdenv.isLinux) [ "--with-sandbox-shell=${sh}/bin/busybox" - ]; + ] + ++ lib.optional ( + hostPlatform != buildPlatform && hostPlatform ? nix && hostPlatform.nix ? system + ) ''--with-system=${hostPlatform.nix.system}''; makeFlags = "profiledir=$(out)/etc/profile.d"; installFlags = "sysconfdir=$(out)/etc"; - doInstallCheck = true; + doInstallCheck = hostPlatform == buildPlatform; # socket path becomes too long otherwise preInstallCheck = lib.optional stdenv.isDarwin "export TMPDIR=/tmp"; separateDebugInfo = stdenv.isLinux; - crossAttrs = { - configureFlags = - '' - --with-store-dir=${storeDir} --localstatedir=${stateDir} - --with-dbi=${perlPackages.DBI}/${perl.libPrefix} - --with-dbd-sqlite=${perlPackages.DBDSQLite}/${perl.libPrefix} - --with-www-curl=${perlPackages.WWWCurl}/${perl.libPrefix} - --disable-init-state - --enable-gc - '' + stdenv.lib.optionalString ( - hostPlatform ? nix && hostPlatform.nix ? system - ) ''--with-system=${hostPlatform.nix.system}''; - - doInstallCheck = false; - }; - enableParallelBuilding = true; meta = {