2024-01-15 10:52:43 +03:00
|
|
|
|
{ fetchurl
|
|
|
|
|
, runCommand
|
|
|
|
|
, writeShellApplication
|
|
|
|
|
, makeDesktopItem
|
|
|
|
|
, symlinkJoin
|
|
|
|
|
|
|
|
|
|
, p7zip
|
|
|
|
|
, asar
|
|
|
|
|
, electron
|
|
|
|
|
, jq
|
|
|
|
|
|
|
|
|
|
, ymExe
|
2024-01-30 21:32:35 +03:00
|
|
|
|
, fixQuit ? true
|
2024-01-15 10:52:43 +03:00
|
|
|
|
}:
|
|
|
|
|
let
|
|
|
|
|
app = runCommand "yandex-music-app"
|
|
|
|
|
{
|
|
|
|
|
nativeBuildInputs = [ p7zip asar jq ];
|
|
|
|
|
repack = ./../repack.sh;
|
|
|
|
|
src = ymExe;
|
|
|
|
|
} ''
|
2024-01-30 21:32:35 +03:00
|
|
|
|
bash "$repack" ${if !fixQuit then "-q" else ""} -o "$out" "$src"
|
2024-01-15 10:52:43 +03:00
|
|
|
|
'';
|
|
|
|
|
launcher = writeShellApplication {
|
|
|
|
|
name = "yandex-music";
|
|
|
|
|
runtimeInputs = [ electron ];
|
|
|
|
|
text = ''
|
2024-01-30 21:22:30 +03:00
|
|
|
|
electron ${app}/yandexmusic.asar "$@"
|
2024-01-15 10:52:43 +03:00
|
|
|
|
'';
|
|
|
|
|
};
|
|
|
|
|
desktopItem = makeDesktopItem {
|
|
|
|
|
name = "yandex-music";
|
|
|
|
|
desktopName = "Yandex Music";
|
|
|
|
|
comment = "Yandex Music - we collect music for you";
|
|
|
|
|
exec = "${launcher}/bin/yandex-music";
|
|
|
|
|
terminal = false;
|
2024-01-30 21:22:30 +03:00
|
|
|
|
icon = "${app}/favicon.svg";
|
2024-01-15 10:52:43 +03:00
|
|
|
|
categories = [ "Audio" "Music" "Player" "AudioVideo" ];
|
|
|
|
|
extraConfig = {
|
|
|
|
|
"Name[ru]" = "Яндекс Музыка";
|
|
|
|
|
"Comment[ru]" = "Яндекс Музыка — собираем музыку для вас";
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
in
|
|
|
|
|
symlinkJoin {
|
|
|
|
|
name = "yandex-music";
|
|
|
|
|
paths = [ launcher desktopItem ];
|
|
|
|
|
}
|