-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpackage.nix
More file actions
58 lines (49 loc) · 1.29 KB
/
Copy pathpackage.nix
File metadata and controls
58 lines (49 loc) · 1.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
{
fetchurl,
stdenvNoCC,
lib,
binutils,
makeWrapper,
}:
let
ymInfo = builtins.fromJSON (builtins.readFile ./ym_info.json);
in
stdenvNoCC.mkDerivation rec {
pname = "yandex-music";
version = ymInfo.version;
src = fetchurl {
url = ymInfo.deb_link;
hash = ymInfo.deb_hash;
};
nativeBuildInputs = [
binutils
makeWrapper
];
passthru.updateScript = ./scripts/update-yandex-music.sh;
unpackPhase = ''
runHook preUnpack
ar x "$src" data.tar.xz
tar -xJf data.tar.xz
runHook postUnpack
'';
installPhase = ''
runHook preInstall
mkdir -p "$out"
cp -r ./opt "$out/"
mkdir -p "$out/share"
cp -r ./usr/share/. "$out/share/"
substituteInPlace "$out/share/applications/yandexmusic.desktop" \
--replace-fail 'Exec="/opt/Яндекс Музыка/yandexmusic" %U' 'Exec=yandex-music %U'
mkdir -p "$out/bin"
makeWrapper "$out/opt/Яндекс Музыка/yandexmusic" "$out/bin/yandex-music"
runHook postInstall
'';
meta = {
description = "Yandex Music desktop client packaged from the official .deb";
homepage = "https://music.yandex.ru/";
downloadPage = "https://music.yandex.ru/download/";
license = lib.licenses.unfree;
mainProgram = "yandex-music";
platforms = lib.platforms.linux;
};
}