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.9.0 -> 2023.9.3 #262797

Merged
merged 2 commits into from
Oct 23, 2023
Merged
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
42 changes: 23 additions & 19 deletions pkgs/tools/security/bitwarden/default.nix
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{ lib
, applyPatches
, buildNpmPackage
, cargo
, copyDesktopItems
, dbus
, electron_24
, electron_25
, fetchFromGitHub
, glib
, gnome
Expand All @@ -26,43 +26,35 @@ let
icon = "bitwarden";

buildNpmPackage' = buildNpmPackage.override { nodejs = nodejs_18; };
electron = electron_24;

desktopItem = makeDesktopItem {
name = "bitwarden";
exec = "bitwarden %U";
inherit icon;
comment = description;
desktopName = "Bitwarden";
categories = [ "Utility" ];
};
electron = electron_25;
in buildNpmPackage' rec {
pname = "bitwarden";
version = "2023.9.0";
version = "2023.9.3";

src = fetchFromGitHub {
owner = "bitwarden";
repo = "clients";
rev = "desktop-v${version}";
hash = "sha256-8rNJmDpKLzTre5c2wktle7tthp1owZK5WAQP80/2R0g=";
hash = "sha256-NiMJmtCx+yD24BCyMgHLpRApNwoIJRps5qmmlVdB0G0=";
};

makeCacheWritable = true;
npmWorkspace = "apps/desktop";
npmDepsHash = "sha256-0q3XoC87kfC2PYMsNse4DV8M8OXjckiLTdN3LK06lZY=";
npmDepsHash = "sha256-HQPxmATA9bUc4NTfvYsL6fGuicU9baySCmNHahs8EF4=";

cargoDeps = rustPlatform.fetchCargoTarball {
name = "${pname}-${version}";
inherit src;
sourceRoot = "${src.name}/${cargoRoot}";
hash = "sha256-YF3UHQWCSuWAg2frE8bo1XrLn44P6+1A7YUh4RZxwo0=";
hash = "sha256-mFxvK9cmSBRVnUwEbzADUa5W5TCL51wcUHxuR5JZwLE=";
};
cargoRoot = "apps/desktop/desktop_native";

env.ELECTRON_SKIP_BINARY_DOWNLOAD = "1";

nativeBuildInputs = [
cargo
copyDesktopItems
jq
makeWrapper
moreutils
Expand Down Expand Up @@ -128,6 +120,8 @@ in buildNpmPackage' rec {
'';

installPhase = ''
runHook preInstall

mkdir $out

pushd apps/desktop/dist/linux-unpacked
Expand All @@ -141,18 +135,28 @@ in buildNpmPackage' rec {
--set-default ELECTRON_IS_DEV 0 \
--inherit-argv0

mkdir -p $out/share/applications
cp ${desktopItem}/share/applications/* $out/share/applications

pushd apps/desktop/resources/icons
for icon in *.png; do
dir=$out/share/icons/hicolor/"''${icon%.png}"/apps
mkdir -p "$dir"
cp "$icon" "$dir"/${icon}.png
done
popd

runHook postInstall
'';

desktopItems = [
(makeDesktopItem {
name = "bitwarden";
exec = "bitwarden %U";
inherit icon;
comment = description;
desktopName = "Bitwarden";
categories = [ "Utility" ];
})
];

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