#! /nix/store/cl2gkgnh26mmpka81pc2g5bzjfrili92-bash-5.3p3/bin/bash -e

if [ -x "/run/wrappers/bin/__chromium-suid-sandbox" ]
then
  export CHROME_DEVEL_SANDBOX="/run/wrappers/bin/__chromium-suid-sandbox"
else
  export CHROME_DEVEL_SANDBOX="/nix/store/wb5fr6ximbq19vbfgr5dw7miqnkqj6h4-helium-browser-0.5.7-141.0.7390.107-sandbox/bin/__chromium-suid-sandbox"
fi

# Make generated desktop shortcuts have a valid executable name.
export CHROME_WRAPPER='helium'

# To avoid loading .so files from cwd, LD_LIBRARY_PATH here must not
# contain an empty section before or after a colon.
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH${LD_LIBRARY_PATH:+:}/nix/store/lm4anvzaxv13aw24cb9cxpwkyrq9d97v-libva-2.22.0/lib:/nix/store/plx9hmh9gbd8s7nbiaijz49501br2vvf-pipewire-1.4.8/lib:/nix/store/7gr1mq9q40xcxirsawn34kzxj8kmgcl6-wayland-1.24.0/lib:/nix/store/m9disdwacfbmfpl9x6v7h7011rbahz7f-gtk+3-3.24.49/lib:/nix/store/2329310vfm5ivldbrnwp317ijcmzbfzi-gtk4-4.18.6/lib:/nix/store/xn5g4ncd73szqypzzmd98dk8xlzncwk4-krb5-1.22.1-lib/lib"

# libredirect causes chromium to deadlock on startup
export LD_PRELOAD="$(echo -n "$LD_PRELOAD" | /nix/store/00bc157nm93q5fjz551fwk60ihlbilvj-coreutils-9.7/bin/tr ':' '\n' | /nix/store/6q57mnfak3q8ss656qgp245qzqvnniyr-gnugrep-3.12/bin/grep -v /lib/libredirect\\.so$ | /nix/store/00bc157nm93q5fjz551fwk60ihlbilvj-coreutils-9.7/bin/tr '\n' ':')"

export XDG_DATA_DIRS=/nix/store/fgyxm1lpvpd13asgmviypbi4sl6a73w2-cups-2.4.14/share:/nix/store/m9disdwacfbmfpl9x6v7h7011rbahz7f-gtk+3-3.24.49/share:/nix/store/2329310vfm5ivldbrnwp317ijcmzbfzi-gtk4-4.18.6/share:/nix/store/f0ih1z5iajsax2rmryck7a6j2ys1k37k-adwaita-icon-theme-48.0/share:/nix/store/gffh39nwyysqncknijxn7hpyasrqszax-hicolor-icon-theme-0.18/share:/nix/store/d177qdbszw6wlmd1yahgk1mbafxbyqmm-gsettings-desktop-schemas-48.0/share/gsettings-schemas/gsettings-desktop-schemas-48.0:/nix/store/m9disdwacfbmfpl9x6v7h7011rbahz7f-gtk+3-3.24.49/share/gsettings-schemas/gtk+3-3.24.49:/nix/store/2329310vfm5ivldbrnwp317ijcmzbfzi-gtk4-4.18.6/share/gsettings-schemas/gtk4-4.18.6${XDG_DATA_DIRS:+:}$XDG_DATA_DIRS

# Mainly for xdg-open but also other xdg-* tools (this is only a fallback; $PATH is suffixed so that other implementations can be used):
export PATH="$PATH${PATH:+:}/nix/store/4y6rpi6hsmnm120xbp3f5xmwa0vgqcqp-xdg-utils-1.2.1/bin"

exec "/nix/store/swqp1gsx4nyvxxalgkpgzh6z7yryd0np-helium-browser-unwrapped-0.5.7-141.0.7390.107/libexec/helium/helium"  ${NIXOS_OZONE_WL:+${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations --enable-wayland-ime=true}}  "$@" 
