nixpkgs/pkgs/applications/audio/youtube-music/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

45 lines
1.5 KiB
Nix
Raw Normal View History

2023-08-19 12:17:30 +00:00
{ lib, fetchurl, appimageTools, makeWrapper }:
2022-11-09 19:09:45 +00:00
let
pname = "youtube-music";
version = "1.20.0";
2022-11-09 19:09:45 +00:00
src = fetchurl {
url = "https://github.com/th-ch/youtube-music/releases/download/v${version}/YouTube-Music-${version}.AppImage";
hash = "sha256-eTPWLD9KUs2ZsLbYRkknnx5uDyrNSbFHPyv6gU+wL/c=";
2022-11-09 19:09:45 +00:00
};
appimageContents = appimageTools.extract { inherit pname version src; };
in
2023-08-19 12:17:30 +00:00
(appimageTools.wrapType2 rec {
2022-11-09 19:09:45 +00:00
inherit pname version src;
extraPkgs = pkgs: (appimageTools.defaultFhsEnvArgs.multiPkgs pkgs)
++ [ pkgs.libappindicator ];
2022-11-09 19:09:45 +00:00
extraInstallCommands = ''
mv $out/bin/{${pname}-${version},${pname}}
2023-08-19 12:17:30 +00:00
wrapProgram "$out/bin/${pname}" \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland --enable-features=WaylandWindowDecorations}}"
2022-11-09 19:09:45 +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;
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
2022-11-09 19:09:45 +00:00
platforms = platforms.linux;
maintainers = [ maintainers.aacebedo ];
mainProgram = "youtube-music";
2022-11-09 19:09:45 +00:00
};
2023-08-19 12:17:30 +00:00
}).overrideAttrs ({ nativeBuildInputs ? [ ], ... }: {
nativeBuildInputs = nativeBuildInputs ++ [ makeWrapper ];
})