From 946bb5f17542163677470445b1b6394869851268 Mon Sep 17 00:00:00 2001 From: Alexander Nortung Date: Wed, 23 Oct 2024 13:01:51 +0200 Subject: [PATCH] feat(meilisearch): Add package option --- src/modules/services/meilisearch.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/modules/services/meilisearch.nix b/src/modules/services/meilisearch.nix index 44ebe15c8..267497d03 100644 --- a/src/modules/services/meilisearch.nix +++ b/src/modules/services/meilisearch.nix @@ -9,6 +9,13 @@ in options.services.meilisearch = { enable = lib.mkEnableOption "Meilisearch"; + package = lib.mkOption { + type = types.package; + description = "Which Meilisearch package to use"; + default = pkgs.meilisearch; + defaultText = "pkgs.meilisearch"; + }; + listenAddress = lib.mkOption { description = "Meilisearch listen address."; default = "127.0.0.1"; @@ -65,7 +72,7 @@ in }; config = lib.mkIf cfg.enable { - packages = [ pkgs.meilisearch ]; + packages = [ cfg.package ]; env.MEILI_DB_PATH = config.env.DEVENV_STATE + "/meilisearch"; env.MEILI_HTTP_ADDR = "${cfg.listenAddress}:${toString cfg.listenPort}"; @@ -76,7 +83,7 @@ in env.MEILI_MAX_INDEX_SIZE = cfg.maxIndexSize; processes.meilisearch = { - exec = "${pkgs.meilisearch}/bin/meilisearch"; + exec = "${cfg.package}/bin/meilisearch"; }; }; }