mirror of
https://git.dirksys.ovh/dirk/bankserver.git
synced 2025-12-20 02:59:20 +01:00
42 lines
873 B
Nix
42 lines
873 B
Nix
{
|
|
lib,
|
|
rustPlatform,
|
|
stdenv,
|
|
redocly,
|
|
yq-go,
|
|
targetPlatform,
|
|
rev ? "dirty",
|
|
}:
|
|
rustPlatform.buildRustPackage {
|
|
pname = "bankingserver";
|
|
version = "unstable-${rev}";
|
|
|
|
src = lib.cleanSource ./.;
|
|
|
|
nativeBuildInputs = [
|
|
redocly
|
|
yq-go
|
|
];
|
|
|
|
preBuild = ''
|
|
cargo test --features schemas --target ${stdenv.buildPlatform.rust.rustcTarget}
|
|
|
|
yq eval-all -n 'load("openapi-def.yaml") *n load("schemas/schemas.json")' > openapi-temp.yaml
|
|
redocly bundle openapi-temp.yaml -o openapi.json
|
|
'';
|
|
|
|
buildType = "debug";
|
|
|
|
useFetchCargoVendor = false;
|
|
cargoLock.lockFile = ./Cargo.lock;
|
|
cargoLock.outputHashes = {
|
|
"dbmigrator-0.4.4-alpha" = "sha256-Nwxw74IyZeZ9dODb+aneQmuQe0grO+g45B3zv1XaihE=";
|
|
};
|
|
|
|
CARGO_BUILD_TARGET = targetPlatform.config;
|
|
|
|
TARGET_CC = "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc";
|
|
|
|
doCheck = false;
|
|
}
|