From bd819e31ad2d23b23e9452c6f3ac7ab9d748372e Mon Sep 17 00:00:00 2001 From: Bob van der Linden Date: Wed, 12 Feb 2025 22:37:00 +0100 Subject: [PATCH 1/3] bitwarden-cli: 2024.12.0 -> 2025.1.3 --- pkgs/by-name/bi/bitwarden-cli/package.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/by-name/bi/bitwarden-cli/package.nix b/pkgs/by-name/bi/bitwarden-cli/package.nix index 5ce79f0e5f98c..0ab09f914a83a 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 From ebcbf1daa5c29a0facfdb869b34f40caa0b4fd10 Mon Sep 17 00:00:00 2001 From: Bob van der Linden Date: Wed, 12 Feb 2025 22:39:05 +0100 Subject: [PATCH 2/3] bitwarden-cli: avoid esbuild prebuilts esbuild binaries are being downloaded through npm. We can work around this using an environment variable, but since there are 2 different versions of esbuild being used in the lock file, we need to do some juggling of this envvar. Skipping those scripts also works and is less complex. --- pkgs/by-name/bi/bitwarden-cli/package.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkgs/by-name/bi/bitwarden-cli/package.nix b/pkgs/by-name/bi/bitwarden-cli/package.nix index 0ab09f914a83a..e5e81886f0d60 100644 --- a/pkgs/by-name/bi/bitwarden-cli/package.nix +++ b/pkgs/by-name/bi/bitwarden-cli/package.nix @@ -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 From 3f7955e7864810f5e5d061887ecd30dd9ddea560 Mon Sep 17 00:00:00 2001 From: Bob van der Linden Date: Wed, 12 Feb 2025 22:41:28 +0100 Subject: [PATCH 3/3] bitwarden-cli: remove dangling symlinks in output --- pkgs/by-name/bi/bitwarden-cli/package.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/by-name/bi/bitwarden-cli/package.nix b/pkgs/by-name/bi/bitwarden-cli/package.nix index e5e81886f0d60..93f2d9bcf7e08 100644 --- a/pkgs/by-name/bi/bitwarden-cli/package.nix +++ b/pkgs/by-name/bi/bitwarden-cli/package.nix @@ -69,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;