filetypes: new definition format

sh-initrd-on-root
Zynh Ludwig 2024-07-28 23:02:47 -07:00
parent 039fcb3d0e
commit b72635d019
1 changed files with 29 additions and 17 deletions

View File

@ -6,23 +6,35 @@ in {
enable = lib.mkEnableOption "default programs"; enable = lib.mkEnableOption "default programs";
}; };
config = lib.mkIf cfg.enable { config = lib.mkIf cfg.enable {
xdg.mimeApps = { xdg.mimeApps =
let
browser = "brave-browser.desktop";
mimeAppsFor =
value: list:
lib.right
builtins.listToAttrs
(map (name: { inherit name value; }))
list;
in
{
enable = true; enable = true;
defaultApplications = { defaultApplications = lib.mkMerge [
# Firefox (mimeAppsFor browser [
"application/pdf" = "brave-browser.desktop"; "application/pdf"
"application/x-extension-htm" = "brave-browser.desktop"; "application/x-extension-htm"
"application/x-extension-html" = "brave-browser.desktop"; "application/x-extension-html"
"application/x-extension-shtml" = "brave-browser.desktop"; "application/x-extension-shtml"
"application/x-extension-xht" = "brave-browser.desktop"; "application/x-extension-xht"
"application/x-extension-xhtml" = "brave-browser.desktop"; "application/x-extension-xhtml"
"application/xhtml+xml" = "brave-browser.desktop"; "application/xhtml+xml"
"text/html" = "brave-browser.desktop"; "text/html"
"x-scheme-handler/about" = "brave-browser.desktop"; "x-scheme-handler/about"
"x-scheme-handler/chrome" = "brave-browser.desktop"; "x-scheme-handler/chrome"
"x-scheme-handler/http" = "brave-browser.desktop"; "x-scheme-handler/http"
"x-scheme-handler/https" = "brave-browser.desktop"; "x-scheme-handler/https"
}; ])
];
}; };
home.sessionVariables = { home.sessionVariables = {