<commit_before>#! @shell@ -e

# Shows the usage of this command to the user

showUsage()
{
    echo "Usage: $0 network_expr"
    echo "Options:"
    echo
    echo "--show-trace  Shows an output trace"
    echo "--no-out-link Do not create a 'result' symlink"
    echo "-h,--help     Shows the usage of this command"
}

# Parse valid argument options

PARAMS=`getopt -n $0 -o h -l show-trace,no-out-link,help -- "$@"`

if [ $? != 0 ]
then
    showUsage
    exit 1
fi

eval set -- "$PARAMS"

# Evaluate valid options

while [ "$1" != "--" ]
do
    case "$1" in
	--show-trace)
	    showTraceArg="--show-trace"
	    ;;
	--no-out-link)
	    noOutLinkArg="--no-out-link"
	    ;;
	-h|--help)
	    showUsage
	    exit 0
	    ;;
    esac
    
    shift
done

shift

# Validate the given options

if [ -z "$NIXOS" ]
then
    NIXOS=/etc/nixos/nixos
fi

if [ "$@" = "" ]
then
    echo "ERROR: A network Nix expression must be specified!" >&2
    exit 1
else
    networkExpr=$(readlink -f $@)
fi

# Deploy the network

vms=`nix-build $NIXOS/modules/installer/tools/nixos-deploy-network/deploy.nix --argstr networkExpr $networkExpr $showTraceArg $noOutLinkArg`
$vms/bin/deploy-systems<commit_msg>Also pass the location of NixOS as argument to the deployment expression<commit_after>#! @shell@ -e

# Shows the usage of this command to the user

showUsage()
{
    echo "Usage: $0 network_expr"
    echo "Options:"
    echo
    echo "--show-trace  Shows an output trace"
    echo "--no-out-link Do not create a 'result' symlink"
    echo "-h,--help     Shows the usage of this command"
}

# Parse valid argument options

PARAMS=`getopt -n $0 -o h -l show-trace,no-out-link,help -- "$@"`

if [ $? != 0 ]
then
    showUsage
    exit 1
fi

eval set -- "$PARAMS"

# Evaluate valid options

while [ "$1" != "--" ]
do
    case "$1" in
	--show-trace)
	    showTraceArg="--show-trace"
	    ;;
	--no-out-link)
	    noOutLinkArg="--no-out-link"
	    ;;
	-h|--help)
	    showUsage
	    exit 0
	    ;;
    esac
    
    shift
done

shift

# Validate the given options

if [ -z "$NIXOS" ]
then
    NIXOS=/etc/nixos/nixos
fi

if [ "$@" = "" ]
then
    echo "ERROR: A network Nix expression must be specified!" >&2
    exit 1
else
    networkExpr=$(readlink -f $@)
fi

# Deploy the network

vms=`nix-build $NIXOS/modules/installer/tools/nixos-deploy-network/deploy.nix --argstr networkExpr $networkExpr --argstr nixos $NIXOS $showTraceArg $noOutLinkArg`
$vms/bin/deploy-systems
{'fraction_non_alphanumeric': 0.1427402862985685, 'fraction_numerical': 0.007361963190184049, 'mean_word_length': 2.591776798825257, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4264831', 'n_tokens_mistral': 945, 'n_tokens_neox': 889, 'n_words': 259}