Unverified Commit 3bd304a8 authored by Pol Dellaiera's avatar Pol Dellaiera Committed by GitHub
Browse files

nixos/searx: add option for favicons settings (#389428)

parents 7a991710 461be7d8
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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.
+37 −2
Original line number Diff line number Diff line
@@ -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,9 +293,14 @@ in
      port = 0;
    };

    environment.etc."searxng/limiter.toml" = lib.mkIf (cfg.limiterSettings != { }) {
    environment.etc = {
      "searxng/limiter.toml" = lib.mkIf (cfg.limiterSettings != { }) {
        source = limiterSettingsFile;
      };
      "searxng/favicons.toml" = lib.mkIf (cfg.faviconsSettings != { }) {
        source = faviconsSettingsFile;
      };
    };
  };

  meta.maintainers = with maintainers; [ rnhmjoj _999eagle ];