modules/hyprspace: better reload handling

This commit is contained in:
Max Headroom 2022-09-26 22:15:19 +02:00
parent a9abf38ab1
commit c626e30976

View file

@ -54,7 +54,8 @@ in {
Restart = "on-failure";
RestartSec = "5s";
ExecStart = "${hyprspace}/bin/hyprspace up hyprspace -f -c ${runConfig}";
ExecStop = "${hyprspace}/bin/hyprspace down hyprspace";
ExecStop = "${hyprspace}/bin/hyprspace down hyprspace -c ${runConfig}";
ExecReload = "${pkgs.coreutils}/bin/kill -USR1 $MAINPID";
};
};
networking.firewall = {
@ -68,10 +69,7 @@ in {
PATH=${pkgs.systemd}/bin:$PATH
case $1 in
wl*|en*)
if systemctl is-active hyprspace.service; then
${builtins.concatStringsSep "\n" (map (peer: "/run/wrappers/bin/ping -qnA -c3 -W1 ${peer} && exit") (builtins.attrNames peers))}
fi
systemctl restart --no-block hyprspace.service;;
systemctl reload-or-restart --no-block hyprspace.service;;
esac
exit 0
'';