{
  config,
  lib,
  ...
}: {
  options.dotfiles.inputs.nixvim.programs.nixvim.autoCmd.enable =
    lib.dotfiles.mkEnableOption;

  config =
    lib.mkIf
    config.dotfiles.inputs.nixvim.programs.nixvim.autoCmd.enable
    {
      programs.nixvim.autoCmd = [
        {
          command = ''%s/\s\+$//e'';
          event = ["BufWritePre"];
          pattern = ["*"];
        }
      ];
    };
}
