summary refs log tree commit diff
path: root/nixos/modules/services/databases/cassandra.nix
diff options
context:
space:
mode:
authorDaniel Schaefer <git@danielschaefer.me>2019-04-24 05:48:22 +0200
committerDaniel Schaefer <git@danielschaefer.me>2019-04-29 14:05:50 +0200
commit786f02f7a45621b9f628f63649ff92546aff83b7 (patch)
tree92784e131ccac4a1a63f7dbae6c228fb9d81468b /nixos/modules/services/databases/cassandra.nix
parent5f14e83bd6b9ef1c83b035011267dd3d40278476 (diff)
downloadnixpkgs-786f02f7a45621b9f628f63649ff92546aff83b7.tar
nixpkgs-786f02f7a45621b9f628f63649ff92546aff83b7.tar.gz
nixpkgs-786f02f7a45621b9f628f63649ff92546aff83b7.tar.bz2
nixpkgs-786f02f7a45621b9f628f63649ff92546aff83b7.tar.lz
nixpkgs-786f02f7a45621b9f628f63649ff92546aff83b7.tar.xz
nixpkgs-786f02f7a45621b9f628f63649ff92546aff83b7.tar.zst
nixpkgs-786f02f7a45621b9f628f63649ff92546aff83b7.zip
treewide: Remove usage of isNull
isNull "is deprecated; just write e == null instead" says the Nix manual
Diffstat (limited to 'nixos/modules/services/databases/cassandra.nix')
-rw-r--r--nixos/modules/services/databases/cassandra.nix22
1 files changed, 8 insertions, 14 deletions
diff --git a/nixos/modules/services/databases/cassandra.nix b/nixos/modules/services/databases/cassandra.nix
index d741ee48c48..68893886802 100644
--- a/nixos/modules/services/databases/cassandra.nix
+++ b/nixos/modules/services/databases/cassandra.nix
@@ -22,11 +22,11 @@ let
              else {})
     );
   cassandraConfigWithAddresses = cassandraConfig //
-    ( if isNull cfg.listenAddress
+    ( if cfg.listenAddress == null
         then { listen_interface = cfg.listenInterface; }
         else { listen_address = cfg.listenAddress; }
     ) // (
-      if isNull cfg.rpcAddress
+      if cfg.rpcAddress == null
         then { rpc_interface = cfg.rpcInterface; }
         else { rpc_address = cfg.rpcAddress; }
     );
@@ -219,19 +219,13 @@ in {
   config = mkIf cfg.enable {
     assertions =
       [ { assertion =
-            ((isNull cfg.listenAddress)
-             || (isNull cfg.listenInterface)
-            ) && !((isNull cfg.listenAddress)
-                   && (isNull cfg.listenInterface)
-                  );
+          (cfg.listenAddress == null || cfg.listenInterface == null)
+          && !(cfg.listenAddress == null && cfg.listenInterface == null);
           message = "You have to set either listenAddress or listenInterface";
         }
         { assertion =
-            ((isNull cfg.rpcAddress)
-             || (isNull cfg.rpcInterface)
-            ) && !((isNull cfg.rpcAddress)
-                   && (isNull cfg.rpcInterface)
-                  );
+          (cfg.rpcAddress == null || cfg.rpcInterface == null)
+          && !(cfg.rpcAddress == null && cfg.rpcInterface == null);
           message = "You have to set either rpcAddress or rpcInterface";
         }
       ];
@@ -276,7 +270,7 @@ in {
           };
       };
     systemd.timers.cassandra-full-repair =
-      mkIf (!isNull cfg.fullRepairInterval) {
+      mkIf (cfg.fullRepairInterval != null) {
         description = "Schedule full repairs on Cassandra";
         wantedBy = [ "timers.target" ];
         timerConfig =
@@ -300,7 +294,7 @@ in {
           };
       };
     systemd.timers.cassandra-incremental-repair =
-      mkIf (!isNull cfg.incrementalRepairInterval) {
+      mkIf (cfg.incrementalRepairInterval != null) {
         description = "Schedule incremental repairs on Cassandra";
         wantedBy = [ "timers.target" ];
         timerConfig =