mirror of
https://github.com/dump-dvb/nix-config.git
synced 2024-06-04 15:29:25 +02:00
new env variables for data-accumulator
This commit is contained in:
parent
3dc3a267ab
commit
756e8e8f7e
|
@ -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";
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user