From 4fda26500b4539e0a1e3afba9f0e1616bdad4f85 Mon Sep 17 00:00:00 2001 From: Johan Larsson Date: Fri, 9 Jan 2026 22:55:58 +0100 Subject: [PATCH] tomat: modify `After`, `PartOf`, `Environment` in service This allows the tomat service to properly execute hooks, which is a feature that requires a modifying the PATH and ensuring that the service is started after the graphical session. --- modules/services/tomat.nix | 6 ++++-- tests/modules/services/tomat/expected.service | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/services/tomat.nix b/modules/services/tomat.nix index 95189cca..8102af86 100644 --- a/modules/services/tomat.nix +++ b/modules/services/tomat.nix @@ -57,17 +57,19 @@ in systemd.user.services.tomat = { Unit = { Description = "Tomat Pomodoro server"; - After = [ "graphical.target" ]; + After = [ "graphical-session.target" ]; + PartOf = [ "graphical-session.target" ]; }; Service = { ExecStart = "${lib.getExe cfg.package} daemon run"; Restart = "always"; RestartSec = 5; + Environment = [ "PATH=${config.home.profileDirectory}/bin" ]; }; Install = { - WantedBy = [ "default.target" ]; + WantedBy = [ "graphical-session.target" ]; }; }; }; diff --git a/tests/modules/services/tomat/expected.service b/tests/modules/services/tomat/expected.service index dce396a2..8a036c8e 100644 --- a/tests/modules/services/tomat/expected.service +++ b/tests/modules/services/tomat/expected.service @@ -1,11 +1,13 @@ [Install] -WantedBy=default.target +WantedBy=graphical-session.target [Service] +Environment=PATH=/home/hm-user/.nix-profile/bin ExecStart=@tomat@/bin/tomat daemon run Restart=always RestartSec=5 [Unit] -After=graphical.target +After=graphical-session.target Description=Tomat Pomodoro server +PartOf=graphical-session.target