Define module for detailed depends_on
options
This commit is contained in:
parent
cf20442a7a
commit
69b9109dea
2 changed files with 16 additions and 6 deletions
|
@ -514,7 +514,7 @@ See link:https://docs.docker.com/compose/compose-file/#depends_on[Docker Compose
|
||||||
[discrete]
|
[discrete]
|
||||||
=== details
|
=== details
|
||||||
|
|
||||||
Type:: list of strings or attribute set of attribute set of stringss
|
Type:: list of strings or attribute set of submodules
|
||||||
Default::
|
Default::
|
||||||
+
|
+
|
||||||
----
|
----
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
|
|
||||||
let
|
let
|
||||||
inherit (lib) mkOption types;
|
inherit (lib) mkOption types;
|
||||||
inherit (types) listOf nullOr attrsOf str either int bool;
|
inherit (types) listOf nullOr attrsOf str either int bool submodule enum;
|
||||||
|
|
||||||
link = url: text:
|
link = url: text:
|
||||||
''link:${url}[${text}]'';
|
''link:${url}[${text}]'';
|
||||||
|
@ -100,8 +100,18 @@ in
|
||||||
default = null;
|
default = null;
|
||||||
description = dockerComposeRef "container_name";
|
description = dockerComposeRef "container_name";
|
||||||
};
|
};
|
||||||
service.depends_on = mkOption {
|
service.depends_on =
|
||||||
type = either (listOf str) (attrsOf (attrsOf str));
|
let conditionsModule = {
|
||||||
|
options = {
|
||||||
|
condition = mkOption {
|
||||||
|
type = enum ["service_started" "service_healthy" "service_completed_successfully"];
|
||||||
|
description = dockerComposeRef "depends_on";
|
||||||
|
default = "service_started";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
in mkOption {
|
||||||
|
type = either (listOf str) (attrsOf (submodule conditionsModule));
|
||||||
default = [];
|
default = [];
|
||||||
description = dockerComposeRef "depends_on";
|
description = dockerComposeRef "depends_on";
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue