diff --git a/README.md b/README.md index 5ede817..4f6d31e 100644 --- a/README.md +++ b/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) -``` +```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--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__.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] ``` *** @@ -110,7 +110,7 @@ sh repack.sh -x [-o OUTPUT_DIR default=./app] `.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 .asar`. You can build this archive with the following command: -``` +```bash sh repack.sh [-o OUTPUT_DIR default=./app] ``` @@ -120,7 +120,7 @@ sh repack.sh [-o OUTPUT_DIR default=./app] 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 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 {}).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 + ]; + ``` diff --git a/flake.nix b/flake.nix index 4c12d76..36c7fe8 100644 --- a/flake.nix +++ b/flake.nix @@ -1,34 +1,41 @@ { 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 { - inherit ymExe; - }; - in - flake-utils.lib.eachDefaultSystem - (system: - let - pkgs = import nixpkgs { inherit system; }; - in - { - packages = rec { - yandex-music = yandex-music-with pkgs; - yandex-music-noflakes = pkgs.callPackage ./nix {}; - default = yandex-music; - }; - } - ) // { - modules = [{ + let + yandex-music-with = pkgs: pkgs.callPackage ./nix { + inherit ymExe; + }; + in + flake-utils.lib.eachDefaultSystem + (system: + let + pkgs = import nixpkgs { inherit system; }; + in + { + packages = rec { + yandex-music = yandex-music-with pkgs; + yandex-music-noflakes = pkgs.callPackage ./nix {}; + default = yandex-music; + }; + } + ) // { + nixosModules = rec { + yandex-music = { nixpkgs.overlays = [ (final: prev: { yandex-music = yandex-music-with prev; }) ]; - }]; + }; + default = yandex-music; }; + + nixosModule = self.nixosModules.default; + }; }