nixos-iso/packages/netali-default-config-ruby/default.nix

19 lines
596 B
Nix
Raw Normal View History

2023-11-10 21:03:33 +01:00
{ writeShellScriptBin, envsubst }:
writeShellScriptBin "netali-default-config-ruby" ''
if [[ $# -ne 3 ]]; then
echo "Usage: netali-default-config-ruby [out-path] [hostname] [last-ip-block]"
echo ""
echo "out-path: path to which the configuration will be written"
echo "hostname: path to which the configuration will be written"
echo "last-ip-block: last block of the IPv6 address of this host"
exit 1
fi
OUT_PATH=$1
export TARGET_HOSTNAME="$2"
export LAST_IP_BLOCK="$3"
${envsubst}/bin/envsubst -i ${./config-template.txt} -o $OUT_PATH
''