mirror of
https://github.com/cucumber-sp/yandex-music-linux.git
synced 2024-12-23 22:22:59 +03:00
Merge pull request #3 from ein-shved/main
nix: add desktop item and fix names
This commit is contained in:
commit
fa262f64f7
29
default.nix
29
default.nix
@ -1,29 +0,0 @@
|
||||
{ fetchurl
|
||||
, runCommand
|
||||
, writeShellApplication
|
||||
|
||||
, p7zip
|
||||
, asar
|
||||
, electron
|
||||
, jq
|
||||
|
||||
, ymExe
|
||||
}:
|
||||
let
|
||||
app = runCommand "yandex_music_app"
|
||||
{
|
||||
nativeBuildInputs = [ p7zip asar jq ];
|
||||
repack = ./repack.sh;
|
||||
src = ymExe;
|
||||
} ''
|
||||
bash "$repack" -xl "$src"
|
||||
mv ./app "$out"
|
||||
'';
|
||||
in
|
||||
writeShellApplication {
|
||||
name = "yandex_music";
|
||||
runtimeInputs = [ electron ];
|
||||
text = ''
|
||||
electron ${app}
|
||||
'';
|
||||
}
|
@ -8,7 +8,7 @@
|
||||
};
|
||||
outputs = { self, ymExe, nixpkgs, flake-utils }:
|
||||
let
|
||||
yandex_music_with = pkgs: pkgs.callPackage ./. {
|
||||
yandex-music-with = pkgs: pkgs.callPackage ./nix {
|
||||
inherit ymExe;
|
||||
};
|
||||
in
|
||||
@ -19,15 +19,15 @@
|
||||
in
|
||||
{
|
||||
packages = rec {
|
||||
yandex_music = yandex_music_with pkgs;
|
||||
default = yandex_music;
|
||||
yandex-music = yandex-music-with pkgs;
|
||||
default = yandex-music;
|
||||
};
|
||||
}
|
||||
) // {
|
||||
modules = [{
|
||||
nixpkgs.overlays = [
|
||||
(final: prev: {
|
||||
yandex_music = yandex_music_with prev;
|
||||
yandex-music = yandex-music-with prev;
|
||||
})
|
||||
];
|
||||
}];
|
||||
|
48
nix/default.nix
Normal file
48
nix/default.nix
Normal file
@ -0,0 +1,48 @@
|
||||
{ fetchurl
|
||||
, runCommand
|
||||
, writeShellApplication
|
||||
, makeDesktopItem
|
||||
, symlinkJoin
|
||||
|
||||
, p7zip
|
||||
, asar
|
||||
, electron
|
||||
, jq
|
||||
|
||||
, ymExe
|
||||
}:
|
||||
let
|
||||
app = runCommand "yandex-music-app"
|
||||
{
|
||||
nativeBuildInputs = [ p7zip asar jq ];
|
||||
repack = ./../repack.sh;
|
||||
src = ymExe;
|
||||
} ''
|
||||
bash "$repack" -xl "$src"
|
||||
mv ./app "$out"
|
||||
'';
|
||||
launcher = writeShellApplication {
|
||||
name = "yandex-music";
|
||||
runtimeInputs = [ electron ];
|
||||
text = ''
|
||||
electron ${app} "$@"
|
||||
'';
|
||||
};
|
||||
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}/build/next-desktop/favicon.svg";
|
||||
categories = [ "Audio" "Music" "Player" "AudioVideo" ];
|
||||
extraConfig = {
|
||||
"Name[ru]" = "Яндекс Музыка";
|
||||
"Comment[ru]" = "Яндекс Музыка — собираем музыку для вас";
|
||||
};
|
||||
};
|
||||
in
|
||||
symlinkJoin {
|
||||
name = "yandex-music";
|
||||
paths = [ launcher desktopItem ];
|
||||
}
|
@ -20,4 +20,4 @@ You can install this app with dep and rpm packages, or by extracting archive fil
|
||||
## NixOs
|
||||
Запустите `nix run` в корне этого репозитория, чтобы запустить приложение. Так
|
||||
же вы можете использовать поле `modules` из flake этого репозитория. Добавив его
|
||||
в модули вашей системы, вы получите пакет `yandex_music` в коллекции pkgs.
|
||||
в модули вашей системы, вы получите пакет `yandex-music` в коллекции pkgs.
|
||||
|
Loading…
Reference in New Issue
Block a user