{
  lib,
  pkgs,
  config,
  ...
}: let
  term = config.programs.terminal;
in {
  options.programs = {
    terminal = lib.mkPackageOption pkgs "foot" {
      example = "pkgs.alacritty";
    };
  };

  config = {
    programs.foot = lib.mkIf (term == pkgs.foot) {
      enable = true;
      server.enable = true;
    };

    home.packages = [term];
  };
}
