about summary refs log tree commit diff
path: root/pkgs/applications/audio/spotify/linux.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/audio/spotify/linux.nix')
-rw-r--r--pkgs/applications/audio/spotify/linux.nix31
1 files changed, 20 insertions, 11 deletions
diff --git a/pkgs/applications/audio/spotify/linux.nix b/pkgs/applications/audio/spotify/linux.nix
index 88e4e8658a8bd..12487ef3e86e1 100644
--- a/pkgs/applications/audio/spotify/linux.nix
+++ b/pkgs/applications/audio/spotify/linux.nix
@@ -120,11 +120,15 @@ stdenv.mkDerivation {
   # Prevent double wrapping
   dontWrapGApps = true;
 
+  env = rec {
+    libdir = "${placeholder "out"}/lib/spotify";
+    librarypath = "${lib.makeLibraryPath deps}:${libdir}";
+  };
+
   installPhase =
     ''
       runHook preInstall
 
-      libdir=$out/lib/spotify
       mkdir -p $libdir
       mv ./usr/* $out/
 
@@ -147,16 +151,6 @@ stdenv.mkDerivation {
         --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
         --set-rpath $rpath $out/share/spotify/spotify
 
-      librarypath="${lib.makeLibraryPath deps}:$libdir"
-      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" \
-        --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"
 
@@ -175,6 +169,21 @@ stdenv.mkDerivation {
       runHook postInstall
     '';
 
+    fixupPhase = ''
+      runHook preFixup
+
+      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" \
+        --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--enable-features=UseOzonePlatform --ozone-platform=wayland}}"
+
+      runHook postFixup
+    '';
+
   meta = meta // {
     maintainers = with lib.maintainers; [ eelco ftrvxmtrx sheenobu timokau ma27 ];
   };