diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2018-10-16 20:25:44 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2018-10-16 20:25:44 +0200 |
commit | b6bac6c144d83d364a5d0ab0bef7d6ffa9efc55b (patch) | |
tree | d8ea414a00c575e6994d7dde170d35480e0df9e8 /nixos/modules/installer/tools/nixos-build-vms | |
parent | 887bf77621dbd93c3e5296a6b047d00bf3da8b78 (diff) | |
download | nixpkgs-b6bac6c144d83d364a5d0ab0bef7d6ffa9efc55b.tar nixpkgs-b6bac6c144d83d364a5d0ab0bef7d6ffa9efc55b.tar.gz nixpkgs-b6bac6c144d83d364a5d0ab0bef7d6ffa9efc55b.tar.bz2 nixpkgs-b6bac6c144d83d364a5d0ab0bef7d6ffa9efc55b.tar.lz nixpkgs-b6bac6c144d83d364a5d0ab0bef7d6ffa9efc55b.tar.xz nixpkgs-b6bac6c144d83d364a5d0ab0bef7d6ffa9efc55b.tar.zst nixpkgs-b6bac6c144d83d364a5d0ab0bef7d6ffa9efc55b.zip |
Revert "Merge pull request #48122 from zimbatm/pkg-nixos-rebuild"
This reverts commit 10addad6035034b2b78f3c74ef436cd7146d5231, reversing changes made to 7786575c6c0e1b010d46ad00b14d0bb5bf08d7d2. NixOS scripts should be kept in the NixOS source tree, not in pkgs. Moving them around is just confusing and creates unnecessary code/history churn.
Diffstat (limited to 'nixos/modules/installer/tools/nixos-build-vms')
-rw-r--r-- | nixos/modules/installer/tools/nixos-build-vms/nixos-build-vms.sh | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/nixos/modules/installer/tools/nixos-build-vms/nixos-build-vms.sh b/nixos/modules/installer/tools/nixos-build-vms/nixos-build-vms.sh new file mode 100644 index 00000000000..4e981c074a5 --- /dev/null +++ b/nixos/modules/installer/tools/nixos-build-vms/nixos-build-vms.sh @@ -0,0 +1,57 @@ +#! @shell@ -e + +# Shows the usage of this command to the user + +showUsage() { + exec man nixos-build-vms + exit 1 +} + +# Parse valid argument options + +PARAMS=`getopt -n $0 -o h -l no-out-link,show-trace,help -- "$@"` + +if [ $? != 0 ] +then + showUsage + exit 1 +fi + +eval set -- "$PARAMS" + +# Evaluate valid options + +while [ "$1" != "--" ] +do + case "$1" in + --no-out-link) + noOutLinkArg="--no-out-link" + ;; + --show-trace) + showTraceArg="--show-trace" + ;; + -h|--help) + showUsage + exit 0 + ;; + esac + + shift +done + +shift + +# Validate the given options + +if [ "$1" = "" ] +then + echo "ERROR: A network expression must be specified!" >&2 + exit 1 +else + networkExpr=$(readlink -f $1) +fi + +# Build a network of VMs + +nix-build '<nixpkgs/nixos/modules/installer/tools/nixos-build-vms/build-vms.nix>' \ + --argstr networkExpr $networkExpr $noOutLinkArg $showTraceArg |