diff options
author | Robert Hensing <robert@roberthensing.nl> | 2021-04-29 08:39:35 +0200 |
---|---|---|
committer | Robert Hensing <robert@roberthensing.nl> | 2021-04-29 08:40:12 +0200 |
commit | 726669ace8a2e13d4211da4a2adfa9ee5f9d9f38 (patch) | |
tree | a4e40727cc4789e8c77ee89dd7445e4f4213fddd | |
parent | 19ba3d97d29285b2e6c49bfa3f3445c679e73ef2 (diff) | |
download | nixpkgs-726669ace8a2e13d4211da4a2adfa9ee5f9d9f38.tar nixpkgs-726669ace8a2e13d4211da4a2adfa9ee5f9d9f38.tar.gz nixpkgs-726669ace8a2e13d4211da4a2adfa9ee5f9d9f38.tar.bz2 nixpkgs-726669ace8a2e13d4211da4a2adfa9ee5f9d9f38.tar.lz nixpkgs-726669ace8a2e13d4211da4a2adfa9ee5f9d9f38.tar.xz nixpkgs-726669ace8a2e13d4211da4a2adfa9ee5f9d9f38.tar.zst nixpkgs-726669ace8a2e13d4211da4a2adfa9ee5f9d9f38.zip |
cassandra: use Nix scope checking
-rw-r--r-- | nixos/modules/services/databases/cassandra.nix | 30 | ||||
-rw-r--r-- | pkgs/servers/nosql/cassandra/generic.nix | 2 |
2 files changed, 22 insertions, 10 deletions
diff --git a/nixos/modules/services/databases/cassandra.nix b/nixos/modules/services/databases/cassandra.nix index 4ce7a068aed..ebb50ddf50b 100644 --- a/nixos/modules/services/databases/cassandra.nix +++ b/nixos/modules/services/databases/cassandra.nix @@ -1,8 +1,20 @@ { config, lib, pkgs, ... }: -with lib; - let + inherit (lib) + concatStringsSep + flip + literalExample + optionalAttrs + optionals + recursiveUpdate + mkEnableOption + mkIf + mkOption + types + versionAtLeast + ; + cfg = config.services.cassandra; defaultUser = "cassandra"; @@ -18,14 +30,14 @@ let data_file_directories = [ "${cfg.homeDir}/data" ]; commitlog_directory = "${cfg.homeDir}/commitlog"; saved_caches_directory = "${cfg.homeDir}/saved_caches"; - } // lib.optionalAttrs (cfg.seedAddresses != [ ]) { + } // 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") { + } // optionalAttrs (versionAtLeast cfg.package.version "3") { hints_directory = "${cfg.homeDir}/hints"; } ); @@ -76,10 +88,10 @@ let fullJvmOptions = cfg.jvmOpts - ++ lib.optionals (cfg.jmxRoles != [ ]) [ + ++ optionals (cfg.jmxRoles != [ ]) [ "-Dcom.sun.management.jmxremote.authenticate=true" "-Dcom.sun.management.jmxremote.password.file=${cfg.jmxRolesFile}" - ] ++ lib.optionals cfg.remoteJmx [ + ] ++ optionals cfg.remoteJmx [ "-Djava.rmi.server.hostname=${cfg.rpcAddress}" ]; @@ -421,7 +433,7 @@ in jmxRolesFile = mkOption { type = types.nullOr types.path; default = - if lib.versionAtLeast cfg.package.version "3.11" + if versionAtLeast cfg.package.version "3.11" then pkgs.writeText "jmx-roles-file" defaultJmxRolesFile else null; example = "/var/lib/cassandra/jmx.password"; @@ -497,7 +509,7 @@ in User = cfg.user; Group = cfg.group; ExecStart = - lib.concatStringsSep " " + concatStringsSep " " ([ "${cfg.package}/bin/nodetool" "repair" @@ -525,7 +537,7 @@ in User = cfg.user; Group = cfg.group; ExecStart = - lib.concatStringsSep " " + concatStringsSep " " ([ "${cfg.package}/bin/nodetool" "repair" diff --git a/pkgs/servers/nosql/cassandra/generic.nix b/pkgs/servers/nosql/cassandra/generic.nix index 029eb160545..cab21080a04 100644 --- a/pkgs/servers/nosql/cassandra/generic.nix +++ b/pkgs/servers/nosql/cassandra/generic.nix @@ -21,7 +21,7 @@ let libPath = lib.makeLibraryPath [ stdenv.cc.cc ]; - binPath = with lib; makeBinPath [ + binPath = lib.makeBinPath [ bash getopt gawk |