forked from fabian/nix_config
46 lines
956 B
Nix
46 lines
956 B
Nix
{
|
|
config,
|
|
lib,
|
|
pkgs,
|
|
...
|
|
}:
|
|
with lib; let
|
|
cfg = config.local.apps.firefox;
|
|
in {
|
|
options.local.apps.firefox = {
|
|
enable = mkEnableOption "firefox settings";
|
|
|
|
makeDefaultBrowser = mkOption {
|
|
type = types.bool;
|
|
default = true;
|
|
description = ''
|
|
Take a guess
|
|
'';
|
|
};
|
|
};
|
|
|
|
config = mkIf cfg.enable (mkMerge [
|
|
{
|
|
programs.firefox.enable = true;
|
|
}
|
|
|
|
(mkIf cfg.makeDefaultBrowser {
|
|
xdg = {
|
|
mimeApps = {
|
|
enable = true;
|
|
defaultApplications = {
|
|
"text/html" = ["firefox"];
|
|
"text/uri-list" = ["firefox"];
|
|
"x-scheme-handler/http" = ["firefox"];
|
|
"x-scheme-handler/https" = ["firefox"];
|
|
"x-scheme-handler/about" = ["firefox"];
|
|
"x-scheme-handler/unknown" = ["firefox"];
|
|
};
|
|
};
|
|
};
|
|
|
|
home.sessionVariables.DEFAULT_BROWSER = "${lib.getExe pkgs.firefox}";
|
|
})
|
|
]);
|
|
}
|