mirror of
https://github.com/dump-dvb/nix-config.git
synced 2024-06-19 22:26:01 +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" ];
|
wantedBy = [ "multi-user.target" ];
|
||||||
|
|
||||||
script = ''
|
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&
|
exec ${pkgs.data-accumulator}/bin/data-accumulator --host 0.0.0.0 --port 8080&
|
||||||
'';
|
'';
|
||||||
|
|
||||||
environment = {
|
environment = {
|
||||||
"INFLUX_HOST" = "http://localhost:8086";
|
"INFLUX_HOST" = "http://localhost:8086";
|
||||||
"GRPC_HOST" = "http://127.0.0.1:50051";
|
"GRPC_HOST" = "http://127.0.0.1:50051";
|
||||||
|
"POSTGRES_HOST" = "127.0.0.1";
|
||||||
|
"POSTGRES_PORT" = "5432";
|
||||||
};
|
};
|
||||||
serviceConfig = {
|
serviceConfig = {
|
||||||
Type = "forking";
|
Type = "forking";
|
||||||
|
|
|
@ -3,7 +3,8 @@ let
|
||||||
|
|
||||||
installScript = (system:
|
installScript = (system:
|
||||||
let ip = "10.13.37.${toString (system.config.dump-dvb.systemNumber + 100)}";
|
let ip = "10.13.37.${toString (system.config.dump-dvb.systemNumber + 100)}";
|
||||||
in (pkgs.writeScriptBin "deploy" ''
|
in
|
||||||
|
(pkgs.writeScriptBin "deploy" ''
|
||||||
#!${pkgs.runtimeShell}
|
#!${pkgs.runtimeShell}
|
||||||
ssh root@${ip} "ps cax | grep \"nixos-rebuild\" > /dev/null"
|
ssh root@${ip} "ps cax | grep \"nixos-rebuild\" > /dev/null"
|
||||||
if [ $? -eq 0 ]
|
if [ $? -eq 0 ]
|
||||||
|
@ -16,7 +17,8 @@ let
|
||||||
fi
|
fi
|
||||||
''));
|
''));
|
||||||
|
|
||||||
installScripts = pkgs.lib.mapAttrs' (name: system:
|
installScripts = pkgs.lib.mapAttrs'
|
||||||
|
(name: system:
|
||||||
pkgs.lib.attrsets.nameValuePair ("deploy-" + name) (installScript system))
|
pkgs.lib.attrsets.nameValuePair ("deploy-" + name) (installScript system))
|
||||||
systems;
|
systems;
|
||||||
|
|
||||||
|
@ -25,12 +27,15 @@ let
|
||||||
(builtins.attrValues installScripts);
|
(builtins.attrValues installScripts);
|
||||||
|
|
||||||
deployAllScript = (name:
|
deployAllScript = (name:
|
||||||
pkgs.writeScriptBin name (''
|
pkgs.writeScriptBin name (
|
||||||
|
''
|
||||||
#!${pkgs.runtimeShell} -ex
|
#!${pkgs.runtimeShell} -ex
|
||||||
${pkgs.parallel}/bin/parallel --will-cite -j10 ::: ${deployAllExecutablePathsConcatted} || echo "Some deployment failed"
|
${pkgs.parallel}/bin/parallel --will-cite -j10 ::: ${deployAllExecutablePathsConcatted} || echo "Some deployment failed"
|
||||||
''));
|
''
|
||||||
|
));
|
||||||
|
|
||||||
in {
|
in
|
||||||
|
{
|
||||||
deploy-all = deployAllScript "deploy-all";
|
deploy-all = deployAllScript "deploy-all";
|
||||||
nuke-all = deployAllScript "nuke-all";
|
nuke-all = deployAllScript "nuke-all";
|
||||||
} // installScripts
|
} // installScripts
|
||||||
|
|
Loading…
Reference in New Issue
Block a user