From 7ffbed85b646ee78a2d7b94775d5179b4c9fd1ce Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Thu, 4 Apr 2024 10:29:00 +0300 Subject: [PATCH] Nix: add systemd variables info --- pages/Nix/Hyprland on Home Manager.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/pages/Nix/Hyprland on Home Manager.md b/pages/Nix/Hyprland on Home Manager.md index 42539f3..d4d0383 100644 --- a/pages/Nix/Hyprland on Home Manager.md +++ b/pages/Nix/Hyprland on Home Manager.md @@ -195,3 +195,24 @@ gtk = { }; }; ``` + +## Programs don't work in systemd services, but do on the terminal + +This problem is related to Systemd not importing the environment by default. It +will not have knowledge of `PATH`, so it cannot run the commands in the +services. This is the most common with user-configured services such as +`hypridle` or `swayidle`. + +To fix it, add to your config: + +```nix +wayland.windowManager.hyprland.systemd.variables = ["--all"]; +``` + +This setting will produce the following entry in the Hyprland config: + +```ini +exec-once = dbus-update-activation-environment --systemd --all +``` + +Make sure to use the above command if you do not use the Home Manager module.