{ config, ... }:

{
  # Directories
  xdg = {
    userDirs = {
      enable = true;
      createDirectories = true;
      desktop = "${config.home.homeDirectory}/Bureau";
      documents = "${config.home.homeDirectory}/Documents";
      download = "${config.home.homeDirectory}/Téléchargements";
      pictures = "${config.home.homeDirectory}/Images";
      music = "${config.home.homeDirectory}/Musique";
      videos = "${config.home.homeDirectory}/Vidéos";
      templates = "${config.home.homeDirectory}/Modèles";
      publicShare = "${config.home.homeDirectory}/Public";
    };
    configHome = "${config.home.homeDirectory}/.config";
    cacheHome = "${config.home.homeDirectory}/.cache";
    dataHome = "${config.home.homeDirectory}/.local/share";
    stateHome = "${config.home.homeDirectory}/.local/state";

    # autostart = {
    #   enable = true;
    #   # readOnly = true;
    #   # entries = [
    #   #   "${pkgs.dosage}"
    #   # ]:
    # };

    # Default apps
    mimeApps = {
      enable = true;
      associations.added = {
        "x-scheme-handler/sms" = "org.gnome.Shell.Extensions.GSConnect.desktop;";
        "x-scheme-handler/tel" = "org.gnome.Shell.Extensions.GSConnect.desktop;";
      };
      defaultApplications = {
        "text/plain" = "org.gnome.TextEditor.desktop";
        "text/markdown" = "org.gnome.TextEditor.desktop";
        "text/json" = "org.gnome.TextEditor.desktop";
        "text/html" = "firefox.desktop";
        "text/xml" = "org.gnome.TextEditor.desktop";
        "image/avif" = "org.gnome.Loupe.desktop";
        "image/png" = "org.gnome.Loupe.desktop";
        "image/jpeg" = "org.gnome.Loupe.desktop";
        "image/svg+xml" = "org.gnome.Loupe.desktop";
        "image/gif" = "org.gnome.Loupe.desktop";
        "image/webp" = "org.gnome.Loupe.desktop";
        "audio/mpeg" = "mpv.desktop";
        "audio/aac" = "mpv.desktop";
        "audio/webm" = "mpv.desktop";
        "audio/ogg" = "mpv.desktop";
        "video/x-matroska" = "mpv.desktop";
        "video/mp4" = "mpv.desktop";
        "video/webm" = "mpv.desktop";
        "video/ogg" = "mpv.desktop";
        "application/pdf" = "org.gnome.Papers.desktop";
        "application/msword" = "onlyoffice-desktopeditors.desktop";
        "application/vnd.ms-powerpoint" = "onlyoffice-desktopeditors.desktop";
        "application/vnd.ms-excel" = "onlyoffice-desktopeditors.desktop";
        "application/vnd.openxmlformats-officedocument.wordprocessingml.document" = "onlyoffice-desktopeditors.desktop";
        "application/vnd.openxmlformats-officedocument.presentationml.presentation" = "onlyoffice-desktopeditors.desktop";
        "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" = "onlyoffice-desktopeditors.desktop";
        "application/vnd.oasis.opendocument.text" = "onlyoffice-desktopeditors.desktop";
        "application/vnd.oasis.opendocument.presentation" = "onlyoffice-desktopeditors.desktop";
        "application/vnd.oasis.opendocument.spreadsheet" = "onlyoffice-desktopeditors.desktop";
        "application/epub+zip" = "com.github.johnfactotum.Foliate.desktop";
        "application/ogg" = "mpv.desktop";
        "application/xml" = "org.gnome.TextEditor.desktop";
        "application/xhtml+xml" = "firefox.desktop";
        "application/x-extension-htm" = "firefox.desktop";
        "application/x-extension-html" = "firefox.desktop";
        "application/x-extension-shtml" = "firefox.desktop";
        "application/x-extension-xhtml" = "firefox.desktop";
        "application/x-extension-xht" = "firefox.desktop";
        "application/x-bittorrent" = "de.haeckerfelix.Fragments.desktop";
        "message/rfc822" = "thunderbird.desktop";
        "x-scheme-handler/mailto" = "thunderbird.desktop";
        "x-scheme-handler/mid" = "thunderbird.desktop";
        "x-scheme-handler/discord" = "vesktop.desktop";
        "x-scheme-handler/http" = "firefox.desktop";
        "x-scheme-handler/https" = "firefox.desktop";
        "x-scheme-handler/chrome" = "firefox.desktop";
      };
    };
  };
}
