2023-10-09 19:29:22 +00:00
|
|
|
{ lib, fetchurl, appimageTools, makeWrapper }:
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
let
|
|
|
|
pname = "youtube-music";
|
2023-05-24 13:37:59 +00:00
|
|
|
version = "1.20.0";
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/th-ch/youtube-music/releases/download/v${version}/YouTube-Music-${version}.AppImage";
|
2023-05-24 13:37:59 +00:00
|
|
|
hash = "sha256-eTPWLD9KUs2ZsLbYRkknnx5uDyrNSbFHPyv6gU+wL/c=";
|
2022-11-21 17:40:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
appimageContents = appimageTools.extract { inherit pname version src; };
|
|
|
|
in
|
2023-10-09 19:29:22 +00:00
|
|
|
(appimageTools.wrapType2 rec {
|
2022-11-21 17:40:18 +00:00
|
|
|
inherit pname version src;
|
2022-12-02 08:20:57 +00:00
|
|
|
extraPkgs = pkgs: (appimageTools.defaultFhsEnvArgs.multiPkgs pkgs)
|
|
|
|
++ [ pkgs.libappindicator ];
|
2022-11-21 17:40:18 +00:00
|
|
|
|
|
|
|
extraInstallCommands = ''
|
|
|
|
mv $out/bin/{${pname}-${version},${pname}}
|
2023-10-09 19:29:22 +00:00
|
|
|
wrapProgram "$out/bin/${pname}" \
|
|
|
|
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland --enable-features=WaylandWindowDecorations}}"
|
|
|
|
|
2022-11-21 17:40:18 +00:00
|
|
|
install -m 444 \
|
|
|
|
-D ${appimageContents}/youtube-music.desktop \
|
|
|
|
-t $out/share/applications
|
|
|
|
substituteInPlace \
|
|
|
|
$out/share/applications/youtube-music.desktop \
|
|
|
|
--replace 'Exec=AppRun' 'Exec=${pname}'
|
|
|
|
cp -r ${appimageContents}/usr/share/icons $out/share
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Electron wrapper around YouTube Music";
|
|
|
|
homepage = "https://th-ch.github.io/youtube-music/";
|
|
|
|
license = licenses.mit;
|
2022-12-02 08:20:57 +00:00
|
|
|
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
|
2022-11-21 17:40:18 +00:00
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = [ maintainers.aacebedo ];
|
2023-08-04 22:07:22 +00:00
|
|
|
mainProgram = "youtube-music";
|
2022-11-21 17:40:18 +00:00
|
|
|
};
|
2023-10-09 19:29:22 +00:00
|
|
|
}).overrideAttrs ({ nativeBuildInputs ? [ ], ... }: {
|
|
|
|
nativeBuildInputs = nativeBuildInputs ++ [ makeWrapper ];
|
|
|
|
})
|