From 9b2c54980df1223d7b48b85b454f6886557db052 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Giraudeau Date: Fri, 11 Dec 2020 16:26:46 +0100 Subject: [PATCH] nixos service: add state directory param. also increase timeout waiting for postgres, mostly useful for slow integration tests --- nix/nixos/smash-service.nix | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/nix/nixos/smash-service.nix b/nix/nixos/smash-service.nix index ea671ff..ce5e988 100644 --- a/nix/nixos/smash-service.nix +++ b/nix/nixos/smash-service.nix @@ -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 @@ -139,6 +140,7 @@ in { ExecStart = config.services.smash.script; DynamicUser = true; RuntimeDirectory = "smash"; + StateDirectory = "smash"; }; wantedBy = [ "multi-user.target" ];