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

let cfg = config.sydnix.users.crumb.default-applications;
in {
  options.sydnix.users.crumb.default-applications = {
    enable = lib.mkEnableOption "Default mime-type applications";
  };

  config = lib.mkIf cfg.enable {
    xdg.mimeApps = {
      enable = true;
      defaultApplications = {
        "application/pdf" = [
          "emacsclient.desktop"
          "emacs.desktop"
        ];
      };
    };
  };
}
