anchor.diff:      // Insist on using IPC for communicating with Tor
       lockPref("extensions.torlauncher.control_port_use_ipc", true);
       lockPref("extensions.torlauncher.socks_port_use_ipc", true);
  +
  +    // Allow sandbox access to sound devices if using ALSA directly
  +    ${if audioSupport then ''
  +      pref("security.sandbox.content.write_path_whitelist", "/dev/snd/");
  +    '' else ''
  +      clearPref("security.sandbox.content.write_path_whitelist");
  +    ''}
   
       // User customization
       ${extraPrefs}
  
positive.code:       shared_mime_info
      ]}
  
      mkdir -p $out/bin
      cat >$out/bin/tor-browser <<EOF
      #! ${stdenv.shell} -eu
  
negative.code: , shared_mime_info
  , noto-fonts
  , noto-fonts-emoji
  
  # Audio support
  , audioSupport ? mediaSupport
  , apulse
  
  # Media support (implies audio support)
  , mediaSupport ? false
  , gstreamer
  , gst-plugins-base
  , gst-plugins-good
  , gst-ffmpeg
  , gmp
  , ffmpeg
  
  # Extensions, common
  , zip
  