{
  config,
  lib,
  pkgs,
  ...
}:

let
  tex = (
    pkgs.texlive.combine {
      inherit (pkgs.texlive)
        scheme-basic
        dvisvgm
        dvipng # for preview and export as html in org-mode
        wrapfig
        amsmath
        ulem
        hyperref
        capt-of
        ;
    }
  );
in
{
  imports = [ ];

  options.me = {
    latex.enable = lib.mkOption {
      type = lib.types.bool;
      default = false;
      example = true;
      description = "Whether we want to install latex.";
    };
  };

  config = lib.mkIf config.me.latex.enable (
    lib.mkMerge [
      {
        environment.systemPackages = with pkgs; [
          tex
        ];
      }
    ]
  );
}