cassandra.updateScript: Generate JSON

This commit is contained in:
Robert Hensing 2022-04-06 11:26:19 +02:00
parent 0038244d60
commit efd55dbef4

View file

@ -6,7 +6,7 @@
}:
let
inherit (lib) makeBinPath;
filename = lib.strings.replaceStrings [ "_" ] [ "." ] generation + ".nix";
filename = lib.strings.replaceStrings [ "_" ] [ "." ] generation + ".json";
regex = lib.strings.replaceStrings [ "_" ] [ "[.]" ] generation;
in
writeScript "update-cassandra_${generation}" ''
@ -34,12 +34,9 @@ writeScript "update-cassandra_${generation}" ''
version="$(grep -E '^${regex}' <$tmp/versions | head -n 1)"
hash="$(nix-prefetch-url "mirror://apache/cassandra/$version/apache-cassandra-$version-bin.tar.gz")"
cat >${filename} <<EOF
# GENERATED BY update.sh
{ callPackage, ... } @ args:
callPackage ./generic.nix (args // {
version = "$version";
sha256 = "$hash";
generation = "${generation}";
})
{
"version": "$version",
"sha256": "$hash"
}
EOF
''