{
  lib,
  config,
  namespace,
  ...
}:
with lib;
let
  name = "free-games-claimer";
  cfg = config.${namespace}.services.${name};

  fgcConfig = lib.${namespace}.mkModule {
    inherit config name;
    serviceName = "podman-${name}";
    description = "free-games-claimer";
    options = { };
    moduleConfig = {
      virtualisation.oci-containers.containers."${name}" = {
        autoStart = true;
        image = "ghcr.io/vogler/free-games-claimer";
        ports = [ "${toString cfg.port}:6080" ];
        volumes = [ "${cfg.configDir}/free-games-claimer:/fgc/data" ];
        environmentFiles = [ config.sops.templates."fgc.env".path ];
        environment = {
          PUID = cfg.puid;
          PGID = cfg.pgid;
          TZ = cfg.timeZone;
        };
      };
    };
  };
in
{
  imports = [ fgcConfig ];
}
