summaryrefslogtreecommitdiffstats
path: root/local-upload-iso
diff options
context:
space:
mode:
Diffstat (limited to 'local-upload-iso')
-rwxr-xr-xlocal-upload-iso17
1 files changed, 17 insertions, 0 deletions
diff --git a/local-upload-iso b/local-upload-iso
new file mode 100755
index 0000000..26c2358
--- /dev/null
+++ b/local-upload-iso
@@ -0,0 +1,17 @@
+#! /bin/sh
+# XXX DRY, see default.nix's ni-upload-iso
+
+keys=$PWD/keys
+nixos_config=$PWD
+nixpkgs=/var/src/nixpkgs
+
+set -efux
+isoImage=$(nix-build \
+ -A config.system.build.isoImage \
+ -I nixos-config="$nixos_config/install.nix" \
+ --no-out-link \
+ "$nixpkgs"/nixos); \
+ftpHost=$(jq -r .ftp.host "$keys/kvm-info.json"); \
+curl -n --netrc-file "$keys/upload-iso.netrc" \
+ -T $isoImage/iso/ni-install.iso \
+ "ftp://$ftpHost/cdrom/ni-install.iso"