about summary refs log tree commit diff
path: root/nixos/modules
diff options
context:
space:
mode:
authorDaniel Schaefer <git@danielschaefer.me>2019-04-07 05:02:51 +0200
committerDaniel Schaefer <git@danielschaefer.me>2019-06-13 04:34:03 +0200
commit746b82bd4a6226f40b89d97856576fcaa117cb5c (patch)
tree74fc549f7da55eaa5d1b3fb8a85fb2acfe76e04c /nixos/modules
parenta2aa01be0c4536985701984c8db2bd75c3a25934 (diff)
downloadnixlib-746b82bd4a6226f40b89d97856576fcaa117cb5c.tar
nixlib-746b82bd4a6226f40b89d97856576fcaa117cb5c.tar.gz
nixlib-746b82bd4a6226f40b89d97856576fcaa117cb5c.tar.bz2
nixlib-746b82bd4a6226f40b89d97856576fcaa117cb5c.tar.lz
nixlib-746b82bd4a6226f40b89d97856576fcaa117cb5c.tar.xz
nixlib-746b82bd4a6226f40b89d97856576fcaa117cb5c.tar.zst
nixlib-746b82bd4a6226f40b89d97856576fcaa117cb5c.zip
nixos/cassandra: Allow setting of seed addresses
Allow for more intuitive specifying of seed node addresses with Nix
syntax.
Diffstat (limited to 'nixos/modules')
-rw-r--r--nixos/modules/services/databases/cassandra.nix12
1 files changed, 11 insertions, 1 deletions
diff --git a/nixos/modules/services/databases/cassandra.nix b/nixos/modules/services/databases/cassandra.nix
index af0c29405c8f..ee6c092f0a45 100644
--- a/nixos/modules/services/databases/cassandra.nix
+++ b/nixos/modules/services/databases/cassandra.nix
@@ -13,7 +13,7 @@ let
        endpoint_snitch = "SimpleSnitch";
        seed_provider =
          [{ class_name = "org.apache.cassandra.locator.SimpleSeedProvider";
-            parameters = [ { seeds = "127.0.0.1"; } ];
+            parameters = [ { seeds = concatStringsSep "," cfg.seedAddresses; } ];
          }];
        data_file_directories = [ "${cfg.homeDir}/data" ];
        commitlog_directory = "${cfg.homeDir}/commitlog";
@@ -163,6 +163,16 @@ in {
         XML logback configuration for cassandra
       '';
     };
+    seedAddresses = mkOption {
+      type = types.listOf types.str;
+      default = [ "127.0.0.1" ];
+      description = ''
+        The addresses of hosts designated as contact points in the cluster. A
+        joining node contacts one of the nodes in the seeds list to learn the
+        topology of the ring.
+        Set to 127.0.0.1 for a single node cluster.
+      '';
+    };
     allowClients = mkOption {
       type = types.bool;
       default = true;