1
0
forked from dan/liminix
liminix/modules/secrets/outboard.nix
Daniel Barlow d5d621f310 rename http-fstree => json-to-fstree
it works for file urls as well, not just http
2024-08-28 16:36:49 +01:00

20 lines
394 B
Nix

{
liminix, lib, json-to-fstree, serviceFns
}:
{ name, url, interval } :
let
inherit (liminix.services) oneshot longrun;
in longrun {
inherit name;
buildInputs = [ json-to-fstree ];
run = ''
. ${serviceFns}
( in_outputs ${name}
while : ; do
${json-to-fstree}/bin/json-to-fstree ${url} .
sleep ${builtins.toString (interval * 60)}
done
)
'';
}