{
  lib,
  config,
  namespace,
  ...
}:
with lib;
let
  name = "mongodb";
  cfg = config.${namespace}.services.${name};

  mongodbConfig = lib.${namespace}.mkModule {
    inherit config name;
    description = "mongodb";
    options = { };
    moduleConfig = {
      virtualisation.oci-containers.containers."${cfg.name}" = {
        autoStart = true;
        image = "mongo";
        ports = [ "${cfg.port}:27017" ];
        volumes = [ "${cfg.configPath}/mongodb:/data/db" ];
        extraOptions = [ "--network-alias=mongo" ];
        # environmentFiles = cfg.environmentFiles;
        environment = {
          PUID = cfg.puid;
          PGID = cfg.pgid;
          TZ = cfg.timeZone;
          # MONGO_INITDB_ROOT_USERNAME = "";#cfg.databaseUser;
          # MONGO_INITDB_ROOT_PASSWORD = "";#cfg.databasePassword; # get from env file
        };
      };
    };
  };
in
{
  imports = [ mongodbConfig ];
}
