From 509b5ad9dbae637871020cd15e2d87ba6be6f194 Mon Sep 17 00:00:00 2001 From: hacker1024 Date: Sat, 19 Aug 2023 22:17:30 +1000 Subject: [PATCH] youtube-music: Respect NIXOS_OZONE_WL --- pkgs/applications/audio/youtube-music/default.nix | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/audio/youtube-music/default.nix b/pkgs/applications/audio/youtube-music/default.nix index 91cf74e65d0c..d6313c6bd84f 100644 --- a/pkgs/applications/audio/youtube-music/default.nix +++ b/pkgs/applications/audio/youtube-music/default.nix @@ -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 ]; +})