diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-03-13 18:31:16 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-03-13 18:31:16 +0100 |
commit | db34445c5e4d4df545b5dab62d5f526a6bda609e (patch) | |
tree | b74395fb44c7b37f5e36c1ca9d254af1de630ae7 /flake.nix | |
parent | 3e1abf4f059634780d5b54d95cc9997e97e0e35f (diff) |
Build vendoredCrates in the overlay
This makes it build on non-x86_64-linux systems (needed in GitHub
actions).
Diffstat (limited to 'flake.nix')
-rw-r--r-- | flake.nix | 16 |
1 files changed, 7 insertions, 9 deletions
@@ -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); |