diff --git a/machines/modules/docker-stack.nix b/machines/modules/docker-stack.nix index 2608d43..eee03ef 100644 --- a/machines/modules/docker-stack.nix +++ b/machines/modules/docker-stack.nix @@ -75,8 +75,7 @@ let networks = mkOption { type = types.listOf types.str; default = [ ]; - description = lib.mdDoc '' - ''; + description = lib.mdDoc "Networks to join."; example = literalExpression '' [ "backend_internal" @@ -88,24 +87,44 @@ let extra_hosts = mkOption { type = types.listOf types.str; default = [ ]; - description = lib.mdDoc '' - ''; + description = lib.mdDoc "Add hostname mappings."; example = literalExpression '' [ "host.docker.internal:host-gateway" + "otherhost:50.31.209.229" ] ''; }; deploy = { + labels = { + default = [ ]; + type = types.listOf types.str; + description = lib.mdDoc "Specify labels for the service."; + example = literalExpression '' + [ + "com.example.description=This label will appear on the web service" + ] + ''; + }; + placement = { constraints = mkOption { default = [ ]; type = types.listOf types.str; - description = lib.mdDoc ""; - example = [ "node.role==manager" ]; + description = lib.mdDoc '' + You can limit the set of nodes where a task can be scheduled by defining constraint expressions. + Constraint expressions can either use a match (==) or exclude (!=) rule. + Multiple constraints find nodes that satisfy every expression (AND match). + ''; + example = literalExample '' + [ + "node.role==manager" + ]; + ''; }; }; + update_config = { order = mkOption { default = "stop-first"; @@ -127,9 +146,12 @@ let networkOptions = { ... }: { options = with lib; { external = mkOption { - default = null; + default = false; type = types.nullOr types.bool; - description = lib.mdDoc ""; + description = lib.mdDoc '' + If set to true, specifies that this volume has been created outside of Compose. + The systemd service does not attempt to create it, and raises an error if it doesn’t exist. + ''; example = "true"; }; };