Can't use sudo nautilus, tracker3 gnome error, gui is slow and glitchy

Hi there! For some reason when I enter sudo nautilus command, nautilus window pops-up and it starts to flicker for a while then stops with console rendering the following error:

** Message: 00:41:39.361: Connecting to org.freedesktop.Tracker3.Miner.Files
libEGL warning: egl: failed to create dri2 screen
DRM kernel driver ‘nvidia-drm’ in use. NVK requires nouveau.
DRM kernel driver ‘nvidia-drm’ in use. NVK requires nouveau.

Is it somethin related to graphics card drivers? I use hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable;

Nixos versions is 24.05, I use unstable channel packages. Any clues how to make nautilus work under sudo? Thanks!

Not sure about the nvidia stuff but you should not run Nautilus or other graphical apps under root, see also the warning on top of Running GUI applications as root - ArchWiki.

If you want to access location that requires elevated privileges, you can do so through GVfs in Nautilus: press Ctrl-L and prepend the directory path with admin://.


XD. I was doing it wrong this whole time. Thanks, it works!

I think the flickering issue was something to do with nvidia though.
So I’ve rebuilt the system and commented out all my nvidia related settings in configuration.nix:

Nvidia Graphics drivers

services.xserver.videoDrivers = [ “nvidia” ];
#hardware.opengl.enable = true;
#hardware.opengl.driSupport = true;
#hardware.opengl.driSupport32Bit = true;
#hardware.nvidia.package = config.boot.kernelPackages.nvidiaPackages.stable;
#hardware.nvidia.modesetting.enable = true;
#hardware.nvidia.nvidiaSettings = true;

and everything works properly now… I think I had way too many options that were conflicting with each other.