brave: add support for command line arguments

Add formal argument `commandLineArgs` to the brave derivation and append it
to the `gappsWrapperArgs` expected by the `wrapGAppsHook`. This adds some
flexibility to the wrapper creation of brave, and aligns with customization
avalible in other chromium derivation.
This commit is contained in:
polykernel 2021-09-03 09:41:52 -04:00
parent 876fb5677c
commit 9ab82127b5

View File

@ -41,6 +41,7 @@
, zlib
, xdg-utils
, wrapGAppsHook
, commandLineArgs ? ""
}:
let
@ -156,6 +157,11 @@ stdenv.mkDerivation rec {
runHook postInstall
'';
preFixup = ''
# Add command line args to wrapGApp.
gappsWrapperArgs+=(--add-flags ${lib.escapeShellArg commandLineArgs})
'';
installCheckPhase = ''
# Bypass upstream wrapper which suppresses errors
$out/opt/brave.com/brave/brave --version