Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bitwarden: 2023.10.1 -> 2023.12.0 #272541

Merged
merged 3 commits into from
Dec 10, 2023
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions pkgs/tools/security/bitwarden/cli.nix
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@

buildNpmPackage rec {
pname = "bitwarden-cli";
version = "2023.10.0";
version = "2023.12.0";

src = fetchFromGitHub {
owner = "bitwarden";
repo = "clients";
rev = "cli-v${version}";
hash = "sha256-egXToXWfb9XV7JuCRBYJO4p/e+WOwMncPKz0oBgeALQ=";
hash = "sha256-WYhLKV3j3Ktite5u1H4fSku38hCCrMzKoxtjq6aT9yo=";
};

nodejs = nodejs_18;

npmDepsHash = "sha256-iO8ZozVl1vOOqowQARnRJWSFUFnau46+dKfcMSkyU3o=";
npmDepsHash = "sha256-bnYpvHO9Pnob+MbrSshv03mSwXCADH/2xw33nLVKMdg=";

nativeBuildInputs = [
python3
Expand Down
18 changes: 10 additions & 8 deletions pkgs/tools/security/bitwarden/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
, cargo
, copyDesktopItems
, dbus
, electron_25
, electron_26
, fetchFromGitHub
, fetchpatch2
, glib
Expand All @@ -25,16 +25,16 @@
let
description = "A secure and free password manager for all of your devices";
icon = "bitwarden";
electron = electron_25;
electron = electron_26;
in buildNpmPackage rec {
pname = "bitwarden";
version = "2023.10.1";
version = "2023.12.0"; # TODO add back Electron version check below

src = fetchFromGitHub {
owner = "bitwarden";
repo = "clients";
rev = "desktop-v${version}";
hash = "sha256-cwSIMN40d1ySUSxBl8jXLVndnJJvPnLiTxkYnA3Pqws=";
hash = "sha256-WYhLKV3j3Ktite5u1H4fSku38hCCrMzKoxtjq6aT9yo=";
};

patches = [
Expand All @@ -49,14 +49,14 @@ in buildNpmPackage rec {

makeCacheWritable = true;
npmWorkspace = "apps/desktop";
npmDepsHash = "sha256-KN8C9Y0tfhHVagk+CUMpI/bIRChhzxC9M27HkU4aTEc=";
npmDepsHash = "sha256-bnYpvHO9Pnob+MbrSshv03mSwXCADH/2xw33nLVKMdg=";

cargoDeps = rustPlatform.fetchCargoTarball {
name = "${pname}-${version}";
inherit patches src;
patchFlags = [ "-p4" ];
sourceRoot = "${src.name}/${cargoRoot}";
hash = "sha256-AmtdmOR3aZJTZiFbkwRXjeTOJdcN40bTmWx4Ss3JNJ8=";
hash = "sha256-pCy3hGhI3mXm4uTOaFMykOzJqK2PC0t0hE8MrJKtA/k=";
};
cargoRoot = "apps/desktop/desktop_native";

Expand All @@ -82,12 +82,14 @@ in buildNpmPackage rec {
libsecret
];

preBuild = ''
# FIXME add back once upstream moves to Electron >= 26
# we use electron_26 because electron_25 is EOL
/*preBuild = ''
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe worth asserting on version to force to re-evaluate on upgrade e.g.

preBuild = let skipCheck = lib.versionOlder version "2023.12.1"; in assert skipCheck; lib.optionalString (!skipCheck) ''
…

Don’t really care too much about the specific construction, just that it goes boom so we don’t forget about it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would a comment behind the version attribute be sufficient?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea suppose that’s okay since it will be visible in the diff for a version bump.

if [[ $(jq --raw-output '.devDependencies.electron' < package.json | grep -E --only-matching '^[0-9]+') != ${lib.escapeShellArg (lib.versions.major electron.version)} ]]; then
echo 'ERROR: electron version mismatch'
exit 1
fi
'';
'';*/

postBuild = ''
pushd apps/desktop
Expand Down