Skip to content

Commit

Permalink
Restore broken Nix build (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
nightkr authored Jul 27, 2024
1 parent 522b47a commit 3ea3466
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 23 deletions.
19 changes: 5 additions & 14 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,11 @@
};
utoipa-swagger-ui = attrs: rec {
# utoipa-swagger-ui tries to redownload swagger-ui, which is blocked by Nix's sandboxing
# so we download it instead, and put it where it expects to be cached
preConfigure =
let
swaggerUi = pkgs.fetchurl {
url = "https://github.com/swagger-api/swagger-ui/archive/refs/tags/v5.17.3.zip";
hash = "sha256-zrb8feuuDzt/g6y7Tucfh+Y2BWZov0soyNPR5LBqKx4=";
};
in ''
mkdir -p target/build/utoipa-swagger-ui.out
ln -s "${swaggerUi}" target/build/utoipa-swagger-ui.out/swagger-ui.zip
'';
# Build script only supports fetching from HTTP, not file URLs
# Last path element decides the cache key, which we rely on above
SWAGGER_UI_DOWNLOAD_URL = "file:///invalid-path/swagger-ui.zip";
# so we download it instead, and tell it to use that
SWAGGER_UI_DOWNLOAD_URL = "file://${pkgs.fetchurl {
url = "https://github.com/swagger-api/swagger-ui/archive/refs/tags/v5.17.3.zip";
hash = "sha256-zrb8feuuDzt/g6y7Tucfh+Y2BWZov0soyNPR5LBqKx4=";
}}";
};
};
}
Expand Down
18 changes: 9 additions & 9 deletions nix/sources.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3ea3466

Please sign in to comment.