summary refs log tree commit diff
path: root/pkgs/applications/audio/spotify/default.nix
diff options
context:
space:
mode:
authorMichael Hoang <enzime@users.noreply.github.com>2023-04-04 11:14:10 +0900
committerMichael Hoang <enzime@users.noreply.github.com>2023-04-04 16:17:14 +0900
commitb5872242a60774a96953d04695d74956889fb3be (patch)
tree1541c9c6cc3e557142b0a147526587a46d2335a9 /pkgs/applications/audio/spotify/default.nix
parent1e36c703b14366c0f4cabfd60d2f9884f330a812 (diff)
downloadnixpkgs-b5872242a60774a96953d04695d74956889fb3be.tar
nixpkgs-b5872242a60774a96953d04695d74956889fb3be.tar.gz
nixpkgs-b5872242a60774a96953d04695d74956889fb3be.tar.bz2
nixpkgs-b5872242a60774a96953d04695d74956889fb3be.tar.lz
nixpkgs-b5872242a60774a96953d04695d74956889fb3be.tar.xz
nixpkgs-b5872242a60774a96953d04695d74956889fb3be.tar.zst
nixpkgs-b5872242a60774a96953d04695d74956889fb3be.zip
spotify: Add support for `NIXOS_OZONE_WL`
Diffstat (limited to 'pkgs/applications/audio/spotify/default.nix')
-rw-r--r--pkgs/applications/audio/spotify/default.nix9
1 files changed, 5 insertions, 4 deletions
diff --git a/pkgs/applications/audio/spotify/default.nix b/pkgs/applications/audio/spotify/default.nix
index 94099abf53f..b615cf0f2c0 100644
--- a/pkgs/applications/audio/spotify/default.nix
+++ b/pkgs/applications/audio/spotify/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, lib, stdenv, squashfsTools, xorg, alsa-lib, makeWrapper, wrapGAppsHook, openssl, freetype
+{ fetchurl, lib, stdenv, squashfsTools, xorg, alsa-lib, makeShellWrapper, wrapGAppsHook, openssl, freetype
 , glib, pango, cairo, atk, gdk-pixbuf, gtk3, cups, nspr, nss, libpng, libnotify
 , libgcrypt, systemd, fontconfig, dbus, expat, ffmpeg, curlWithGnuTls, zlib, gnome
 , at-spi2-atk, at-spi2-core, libpulseaudio, libdrm, mesa, libxkbcommon
@@ -86,7 +86,7 @@ stdenv.mkDerivation {
     sha512 = "339r2q13nnpwi7gjd1axc6z2gycfm9gwz3x9dnqyaqd1g3rw7nk6nfbp6bmpkr68lfq1jfgvqwnimcgs84rsi7nmgsiabv3cz0673wv";
   };
 
-  nativeBuildInputs = [ makeWrapper wrapGAppsHook squashfsTools ];
+  nativeBuildInputs = [ wrapGAppsHook makeShellWrapper squashfsTools ];
 
   dontStrip = true;
   dontPatchELF = true;
@@ -144,13 +144,14 @@ stdenv.mkDerivation {
         --set-rpath $rpath $out/share/spotify/spotify
 
       librarypath="${lib.makeLibraryPath deps}:$libdir"
-      wrapProgram $out/share/spotify/spotify \
+      wrapProgramShell $out/share/spotify/spotify \
         ''${gappsWrapperArgs[@]} \
         ${lib.optionalString (deviceScaleFactor != null) ''
           --add-flags "--force-device-scale-factor=${toString deviceScaleFactor}" \
         ''} \
         --prefix LD_LIBRARY_PATH : "$librarypath" \
-        --prefix PATH : "${gnome.zenity}/bin"
+        --prefix PATH : "${gnome.zenity}/bin" \
+        --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}"
 
       # fix Icon line in the desktop file (#48062)
       sed -i "s:^Icon=.*:Icon=spotify-client:" "$out/share/spotify/spotify.desktop"