2024-08-12 21:57:21 +00:00
|
|
|
{
|
2024-08-28 18:12:00 +00:00
|
|
|
liminix, lib, json-to-fstree, serviceFns
|
2024-08-12 21:57:21 +00:00
|
|
|
}:
|
|
|
|
{ name, url, interval } :
|
|
|
|
let
|
|
|
|
inherit (liminix.services) oneshot longrun;
|
|
|
|
in longrun {
|
|
|
|
inherit name;
|
2024-08-28 18:12:00 +00:00
|
|
|
buildInputs = [ json-to-fstree ];
|
2024-08-12 21:57:21 +00:00
|
|
|
run = ''
|
|
|
|
. ${serviceFns}
|
|
|
|
( in_outputs ${name}
|
2024-08-14 21:41:56 +00:00
|
|
|
while : ; do
|
2024-08-28 18:12:00 +00:00
|
|
|
${json-to-fstree}/bin/json-to-fstree ${url} .
|
2024-08-14 21:41:56 +00:00
|
|
|
sleep ${builtins.toString (interval * 60)}
|
|
|
|
done
|
2024-08-12 21:57:21 +00:00
|
|
|
)
|
|
|
|
'';
|
|
|
|
}
|