From 5dab9d0ffce42f22bf69b8a8c048cf933f97b1f5 Mon Sep 17 00:00:00 2001 From: Andrew Marshall Date: Thu, 12 Oct 2023 08:00:01 -0400 Subject: [PATCH 1/2] bitwarden: 2023.9.0 -> 2023.9.3 Diff: https://github.com/bitwarden/clients/compare/desktop-v2023.9.0...desktop-v2023.9.3 Changelog: https://github.com/bitwarden/clients/releases/tag/desktop-v2023.9.3 --- pkgs/tools/security/bitwarden/default.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/tools/security/bitwarden/default.nix b/pkgs/tools/security/bitwarden/default.nix index 41ce0d7e5e892..ebf019a39d703 100644 --- a/pkgs/tools/security/bitwarden/default.nix +++ b/pkgs/tools/security/bitwarden/default.nix @@ -3,7 +3,7 @@ , buildNpmPackage , cargo , dbus -, electron_24 +, electron_25 , fetchFromGitHub , glib , gnome @@ -26,7 +26,7 @@ let icon = "bitwarden"; buildNpmPackage' = buildNpmPackage.override { nodejs = nodejs_18; }; - electron = electron_24; + electron = electron_25; desktopItem = makeDesktopItem { name = "bitwarden"; @@ -38,24 +38,24 @@ let }; 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"; From 33981053289592b9fccc1c491dd385d47be26b90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Sun, 22 Oct 2023 10:32:25 -0700 Subject: [PATCH 2/2] bitwarden: use copyDesktopItems --- pkgs/tools/security/bitwarden/default.nix | 30 +++++++++++++---------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/pkgs/tools/security/bitwarden/default.nix b/pkgs/tools/security/bitwarden/default.nix index ebf019a39d703..84ce6b59d7871 100644 --- a/pkgs/tools/security/bitwarden/default.nix +++ b/pkgs/tools/security/bitwarden/default.nix @@ -1,7 +1,7 @@ { lib -, applyPatches , buildNpmPackage , cargo +, copyDesktopItems , dbus , electron_25 , fetchFromGitHub @@ -27,15 +27,6 @@ let buildNpmPackage' = buildNpmPackage.override { nodejs = nodejs_18; }; electron = electron_25; - - desktopItem = makeDesktopItem { - name = "bitwarden"; - exec = "bitwarden %U"; - inherit icon; - comment = description; - desktopName = "Bitwarden"; - categories = [ "Utility" ]; - }; in buildNpmPackage' rec { pname = "bitwarden"; version = "2023.9.3"; @@ -63,6 +54,7 @@ in buildNpmPackage' rec { nativeBuildInputs = [ cargo + copyDesktopItems jq makeWrapper moreutils @@ -128,6 +120,8 @@ in buildNpmPackage' rec { ''; installPhase = '' + runHook preInstall + mkdir $out pushd apps/desktop/dist/linux-unpacked @@ -141,9 +135,6 @@ 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 @@ -151,8 +142,21 @@ in buildNpmPackage' rec { 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;