♻️ different approach of unpackiging appImages
Signed-off-by: Xaiya Schumin <d.schumin@proton.me>
This commit is contained in:
@@ -5,36 +5,25 @@
|
||||
appimageTools,
|
||||
makeDesktopItem,
|
||||
}:
|
||||
let
|
||||
version = "2.3.5";
|
||||
appimageTools.wrapType2 rec {
|
||||
pname = "discord-music-presence";
|
||||
version = "2.3.5";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://github.com/ungive/discord-music-presence/releases/download/v${version}/musicpresence-${version}-linux-x86_64.AppImage";
|
||||
hash = "sha256-M7oDxVevspA3SGuHktS8ChQAYopgIqypiVlzyE4uyqI=";
|
||||
};
|
||||
|
||||
icon = fetchurl {
|
||||
url = "https://raw.githubusercontent.com/music-presence/icons/refs/heads/master/dist/logo-app-circle.png";
|
||||
hash = "sha256-ZQMN145GiTiFAYcVVSgaOLP3xSHokf3N0kFI+jf/2Zk=";
|
||||
};
|
||||
|
||||
desktopItem = makeDesktopItem {
|
||||
name = pname;
|
||||
exec = pname;
|
||||
icon = icon;
|
||||
desktopName = pname;
|
||||
genericName = "Discord Music Presence";
|
||||
categories = [ "Application" ];
|
||||
};
|
||||
in
|
||||
appimageTools.wrapType2 rec {
|
||||
inherit pname version src;
|
||||
|
||||
extraInstallCommands = ''
|
||||
mkdir "$out/share";
|
||||
ln -s "${desktopItem}/share/applications" "$out/share";
|
||||
'';
|
||||
extraInstallCommands =
|
||||
let
|
||||
contents = appimageTools.extract { inherit pname version src; };
|
||||
in
|
||||
''
|
||||
install -m 444 -D ${contents}/musicpresence.desktop -t $out/share/applications
|
||||
substituteInPlace $out/share/applications/musicpresence.desktop \
|
||||
--replace-fail Exec=musicpresence Exec=$out/bin/${pname}
|
||||
cp -r ${contents}/usr/share/icons $out/share
|
||||
'';
|
||||
|
||||
meta = {
|
||||
description = "The Discord music status that works with any media player";
|
||||
|
||||
Reference in New Issue
Block a user