2023-08-04 22:07:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildNpmPackage
|
2024-06-24 18:47:55 +00:00
|
|
|
, nodejs_20
|
2023-08-04 22:07:22 +00:00
|
|
|
, fetchFromGitHub
|
2024-07-27 06:49:29 +00:00
|
|
|
, python311
|
2023-08-04 22:07:22 +00:00
|
|
|
, darwin
|
|
|
|
, nixosTests
|
2024-07-27 06:49:29 +00:00
|
|
|
, xcbuild
|
2023-08-04 22:07:22 +00:00
|
|
|
}:
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
buildNpmPackage rec {
|
2023-08-04 22:07:22 +00:00
|
|
|
pname = "bitwarden-cli";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "2024.6.1";
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "bitwarden";
|
|
|
|
repo = "clients";
|
|
|
|
rev = "cli-v${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-LKeJKA4/Vd80y48RdZTUh10bY38AoQ5G5oK6S77fSJI=";
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
|
2024-06-24 18:47:55 +00:00
|
|
|
nodejs = nodejs_20;
|
2023-11-16 04:20:00 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
npmDepsHash = "sha256-rwzyKaCW3LAOqw6BEu8DLS0Ad5hB6cH1OnjWzbSEgVI=";
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2024-07-27 06:49:29 +00:00
|
|
|
python311
|
2023-08-04 22:07:22 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
darwin.cctools
|
2024-07-27 06:49:29 +00:00
|
|
|
xcbuild.xcrun
|
2023-08-04 22:07:22 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
makeCacheWritable = true;
|
|
|
|
|
|
|
|
env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1";
|
|
|
|
|
2024-06-24 18:47:55 +00:00
|
|
|
npmBuildScript = "build:oss:prod";
|
2023-08-04 22:07:22 +00:00
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|