Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Commit

Permalink
nixos service: add state directory param.
Browse files Browse the repository at this point in the history
 also increase timeout waiting for postgres,
 mostly useful for slow integration tests
  • Loading branch information
jbgi committed Dec 11, 2020
1 parent 210015b commit 9b2c549
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions nix/nixos/smash-service.nix
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,14 @@ in {
exec ${cfg.package}/bin/smash-exe run-app-with-db-sync \
--config ${configFile} \
--socket-path "$CARDANO_NODE_SOCKET_PATH" \
--schema-dir ${../../schema}
--schema-dir ${../../schema} \
--state-dir $STATE_DIRECTORY
'';
environment.systemPackages = [ cfg.package config.services.postgresql.package ];
systemd.services.smash = {
path = [ cfg.package pkgs.netcat pkgs.postgresql ];
preStart = ''
for x in {1..30}; do
for x in {1..60}; do
nc -z localhost ${toString config.services.smash.postgres.port} && break
echo loop $x: waiting for postgresql 2 sec...
sleep 2
Expand All @@ -139,6 +140,7 @@ in {
ExecStart = config.services.smash.script;
DynamicUser = true;
RuntimeDirectory = "smash";
StateDirectory = "smash";
};

wantedBy = [ "multi-user.target" ];
Expand Down

0 comments on commit 9b2c549

Please sign in to comment.