From 13ccf360aba8143154df5e1fa915ef94273bfb19 Mon Sep 17 00:00:00 2001 From: FelixLusseau <94113911+FelixLusseau@users.noreply.github.com> Date: Fri, 10 Apr 2026 20:29:50 +0200 Subject: [PATCH 1/4] feat: add Nix build --- Makefile | 10 +++++++++ README.md | 36 +++++++++++++++++++++++++++++ default.nix | 55 +++++++++++++++++++++++++++++++++++++++++++++ package-append.json | 1 + shell.nix | 13 +++++++++++ 5 files changed, 115 insertions(+) create mode 100644 default.nix create mode 100644 shell.nix diff --git a/Makefile b/Makefile index f6e1f19..c7ab5fb 100644 --- a/Makefile +++ b/Makefile @@ -110,6 +110,16 @@ build_flatpak_arm64: @echo "Build Flatpak package" @$(PACKAGE_MANAGER) $(PACKAGE_MANAGER_SUBDIR_ARG) $(APP_DIR) run build-flatpak-arm64 +build_nix_x64: + @echo "Build Nix package" + @$(PACKAGE_MANAGER) $(PACKAGE_MANAGER_SUBDIR_ARG) $(APP_DIR) run prepare-nix + @nix-build -A deezer-desktop --argstr pkgVer "$(PKGVER)" --argstr arch "x64" --out-link ./artifacts/x64/nix-result + +build_nix_arm64: + @echo "Build Nix package" + @$(PACKAGE_MANAGER) $(PACKAGE_MANAGER_SUBDIR_ARG) $(APP_DIR) run prepare-nix + @nix-build -A deezer-desktop --argstr pkgVer "$(PKGVER)" --argstr arch "arm64" --out-link ./artifacts/arm64/nix-result + #! DEV patch-new: install_deps diff --git a/README.md b/README.md index 9afb316..8310e5f 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ It packages the app in a number of formats: - `rpm` (Fedora, Red Hat, CentOS, openSUSE, ...) - `deb` (Debian, Ubuntu, Pop!\_OS, elementary OS, ...) - `tar.xz` to install anywhere else +- Nix ## Star History @@ -24,8 +25,27 @@ Special thanks to [SibrenVasse](https://github.com/SibrenVasse) who made the [or You can find all of the packages on [the release page](https://github.com/aunetx/deezer-linux/releases/latest). +### Flatpak + To install the flatpak version, you can simply go to https://flathub.org/apps/dev.aunetx.deezer (or use your favorite flatpak package manager). +### Nix + +To install the [Nix version](https://search.nixos.org/packages?query=deezer-desktop&show=deezer-desktop) available in `unstable` and current releases, you can use: +```sh +nix-shell -p deezer-desktop +``` +Or, to install it permanently, add it to your `configuration.nix` or Flakes: +```nix +{ + environment.systemPackages = with pkgs; [ + deezer-desktop + ]; +} +``` + +### Other packages + Other packages can be installed from your package manager, either by clicking on them or from the command-line. ## Usage @@ -67,6 +87,7 @@ Other packages can be installed from your package manager, either by clicking on | tar.xz | ⚠️ | ✅ | | snap | ⚠️ | ✅ | | flatpak | ⚠️ | ✅ | +| nix | ✅ | ✅ | ✅ Available ; ⚠️ Not tested ; ❌ Not available ; ⛔ Not planned @@ -187,6 +208,21 @@ To run it, you can use: flatpak run dev.aunetx.deezer ``` +### Nix + +To build the `nix` package, you can use: + +```sh +nix-shell # Temporarily install dependencies from shell.nix in a shell +make install_deps +make build_nix_{arch} +``` + +To run it, you can use: +```sh +./artifacts/{arch}/nix-result/bin/deezer-desktop +``` + ## Development If you want to contribute to this project, please read the [contribution guidelines](CONTRIBUTING.md) file. diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..800f787 --- /dev/null +++ b/default.nix @@ -0,0 +1,55 @@ +{ + pkgs ? import { config.allowUnfree = true; }, + pkgVer ? "local", + arch ? "x64", + lib ? pkgs.lib, +}: + +let + + src = ./. + "/artifacts/${arch}/linux-unpacked"; + + deezer-desktop = pkgs.stdenv.mkDerivation (finalAttrs: { + pname = "deezer-desktop"; + version = pkgVer; + inherit src; + + nativeBuildInputs = [ + pkgs.makeWrapper + ]; + + dontUnpack = true; + dontBuild = true; + installPhase = '' + runHook preInstall + install -d $out/bin $out/share/deezer-desktop/resources $out/share/applications $out/share/icons/hicolor/scalable/apps + + cp $src/resources/dev.aunetx.deezer.desktop $out/share/applications/ + substituteInPlace $out/share/applications/dev.aunetx.deezer.desktop \ + --replace-fail "run.sh" "deezer-desktop" + cp $src/resources/dev.aunetx.deezer.svg $out/share/icons/hicolor/scalable/apps/ + cp -r $src/resources/{app.asar,linux} $out/share/deezer-desktop/resources/ + + makeWrapper "${pkgs.lib.getExe pkgs.electron}" "$out/bin/deezer-desktop" \ + --inherit-argv0 \ + --add-flags "$out/share/deezer-desktop/resources/app.asar" \ + --set-default ELECTRON_FORCE_IS_PACKAGED 1 \ + --set DZ_RESOURCES_PATH "$out/share/deezer-desktop/resources" + + runHook postInstall + ''; + + meta = { + description = "Unofficial Linux port of the music streaming application"; + homepage = "https://github.com/aunetx/deezer-linux"; + downloadPage = "https://github.com/aunetx/deezer-linux/releases"; + platforms = lib.platforms.linux; + license = lib.licenses.unfree; + mainProgram = "deezer-desktop"; + }; + }); +in +{ + "deezer-desktop" = deezer-desktop; + default = deezer-desktop; +} diff --git a/package-append.json b/package-append.json index ea4e47e..e4dbab8 100644 --- a/package-append.json +++ b/package-append.json @@ -3,6 +3,7 @@ "copy-resources": "mkdir -p resources/linux && cp ../extra/linux/* ./resources/linux", "start": "yarn run copy-resources && electron .", "prepare-flatpak": "electron-builder --linux --dir", + "prepare-nix": "electron-builder --linux --dir", "build-flatpak-x64": "env DEBUG='@malept/flatpak-bundler' electron-builder --x64 --linux flatpak", "build-flatpak-arm64": "env DEBUG='@malept/flatpak-bundler' electron-builder --arm64 --linux flatpak", diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..0d8d9c4 --- /dev/null +++ b/shell.nix @@ -0,0 +1,13 @@ +{ + pkgs ? import { }, +}: + +pkgs.mkShell { + buildInputs = with pkgs; [ + gnumake + p7zip + nodejs + jq + wget + ]; +} From 690537a80f41681ab9a2695eb720ae199b543b90 Mon Sep 17 00:00:00 2001 From: FelixLusseau <94113911+FelixLusseau@users.noreply.github.com> Date: Sun, 30 Aug 2026 00:56:59 +0200 Subject: [PATCH 2/4] Corrections after Copilot review --- Makefile | 5 +++-- README.md | 2 +- default.nix | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 3d924fc..dec63d5 100644 --- a/Makefile +++ b/Makefile @@ -114,12 +114,13 @@ build_flatpak_arm64: build_nix_x64: @echo "Build Nix package" - @$(PACKAGE_MANAGER) $(PACKAGE_MANAGER_SUBDIR_ARG) $(APP_DIR) run prepare-nix + @$(PACKAGE_MANAGER) $(PACKAGE_MANAGER_SUBDIR_ARG) $(APP_DIR) run prepare-nix -- --x64 @nix-build -A deezer-desktop --argstr pkgVer "$(PKGVER)" --argstr arch "x64" --out-link ./artifacts/x64/nix-result build_nix_arm64: @echo "Build Nix package" - @$(PACKAGE_MANAGER) $(PACKAGE_MANAGER_SUBDIR_ARG) $(APP_DIR) run prepare-nix + @uname -m | grep -Eq 'arm64|aarch64' || { echo "The arm64 Nix target requires a native arm64 host."; exit 1; } + @$(PACKAGE_MANAGER) $(PACKAGE_MANAGER_SUBDIR_ARG) $(APP_DIR) run prepare-nix -- --arm64 @nix-build -A deezer-desktop --argstr pkgVer "$(PKGVER)" --argstr arch "arm64" --out-link ./artifacts/arm64/nix-result #! DEV diff --git a/README.md b/README.md index 74e62f5..a7a9ed1 100644 --- a/README.md +++ b/README.md @@ -70,7 +70,7 @@ After installing, launch **Deezer** from your applications menu, or from a termi | -------------------- | ------------------------------------------------------------------- | | Flatpak | `flatpak run dev.aunetx.deezer` | | Snap | `deezer-desktop` | -| Nix | `deezer-desktop` or `nix-shell -p deezer-desktop` | +| Nix | `deezer-desktop` or `nix run nixpkgs#deezer-desktop` | | `.deb` / `.rpm` | `deezer-desktop` | | `.tar.xz` / AppImage | `./deezer-desktop` (from the extracted folder or the AppImage file) | diff --git a/default.nix b/default.nix index 800f787..4e6ba78 100644 --- a/default.nix +++ b/default.nix @@ -7,7 +7,7 @@ let - src = ./. + "/artifacts/${arch}/linux-unpacked"; + src = ./. + "/artifacts/${arch}/linux${lib.optionalString (arch != "x64") "-${arch}"}-unpacked"; deezer-desktop = pkgs.stdenv.mkDerivation (finalAttrs: { pname = "deezer-desktop"; From ccbf2de6da0a4bc8ef500cea8a81b86e7e5be122 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Lusseau?= <94113911+FelixLusseau@users.noreply.github.com> Date: Sun, 30 Aug 2026 01:53:31 +0200 Subject: [PATCH 3/4] Also checks if x64 build is executed on a x64 system Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index dec63d5..a958c23 100644 --- a/Makefile +++ b/Makefile @@ -114,6 +114,7 @@ build_flatpak_arm64: build_nix_x64: @echo "Build Nix package" + @uname -m | grep -Eq 'x86_64|amd64' || { echo "The x64 Nix target requires a native x86_64 host."; exit 1; } @$(PACKAGE_MANAGER) $(PACKAGE_MANAGER_SUBDIR_ARG) $(APP_DIR) run prepare-nix -- --x64 @nix-build -A deezer-desktop --argstr pkgVer "$(PKGVER)" --argstr arch "x64" --out-link ./artifacts/x64/nix-result From 147a0213f35a410ad5508e5c8d5815049c727af5 Mon Sep 17 00:00:00 2001 From: FelixLusseau <94113911+FelixLusseau@users.noreply.github.com> Date: Sun, 30 Aug 2026 13:25:57 +0200 Subject: [PATCH 4/4] Correct run once command and move it --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a7a9ed1..5ff736a 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ It packages the app in a number of formats: | **Flatpak**\* | Sandboxed, auto-updated, works everywhere | [**Install from Flathub**](https://flathub.org/apps/dev.aunetx.deezer) or `flatpak install flathub dev.aunetx.deezer` | | **Snap**\* | Ubuntu and Snap-based distros | [**Install from the Snap Store**](https://snapcraft.io/deezer-desktop) or `sudo snap install deezer-desktop` | | **AppImage** | A single portable file, no installation needed | [Download from the releases page](https://github.com/aunetx/deezer-linux/releases/latest) | -| **Nix** | NixOS and other distros using Nix package manager | Add the [Nix version](https://search.nixos.org/packages?query=deezer-desktop&show=deezer-desktop) available in `unstable` and current releases to your configuration | +| **Nix** | NixOS and other distros using Nix package manager | Add the [Nix version](https://search.nixos.org/packages?query=deezer-desktop&show=deezer-desktop) available in `unstable` and current releases to your configuration or run it once with `nix-shell -p deezer-desktop --run deezer-desktop` | | **`.deb`** | Debian, Ubuntu, Pop!\_OS, elementary OS… | [Download from the releases page](https://github.com/aunetx/deezer-linux/releases/latest) | | **`.rpm`** | Fedora, Red Hat, CentOS, openSUSE… | [Download from the releases page](https://github.com/aunetx/deezer-linux/releases/latest) | | **`.tar.xz`** | Any other distro. Set up and run | [Download from the releases page](https://github.com/aunetx/deezer-linux/releases/latest) | @@ -70,7 +70,7 @@ After installing, launch **Deezer** from your applications menu, or from a termi | -------------------- | ------------------------------------------------------------------- | | Flatpak | `flatpak run dev.aunetx.deezer` | | Snap | `deezer-desktop` | -| Nix | `deezer-desktop` or `nix run nixpkgs#deezer-desktop` | +| Nix | `deezer-desktop` | | `.deb` / `.rpm` | `deezer-desktop` | | `.tar.xz` / AppImage | `./deezer-desktop` (from the extracted folder or the AppImage file) |