diff --git a/nixos/doc/manual/release-notes/rl-2505.section.md b/nixos/doc/manual/release-notes/rl-2505.section.md index 745044d9d546..91fe7eca35bf 100644 --- a/nixos/doc/manual/release-notes/rl-2505.section.md +++ b/nixos/doc/manual/release-notes/rl-2505.section.md @@ -570,6 +570,8 @@ - `services.kmonad` now creates a determinate symlink (in `/dev/input/by-id/`) to each of KMonad virtual devices. +- `services.searx` now supports configuration of the favicons cache and other options available in SearXNG's `favicons.toml` file + - `services.gitea` now supports CAPTCHA usage through the `services.gitea.captcha` variable. - `services.soft-serve` now restarts upon config change. diff --git a/nixos/modules/services/networking/searx.nix b/nixos/modules/services/networking/searx.nix index 7ad76026a03c..d7fbcb9f9c15 100644 --- a/nixos/modules/services/networking/searx.nix +++ b/nixos/modules/services/networking/searx.nix @@ -11,6 +11,7 @@ let (builtins.toJSON cfg.settings); limiterSettingsFile = (pkgs.formats.toml { }).generate "limiter.toml" cfg.limiterSettings; + faviconsSettingsFile = (pkgs.formats.toml { }).generate "favicons.toml" cfg.faviconsSettings; generateConfig = '' cd ${runDir} @@ -143,6 +144,35 @@ in ''; }; + faviconsSettings = mkOption { + type = types.attrsOf settingType; + default = { }; + example = literalExpression '' + { + favicons = { + cfg_schema = 1; + cache = { + db_url = "/run/searx/faviconcache.db"; + HOLD_TIME = 5184000; + LIMIT_TOTAL_BYTES = 2147483648; + BLOB_MAX_BYTES = 40960; + MAINTENANCE_MODE = "auto"; + MAINTENANCE_PERIOD = 600; + }; + }; + } + ''; + description = '' + Favicons settings for SearXNG. + + ::: {.note} + For available settings, see the SearXNG + [schema file](https://github.com/searxng/searxng/blob/master/searx/favicons/favicons.toml). + ::: + ''; + }; + + package = mkPackageOption pkgs "searxng" { }; runInUwsgi = mkOption { @@ -263,8 +293,13 @@ in port = 0; }; - environment.etc."searxng/limiter.toml" = lib.mkIf (cfg.limiterSettings != { }) { - source = limiterSettingsFile; + environment.etc = { + "searxng/limiter.toml" = lib.mkIf (cfg.limiterSettings != { }) { + source = limiterSettingsFile; + }; + "searxng/favicons.toml" = lib.mkIf (cfg.faviconsSettings != { }) { + source = faviconsSettingsFile; + }; }; };