Skip to content

Commit

Permalink
bitwarden-{cli,desktop}: 2024.8.1 -> 2024.8.2, add updateScripts (#33…
Browse files Browse the repository at this point in the history
  • Loading branch information
dotlambda authored Sep 8, 2024
2 parents a35aa54 + c0348dc commit 142bdf7
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
16 changes: 11 additions & 5 deletions pkgs/by-name/bi/bitwarden-cli/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,20 @@
, fetchFromGitHub
, python3
, cctools
, nix-update-script
, nixosTests
, xcbuild
}:

buildNpmPackage rec {
pname = "bitwarden-cli";
version = "2024.8.1";
version = "2024.8.2";

src = fetchFromGitHub {
owner = "bitwarden";
repo = "clients";
rev = "cli-v${version}";
hash = "sha256-l9fLh1YFivVcMs688vM0pHoN0Um2r/EDpo7dvwvZFwY=";
hash = "sha256-F/UbaNKkyf8AoTSa0B0Ipdr5Z8qAkbk7tJ0Cdq7gk+U=";
};

postPatch = ''
Expand All @@ -27,7 +28,7 @@ buildNpmPackage rec {

nodejs = nodejs_20;

npmDepsHash = "sha256-/6yWdTy6/GvYy8u5eZB+x5KRG6vhPVE0DIn+RUAO5MI=";
npmDepsHash = "sha256-SnrK26QaxHYKX0532rGBASjx9PwxKSsVFRzZ3Cs2GPk=";

nativeBuildInputs = [
(python3.withPackages (ps: with ps; [ setuptools ]))
Expand Down Expand Up @@ -58,8 +59,13 @@ buildNpmPackage rec {

npmFlags = [ "--legacy-peer-deps" ];

passthru.tests = {
vaultwarden = nixosTests.vaultwarden.sqlite;
passthru = {
tests = {
vaultwarden = nixosTests.vaultwarden.sqlite;
};
updateScript = nix-update-script {
extraArgs = [ "--commit" "--version=stable" "--version-regex=^cli-v(.*)$" ];
};
};

meta = with lib; {
Expand Down
15 changes: 11 additions & 4 deletions pkgs/by-name/bi/bitwarden-desktop/package.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
, makeDesktopItem
, makeWrapper
, napi-rs-cli
, nix-update-script
, nodejs_20
, patchutils_0_4_2
, pkg-config
Expand All @@ -28,13 +29,13 @@ let
electron = electron_31;
in buildNpmPackage rec {
pname = "bitwarden-desktop";
version = "2024.8.1";
version = "2024.8.2";

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

patches = [
Expand All @@ -51,7 +52,7 @@ in buildNpmPackage rec {
makeCacheWritable = true;
npmFlags = [ "--engine-strict" "--legacy-peer-deps" ];
npmWorkspace = "apps/desktop";
npmDepsHash = "sha256-8cxhor90GqgO34AD8Jhd3N7PCnBnbhg8h7agVq0i3jk=";
npmDepsHash = "sha256-SnrK26QaxHYKX0532rGBASjx9PwxKSsVFRzZ3Cs2GPk=";

cargoDeps = rustPlatform.fetchCargoTarball {
name = "${pname}-${version}";
Expand All @@ -67,7 +68,7 @@ in buildNpmPackage rec {
patches;
patchFlags = [ "-p4" ];
sourceRoot = "${src.name}/${cargoRoot}";
hash = "sha256-zc5AarCbrJixcin8t+Ws8fH0ULM9rp3sUFsDb0htPuM=";
hash = "sha256-MjGKQky6LGtpG1maBWd+WkMZlnZfdl9Sm2dlvdD8ANw=";
};
cargoRoot = "apps/desktop/desktop_native";

Expand Down Expand Up @@ -195,6 +196,12 @@ in buildNpmPackage rec {
})
];

passthru = {
updateScript = nix-update-script {
extraArgs = [ "--commit" "--version=stable" "--version-regex=^desktop-v(.*)$" ];
};
};

meta = {
changelog = "https://github.com/bitwarden/clients/releases/tag/${src.rev}";
inherit description;
Expand Down

0 comments on commit 142bdf7

Please sign in to comment.