summaryrefslogtreecommitdiff
path: root/lxc/lxc-import.sh
diff options
context:
space:
mode:
Diffstat (limited to 'lxc/lxc-import.sh')
-rwxr-xr-xlxc/lxc-import.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/lxc/lxc-import.sh b/lxc/lxc-import.sh
new file mode 100755
index 0000000..f4160a4
--- /dev/null
+++ b/lxc/lxc-import.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+set -eu
+alias="${1:-nixos-openrc}"
+
+nix build -o result-metadata .#lxc-metadata
+nix build -o result .#lxc
+
+if lxc image info "$alias" >/dev/null 2>&1; then
+ lxc image delete "$alias"
+fi
+
+lxc image import \
+ --alias "$alias" \
+ result-metadata/tarball/nixos-system-*.tar.xz \
+ result/tarball/nixos-system-*.tar.xz