Merge pull request #250182 from hacker1024/feature/youtube-music-wayland

youtube-music: Respect NIXOS_OZONE_WL
This commit is contained in:
Weijia Wang 2023-09-07 01:55:16 +02:00 committed by GitHub
commit cc9110350d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,4 +1,4 @@
{ lib, fetchurl, appimageTools, }:
{ lib, fetchurl, appimageTools, makeWrapper }:
let
pname = "youtube-music";
@ -11,13 +11,16 @@ let
appimageContents = appimageTools.extract { inherit pname version src; };
in
appimageTools.wrapType2 rec {
(appimageTools.wrapType2 rec {
inherit pname version src;
extraPkgs = pkgs: (appimageTools.defaultFhsEnvArgs.multiPkgs pkgs)
++ [ pkgs.libappindicator ];
extraInstallCommands = ''
mv $out/bin/{${pname}-${version},${pname}}
wrapProgram "$out/bin/${pname}" \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland --enable-features=WaylandWindowDecorations}}"
install -m 444 \
-D ${appimageContents}/youtube-music.desktop \
-t $out/share/applications
@ -36,4 +39,6 @@ appimageTools.wrapType2 rec {
maintainers = [ maintainers.aacebedo ];
mainProgram = "youtube-music";
};
}
}).overrideAttrs ({ nativeBuildInputs ? [ ], ... }: {
nativeBuildInputs = nativeBuildInputs ++ [ makeWrapper ];
})