summaryrefslogtreecommitdiff
path: root/lxc/lxc-import.sh
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2022-04-09 16:23:35 +0200
committerKarel Kočí <cynerd@email.cz>2022-04-09 16:23:35 +0200
commit4c0a4740a76ce61b419d51336073764284118aaf (patch)
tree24f3f50a36cc66f37e849f47bdab3f0ab1852c97 /lxc/lxc-import.sh
parent6a039e268369f7e9055e19d733849da26ab0208b (diff)
downloadnix-openrc-4c0a4740a76ce61b419d51336073764284118aaf.tar.gz
nix-openrc-4c0a4740a76ce61b419d51336073764284118aaf.tar.bz2
nix-openrc-4c0a4740a76ce61b419d51336073764284118aaf.zip
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