diff --git a/pkgs/by-name/bi/bitwarden-cli/package.nix b/pkgs/by-name/bi/bitwarden-cli/package.nix index 5ce79f0e5f98c..93f2d9bcf7e08 100644 --- a/pkgs/by-name/bi/bitwarden-cli/package.nix +++ b/pkgs/by-name/bi/bitwarden-cli/package.nix @@ -13,13 +13,13 @@ buildNpmPackage rec { pname = "bitwarden-cli"; - version = "2024.12.0"; + version = "2025.1.3"; src = fetchFromGitHub { owner = "bitwarden"; repo = "clients"; rev = "cli-v${version}"; - hash = "sha256-3aN2t8/qhN0sjACvtip45efHQJl8nEMNre0+oBL1/go="; + hash = "sha256-a8OQ/vQCJSjipLnuNWaWqnAJK+Str6FdHPBTbC04VxA="; }; postPatch = '' @@ -29,7 +29,7 @@ buildNpmPackage rec { nodejs = nodejs_20; - npmDepsHash = "sha256-EtIcqbubAYN9I9wbw17oHiVshd3GtQayFtdgqWP7Pgg="; + npmDepsHash = "sha256-BoHwgv/1QiIfUPCJ3+ZHvbMelngRSEKlbkpBHRtnoP8="; nativeBuildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ cctools @@ -50,6 +50,11 @@ buildNpmPackage rec { npmFlags = [ "--legacy-peer-deps" ]; + npmRebuildFlags = [ + # Avoid downloading prebuilt esbuild versions + "--ignore-scripts" + ]; + postConfigure = '' # we want to build everything from source shopt -s globstar @@ -64,6 +69,13 @@ buildNpmPackage rec { shopt -u globstar ''; + postInstall = '' + # Remove the @bitwarden modules as they are broken (but unused) symlinks + rm -rf $out/lib/node_modules/@bitwarden/clients/node_modules/@bitwarden + # Remove .bin directory as it contains broken symlinks + rm -rf $out/lib/node_modules/@bitwarden/clients/node_modules/.bin + ''; + passthru = { tests = { vaultwarden = nixosTests.vaultwarden.sqlite;