From 141386503c2869b2063af9aa87dcb453c0976095 Mon Sep 17 00:00:00 2001 From: Mikael Voss Date: Wed, 18 Sep 2024 23:38:44 +0200 Subject: [PATCH] home: Ensure proper ordering of graphical session services --- home/config/nil/bar.nix | 8 ++++++++ home/config/nil/desktop.nix | 19 ++++++++----------- 2 files changed, 16 insertions(+), 11 deletions(-) diff --git a/home/config/nil/bar.nix b/home/config/nil/bar.nix index 68a4e72..7bbd4e3 100644 --- a/home/config/nil/bar.nix +++ b/home/config/nil/bar.nix @@ -321,6 +321,14 @@ in lib.mkIf (osConfig.hardware.graphics.enable or false) { }; }; + systemd.user.services = { + waybar = { + Unit = { + After = [ "graphical-session.target" ]; + }; + }; + }; + systemd.user.targets = { tray = { Unit = { diff --git a/home/config/nil/desktop.nix b/home/config/nil/desktop.nix index 865c72e..beda777 100644 --- a/home/config/nil/desktop.nix +++ b/home/config/nil/desktop.nix @@ -273,17 +273,6 @@ in lib.mkIf (osConfig.hardware.graphics.enable or false) { SSH_ASKPASS_REQUIRE = "force"; TERMINAL = kitty; }; - - spawn-at-startup = [ - { command = [ dbus-update "--systemd" - "NIRI_SOCKET" - "WAYLAND_DISPLAY" - "XDG_CURRENT_DESKTOP" - "XDG_SESSION_TYPE" - ]; } - { command = [ systemctl "--user" "start" "swayidle.service" ]; } - { command = [ systemctl "--user" "start" "waybar.service" ]; } - ]; }; programs.swaylock = { @@ -329,6 +318,14 @@ in lib.mkIf (osConfig.hardware.graphics.enable or false) { services.syncthing.enable = true; + systemd.user.services = { + swayidle = { + Unit = { + After = [ "graphical-session.target" ]; + }; + }; + }; + xdg.mimeApps.enable = true; xdg.portal = {