mirror of
https://git.pvv.ntnu.no/Drift/pvv-nixos-config.git
synced 2026-07-21 20:41:25 +02:00
modules/drumknotty: wrap services in infinite loops
This commit is contained in:
@@ -138,6 +138,15 @@ in
|
|||||||
|
|
||||||
ExecStart =
|
ExecStart =
|
||||||
let
|
let
|
||||||
|
mkRespawningCommand = name: command: pkgs.writeShellScript "drumknotty-${name}-watchdog" ''
|
||||||
|
while true; do
|
||||||
|
${command}
|
||||||
|
echo
|
||||||
|
echo "${name} exited, restarting in 3s..." >&2
|
||||||
|
sleep 3
|
||||||
|
done
|
||||||
|
'';
|
||||||
|
|
||||||
screenrc = let
|
screenrc = let
|
||||||
convertToFile = lines: lib.pipe lines [
|
convertToFile = lines: lib.pipe lines [
|
||||||
lib.concatLists
|
lib.concatLists
|
||||||
@@ -157,8 +166,7 @@ in
|
|||||||
config = "/etc/dibbler/dibbler.toml";
|
config = "/etc/dibbler/dibbler.toml";
|
||||||
};
|
};
|
||||||
in lib.optionals cfg.dibbler.enable [
|
in lib.optionals cfg.dibbler.enable [
|
||||||
"screen -t dibbler ${lib.getExe cfg.dibbler.package} ${dibblerArgs} loop"
|
"screen -t dibbler ${mkRespawningCommand "dibbler" "${lib.getExe cfg.dibbler.package} ${dibblerArgs} loop"}"
|
||||||
|
|
||||||
])
|
])
|
||||||
|
|
||||||
(let
|
(let
|
||||||
@@ -166,7 +174,7 @@ in
|
|||||||
config = "/etc/worblehat/config.toml";
|
config = "/etc/worblehat/config.toml";
|
||||||
};
|
};
|
||||||
in lib.optionals cfg.worblehat.enable [
|
in lib.optionals cfg.worblehat.enable [
|
||||||
"screen -t worblehat ${lib.getExe cfg.worblehat.package} ${worblehatArgs} cli"
|
"screen -t worblehat ${mkRespawningCommand "worblehat" "${lib.getExe cfg.worblehat.package} ${worblehatArgs} cli"}"
|
||||||
])
|
])
|
||||||
|
|
||||||
[ "select 0" ]
|
[ "select 0" ]
|
||||||
|
|||||||
Reference in New Issue
Block a user