Skip to content

Commit

Permalink
Merge pull request #1547 from Oak-Digital/feature/meilisearch-package
Browse files Browse the repository at this point in the history
feat(meilisearch): Add package option
  • Loading branch information
domenkozar authored Oct 23, 2024
2 parents 874a526 + 946bb5f commit a358757
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/modules/services/meilisearch.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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}";
Expand All @@ -76,7 +83,7 @@ in
env.MEILI_MAX_INDEX_SIZE = cfg.maxIndexSize;

processes.meilisearch = {
exec = "${pkgs.meilisearch}/bin/meilisearch";
exec = "${cfg.package}/bin/meilisearch";
};
};
}

0 comments on commit a358757

Please sign in to comment.