aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFinn Behrens <me@kloenk.de>2020-11-08 22:18:55 +0100
committerFinn Behrens <me@kloenk.de>2020-11-08 22:19:26 +0100
commit05f327773ead69c59c9fc10e152e9cdf552dc8d1 (patch)
tree9ee4ae0037bf054a08c67704dfa070b5c5c2dd92
parentbcb167a6fa2aae21b431bd6e96c4aa56d0106be2 (diff)
downloadbackend-05f327773ead69c59c9fc10e152e9cdf552dc8d1.tar.gz
backend-05f327773ead69c59c9fc10e152e9cdf552dc8d1.tar.xz
backend-05f327773ead69c59c9fc10e152e9cdf552dc8d1.zip
fix flake
-rw-r--r--.gitignore2
-rw-r--r--flake.nix16
2 files changed, 10 insertions, 8 deletions
diff --git a/.gitignore b/.gitignore
index ea8c4bf..daf2111 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,3 @@
/target
+
+result*
diff --git a/flake.nix b/flake.nix
index c0583d7..e5990bf 100644
--- a/flake.nix
+++ b/flake.nix
@@ -23,12 +23,13 @@
overlay = final: prev: {
vendorCrates = with final; let
- lockFile = builtins.fromTOML (builtins.readFile self + "./Cargo.lock");
+ lockFile = builtins.fromTOML (builtins.readFile ./Cargo.lock);#(builtins.readFile self + "./Cargo.lock");
- files = map (pkg: fetchulr {
- url = "https://crates.io/api/v1/crates/${pgk.name}/${pkg.version}/download";
+ files = map (pkg: fetchurl {
+ name = pkg.name;
+ url = "https://crates.io/api/v1/crates/${pkg.name}/${pkg.version}/download";
sha256 = pkg.checksum;
- }) (builtins.filter (pkg: pgk.source or "" == "registry+https://github.com/rust-lang/crates.io-index") lockFile.package);
+ }) (builtins.filter (pkg: pkg.source or "" == "registry+https://github.com/rust-lang/crates.io-index") lockFile.package);
in runCommand "cargo-vendor-dir" {}
''
mkdir -p $out/vendor
@@ -37,16 +38,15 @@
[source.crates-io]
replace-with = "vendored-sources"
- [sources.vendored-sources]
+ [source.vendored-sources]
directory = "vendor"
EOF
-
${toString (builtins.map (file: ''
mkdir $out/vendor/tmp
tar xvf ${file} -C $out/vendor/tmp
dir=$(echo $out/vendor/tmp/*)
- printf '{"files":{},"package":"${file.outputHash}"}' > $dir/.cargo-checksum.json"
+ printf '{"files":{},"package":"${file.outputHash}"}' > "$dir/.cargo-checksum.json"
if [[ $dir =~ /winapi ]]; then
find $dir -name "*.a" -print0 | xargs -0 rm -f --
@@ -85,7 +85,7 @@
};
packages = forAllSystems (system: {
- inherit (nixpkgsFor.${system}) backend;
+ inherit (nixpkgsFor.${system}) backend vendorCrates;
});
defaultPackage = forAllSystems (system: self.packages.${system}.backend);