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]
|
||||
=== details
|
||||
|
||||
Type:: list of strings or attribute set of attribute set of stringss
|
||||
Type:: list of strings or attribute set of submodules
|
||||
Default::
|
||||
+
|
||||
----
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
let
|
||||
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}]'';
|
||||
|
@ -100,8 +100,18 @@ in
|
|||
default = null;
|
||||
description = dockerComposeRef "container_name";
|
||||
};
|
||||
service.depends_on = mkOption {
|
||||
type = either (listOf str) (attrsOf (attrsOf str));
|
||||
service.depends_on =
|
||||
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 = [];
|
||||
description = dockerComposeRef "depends_on";
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue