diff options
author | Jonathan Zielinski <jozi@dbc.dk> | 2023-11-03 10:24:42 +0100 |
---|---|---|
committer | Jonathan Zielinski <jozi@dbc.dk> | 2023-11-14 14:00:30 +0100 |
commit | aca76b750da32c533e0e93139f32455ff77f869d (patch) | |
tree | b33ace16a4ff572a95f057e7f7aa170bb7cebfac /nixos/modules/services/search | |
parent | 6d2aa33a17681a30777cb53411bd8243ac765555 (diff) |
nixos/opensearch: link plugins from opensearch package
disable security module by default, it crashes unit expecting certificates.
Diffstat (limited to 'nixos/modules/services/search')
-rw-r--r-- | nixos/modules/services/search/opensearch.nix | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/nixos/modules/services/search/opensearch.nix b/nixos/modules/services/search/opensearch.nix index 9a50e79631380..ae79d5545fd76 100644 --- a/nixos/modules/services/search/opensearch.nix +++ b/nixos/modules/services/search/opensearch.nix @@ -72,6 +72,18 @@ in The port to listen on for transport traffic. ''; }; + + options."plugins.security.disabled" = lib.mkOption { + type = lib.types.bool; + default = true; + description = lib.mdDoc '' + Whether to enable the security plugin, + `plugins.security.ssl.transport.keystore_filepath` or + `plugins.security.ssl.transport.server.pemcert_filepath` and + `plugins.security.ssl.transport.client.pemcert_filepath` + must be set for this plugin to be enabled. + ''; + }; }; default = {}; @@ -186,6 +198,13 @@ in shopt -s inherit_errexit # Install plugins + + # remove plugins directory if it is empty. + if [ -z "$(ls -A ${cfg.dataDir}/plugins)" ]; then + rm -r "${cfg.dataDir}/plugins" + fi + + ln -sfT "${cfg.package}/plugins" "${cfg.dataDir}/plugins" ln -sfT ${cfg.package}/lib ${cfg.dataDir}/lib ln -sfT ${cfg.package}/modules ${cfg.dataDir}/modules |