Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions pkgs/by-name/bi/bitwarden-cli/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ''
Expand All @@ -29,7 +29,7 @@ buildNpmPackage rec {

nodejs = nodejs_20;

npmDepsHash = "sha256-EtIcqbubAYN9I9wbw17oHiVshd3GtQayFtdgqWP7Pgg=";
npmDepsHash = "sha256-BoHwgv/1QiIfUPCJ3+ZHvbMelngRSEKlbkpBHRtnoP8=";

nativeBuildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
cctools
Expand All @@ -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
Expand All @@ -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;
Expand Down