{ config, containerCfg, pkgs, lib, builder, name,... }:
let
  version = "latest";
  serverCfg = config.syscfg.server;
  image = pkgs.dockerTools.streamLayeredImage {
    name = "EXAMPLE";
    tag = "0.0.0";
    contents = [ pkgs.bashInteractive ];
    config = {
      Entrypoint = [ "echo 1" ];
      ExposedPorts = {  };
    };
  }; 
  settings = pkgs.writeText "settings.yaml" ...;
  templateData = builder.mkData { name = "template"; dir = "template"; vars = {
      _ARGUMENT = "template";
    };
  };
in {
  requires = {
    secrets = [ ];
    databases = [ ];
  };

  runtime = {
    paths = [{
      path="${serverCfg.path.config.path}/example/";
      mode = "0444";
    }];

    containers = {
      server = builder.mkContainer {
        subdomain = containerCfg.subdomain;
        # imageStream = image;
        image = "....:${version}";
        port = 8080;
        secret = name;
        extraEnv = { };
        overrides = {
          cmd = [ ];
          volumes = [ ];
         };
      };
    };

    setup = {
      trigger = "server";
      envFile = config.sops.secrets."EXAMPLE".path;
      script = pkgs.writeShellScript "setup" ''
        ...
      '';
    };
  };
}
