nixos/home/modules/filetypes.nix

33 lines
1.1 KiB
Nix
Raw Normal View History

2024-06-28 05:31:33 +00:00
{ config, lib, pkgs, ... }:
let cfg = config.snowhawk.defaultPrograms;
in {
options.snowhawk.defaultPrograms = {
enable = lib.mkEnableOption "default programs";
};
2024-06-28 06:23:02 +00:00
config = lib.mkIf cfg.enable {
2024-06-28 05:31:33 +00:00
xdg.mimeApps = {
enable = true;
defaultApplications = {
# Firefox
"application/pdf" = "brave-browser.desktop";
"application/x-extension-htm" = "brave-browser.desktop";
"application/x-extension-html" = "brave-browser.desktop";
"application/x-extension-shtml" = "brave-browser.desktop";
"application/x-extension-xht" = "brave-browser.desktop";
"application/x-extension-xhtml" = "brave-browser.desktop";
"application/xhtml+xml" = "brave-browser.desktop";
"text/html" = "brave-browser.desktop";
"x-scheme-handler/about" = "brave-browser.desktop";
"x-scheme-handler/chrome" = "brave-browser.desktop";
"x-scheme-handler/http" = "brave-browser.desktop";
"x-scheme-handler/https" = "brave-browser.desktop";
};
};
home.sessionVariables = {
DEFAULT_BROWSER = "${pkgs.brave}/bin/brave";
};
};
}