nixos/cassandra: Add cfg.extraEnvSh
This commit is contained in:
parent
0dc4edcd60
commit
2d2612a020
@ -38,13 +38,18 @@ let
|
|||||||
cassandraYaml = builtins.toJSON cassandraConfigWithAddresses;
|
cassandraYaml = builtins.toJSON cassandraConfigWithAddresses;
|
||||||
cassandraEnvPkg = "${cfg.package}/conf/cassandra-env.sh";
|
cassandraEnvPkg = "${cfg.package}/conf/cassandra-env.sh";
|
||||||
cassandraLogbackConfig = pkgs.writeText "logback.xml" cfg.logbackConfig;
|
cassandraLogbackConfig = pkgs.writeText "logback.xml" cfg.logbackConfig;
|
||||||
|
passAsFile = [ "extraEnvSh" ];
|
||||||
|
inherit (cfg) extraEnvSh;
|
||||||
buildCommand = ''
|
buildCommand = ''
|
||||||
mkdir -p "$out"
|
mkdir -p "$out"
|
||||||
|
|
||||||
echo "$cassandraYaml" > "$out/cassandra.yaml"
|
echo "$cassandraYaml" > "$out/cassandra.yaml"
|
||||||
ln -s "$cassandraLogbackConfig" "$out/logback.xml"
|
ln -s "$cassandraLogbackConfig" "$out/logback.xml"
|
||||||
|
|
||||||
cp "$cassandraEnvPkg" "$out/cassandra-env.sh"
|
( cat "$cassandraEnvPkg"
|
||||||
|
echo "# lines from services.cassandra.extraEnvSh: "
|
||||||
|
cat "$extraEnvShPath"
|
||||||
|
) > "$out/cassandra-env.sh"
|
||||||
|
|
||||||
# Delete default JMX Port, otherwise we can't set it using env variable
|
# Delete default JMX Port, otherwise we can't set it using env variable
|
||||||
sed -i '/JMX_PORT="7199"/d' "$out/cassandra-env.sh"
|
sed -i '/JMX_PORT="7199"/d' "$out/cassandra-env.sh"
|
||||||
@ -224,6 +229,14 @@ in {
|
|||||||
Extra options to be merged into cassandra.yaml as nix attribute set.
|
Extra options to be merged into cassandra.yaml as nix attribute set.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
extraEnvSh = mkOption {
|
||||||
|
type = types.lines;
|
||||||
|
default = "";
|
||||||
|
example = "CLASSPATH=$CLASSPATH:\${extraJar}";
|
||||||
|
description = ''
|
||||||
|
Extra shell lines to be appended onto cassandra-env.sh.
|
||||||
|
'';
|
||||||
|
};
|
||||||
fullRepairInterval = mkOption {
|
fullRepairInterval = mkOption {
|
||||||
type = types.nullOr types.str;
|
type = types.nullOr types.str;
|
||||||
default = "3w";
|
default = "3w";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user