🚀 add xdg-mime

nixos
Moritz Böhme 2022-02-15 16:41:36 +01:00
parent 9aaba816a2
commit 0d65a4379d
No known key found for this signature in database
GPG Key ID: 213820E2795F5CF5
2 changed files with 43 additions and 0 deletions

View File

@ -7,6 +7,7 @@
./kitty.nix ./kitty.nix
./rofi ./rofi
./spotify.nix ./spotify.nix
./xdg-mime.nix
./zathura.nix ./zathura.nix
]; ];
home-manager.users.moritz = { home-manager.users.moritz = {

View File

@ -0,0 +1,42 @@
{ 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"
];
};
};
};
}