diff --git a/build.nix b/build.nix index c50b744..1dde085 100644 --- a/build.nix +++ b/build.nix @@ -227,12 +227,11 @@ with rec # anything changes all the deps will be rebuilt. The rustc compiler is # pretty fast so this is not too bad. In the future we'll want to pre-build # the crates and give cargo a pre-populated ./target directory. - # TODO: this should most likely take more than one packageName - mkSnapshotForest = packageName: + mkSnapshotForest = symlinkJoin { name = "crates-io"; paths = map (v: unpackCrate v.name v.version v.sha256) - (libb.mkVersions packageName cargolock); + (libb.mkVersions cargolock); }; # All the Cargo.tomls, including the top-level one @@ -252,7 +251,7 @@ with rec { source = { crates-io = { replace-with = "nix-sources"; } ; nix-sources = - { directory = mkSnapshotForest (lib.head crateNames) ; }; + { directory = mkSnapshotForest; }; }; }; }; diff --git a/default.nix b/default.nix index 0be42e4..2dba6e8 100644 --- a/default.nix +++ b/default.nix @@ -43,7 +43,7 @@ with rec # # Really this should be 'buildPackageIncremental' but that makes # # Nix segfault # buildPackage (libb.dummySrc depName depVersion) -# { cargoBuild = "cargo build --release -p ${depName}:${depVersion} -j $NIX_BUILD_CORES"; +# { cargoBuild = "cargo build --$CARGO_BUILD_PROFILE -p ${depName}:${depVersion} -j $NIX_BUILD_CORES"; # inherit (attrs) cargo; # cargotomlPath = libb.writeTOML (libb.cargotomlFor depName depVersion); # cargolockPath = libb.writeTOML ( diff --git a/lib.nix b/lib.nix index 10c1371..aa679e9 100644 --- a/lib.nix +++ b/lib.nix @@ -3,7 +3,7 @@ rec { # creates an attrset from package name to package version + sha256 # (note: this includes the package's dependencies) - mkVersions = packageName: cargolock: + mkVersions = cargolock: if builtins.hasAttr "metadata" cargolock then # TODO: this should nub by - @@ -16,7 +16,7 @@ rec ) ++ (lib.concatMap (parseDependency cargolock) (x.dependencies or [])) ) - (builtins.filter (v: v.name != packageName) cargolock.package)) + cargolock.package) else []; # Turns "lib-name lib-ver (registry+...)" to [ { name = "lib-name", etc } ]