diff --git a/configuration.nix b/configuration.nix index 0590efb..8d3042c 100644 --- a/configuration.nix +++ b/configuration.nix @@ -110,7 +110,6 @@ nix-output-monitor - brave gparted arandr flameshot diff --git a/home.nix b/home.nix index b5468cd..b74375e 100644 --- a/home.nix +++ b/home.nix @@ -34,6 +34,7 @@ feh imagemagick + brave ]; home.file = { }; diff --git a/home/modules/filetypes.nix b/home/modules/filetypes.nix new file mode 100644 index 0000000..9aecb47 --- /dev/null +++ b/home/modules/filetypes.nix @@ -0,0 +1,32 @@ +{ config, lib, pkgs, ... }: + +let cfg = config.snowhawk.defaultPrograms; +in { + options.snowhawk.defaultPrograms = { + enable = lib.mkEnableOption "default programs"; + }; + config = cfg.enable { + 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"; + }; + }; +}