vanadium: improve browser xdg configuration

This commit is contained in:
Primrose 2025-11-26 15:12:24 +08:00
parent 4c4ed165b3
commit 1bec3a93a0
Signed by: primrose
GPG key ID: 4E887A4CA9714ADA
2 changed files with 18 additions and 25 deletions

View file

@ -140,7 +140,7 @@ in
"x-scheme-handler/unknown" = "firefox.desktop"; "x-scheme-handler/unknown" = "firefox.desktop";
}; };
in in
lib.mkIf cfg.enable { lib.mkIf (cfg.enable && !config.programs.zen-browser.enable) {
enable = true; enable = true;
associations.added = associations; associations.added = associations;
defaultApplications = associations; defaultApplications = associations;

View file

@ -134,30 +134,23 @@ in
xdg.mimeApps = xdg.mimeApps =
let let
associations = builtins.listToAttrs ( associations = lib.genAttrs [
map
(name: {
inherit name;
value = cfg.package.meta.desktopFileName;
})
[
"application/x-extension-shtml" "application/x-extension-shtml"
"application/x-extension-xhtml" "application/x-extension-xhtml"
"application/x-extension-html" "application/x-extension-html"
"application/x-extension-xht" "application/x-extension-xht"
"application/x-extension-htm" "application/x-extension-htm"
"x-scheme-handler/unknown" # "x-scheme-handler/unknown"
"x-scheme-handler/mailto" # "x-scheme-handler/mailto"
"x-scheme-handler/chrome" "x-scheme-handler/chrome"
"x-scheme-handler/about" "x-scheme-handler/about"
"x-scheme-handler/https" "x-scheme-handler/https"
"x-scheme-handler/http" "x-scheme-handler/http"
"application/xhtml+xml" "application/xhtml+xml"
"application/json" # "application/json"
"text/plain" # "text/plain"
"text/html" "text/html"
] ] (_: cfg.package.meta.desktopFileName);
);
in in
lib.mkIf cfg.enable { lib.mkIf cfg.enable {
associations.added = associations; associations.added = associations;