dotfiles/modules/desktop/apps/xdg-mime.nix

43 lines
1.2 KiB
Nix
Raw Normal View History

2022-02-15 16:41:36 +01:00
{ config, lib, pkgs, ... }:
let
browser = [ "firefox.desktop" ];
associations = {
"text/html" = browser;
"x-scheme-handler/http" = browser;
"x-scheme-handler/https" = browser;
"x-scheme-handler/ftp" = browser;
"x-scheme-handler/chrome" = browser;
"x-scheme-handler/about" = browser;
"x-scheme-handler/unknown" = browser;
"application/x-extension-htm" = browser;
"application/x-extension-html" = browser;
"application/x-extension-shtml" = browser;
"application/xhtml+xml" = browser;
"application/x-extension-xhtml" = browser;
"application/x-extension-xht" = browser;
};
in {
home-manager.users.moritz = {
xdg.mime.enable = true;
xdg.mimeApps.enable = true;
xdg.mimeApps.associations.added = associations;
xdg.mimeApps.defaultApplications = associations;
xdg.desktopEntries = {
firefox = {
name = "Firefox";
genericName = "Web Browser";
exec = "${pkgs.firefox}/bin/firefox %U";
terminal = false;
categories = [ "Application" "Network" "WebBrowser" ];
mimeType = [
"text/html"
"text/xml"
"x-scheme-handler/http"
"x-scheme-handler/https"
];
};
};
};
}