new env variables for data-accumulator

This commit is contained in:
Tassilo - 2022-06-11 01:19:12 +02:00
parent 3dc3a267ab
commit 756e8e8f7e
Signed by: revol-xut
GPG Key ID: 4F56FF7759627D07
9 changed files with 138 additions and 130 deletions

View File

@ -12,12 +12,15 @@
wantedBy = [ "multi-user.target" ];
script = ''
export POSTGRES_PASSWORD=$(cat ${config.sops.secrets.postgres_password.path})
exec ${pkgs.data-accumulator}/bin/data-accumulator --host 0.0.0.0 --port 8080&
'';
environment = {
"INFLUX_HOST" = "http://localhost:8086";
"GRPC_HOST" = "http://127.0.0.1:50051";
"POSTGRES_HOST" = "127.0.0.1";
"POSTGRES_PORT" = "5432";
};
serviceConfig = {
Type = "forking";

View File

@ -3,7 +3,8 @@ let
installScript = (system:
let ip = "10.13.37.${toString (system.config.dump-dvb.systemNumber + 100)}";
in (pkgs.writeScriptBin "deploy" ''
in
(pkgs.writeScriptBin "deploy" ''
#!${pkgs.runtimeShell}
ssh root@${ip} "ps cax | grep \"nixos-rebuild\" > /dev/null"
if [ $? -eq 0 ]
@ -16,7 +17,8 @@ let
fi
''));
installScripts = pkgs.lib.mapAttrs' (name: system:
installScripts = pkgs.lib.mapAttrs'
(name: system:
pkgs.lib.attrsets.nameValuePair ("deploy-" + name) (installScript system))
systems;
@ -25,12 +27,15 @@ let
(builtins.attrValues installScripts);
deployAllScript = (name:
pkgs.writeScriptBin name (''
pkgs.writeScriptBin name (
''
#!${pkgs.runtimeShell} -ex
${pkgs.parallel}/bin/parallel --will-cite -j10 ::: ${deployAllExecutablePathsConcatted} || echo "Some deployment failed"
''));
''
));
in {
in
{
deploy-all = deployAllScript "deploy-all";
nuke-all = deployAllScript "nuke-all";
} // installScripts