home/firefox: improve xdg mimeApps configuration

This commit is contained in:
Primrose 2025-11-23 18:58:17 +08:00
parent c2c655981a
commit 2cada3b44e
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA

View file

@ -129,15 +129,20 @@ in
};
};
xdg.mimeApps = lib.mkIf cfg.enable {
enable = true;
xdg.mimeApps =
let
# source: https://unix.stackexchange.com/a/684582
defaultApplications = {
associations = {
"text/html" = "firefox.desktop";
"x-scheme-handler/http" = "firefox.desktop";
"x-scheme-handler/https" = "firefox.desktop";
"x-scheme-handler/about" = "firefox.desktop";
"x-scheme-handler/unknown" = "firefox.desktop";
};
in
lib.mkIf cfg.enable {
enable = true;
associations.added = associations;
defaultApplications = associations;
};
}