diff --git a/example/flake.lock b/example/flake.lock index c5955d9..9c100b7 100644 --- a/example/flake.lock +++ b/example/flake.lock @@ -70,11 +70,11 @@ }, "process-compose-flake": { "locked": { - "lastModified": 1693927910, - "narHash": "sha256-qPKHnWWzHS2bAi/SsFePQkGFeC2E1jklUjEidfQwYLc=", + "lastModified": 1695992918, + "narHash": "sha256-5tHNbk0ldLUjAqKRZog/3asiVvkD51VGK9TvwzUBs38=", "owner": "Platonic-Systems", "repo": "process-compose-flake", - "rev": "5494afa0b6a7bc4ccf82ef1c36fe1fcdb4217255", + "rev": "1ebecb83f15736f5d4ae3feb01a8391977dd71da", "type": "github" }, "original": { diff --git a/nix/apache-kafka.nix b/nix/apache-kafka.nix index 7f0f872..63eb8f8 100644 --- a/nix/apache-kafka.nix +++ b/nix/apache-kafka.nix @@ -144,6 +144,7 @@ with lib; success_threshold = 1; failure_threshold = 5; }; + namespace = name; availability.restart = "on_failure"; }; diff --git a/nix/elasticsearch.nix b/nix/elasticsearch.nix index 1cdcd6e..4e7b468 100644 --- a/nix/elasticsearch.nix +++ b/nix/elasticsearch.nix @@ -188,6 +188,7 @@ in success_threshold = 1; failure_threshold = 5; }; + namespace = name; # https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy availability.restart = "on_failure"; diff --git a/nix/mysql.nix b/nix/mysql.nix index bd518f7..288abae 100644 --- a/nix/mysql.nix +++ b/nix/mysql.nix @@ -260,12 +260,14 @@ in success_threshold = 1; failure_threshold = 5; }; + namespace = name; # https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy availability.restart = "on_failure"; }; "${name}-configure" = { command = "${configureScript}/bin/configure-mysql"; + namespace = name; depends_on."${name}".condition = "process_healthy"; }; }; diff --git a/nix/postgres.nix b/nix/postgres.nix index 5382913..618a43a 100644 --- a/nix/postgres.nix +++ b/nix/postgres.nix @@ -269,7 +269,7 @@ in { processes = { # DB initialization - "${name}-init".command = + "${name}-init" = let setupInitialDatabases = if config.initialDatabases != [ ] then @@ -368,10 +368,13 @@ in cp ${configFile} "$PGDATA/postgresql.conf" ''; in - '' - export PGDATA="${config.dataDir}" - ${lib.getExe setupScript} - ''; + { + command = '' + export PGDATA="${config.dataDir}" + ${lib.getExe setupScript} + ''; + namespace = name; + }; # DB process ${name} = @@ -405,6 +408,7 @@ in success_threshold = 1; failure_threshold = 5; }; + namespace = name; # https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy availability.restart = "on_failure"; }; diff --git a/nix/redis-cluster.nix b/nix/redis-cluster.nix index a011f7d..29f80a3 100644 --- a/nix/redis-cluster.nix +++ b/nix/redis-cluster.nix @@ -114,6 +114,7 @@ in success_threshold = 1; failure_threshold = 5; }; + namespace = name; # https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy availability.restart = "on_failure"; @@ -125,6 +126,7 @@ in "${name}-cluster-create" = { depends_on = lib.mapAttrs' (nodeName: cfg: lib.nameValuePair "${name}-${nodeName}" { condition = "process_healthy"; }) config.nodes; command = "${config.package}/bin/redis-cli --cluster create ${lib.concatStringsSep " " hosts} --cluster-replicas ${builtins.toString config.replicas} --cluster-yes"; + namespace = name; }; }; }; diff --git a/nix/redis.nix b/nix/redis.nix index d16a269..e3222c2 100644 --- a/nix/redis.nix +++ b/nix/redis.nix @@ -78,6 +78,7 @@ in success_threshold = 1; failure_threshold = 5; }; + namespace = name; # https://github.com/F1bonacc1/process-compose#-auto-restart-if-not-healthy availability.restart = "on_failure"; diff --git a/nix/zookeeper.nix b/nix/zookeeper.nix index 4147c3d..7622291 100644 --- a/nix/zookeeper.nix +++ b/nix/zookeeper.nix @@ -144,6 +144,7 @@ with lib; success_threshold = 1; failure_threshold = 5; }; + namespace = name; availability.restart = "on_failure"; }; diff --git a/test/flake.lock b/test/flake.lock index e446779..1fdf033 100644 --- a/test/flake.lock +++ b/test/flake.lock @@ -54,11 +54,11 @@ }, "process-compose-flake": { "locked": { - "lastModified": 1693927910, - "narHash": "sha256-qPKHnWWzHS2bAi/SsFePQkGFeC2E1jklUjEidfQwYLc=", + "lastModified": 1695992918, + "narHash": "sha256-5tHNbk0ldLUjAqKRZog/3asiVvkD51VGK9TvwzUBs38=", "owner": "Platonic-Systems", "repo": "process-compose-flake", - "rev": "5494afa0b6a7bc4ccf82ef1c36fe1fcdb4217255", + "rev": "1ebecb83f15736f5d4ae3feb01a8391977dd71da", "type": "github" }, "original": {