mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-28 00:24:18 +00:00
0497d5b99f
- Adds an update script to fetch the compatible web vault version - Removes `vaultwarden-vault` from top-level to prevent independent updates through e.g. r-ryantm. Istead the vault is now accessible at `vaultwarden.webvault`. - The name webvault was chosen because it is the title of the projects README and it makes it clearer, that this is the web UI.
54 lines
1.6 KiB
Nix
54 lines
1.6 KiB
Nix
{ lib, stdenv, callPackage, rustPlatform, fetchFromGitHub, fetchurl, nixosTests
|
|
, pkg-config, openssl
|
|
, libiconv, Security, CoreServices
|
|
, dbBackend ? "sqlite", libmysqlclient, postgresql }:
|
|
|
|
let
|
|
webvault = callPackage ./webvault.nix {};
|
|
in
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
pname = "vaultwarden";
|
|
version = "1.26.0";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "dani-garcia";
|
|
repo = pname;
|
|
rev = version;
|
|
sha256 = "sha256-LPIc1odUBvjVJty3GYYFNhile4XBWMisLUeVtWH6xgE=";
|
|
};
|
|
|
|
cargoSha256 = "sha256-IfseODaoqlPNBlVjS+9+rKXAOq29TgULMA/ogmqg0NA=";
|
|
|
|
postPatch = ''
|
|
# Upstream specifies 1.57; nixpkgs has 1.56 which also produces a working
|
|
# vaultwarden when using RUSTC_BOOTSTRAP=1
|
|
sed -ri 's/^rust-version = .*//g' Cargo.toml
|
|
'';
|
|
|
|
nativeBuildInputs = [ pkg-config ];
|
|
buildInputs = with lib; [ openssl ]
|
|
++ optionals stdenv.isDarwin [ libiconv Security CoreServices ]
|
|
++ optional (dbBackend == "mysql") libmysqlclient
|
|
++ optional (dbBackend == "postgresql") postgresql;
|
|
|
|
# vaultwarden depends on rocket v0.5.0-dev, which requires nightly features.
|
|
# This may be removed if https://github.com/dani-garcia/vaultwarden/issues/712 is fixed.
|
|
RUSTC_BOOTSTRAP = 1;
|
|
|
|
buildFeatures = dbBackend;
|
|
|
|
passthru = {
|
|
inherit webvault;
|
|
tests = nixosTests.vaultwarden;
|
|
updateScript = callPackage ./update.nix {};
|
|
};
|
|
|
|
meta = with lib; {
|
|
description = "Unofficial Bitwarden compatible server written in Rust";
|
|
homepage = "https://github.com/dani-garcia/vaultwarden";
|
|
license = licenses.gpl3Only;
|
|
maintainers = with maintainers; [ msteen ivan ];
|
|
};
|
|
}
|