@@ -0,0 +1,31 @@
1+{ symlinkJoin
2+, lib
3+, spotify-unwrapped
4+, makeWrapper
5+
6+ # High-DPI support: Spotify's --force-device-scale-factor argument; not added
7+ # if `null`, otherwise, should be a number.
8+, deviceScaleFactor ? null
9+}:
10+
11+symlinkJoin {
12+ name = "spotify-${spotify-unwrapped.version}";
13+
14+ paths = [ spotify-unwrapped.out ];
15+
16+ nativeBuildInputs = [ makeWrapper ];
17+ preferLocalBuild = true;
18+ passthru.unwrapped = spotify-unwrapped;
19+ postBuild = ''
20+ wrapProgram $out/bin/spotify \
21+ ${lib.optionalString (deviceScaleFactor != null) ''
22+ --add-flags ${lib.escapeShellArg "--force-device-scale-factor=${
23+ builtins.toString deviceScaleFactor
24+ }"}
25+ ''}
26+ '';
27+
28+ meta = spotify-unwrapped.meta // {
29+ priority = (spotify-unwrapped.meta.priority or 0) - 1;
30+ };
31+}