vaultwarden: use buildFeatures

This commit is contained in:
figsoda 2021-11-16 08:18:57 -05:00
parent 84361e0a98
commit b356c37023

View file

@ -3,10 +3,7 @@
, libiconv, Security, CoreServices
, dbBackend ? "sqlite", libmysqlclient, postgresql }:
let
featuresFlag = "--features ${dbBackend}";
in rustPlatform.buildRustPackage rec {
rustPlatform.buildRustPackage rec {
pname = "vaultwarden";
version = "1.23.0";
@ -35,14 +32,7 @@ in rustPlatform.buildRustPackage rec {
# This may be removed if https://github.com/dani-garcia/vaultwarden/issues/712 is fixed.
RUSTC_BOOTSTRAP = 1;
cargoBuildFlags = [ featuresFlag ];
checkPhase = ''
runHook preCheck
echo "Running cargo cargo test ${featuresFlag} -- ''${checkFlags} ''${checkFlagsArray+''${checkFlagsArray[@]}}"
cargo test ${featuresFlag} -- ''${checkFlags} ''${checkFlagsArray+"''${checkFlagsArray[@]}"}
runHook postCheck
'';
buildFeatures = dbBackend;
passthru.tests = nixosTests.vaultwarden;