{ lib, mediaStackPaths, ... }:
{
  nixpkgs.overlays = [
    (final: prev: {
      seerr = prev.seerr.overrideAttrs (oldAttrs: {
        postInstall =
          (oldAttrs.postInstall or "")
          + ''
            find "$out/share/public" -maxdepth 1 -type f \( -name 'logo_full.svg' -o -name 'logo_stacked.svg' \) \
              -exec truncate -s 0 {} \;
          '';
      });
    })
  ];

  services.seerr = {
    enable = true;
    openFirewall = true;
    configDir = mediaStackPaths.seerrConfigDir;
  };

  users.groups.jellyseerr = { };
  users.users.jellyseerr = {
    isSystemUser = true;
    group = "jellyseerr";
  };

  systemd.services.seerr.serviceConfig = {
    DynamicUser = lib.mkForce false;
    User = "jellyseerr";
    Group = "jellyseerr";
    ReadWritePaths = [ mediaStackPaths.seerrConfigDir ];
  };

}
