Obsidian installed via nix issue: system aborts because of sandbox issues

$ obsidian The SUID sandbox helper binary was found, but is not configured correctly. Rather than run without sandboxing I’m aborting now. You need to make sure that /nix/store/b839r5g9ywf4fkama8zah8r55nwbzmky-electron-31.4.0/libexec/electron/chrome-sandbox is owned by root and has mode 4755. zsh: trace trap (core dumped) obsidian

Cause: Ubuntu 24.04 has apparmor enabled by default

solution: for one session:

echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns

permanently disable restrictions:

echo "kernel.apparmor_restrict_unprivileged_userns=0" >> /etc/sysctl.d/60-apparmor-namespace.conf

for specific app:

ref: nix issue solution ubuntu docs