{discord,vesktop}: Add NIXOS_SPEECH variable to allow turning off speech without rebuilding

It's on by default and launches 6 processes

I wrote this before realizing that discord is unfree and has to be
built always anyway.

For vesktop the variable will be useful since it has to built, however
for the sake of consistency let's add it for discord too.
This commit is contained in:
Artturin
2025-04-15 01:32:02 +03:00
parent 82172395a4
commit c88d1114ed
2 changed files with 8 additions and 2 deletions
@@ -173,7 +173,10 @@ stdenv.mkDerivation rec {
wrapProgramShell $out/opt/${binaryName}/${binaryName} \
"''${gappsWrapperArgs[@]}" \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform=wayland --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}" \
${lib.strings.optionalString withTTS "--add-flags \"--enable-speech-dispatcher\""} \
${lib.strings.optionalString withTTS ''
--run 'if [[ "''${NIXOS_SPEECH:-default}" != "False" ]]; then NIXOS_SPEECH=True; else unset NIXOS_SPEECH; fi' \
--add-flags "\''${NIXOS_SPEECH:+--enable-speech-dispatcher}" \
''} \
${lib.strings.optionalString enableAutoscroll "--add-flags \"--enable-blink-features=MiddleClickAutoscroll\""} \
--prefix XDG_DATA_DIRS : "${gtk3}/share/gsettings-schemas/${gtk3.name}/" \
--prefix LD_LIBRARY_PATH : ${libPath}:$out/opt/${binaryName} \
+4 -1
View File
@@ -139,7 +139,10 @@ stdenv.mkDerivation (finalAttrs: {
lib.optionalString stdenv.hostPlatform.isLinux ''
makeWrapper ${electron}/bin/electron $out/bin/vesktop \
--add-flags $out/opt/Vesktop/resources/app.asar \
${lib.optionalString withTTS "--add-flags \"--enable-speech-dispatcher\""} \
${lib.strings.optionalString withTTS ''
--run 'if [[ "''${NIXOS_SPEECH:-default}" != "False" ]]; then NIXOS_SPEECH=True; else unset NIXOS_SPEECH; fi' \
--add-flags "\''${NIXOS_SPEECH:+--enable-speech-dispatcher}" \
''} \
${lib.optionalString withMiddleClickScroll "--add-flags \"--enable-blink-features=MiddleClickAutoscroll\""} \
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}"
''