From e622df9bb8b31dc0d6178b874e9eeebe082b3408 Mon Sep 17 00:00:00 2001 From: Laurenz Foglia Date: Thu, 9 Mar 2023 14:17:10 +0100 Subject: [PATCH] onlykey: fix missing wrapGAppsHook causing GLib-GIO-ERROR #181500 install unused desktop file --- pkgs/tools/security/onlykey/default.nix | 31 +++++++++++++++++++++---- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/pkgs/tools/security/onlykey/default.nix b/pkgs/tools/security/onlykey/default.nix index 018c53b0c083..c63173d889b2 100644 --- a/pkgs/tools/security/onlykey/default.nix +++ b/pkgs/tools/security/onlykey/default.nix @@ -1,9 +1,11 @@ { lib , node_webkit , pkgs -, runCommand +, copyDesktopItems +, makeDesktopItem , stdenv , writeShellScript +, wrapGAppsHook }: let @@ -47,7 +49,26 @@ let ${node_webkit}/bin/nw ${onlykey}/lib/node_modules/${onlykey.packageName}/build ''; in -runCommand "${onlykey.packageName}-${onlykey.version}" { } '' - mkdir -p $out/bin - ln -s ${script} $out/bin/onlykey -'' +stdenv.mkDerivation { + pname = "${onlykey.packageName}"; + inherit (onlykey) version; + dontUnpack = true; + nativeBuildInputs = [ wrapGAppsHook copyDesktopItems ]; + desktopItems = [ + (makeDesktopItem { + name = onlykey.packageName; + exec = script; + icon = "${onlykey}/lib/node_modules/${onlykey.packageName}/resources/onlykey_logo_128.png"; + desktopName = onlykey.packageName; + genericName = onlykey.packageName; + }) + ]; + installPhase = '' + runHook preInstall + + mkdir -p $out/bin + ln -s ${script} $out/bin/onlykey + + runHook postInstall + ''; +}