Commit 79b1189b authored by nicoo's avatar nicoo
Browse files

nixos/oci-containers: remove overuse of `literalExpression`

This forced examples to be typeset with extraneous linebreaks,
as well as failed to detect syntax errors in examples.
parent e8ebbb0b
Loading
Loading
Loading
Loading
+24 −40
Original line number Diff line number Diff line
@@ -98,20 +98,16 @@ let
          type = with types; listOf str;
          default = [ ];
          description = "Commandline arguments to pass to the image's entrypoint.";
          example = literalExpression ''
            ["--port=9000"]
          '';
          example = [ "--port=9000" ];
        };

        labels = mkOption {
          type = with types; attrsOf str;
          default = { };
          description = "Labels to attach to the container at runtime.";
          example = literalExpression ''
            {
          example = {
            "traefik.https.routers.example.rule" = "Host(`example.container`)";
            }
          '';
          };
        };

        entrypoint = mkOption {
@@ -125,24 +121,20 @@ let
          type = with types; attrsOf str;
          default = { };
          description = "Environment variables to set for this container.";
          example = literalExpression ''
            {
          example = {
            DATABASE_HOST = "db.example.com";
            DATABASE_PORT = "3306";
            }
          '';
          };
        };

        environmentFiles = mkOption {
          type = with types; listOf path;
          default = [ ];
          description = "Environment files for this container.";
          example = literalExpression ''
            [
          example = [
            /path/to/.env
            /path/to/.env.secret
            ]
          '';
          ];
        };

        log-driver = mkOption {
@@ -223,12 +215,10 @@ let
            field; please refer to the
            [docker engine documentation](https://docs.docker.com/engine/storage/volumes/) for details.
          '';
          example = literalExpression ''
            [
          example = [
            "volume_name:/path/inside/container"
            "/path/on/host:/path/inside/container"
            ]
          '';
          ];
        };

        workdir = mkOption {
@@ -277,9 +267,7 @@ let
          type = with types; listOf str;
          default = [ ];
          description = "Extra options for {command}`${defaultBackend} run`.";
          example = literalExpression ''
            ["--network=host"]
          '';
          example = [ "--network=host" ];
        };

        autoStart = mkOption {
@@ -352,12 +340,10 @@ let
            When set to false, capability is dropped from the container.
            When null, default runtime settings apply.
          '';
          example = literalExpression ''
            {
          example = {
            SYS_ADMIN = true;
            SYS_WRITE = false;
            {
          '';
          };
        };

        devices = mkOption {
@@ -366,11 +352,9 @@ let
          description = ''
            List of devices to attach to this container.
          '';
          example = literalExpression ''
            [
          example = [
            "/dev/dri:/dev/dri"
            ]
          '';
          ];
        };

        privileged = mkOption {