0
0
mirror of https://github.com/cucumber-sp/yandex-music-linux.git synced 2024-12-23 22:22:59 +03:00

rename modules -> nixModules; change nixModules type from list -> attrset; add instruction in README.md

This commit is contained in:
TheMaxMur 2024-02-29 18:05:13 +03:00
parent 7f5e5c2d8f
commit dd0f09cc0a
No known key found for this signature in database
GPG Key ID: B72F4A649F92F410
2 changed files with 69 additions and 32 deletions

View File

@ -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)
```
```bash
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
```
```bash
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
```
```bash
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
```
```bash
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:
```
```bash
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:
```
```bash
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:
```
```bash
pacman -S electron libpulse
makepkg
```
@ -131,7 +131,7 @@ makepkg
You can build `.deb` binary package using the following command:
```
```bash
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
```
```bash
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
flakes.
```
```bash
nix-build --expr '(import <nixpkgs> {}).callPackage ./nix {}'
```
### Install to NixOS
This flake exports `modules` list. Append it to your system modules and add
`yandex-music` package to `environment.systemPackages`.
1. Add input in your flake.nix
```nix
inputs = {
yandex-music.url = "github:cucumber-sp/yandex-music-linux";
};
```
2. Import module in your `configuration.nix` or `home-manager.nix`
```nix
imports = [
inputs.yandex-music.nixosModules.yandex-music
];
```
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
];
```

View File

@ -1,9 +1,11 @@
{
description = "Native Yandex Music desktop client";
inputs = {
ymExe.url = https://music-desktop-application.s3.yandex.net/stable/Yandex_Music_x64_5.0.12.exe;
ymExe.flake = false;
};
outputs = { self, ymExe, nixpkgs, flake-utils }:
let
yandex-music-with = pkgs: pkgs.callPackage ./nix {
@ -23,12 +25,17 @@
};
}
) // {
modules = [{
nixosModules = rec {
yandex-music = {
nixpkgs.overlays = [
(final: prev: {
yandex-music = yandex-music-with prev;
})
];
}];
};
default = yandex-music;
};
nixosModule = self.nixosModules.default;
};
}