fix: pre-fetch swagger-ui assets for Nix sandbox build

This commit is contained in:
maulanasdqn
2026-04-02 14:09:26 +07:00
parent 052fee4b78
commit 05a5b39195
+9
View File
@@ -1,4 +1,10 @@
{ pkgs ? import <nixpkgs> { } }:
let
swaggerUi = pkgs.fetchurl {
url = "https://github.com/swagger-api/swagger-ui/archive/refs/tags/v5.17.14.zip";
hash = "sha256-SBJE0IEgl7Efuu73n3HZQrFxYX+cn5UU5jrL4T5xzNw=";
};
in
pkgs.rustPlatform.buildRustPackage {
pname = "imphnen-backend";
version = (pkgs.lib.importTOML ./imphnen-backend/Cargo.toml).package.version;
@@ -12,5 +18,8 @@ pkgs.rustPlatform.buildRustPackage {
];
nativeBuildInputs = [ pkgs.pkg-config ];
buildInputs = [ pkgs.openssl ];
preBuild = ''
export SWAGGER_UI_DOWNLOAD_URL="file://${swaggerUi}"
'';
doCheck = false;
}