2023-08-04 22:07:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildNpmPackage
|
|
|
|
, nodejs_18
|
|
|
|
, fetchFromGitHub
|
|
|
|
, python3
|
|
|
|
, darwin
|
|
|
|
, nixosTests
|
|
|
|
}:
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
buildNpmPackage rec {
|
2023-08-04 22:07:22 +00:00
|
|
|
pname = "bitwarden-cli";
|
2024-06-05 15:53:02 +00:00
|
|
|
version = "2024.4.1";
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bitwarden";
|
|
|
|
repo = "clients";
|
|
|
|
rev = "cli-v${version}";
|
2024-06-05 15:53:02 +00:00
|
|
|
hash = "sha256-Dz7EActqXd97kNxEaNINj2O6TLZWEgHHg1lOIa2+Lt4=";
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
nodejs = nodejs_18;
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
npmDepsHash = "sha256-fjYez3nSDsG5kYtrun3CkDCz1GNAjNlwPzEL+/9qQRU=";
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
python3
|
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
darwin.cctools
|
|
|
|
];
|
|
|
|
|
|
|
|
makeCacheWritable = true;
|
|
|
|
|
|
|
|
env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
|
|
|
|
|
|
|
|
npmBuildScript = "build:prod";
|
|
|
|
|
|
|
|
npmWorkspace = "apps/cli";
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
npmFlags = [ "--legacy-peer-deps" ];
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
passthru.tests = {
|
|
|
|
vaultwarden = nixosTests.vaultwarden.sqlite;
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
changelog = "https://github.com/bitwarden/clients/releases/tag/${src.rev}";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Secure and free password manager for all of your devices";
|
2023-08-04 22:07:22 +00:00
|
|
|
homepage = "https://bitwarden.com";
|
|
|
|
license = lib.licenses.gpl3Only;
|
|
|
|
mainProgram = "bw";
|
|
|
|
maintainers = with maintainers; [ dotlambda ];
|
|
|
|
};
|
|
|
|
}
|