# Nautilus not working properly due to missing PATH in dbus

**URL:** https://discourse.nixosstag.fcio.net/t/nautilus-not-working-properly-due-to-missing-path-in-dbus/38824
**Category:** Help
**Created:** [January 25, 2024, 11:24pm UTC](https://discourse.nixosstag.fcio.net/t/nautilus-not-working-properly-due-to-missing-path-in-dbus/38824 "2024-01-25T23:24:13Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![abmantis](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/abmantis/32/12652_2.png) [@abmantis](https://discourse.nixosstag.fcio.net/u/abmantis)
#### Post date: [January 25, 2024, 11:24pm UTC](https://discourse.nixosstag.fcio.net/t/nautilus-not-working-properly-due-to-missing-path-in-dbus/38824/1 "2024-01-25T23:24:13Z")

</div>

I am using Hyprland with wofi to run apps.  
When I open nautilus using wofi, it cannot find any app to open files (except VLC, for some reason I have no clue why). If I go to the “Open With…” dialog, only VLC is present.

Apparently, this is due to the PATH env var missing in dbus, since if I do `dbus-update-activation-environment PATH` then nautilus works as expected.

Is there something that I am missing to make this work without having to explicitly import `PATH`?

---

<div class="post-metadata">

### Author: ![jtojnar](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/jtojnar/32/70_2.png) [@jtojnar](https://discourse.nixosstag.fcio.net/u/jtojnar)
#### Post date: [January 26, 2024, 9:00am UTC](https://discourse.nixosstag.fcio.net/t/nautilus-not-working-properly-due-to-missing-path-in-dbus/38824/2 "2024-01-26T09:00:04Z")

</div>

Your desktop environment should run that program, otherwise D-Bus activated applications will not have access to your session environment.

For window managers, the display manager session script does it:

> <https://github.com/NixOS/nixpkgs/blob/57de71a6f09d9ace36cf453d27450f3cb4bb9fd3/nixos/modules/services/x11/display-managers/default.nix#L472>

But if you do not use a display manager, you will need to call it yourself.

---

<div class="post-metadata">

### Author: ![jtojnar](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/jtojnar/32/70_2.png) [@jtojnar](https://discourse.nixosstag.fcio.net/u/jtojnar)
#### Post date: [January 26, 2024, 9:07am UTC](https://discourse.nixosstag.fcio.net/t/nautilus-not-working-properly-due-to-missing-path-in-dbus/38824/3 "2024-01-26T09:07:49Z")

</div>

Actually, it looks like Hyprland [does call `dbus-update-activation-environment`](https://github.com/hyprwm/Hyprland/blob/72987dee88a0359d42af9f3064a62b934dcd7be0/src/Compositor.cpp#L581), it just does not include `PATH` and `XDG_DATA_DIRS`, which are necessary for application launchers and file associations.

There is an upstream issue about that: [Import environment variables into systemd in NixOS modules · Issue #2800 · hyprwm/Hyprland · GitHub](https://github.com/hyprwm/Hyprland/issues/2800) Also [Xwayland applications don't startup when launching them from `nautilus` · Issue #2965 · hyprwm/Hyprland · GitHub](https://github.com/hyprwm/Hyprland/issues/2965)

---

<div class="post-metadata">

### Author: ![abmantis](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/abmantis/32/12652_2.png) [@abmantis](https://discourse.nixosstag.fcio.net/u/abmantis)
#### Post date: [January 27, 2024, 11:40pm UTC](https://discourse.nixosstag.fcio.net/t/nautilus-not-working-properly-due-to-missing-path-in-dbus/38824/4 "2024-01-27T23:40:09Z")

</div>

Thanks! I don’t know how I missed those two issues.  
I was a bit afraid that passing PATH to dbus was not the proper thing to do, but if it is ok, then I’ll just do that. Thanks!

---

<div class="post-metadata">

### Author: ![abmantis](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/abmantis/32/12652_2.png) [@abmantis](https://discourse.nixosstag.fcio.net/u/abmantis)
#### Post date: [January 27, 2024, 11:44pm UTC](https://discourse.nixosstag.fcio.net/t/nautilus-not-working-properly-due-to-missing-path-in-dbus/38824/5 "2024-01-27T23:44:35Z")

</div>

Actually, I just noticed that you said “But if you do not use a display manager, you will need to call it yourself.”.  
I do use GDM, so it should do that for me?

---

<div class="post-metadata">

### Author: ![jtojnar](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/jtojnar/32/70_2.png) [@jtojnar](https://discourse.nixosstag.fcio.net/u/jtojnar)
#### Post date: [January 28, 2024, 12:04am UTC](https://discourse.nixosstag.fcio.net/t/nautilus-not-working-properly-due-to-missing-path-in-dbus/38824/6 "2024-01-28T00:04:51Z")

</div>

I meant that if your desktop environment does not do it and you use display manager, you can use [`services.xserver.updateDbusEnvironment`](https://nixos.org/manual/nixos/unstable/options.html#opt-services.xserver.updateDbusEnvironment) NixOS option to have the session script generated by the display manager NixOS module do it for you.

---

<div class="post-metadata">

### Author: ![abmantis](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/abmantis/32/12652_2.png) [@abmantis](https://discourse.nixosstag.fcio.net/u/abmantis)
#### Post date: [January 28, 2024, 12:34am UTC](https://discourse.nixosstag.fcio.net/t/nautilus-not-working-properly-due-to-missing-path-in-dbus/38824/7 "2024-01-28T00:34:11Z")

</div>

Ohh, right! That works!  
Thanks a lot once again.

---

<div class="post-metadata">

### Author: ![teto](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/teto/32/182_2.png) [@teto](https://discourse.nixosstag.fcio.net/u/teto)
#### Post date: [April 11, 2025, 10:36am UTC](https://discourse.nixosstag.fcio.net/t/nautilus-not-working-properly-due-to-missing-path-in-dbus/38824/8 "2025-04-11T10:36:41Z")

</div>

I have sway configured via Home-manager.  
I’ve tried running `dbus-update-activation-environment --systemd --all` from a terminal and then start nautilus, it can’t find much mimetypes mappings.  
What puzzles me is that `gio` launched from a terminal seems to find libreoffice (writer.desktop)

```auto
$ gio mime application/vnd.oasis.opendocument.text # for .odt documents
Application par défaut pour « application/vnd.oasis.opendocument.text » : org.gnome.BrowserConnector.desktop
Applications inscrites :
	org.gnome.BrowserConnector.desktop
	writer.desktop
	xarchiver.desktop
	org.gnome.FileRoller.desktop
	org.gnome.Nautilus.desktop
Applications recommandées :
	org.gnome.BrowserConnector.desktop
	writer.desktop
	xarchiver.desktop

```

but in nautilus it can’t find any application to open it, writer.desktop doesn’t even appear in the list of applications I can start manually 😢

---

<div class="post-metadata">

### Author: ![abmantis](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/abmantis/32/12652_2.png) [@abmantis](https://discourse.nixosstag.fcio.net/u/abmantis)
#### Post date: [April 17, 2025, 4:36pm UTC](https://discourse.nixosstag.fcio.net/t/nautilus-not-working-properly-due-to-missing-path-in-dbus/38824/9 "2025-04-17T16:36:21Z")

</div>

Have you tried the solution [here](https://discourse.nixosstag.fcio.net/t/nautilus-not-working-properly-due-to-missing-path-in-dbus/38824/6) ?

---

<div class="post-metadata">

### Author: ![JimJ92120](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/jimj92120/32/12741_2.png) [@JimJ92120](https://discourse.nixosstag.fcio.net/u/JimJ92120)
#### Post date: [April 17, 2025, 7:54pm UTC](https://discourse.nixosstag.fcio.net/t/nautilus-not-working-properly-due-to-missing-path-in-dbus/38824/10 "2025-04-17T19:54:16Z")

</div>

Also mentioned here in `hyprland` doc with `home-manager`: [Hyprland on Home Manager – Hyprland Wiki](https://wiki.hyprland.org/Nix/Hyprland-on-Home-Manager/#programs-dont-work-in-systemd-services-but-do-on-the-terminal)

```nix
wayland.windowManager.hyprland.systemd.variables = ["--all"];

```

---

<div class="post-metadata">

### Author: ![codethief](https://discourse.nixosstag.fcio.net/user_avatar/discourse.nixosstag.fcio.net/codethief/32/31696_2.png) [@codethief](https://discourse.nixosstag.fcio.net/u/codethief)
#### Post date: [August 8, 2025, 2:02pm UTC](https://discourse.nixosstag.fcio.net/t/nautilus-not-working-properly-due-to-missing-path-in-dbus/38824/11 "2025-08-08T14:02:53Z")

</div>

@abmantis

> Have you tried the solution [here](https://discourse.nixosstag.fcio.net/t/nautilus-not-working-properly-due-to-missing-path-in-dbus/38824/6) ?

I’m not the OP but I just gave this a try and it didn’t do the trick for me, unfortunately.

EDIT: I managed to make it work by invoking `dbus-update-activation-environment` manually, see [Nautilus doesn't know how to open files, unless launched from terminal first · Issue #177900 · NixOS/nixpkgs · GitHub](https://github.com/NixOS/nixpkgs/issues/177900#issuecomment-3167947983) .
