ungoogled-chromium-private.bash 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #!/bin/bash
  2. set -euo pipefail
  3. (exec bwrap \
  4. --proc /proc \
  5. --dev /dev \
  6. --tmpfs /tmp \
  7. --dev-bind /dev/dri /dev/dri \
  8. --dev-bind /dev/snd /dev/snd \
  9. --ro-bind /etc/fonts/ /etc/fonts/ \
  10. --ro-bind /etc/sndio.conf /etc/sndio.conf \
  11. --ro-bind /etc/ssl/certs /etc/ssl/certs \
  12. --ro-bind /etc/resolv.conf /etc/resolv.conf \
  13. --ro-bind /lib /lib \
  14. --ro-bind /lib64 /lib64 \
  15. --ro-bind /sys/dev/char /sys/dev/char \
  16. --ro-bind /sys/devices /sys/devices \
  17. --ro-bind /usr/bin /usr/bin \
  18. --ro-bind /usr/include/fontconfig /usr/include/fontconfig \
  19. --ro-bind /usr/lib /usr/lib \
  20. --ro-bind /usr/lib64 /usr/lib64 \
  21. --ro-bind /usr/share/alsa /usr/share/alsa \
  22. --ro-bind /usr/share/applications /usr/share/applications \
  23. --ro-bind /usr/share/ca-certificates /usr/share/ca-certificates \
  24. --ro-bind /usr/share/fonts /usr/share/fonts \
  25. --ro-bind /usr/share/glib-2.0 /usr/share/glib-2.0 \
  26. --ro-bind /usr/share/icons /usr/share/icons \
  27. --ro-bind /usr/share/libdrm /usr/share/libdrm \
  28. --ro-bind /usr/share/mime /usr/share/mime \
  29. --ro-bind /usr/share/X11/xkb /usr/share/X11/xkb \
  30. --ro-bind /var/cache/fontconfig /var/cache/fontconfig \
  31. --ro-bind /var/lib/alsa /var/lib/alsa \
  32. --ro-bind /var/guix /var/guix \
  33. --ro-bind /gnu/store/ /gnu/store \
  34. --bind-try /tmp/sndio /tmp/sndio \
  35. --bind-try /tmp/sndio-"$(id -u)" /tmp/sndio-"$(id -u)" \
  36. --bind-try "${HOME}/.sndio" "${HOME}/.sndio" \
  37. --bind "${HOME}/.guix-profile" "${HOME}/.guix-profile" \
  38. --bind "$(xdg-user-dir DOWNLOAD)" "$(xdg-user-dir DOWNLOAD)" \
  39. --chdir "${HOME}" \
  40. --unshare-all \
  41. --share-net \
  42. --die-with-parent \
  43. --hostname RESTRICTED \
  44. --setenv SHELL /bin/false \
  45. --setenv PATH $HOME/.guix-profile/bin:/usr/bin:/bin \
  46. --file 11 /etc/passwd \
  47. --file 12 /etc/group \
  48. --new-session \
  49. $HOME/.guix-profile/bin/chromium) \
  50. 11< <(getent passwd $UID 65534 audio video) \
  51. 12< <(getent group "$(id -g)" 65534 audio video)
  52. # note: running ungoogled-chromium (GNU Guix) on private mode sanbox