2023-07-15 17:15:38 +00:00
|
|
|
{ lib, stdenv, callPackage, rustPlatform, fetchFromGitHub, nixosTests
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config, openssl
|
2021-05-20 23:08:51 +00:00
|
|
|
, libiconv, Security, CoreServices
|
2020-04-24 23:36:52 +00:00
|
|
|
, dbBackend ? "sqlite", libmysqlclient, postgresql }:
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
let
|
|
|
|
webvault = callPackage ./webvault.nix {};
|
|
|
|
in
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
rustPlatform.buildRustPackage rec {
|
2021-07-04 02:40:35 +00:00
|
|
|
pname = "vaultwarden";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "1.29.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dani-garcia";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-ByMPS68GBOvjB/RpoLAvgE+NcbbIa1qfU1TQ4yhbH+I=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2023-03-27 19:17:25 +00:00
|
|
|
cargoLock = {
|
|
|
|
lockFile = ./Cargo.lock;
|
2023-07-15 17:15:38 +00:00
|
|
|
outputHashes = {
|
|
|
|
"rocket-0.5.0-rc.3" = "sha256-E71cktkHCbmQyjkjWWJ20KfCm3B/h3jQ2TMluYhvCQw=";
|
|
|
|
};
|
2023-03-27 19:17:25 +00:00
|
|
|
};
|
2021-07-04 02:40:35 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2021-01-15 22:18:51 +00:00
|
|
|
buildInputs = with lib; [ openssl ]
|
2021-05-20 23:08:51 +00:00
|
|
|
++ optionals stdenv.isDarwin [ libiconv Security CoreServices ]
|
2020-04-24 23:36:52 +00:00
|
|
|
++ optional (dbBackend == "mysql") libmysqlclient
|
|
|
|
++ optional (dbBackend == "postgresql") postgresql;
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
buildFeatures = dbBackend;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
passthru = {
|
|
|
|
inherit webvault;
|
|
|
|
tests = nixosTests.vaultwarden;
|
|
|
|
updateScript = callPackage ./update.nix {};
|
|
|
|
};
|
2020-09-25 04:45:31 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Unofficial Bitwarden compatible server written in Rust";
|
2021-07-04 02:40:35 +00:00
|
|
|
homepage = "https://github.com/dani-garcia/vaultwarden";
|
2023-03-30 22:05:00 +00:00
|
|
|
license = licenses.agpl3Only;
|
2021-12-06 16:07:01 +00:00
|
|
|
maintainers = with maintainers; [ msteen ivan ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|