summary refs log tree commit diff
diff options
context:
space:
mode:
authorSarah Brofeldt <sbrofeldt@gmail.com>2023-11-16 11:30:09 +0100
committerGitHub <noreply@github.com>2023-11-16 11:30:09 +0100
commit54f00576aa6139a9d54062d0edc2fb31423f0ffb (patch)
treec041e1aa1f90a98d1ceba4c9d6a6cf47279e8b25
parentb7b91c7a4a6630b086b7d8e87dd0350dac8e422a (diff)
parentaca76b750da32c533e0e93139f32455ff77f869d (diff)
downloadnixpkgs-54f00576aa6139a9d54062d0edc2fb31423f0ffb.tar
nixpkgs-54f00576aa6139a9d54062d0edc2fb31423f0ffb.tar.gz
nixpkgs-54f00576aa6139a9d54062d0edc2fb31423f0ffb.tar.bz2
nixpkgs-54f00576aa6139a9d54062d0edc2fb31423f0ffb.tar.lz
nixpkgs-54f00576aa6139a9d54062d0edc2fb31423f0ffb.tar.xz
nixpkgs-54f00576aa6139a9d54062d0edc2fb31423f0ffb.tar.zst
nixpkgs-54f00576aa6139a9d54062d0edc2fb31423f0ffb.zip
Merge pull request #265193 from 0z13/opensearch-module-link-plugins
nixos/opensearch: link plugins from opensearch package
-rw-r--r--nixos/modules/services/search/opensearch.nix19
1 files changed, 19 insertions, 0 deletions
diff --git a/nixos/modules/services/search/opensearch.nix b/nixos/modules/services/search/opensearch.nix
index 9a50e796313..ae79d5545fd 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