{pkgs, ...}: let
  global = import ../global-var.nix;
in {
  # TODO: Remove this abomination when there is better way to set default terminal, GNOME devs to blame once again... Sigh
  # Sets default terminal
  environment.systemPackages = with pkgs; [
    xdg-terminal-exec
  ];

  home-manager.users.${global.username} = {...}: {
    home.file.".config/xdg-terminals.list".text = ''
      kitty.desktop
    '';

    # Sets default apps
    xdg.mimeApps = {
      enable = true;
      defaultApplications = {
        "application/pdf" = ["org.pwmt.zathura.desktop"];
        "text/html" = ["firefox.desktop"];
        "x-scheme-handler/https" = ["firefox.desktop"];
        "x-scheme-handler/http" = ["firefox.desktop"];
        "x-terminal-emulator" = ["kitty.desktop"];
        "video/mp4" = ["mpv.desktop"];
        "video/webm" = ["mpv.desktop"];
        "video/avi" = ["mpv.desktop"];
        "video/flv" = ["mpv.desktop"];
        "video/mov" = ["mpv.desktop"];
        "video/m4v" = ["mpv.desktop"];
        "audio/mp3" = ["mpv.desktop"];
        "audio/opus" = ["mpv.desktop"];
        "audio/ogg" = ["mpv.desktop"];
        "audio/wav" = ["mpv.desktop"];
        "audio/m4a" = ["mpv.desktop"];
        "image/png" = ["oculante.desktop"];
        "image/jpg" = ["oculante.desktop"];
        "image/jpeg" = ["oculante.desktop"];
        "image/webp" = ["oculante.desktop"];
        "image/avif" = ["oculante.desktop"];
        "image/svg" = ["oculante.desktop"];
        "image/gif" = ["oculante.desktop"];
        "inode/directory" = ["yazi.desktop"];
        "text/plain" = ["neovide.desktop"];
        "text/reg" = ["neovide.desktop"];
        "application/zip" = ["org.kde.ark.desktop"];
        "application/x-7z-compressed" = ["org.kde.ark.desktop"];
        "application/x-tar" = ["org.kde.ark.desktop"];
        "application/vnd.rar" = ["org.kde.ark.desktop"];
        "application/x-bzip2" = ["org.kde.ark.desktop"];
        "application/x-bzip" = ["org.kde.ark.desktop"];
      };
    };
  };
}
