nixos/home/modules/filetypes.nix

46 lines
1.1 KiB
Nix
Raw Permalink 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
2024-10-17 00:33:24 +00:00
browser = "firefox.desktop";
2024-07-29 06:02:47 +00:00
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/http"
"x-scheme-handler/https"
])
2024-10-17 00:33:24 +00:00
(mimeAppsFor "brave-browser.desktop" [
"x-scheme-handler/chrome"
])
2024-07-29 06:02:47 +00:00
];
2024-06-28 05:31:33 +00:00
};
home.sessionVariables = {
2024-10-18 01:48:51 +00:00
DEFAULT_BROWSER = lib.getExe pkgs.firefox;
2024-06-28 05:31:33 +00:00
};
};
}