first pass at outboard secrets

- a module to fetch them with http(s)
- a service using templating to consume them
- update an example to use it

needs service restarts
needs other services to use the template mechanism
needs tidying up
This commit is contained in:
Daniel Barlow
2024-08-12 22:57:21 +01:00
parent ff3a1905a5
commit 4fb8253e57
4 changed files with 103 additions and 10 deletions

View File

@@ -0,0 +1,19 @@
{
liminix, lib, http-fstree, serviceFns
}:
{ name, url, interval } :
let
inherit (liminix.services) oneshot longrun;
in longrun {
inherit name;
buildInputs = [ http-fstree ];
# this script runs once and expects the service superviser
# to restart it
run = ''
. ${serviceFns}
( in_outputs ${name}
${http-fstree}/bin/http-fstree ${url} .
sleep ${builtins.toString (interval * 60)}
)
'';
}