{
  marleylib,
  config,
  osConfig,
  lib,
  pkgs,
  ...
}: let
  inherit (marleylib.module) mkEnableOption';

  cfg = config.marleyos.programs.thunderbird;
  osCfg = osConfig.marleyos.programs.thunderbird.enable or false;
in {
  options.marleyos.programs.thunderbird.enable =
    mkEnableOption' "thunderbird" osCfg;

  config = lib.mkIf cfg.enable {
    programs.thunderbird = {
      enable = true;
      package = lib.mkIf pkgs.stdenv.isDarwin pkgs.emptyDirectory;

      settings = {
        "privacy.donottrackheader.enabled" = true;
      };

      profiles."${config.marleycfg.my.name}" = {
        isDefault = true;
      };
    };
  };
}
