anchor.diff:              will be used as the image name for docker to start a container.
             '';
             example = literalExample "pkgs.dockerTools.buildDockerImage {...};";
  +        };
  +
  +        login = {
  +
  +          username = mkOption {
  +            type = with types; nullOr str;
  +            default = null;
  +            description = "Username for login.";
  +          };
  +
  +          passwordFile = mkOption {
  +            type = with types; nullOr str;
  +            default = null;
  +            description = "Path to file containing password.";
  +            example = "/etc/nixos/dockerhub-password.txt";
  +          };
  +
  +          registry = mkOption {
  +            type = with types; nullOr str;
  +            default = null;
  +            description = "Registry where to login to.";
  +            example = "https://docker.pkg.github.com";
  +          };
  +
           };
   
           cmd = mkOption {
  
positive.code:       };
      };
  
    mkService = name: container: let
      dependsOn = map (x: "${cfg.backend}-${x}.service") container.dependsOn;
    in {
  
negative.code: 
      preStart = ''
        ${cfg.backend} rm -f ${name} || true
        ${optionalString (isValidLogin container.login) ''
          cat ${container.login.passwordFile} | \
            ${cfg.backend} login \
              ${container.login.registry} \
              --username ${container.login.username} \
              --password-stdin
          ''}
        ${optionalString (container.imageFile != null) ''
          ${cfg.backend} load -i ${container.imageFile}
          ''}
  