From a640dddc9a176585b7f1a01579f3dcd5bda58b40 Mon Sep 17 00:00:00 2001 From: Daniel Thwaites Date: Sat, 16 Apr 2022 23:31:03 +0100 Subject: [PATCH] waybar: fix command not found when reloading (#2865) --- modules/programs/waybar.nix | 2 +- .../waybar/systemd-with-graphical-session-target.nix | 7 ++++--- .../waybar/systemd-with-graphical-session-target.service | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/programs/waybar.nix b/modules/programs/waybar.nix index faef644d3..12002d546 100644 --- a/modules/programs/waybar.nix +++ b/modules/programs/waybar.nix @@ -318,7 +318,7 @@ in { Service = { ExecStart = "${cfg.package}/bin/waybar"; - ExecReload = "kill -SIGUSR2 $MAINPID"; + ExecReload = "${pkgs.coreutils}/bin/kill -SIGUSR2 $MAINPID"; Restart = "on-failure"; KillMode = "mixed"; }; diff --git a/tests/modules/programs/waybar/systemd-with-graphical-session-target.nix b/tests/modules/programs/waybar/systemd-with-graphical-session-target.nix index 624ab5039..dc7a620fa 100644 --- a/tests/modules/programs/waybar/systemd-with-graphical-session-target.nix +++ b/tests/modules/programs/waybar/systemd-with-graphical-session-target.nix @@ -17,9 +17,10 @@ with lib; assertPathNotExists home-files/.config/waybar/config assertPathNotExists home-files/.config/waybar/style.css - assertFileContent \ - home-files/.config/systemd/user/waybar.service \ - ${./systemd-with-graphical-session-target.service} + serviceFile=$(normalizeStorePaths home-files/.config/systemd/user/waybar.service) + assertFileContent "$serviceFile" ${ + ./systemd-with-graphical-session-target.service + } ''; }; } diff --git a/tests/modules/programs/waybar/systemd-with-graphical-session-target.service b/tests/modules/programs/waybar/systemd-with-graphical-session-target.service index a954207d3..e1343da8a 100644 --- a/tests/modules/programs/waybar/systemd-with-graphical-session-target.service +++ b/tests/modules/programs/waybar/systemd-with-graphical-session-target.service @@ -2,7 +2,7 @@ WantedBy=sway-session.target [Service] -ExecReload=kill -SIGUSR2 $MAINPID +ExecReload=/nix/store/00000000000000000000000000000000-coreutils/bin/kill -SIGUSR2 $MAINPID ExecStart=@waybar@/bin/waybar KillMode=mixed Restart=on-failure