1{
2 lib,
3 fetchurl,
4 appimageTools,
5 makeWrapper,
6}:
7
8let
9 pname = "plexamp";
10 version = "4.12.4";
11
12 src = fetchurl {
13 url = "https://plexamp.plex.tv/plexamp.plex.tv/desktop/Plexamp-${version}.AppImage";
14 name = "${pname}-${version}.AppImage";
15 hash = "sha512-LtYqC4pqX7hA+clUj9UVrp0YWebELULM23SsYlKnVDcYbZn8LJldiOOebS0+SU4RqK1a8Z3Kh4fPJ/HfijP0qw==";
16 };
17
18 appimageContents = appimageTools.extractType2 {
19 inherit pname version src;
20 };
21in
22appimageTools.wrapType2 {
23 inherit pname version src;
24
25 extraInstallCommands = ''
26 install -m 444 -D ${appimageContents}/plexamp.desktop $out/share/applications/plexamp.desktop
27 install -m 444 -D ${appimageContents}/plexamp.svg \
28 $out/share/icons/hicolor/scalable/apps/plexamp.svg
29 substituteInPlace $out/share/applications/${pname}.desktop \
30 --replace 'Exec=AppRun' 'Exec=${pname}'
31 source "${makeWrapper}/nix-support/setup-hook"
32 wrapProgram "$out/bin/plexamp" \
33 --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}"
34 '';
35
36 passthru.updateScript = ./update-plexamp.sh;
37
38 meta = with lib; {
39 description = "Beautiful Plex music player for audiophiles, curators, and hipsters";
40 homepage = "https://plexamp.com/";
41 changelog = "https://forums.plex.tv/t/plexamp-release-notes/221280/81";
42 license = licenses.unfree;
43 maintainers = with maintainers; [
44 killercup
45 redhawk
46 synthetica
47 ];
48 platforms = [ "x86_64-linux" ];
49 };
50}