mirror of
https://github.com/cucumber-sp/yandex-music-linux.git
synced 2024-12-23 22:22:59 +03:00
Merge pull request #56 from TheMaxMur/feature/nixosModules
rename modules -> nixModules; change nixModules type from list -> att…
This commit is contained in:
commit
bf139db355
54
README.md
54
README.md
@ -36,7 +36,7 @@ You can obtain the latest version of package from `AUR` using one of the [AUR He
|
|||||||
|
|
||||||
For this example I will use [yay](https://github.com/Jguer/yay)
|
For this example I will use [yay](https://github.com/Jguer/yay)
|
||||||
|
|
||||||
```
|
```bash
|
||||||
yay -S yandex-music
|
yay -S yandex-music
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ Download prebuilt binary package from [Releases](https://github.com/cucumber-sp/
|
|||||||
|
|
||||||
Then you can install it with the following command
|
Then you can install it with the following command
|
||||||
|
|
||||||
```
|
```bash
|
||||||
pacman -U yandex-music-<version>-any.pkg.tar.zst
|
pacman -U yandex-music-<version>-any.pkg.tar.zst
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ Download prebuilt binary package from [Releases](https://github.com/cucumber-sp/
|
|||||||
|
|
||||||
Then you can install it with the following command
|
Then you can install it with the following command
|
||||||
|
|
||||||
```
|
```bash
|
||||||
dpkg -i yandex-music_<version>_<arch>.deb
|
dpkg -i yandex-music_<version>_<arch>.deb
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ That's the list of packages you might need to install to be able to manually bui
|
|||||||
|
|
||||||
In addition you will need to install [Asar](https://github.com/electron/asar) tool with `npm`. I recommend install it globally with the following command
|
In addition you will need to install [Asar](https://github.com/electron/asar) tool with `npm`. I recommend install it globally with the following command
|
||||||
|
|
||||||
```
|
```bash
|
||||||
npm install -g @electron/asar
|
npm install -g @electron/asar
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -101,7 +101,7 @@ Last step is to download original client `.exe` file. You can get it yourself or
|
|||||||
|
|
||||||
If you only want to get extracted app project with applied patches, you can use the following command:
|
If you only want to get extracted app project with applied patches, you can use the following command:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
sh repack.sh -x [-o OUTPUT_DIR default=./app] <YM.exe>
|
sh repack.sh -x [-o OUTPUT_DIR default=./app] <YM.exe>
|
||||||
```
|
```
|
||||||
***
|
***
|
||||||
@ -110,7 +110,7 @@ sh repack.sh -x [-o OUTPUT_DIR default=./app] <YM.exe>
|
|||||||
|
|
||||||
`.asar` is archive file that containes all electron app resources and information, but doesn't hold Electron binaries. If you have `.asar` file you can launch app using `electron <app>.asar`. You can build this archive with the following command:
|
`.asar` is archive file that containes all electron app resources and information, but doesn't hold Electron binaries. If you have `.asar` file you can launch app using `electron <app>.asar`. You can build this archive with the following command:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
sh repack.sh [-o OUTPUT_DIR default=./app] <YM.exe>
|
sh repack.sh [-o OUTPUT_DIR default=./app] <YM.exe>
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -120,7 +120,7 @@ sh repack.sh [-o OUTPUT_DIR default=./app] <YM.exe>
|
|||||||
|
|
||||||
You can build `pacman` package file manually using `PKGBUILD` file from the this repository. Run following commands in folder with `PKGBUILD` file inside to get `.pkg.tar.zst` package:
|
You can build `pacman` package file manually using `PKGBUILD` file from the this repository. Run following commands in folder with `PKGBUILD` file inside to get `.pkg.tar.zst` package:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
pacman -S electron libpulse
|
pacman -S electron libpulse
|
||||||
makepkg
|
makepkg
|
||||||
```
|
```
|
||||||
@ -131,7 +131,7 @@ makepkg
|
|||||||
|
|
||||||
You can build `.deb` binary package using the following command:
|
You can build `.deb` binary package using the following command:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
sh build_deb.sh [-a <x64|armv7l|arm64|all> default=x64]
|
sh build_deb.sh [-a <x64|armv7l|arm64|all> default=x64]
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -146,7 +146,7 @@ The `yandex-music` package has unlicensed license, so you need to have
|
|||||||
|
|
||||||
Execute next to build and run yandex music directly from github
|
Execute next to build and run yandex music directly from github
|
||||||
|
|
||||||
```
|
```bash
|
||||||
nix run github:cucumber-sp/yandex-music-linux
|
nix run github:cucumber-sp/yandex-music-linux
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -155,11 +155,41 @@ nix run github:cucumber-sp/yandex-music-linux
|
|||||||
Execute next in this repository to build yandex-music package without using
|
Execute next in this repository to build yandex-music package without using
|
||||||
flakes.
|
flakes.
|
||||||
|
|
||||||
```
|
```bash
|
||||||
nix-build --expr '(import <nixpkgs> {}).callPackage ./nix {}'
|
nix-build --expr '(import <nixpkgs> {}).callPackage ./nix {}'
|
||||||
```
|
```
|
||||||
|
|
||||||
### Install to NixOS
|
### Install to NixOS
|
||||||
|
|
||||||
This flake exports `modules` list. Append it to your system modules and add
|
1. Add input in your flake.nix
|
||||||
`yandex-music` package to `environment.systemPackages`.
|
|
||||||
|
```nix
|
||||||
|
inputs = {
|
||||||
|
yandex-music.url = "github:cucumber-sp/yandex-music-linux";
|
||||||
|
};
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Import module in your `configuration.nix` or `home-manager.nix`
|
||||||
|
|
||||||
|
```nix
|
||||||
|
imports = [
|
||||||
|
yandex-music.nixosModule
|
||||||
|
];
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Add package `yandex-music`
|
||||||
|
|
||||||
|
For `configuration.nix`:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
environment.systemPackages = with pkgs; [
|
||||||
|
yandex-music
|
||||||
|
];
|
||||||
|
```
|
||||||
|
For Home Manager:
|
||||||
|
|
||||||
|
```nix
|
||||||
|
home.packages = with pkgs; [
|
||||||
|
yandex-music
|
||||||
|
];
|
||||||
|
```
|
||||||
|
47
flake.nix
47
flake.nix
@ -1,34 +1,41 @@
|
|||||||
{
|
{
|
||||||
description = "Native Yandex Music desktop client";
|
description = "Native Yandex Music desktop client";
|
||||||
|
|
||||||
inputs = {
|
inputs = {
|
||||||
ymExe.url = https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.12.exe;
|
ymExe.url = https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.12.exe;
|
||||||
ymExe.flake = false;
|
ymExe.flake = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = { self, ymExe, nixpkgs, flake-utils }:
|
outputs = { self, ymExe, nixpkgs, flake-utils }:
|
||||||
let
|
let
|
||||||
yandex-music-with = pkgs: pkgs.callPackage ./nix {
|
yandex-music-with = pkgs: pkgs.callPackage ./nix {
|
||||||
inherit ymExe;
|
inherit ymExe;
|
||||||
};
|
};
|
||||||
in
|
in
|
||||||
flake-utils.lib.eachDefaultSystem
|
flake-utils.lib.eachDefaultSystem
|
||||||
(system:
|
(system:
|
||||||
let
|
let
|
||||||
pkgs = import nixpkgs { inherit system; };
|
pkgs = import nixpkgs { inherit system; };
|
||||||
in
|
in
|
||||||
{
|
{
|
||||||
packages = rec {
|
packages = rec {
|
||||||
yandex-music = yandex-music-with pkgs;
|
yandex-music = yandex-music-with pkgs;
|
||||||
yandex-music-noflakes = pkgs.callPackage ./nix {};
|
yandex-music-noflakes = pkgs.callPackage ./nix {};
|
||||||
default = yandex-music;
|
default = yandex-music;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
) // {
|
) // {
|
||||||
modules = [{
|
nixosModules = rec {
|
||||||
|
yandex-music = {
|
||||||
nixpkgs.overlays = [
|
nixpkgs.overlays = [
|
||||||
(final: prev: {
|
(final: prev: {
|
||||||
yandex-music = yandex-music-with prev;
|
yandex-music = yandex-music-with prev;
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
}];
|
};
|
||||||
|
default = yandex-music;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
nixosModule = self.nixosModules.default;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user