summaryrefslogtreecommitdiffstats
path: root/nixos/modules/services/databases/cassandra.nix
diff options
context:
space:
mode:
Diffstat (limited to 'nixos/modules/services/databases/cassandra.nix')
-rw-r--r--nixos/modules/services/databases/cassandra.nix15
1 files changed, 8 insertions, 7 deletions
diff --git a/nixos/modules/services/databases/cassandra.nix b/nixos/modules/services/databases/cassandra.nix
index 452691e42322..fc5812c49df0 100644
--- a/nixos/modules/services/databases/cassandra.nix
+++ b/nixos/modules/services/databases/cassandra.nix
@@ -12,16 +12,17 @@ let
cluster_name = cfg.clusterName;
partitioner = "org.apache.cassandra.dht.Murmur3Partitioner";
endpoint_snitch = "SimpleSnitch";
- seed_provider =
- [{ class_name = "org.apache.cassandra.locator.SimpleSeedProvider";
- parameters = [ { seeds = concatStringsSep "," cfg.seedAddresses; } ];
- }];
data_file_directories = [ "${cfg.homeDir}/data" ];
commitlog_directory = "${cfg.homeDir}/commitlog";
saved_caches_directory = "${cfg.homeDir}/saved_caches";
- } // (if lib.versionAtLeast cfg.package.version "3"
- then { hints_directory = "${cfg.homeDir}/hints"; }
- else {})
+ } // (lib.optionalAttrs (cfg.seedAddresses != []) {
+ seed_provider = [{
+ class_name = "org.apache.cassandra.locator.SimpleSeedProvider";
+ parameters = [ { seeds = concatStringsSep "," cfg.seedAddresses; } ];
+ }];
+ }) // (lib.optionalAttrs (lib.versionAtLeast cfg.package.version "3") {
+ hints_directory = "${cfg.homeDir}/hints";
+ })
);
cassandraConfigWithAddresses = cassandraConfig //
( if cfg.listenAddress == null