filetypes: new definition format
This commit is contained in:
parent
039fcb3d0e
commit
b72635d019
1 changed files with 29 additions and 17 deletions
|
@ -6,24 +6,36 @@ 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 =
|
||||||
enable = true;
|
let
|
||||||
defaultApplications = {
|
browser = "brave-browser.desktop";
|
||||||
# Firefox
|
|
||||||
"application/pdf" = "brave-browser.desktop";
|
mimeAppsFor =
|
||||||
"application/x-extension-htm" = "brave-browser.desktop";
|
value: list:
|
||||||
"application/x-extension-html" = "brave-browser.desktop";
|
lib.right
|
||||||
"application/x-extension-shtml" = "brave-browser.desktop";
|
builtins.listToAttrs
|
||||||
"application/x-extension-xht" = "brave-browser.desktop";
|
(map (name: { inherit name value; }))
|
||||||
"application/x-extension-xhtml" = "brave-browser.desktop";
|
list;
|
||||||
"application/xhtml+xml" = "brave-browser.desktop";
|
in
|
||||||
"text/html" = "brave-browser.desktop";
|
{
|
||||||
"x-scheme-handler/about" = "brave-browser.desktop";
|
enable = true;
|
||||||
"x-scheme-handler/chrome" = "brave-browser.desktop";
|
defaultApplications = lib.mkMerge [
|
||||||
"x-scheme-handler/http" = "brave-browser.desktop";
|
(mimeAppsFor browser [
|
||||||
"x-scheme-handler/https" = "brave-browser.desktop";
|
"application/pdf"
|
||||||
|
"application/x-extension-htm"
|
||||||
|
"application/x-extension-html"
|
||||||
|
"application/x-extension-shtml"
|
||||||
|
"application/x-extension-xht"
|
||||||
|
"application/x-extension-xhtml"
|
||||||
|
"application/xhtml+xml"
|
||||||
|
"text/html"
|
||||||
|
"x-scheme-handler/about"
|
||||||
|
"x-scheme-handler/chrome"
|
||||||
|
"x-scheme-handler/http"
|
||||||
|
"x-scheme-handler/https"
|
||||||
|
])
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
home.sessionVariables = {
|
home.sessionVariables = {
|
||||||
DEFAULT_BROWSER = "${pkgs.brave}/bin/brave";
|
DEFAULT_BROWSER = "${pkgs.brave}/bin/brave";
|
||||||
|
|
Loading…
Reference in a new issue