mirror of
https://github.com/cucumber-sp/yandex-music-linux.git
synced 2025-09-28 01:29:03 +03:00
[nix] Fix configuration
Reuse common shell for nix package. Add options for nix-way configuration of yandex music. Change-Id: I71a209a8ca8b5e3c5c08349b8da5ba91182a919e
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
, electron
|
||||
|
||||
, ymExe ? null
|
||||
, electronArguments ? ""
|
||||
, trayEnabled ? false
|
||||
}:
|
||||
let
|
||||
version_info = with builtins; fromJSON (readFile ../utility/version_info.json);
|
||||
@@ -32,6 +34,7 @@ stdenvNoCC.mkDerivation
|
||||
utility = ./../utility;
|
||||
icons = ./../icons;
|
||||
desktopItem = ../templates/desktop;
|
||||
ymScript = ../templates/yandex-music.sh;
|
||||
src =
|
||||
if ymExe != null
|
||||
then ymExe
|
||||
@@ -54,10 +57,17 @@ stdenvNoCC.mkDerivation
|
||||
mkdir -p "$out/share/nodejs"
|
||||
mv app/yandex-music.asar "$out/share/nodejs"
|
||||
|
||||
# use makeWrapper on electron binary to make it call our asar package
|
||||
makeWrapper "${electron}/bin/electron" "$out/bin/yandex-music" \
|
||||
--add-flags "$out/share/nodejs/yandex-music.asar" \
|
||||
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}"
|
||||
CONFIG_FILE="$out/share/yandex-music.conf"
|
||||
echo "TRAY_ENABLED=${if trayEnabled then "1" else "0"}" >> "$CONFIG_FILE"
|
||||
echo "ELECTRON_ARGS=\"${electronArguments}\"" >> "$CONFIG_FILE"
|
||||
|
||||
|
||||
install -Dm755 "$ymScript" "$out/bin/yandex-music"
|
||||
sed -i "s|%electron_path%|${electron}/bin/electron|g" "$out/bin/yandex-music"
|
||||
sed -i "s|%asar_path%|$out/share/nodejs/yandex-music.asar|g" "$out/bin/yandex-music"
|
||||
|
||||
wrapProgram "$out/bin/yandex-music" \
|
||||
--set-default YANDEX_MUSIC_CONFIG "$CONFIG_FILE"
|
||||
|
||||
install -Dm644 "./app/favicon.png" "$out/share/pixmaps/yandex-music.png"
|
||||
install -Dm644 "./app/favicon.png" "$out/share/icons/hicolor/48x48/apps/yandex-music.png"
|
||||
|
Reference in New Issue
Block a user