···
cfg = config.services.meilisearch;
16
-
meta.maintainers = with maintainers; [
13
+
meta.maintainers = with lib.maintainers; [
···
options.services.meilisearch = {
25
-
enable = mkEnableOption "MeiliSearch - a RESTful search API";
22
+
enable = lib.mkEnableOption "MeiliSearch - a RESTful search API";
27
-
package = mkPackageOption pkgs "meilisearch" {
24
+
package = lib.mkPackageOption pkgs "meilisearch" {
Use this if you require specific features to be enabled. The default package has no features.
33
-
listenAddress = mkOption {
30
+
listenAddress = lib.mkOption {
description = "MeiliSearch listen address.";
33
+
type = lib.types.str;
39
-
listenPort = mkOption {
36
+
listenPort = lib.mkOption {
description = "MeiliSearch port to listen on.";
39
+
type = lib.types.port;
45
-
environment = mkOption {
42
+
environment = lib.mkOption {
description = "Defines the running environment of MeiliSearch.";
45
+
type = lib.types.enum [
# TODO change this to LoadCredentials once possible
55
-
masterKeyEnvironmentFile = mkOption {
52
+
masterKeyEnvironmentFile = lib.mkOption {
Path to file which contains the master key.
By doing so, all routes will be protected and will require a key to be accessed.
···
MEILI_MASTER_KEY=my_secret_key
64
-
type = with types; nullOr path;
61
+
type = with lib.types; nullOr path;
67
-
noAnalytics = mkOption {
64
+
noAnalytics = lib.mkOption {
Analytics allow MeiliSearch to know how many users are using MeiliSearch,
···
This process is entirely anonymous.
72
+
type = lib.types.bool;
78
-
logLevel = mkOption {
75
+
logLevel = lib.mkOption {
Defines how much detail should be present in MeiliSearch's logs.
MeiliSearch currently supports four log levels, listed in order of increasing verbosity:
···
Useful when diagnosing issues and debugging
86
+
type = lib.types.str;
92
-
maxIndexSize = mkOption {
89
+
maxIndexSize = lib.mkOption {
Sets the maximum size of the index.
Value must be given in bytes or explicitly stating a base unit.
···
default = "107374182400";
97
+
type = lib.types.str;
103
-
payloadSizeLimit = mkOption {
100
+
payloadSizeLimit = lib.mkOption {
Sets the maximum size of accepted JSON payloads.
Value must be given in bytes or explicitly stating a base unit.
···
108
+
type = lib.types.str;
118
-
config = mkIf cfg.enable {
115
+
config = lib.mkIf cfg.enable {
environment.systemPackages = [ cfg.package ];
···
MEILI_DB_PATH = "/var/lib/meilisearch";
MEILI_HTTP_ADDR = "${cfg.listenAddress}:${toString cfg.listenPort}";
130
-
MEILI_NO_ANALYTICS = boolToString cfg.noAnalytics;
127
+
MEILI_NO_ANALYTICS = lib.boolToString cfg.noAnalytics;
MEILI_ENV = cfg.environment;
MEILI_DUMP_DIR = "/var/lib/meilisearch/dumps";
MEILI_LOG_LEVEL = cfg.logLevel;
···
ExecStart = "${cfg.package}/bin/meilisearch";
StateDirectory = "meilisearch";
140
-
EnvironmentFile = mkIf (cfg.masterKeyEnvironmentFile != null) cfg.masterKeyEnvironmentFile;
137
+
EnvironmentFile = lib.mkIf (cfg.masterKeyEnvironmentFile != null) cfg.masterKeyEnvironmentFile;