mirror of
https://github.com/SebastianStork/nixos-config.git
synced 2026-03-22 16:39:07 +01:00
firefox: Make options homepage and searchEngine nullable
This commit is contained in:
parent
a4c6c0424f
commit
2bc59a7438
1 changed files with 6 additions and 6 deletions
|
|
@ -31,24 +31,24 @@ in
|
||||||
options.custom.programs.firefox = {
|
options.custom.programs.firefox = {
|
||||||
enable = lib.mkEnableOption "";
|
enable = lib.mkEnableOption "";
|
||||||
homepage = lib.mkOption {
|
homepage = lib.mkOption {
|
||||||
type = lib.types.nonEmptyStr;
|
type = lib.types.nullOr lib.types.nonEmptyStr;
|
||||||
default =
|
default =
|
||||||
allHosts
|
allHosts
|
||||||
|> lib.attrValues
|
|> lib.attrValues
|
||||||
|> lib.map (host: host.config.custom.web-services.glance)
|
|> lib.map (host: host.config.custom.web-services.glance)
|
||||||
|> lib.filter (glance: glance.enable)
|
|> lib.filter (glance: glance.enable)
|
||||||
|> lib.map (glance: glance.domain)
|
|> lib.map (glance: glance.domain)
|
||||||
|> lib.head;
|
|> (domains: if (lib.length domains != 0) then domains |> lib.head else null);
|
||||||
};
|
};
|
||||||
searchEngine = lib.mkOption {
|
searchEngine = lib.mkOption {
|
||||||
type = lib.types.nonEmptyStr;
|
type = lib.types.nullOr lib.types.nonEmptyStr;
|
||||||
default =
|
default =
|
||||||
allHosts
|
allHosts
|
||||||
|> lib.attrValues
|
|> lib.attrValues
|
||||||
|> lib.map (host: host.config.custom.web-services.searxng)
|
|> lib.map (host: host.config.custom.web-services.searxng)
|
||||||
|> lib.filter (searxng: searxng.enable)
|
|> lib.filter (searxng: searxng.enable)
|
||||||
|> lib.map (searxng: searxng.domain)
|
|> lib.map (searxng: searxng.domain)
|
||||||
|> lib.head;
|
|> (domains: if (lib.length domains != 0) then domains |> lib.head else null);
|
||||||
};
|
};
|
||||||
extensions = lib.mkOption {
|
extensions = lib.mkOption {
|
||||||
type = lib.types.attrsOf (
|
type = lib.types.attrsOf (
|
||||||
|
|
@ -107,7 +107,7 @@ in
|
||||||
{
|
{
|
||||||
"intl.accept_languages" = "en-us,en,de-de,de";
|
"intl.accept_languages" = "en-us,en,de-de,de";
|
||||||
"browser.uiCustomization.state" = uiState;
|
"browser.uiCustomization.state" = uiState;
|
||||||
"browser.startup.homepage" = cfg.homepage;
|
"browser.startup.homepage" = lib.mkIf (cfg.homepage != null) cfg.homepage;
|
||||||
"sidebar.position_start" = false;
|
"sidebar.position_start" = false;
|
||||||
"browser.toolbars.bookmarks.visibility" = "always";
|
"browser.toolbars.bookmarks.visibility" = "always";
|
||||||
"browser.bookmarks.restore_default_bookmarks" = false;
|
"browser.bookmarks.restore_default_bookmarks" = false;
|
||||||
|
|
@ -126,7 +126,7 @@ in
|
||||||
|
|
||||||
extraConfig = lib.readFile "${inputs.betterfox}/user.js";
|
extraConfig = lib.readFile "${inputs.betterfox}/user.js";
|
||||||
|
|
||||||
search = {
|
search = lib.mkIf (cfg.searchEngine != null) {
|
||||||
force = true;
|
force = true;
|
||||||
default = "searxng";
|
default = "searxng";
|
||||||
privateDefault = "searxng";
|
privateDefault = "searxng";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue