From db34445c5e4d4df545b5dab62d5f526a6bda609e Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Fri, 13 Mar 2020 18:31:16 +0100 Subject: [PATCH] Build vendoredCrates in the overlay This makes it build on non-x86_64-linux systems (needed in GitHub actions). --- flake.nix | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/flake.nix b/flake.nix index fa5965a22..188c3fdd6 100644 --- a/flake.nix +++ b/flake.nix @@ -131,7 +131,7 @@ patchelf --set-rpath $out/lib:${stdenv.cc.cc.lib}/lib $out/lib/libboost_thread.so.* ''} - ln -sfn ${self.hydraJobs.vendoredCrates}/vendor/ nix-rust/vendor + ln -sfn ${final.nixVendoredCrates}/vendor/ nix-rust/vendor (cd perl; autoreconf --install --force --verbose) ''; @@ -188,16 +188,10 @@ }; - }; - - hydraJobs = { - # Create a "vendor" directory that contains the crates listed in # Cargo.lock, and include it in the Nix tarball. This allows Nix # to be built without network access. - vendoredCrates = - with nixpkgsFor.x86_64-linux; - + nixVendoredCrates = let lockFile = builtins.fromTOML (builtins.readFile nix-rust/Cargo.lock); @@ -206,7 +200,7 @@ sha256 = lockFile.metadata."checksum ${pkg.name} ${pkg.version} (registry+https://github.com/rust-lang/crates.io-index)"; }) (builtins.filter (pkg: pkg.source or "" == "registry+https://github.com/rust-lang/crates.io-index") lockFile.package); - in pkgs.runCommand "cargo-vendor-dir" {} + in final.runCommand "cargo-vendor-dir" {} '' mkdir -p $out/vendor @@ -238,6 +232,10 @@ '') files)} ''; + }; + + hydraJobs = { + # Binary package for various platforms. build = nixpkgs.lib.genAttrs systems (system: nixpkgsFor.${system}.nix);