mirror of
https://github.com/cucumber-sp/yandex-music-linux.git
synced 2024-12-25 06:44:38 +03:00
a75f59cd80
Electron is quite unoptimised technology and running YM window in foreground requires a lot of cpu usage. So hiding window to background is more feature, then bug =) Change-Id: Id4e00303379004b6353a88efd7232e180f80fe6d
49 lines
1.1 KiB
Nix
49 lines
1.1 KiB
Nix
{ fetchurl
|
||
, runCommand
|
||
, writeShellApplication
|
||
, makeDesktopItem
|
||
, symlinkJoin
|
||
|
||
, p7zip
|
||
, asar
|
||
, electron
|
||
, jq
|
||
|
||
, ymExe
|
||
, fixQuit ? true
|
||
}:
|
||
let
|
||
app = runCommand "yandex-music-app"
|
||
{
|
||
nativeBuildInputs = [ p7zip asar jq ];
|
||
repack = ./../repack.sh;
|
||
src = ymExe;
|
||
} ''
|
||
bash "$repack" ${if !fixQuit then "-q" else ""} -o "$out" "$src"
|
||
'';
|
||
launcher = writeShellApplication {
|
||
name = "yandex-music";
|
||
runtimeInputs = [ electron ];
|
||
text = ''
|
||
electron ${app}/yandexmusic.asar "$@"
|
||
'';
|
||
};
|
||
desktopItem = makeDesktopItem {
|
||
name = "yandex-music";
|
||
desktopName = "Yandex Music";
|
||
comment = "Yandex Music - we collect music for you";
|
||
exec = "${launcher}/bin/yandex-music";
|
||
terminal = false;
|
||
icon = "${app}/favicon.svg";
|
||
categories = [ "Audio" "Music" "Player" "AudioVideo" ];
|
||
extraConfig = {
|
||
"Name[ru]" = "Яндекс Музыка";
|
||
"Comment[ru]" = "Яндекс Музыка — собираем музыку для вас";
|
||
};
|
||
};
|
||
in
|
||
symlinkJoin {
|
||
name = "yandex-music";
|
||
paths = [ launcher desktopItem ];
|
||
}
|