nixos/home/modules/filetypes.nix

43 lines
1.0 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-07-29 06:02:47 +00:00
xdg.mimeApps =
let
browser = "brave-browser.desktop";
mimeAppsFor =
value: list:
2024-07-30 08:11:06 +00:00
lib.genAttrs list (name: value);
2024-07-29 06:02:47 +00:00
in
{
enable = true;
defaultApplications = lib.mkMerge [
(mimeAppsFor browser [
"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"
])
];
2024-06-28 05:31:33 +00:00
};
home.sessionVariables = {
DEFAULT_BROWSER = "${pkgs.brave}/bin/brave";
};
};
}