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
|
2023-11-16 04:20:00 +00:00
|
|
|
, libiconv, Security, CoreServices, SystemConfiguration
|
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";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "1.31.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "dani-garcia";
|
2024-07-27 06:49:29 +00:00
|
|
|
repo = "vaultwarden";
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = version;
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-fQjTSLPJQk1byjX+HADtQvQRqEaEiCmWjgA1WIMLBu4=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
cargoHash = "sha256-VWKkZvuv+B9V6pgxZRGlLIRUdLEh61RpOfEnOtEBKU0=";
|
2024-04-21 15:54:59 +00:00
|
|
|
|
|
|
|
# used for "Server Installed" version in admin panel
|
|
|
|
env.VW_VERSION = version;
|
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 ]
|
2023-11-16 04:20:00 +00:00
|
|
|
++ optionals stdenv.isDarwin [ libiconv Security CoreServices SystemConfiguration ]
|
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";
|
2024-02-07 01:22:34 +00:00
|
|
|
changelog = "https://github.com/dani-garcia/vaultwarden/releases/tag/${version}";
|
2023-03-30 22:05:00 +00:00
|
|
|
license = licenses.agpl3Only;
|
2024-04-21 15:54:59 +00:00
|
|
|
maintainers = with maintainers; [ dotlambda SuperSandro2000 ];
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "vaultwarden";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|