From 0ee07ed92b33ad8a6b60ef5db4102286d1ace81f Mon Sep 17 00:00:00 2001 From: "Markus S. Wamser" Date: Sun, 22 Mar 2020 14:16:35 +0100 Subject: [PATCH] notable: use .desktop file from AppImage --- pkgs/applications/misc/notable/default.nix | 25 ++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/misc/notable/default.nix b/pkgs/applications/misc/notable/default.nix index 9a00959de020..923f5fb4528e 100644 --- a/pkgs/applications/misc/notable/default.nix +++ b/pkgs/applications/misc/notable/default.nix @@ -3,14 +3,24 @@ let pname = "notable"; version = "1.8.4"; -in -appimageTools.wrapType2 rec { + sha256 = "0rvz8zwsi62kiq89pv8n2wh9h5yb030kvdr1vf65xwqkhqcrzrby"; + name = "${pname}-${version}"; + src = fetchurl { url = "https://github.com/notable/notable/releases/download/v${version}/Notable-${version}.AppImage"; - sha256 = "0rvz8zwsi62kiq89pv8n2wh9h5yb030kvdr1vf65xwqkhqcrzrby"; + inherit sha256; }; + appimageContents = appimageTools.extract { + inherit name src; + }; + +in +appimageTools.wrapType2 rec { + + inherit name src; + profile = '' export LC_ALL=C.UTF-8 export XDG_DATA_DIRS=${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}:${gtk3}/share/gsettings-schemas/${gtk3.name}:$XDG_DATA_DIRS @@ -18,7 +28,14 @@ appimageTools.wrapType2 rec { multiPkgs = null; # no 32bit needed extraPkgs = p: (appimageTools.defaultFhsEnvArgs.multiPkgs p) ++ [ p.at-spi2-atk p.at-spi2-core ]; - extraInstallCommands = "mv $out/bin/{${name},${pname}}"; + extraInstallCommands = '' + mv $out/bin/{${name},${pname}} + install -m 444 -D ${appimageContents}/notable.desktop $out/share/applications/notable.desktop + install -m 444 -D ${appimageContents}/usr/share/icons/hicolor/1024x1024/apps/notable.png \ + $out/share/icons/hicolor/1024x1024/apps/notable.png + substituteInPlace $out/share/applications/notable.desktop \ + --replace 'Exec=AppRun' 'Exec=${pname}' + ''; meta = with lib; { description = "The markdown-based note-taking app that doesn't suck";