diff options
author | Karel Kočí <cynerd@email.cz> | 2022-04-09 16:23:35 +0200 |
---|---|---|
committer | Karel Kočí <cynerd@email.cz> | 2022-04-09 16:23:35 +0200 |
commit | 4c0a4740a76ce61b419d51336073764284118aaf (patch) | |
tree | 24f3f50a36cc66f37e849f47bdab3f0ab1852c97 /lxc/lxc-import.sh | |
parent | 6a039e268369f7e9055e19d733849da26ab0208b (diff) | |
download | nix-openrc-master.tar.gz nix-openrc-master.tar.bz2 nix-openrc-master.zip |
Diffstat (limited to 'lxc/lxc-import.sh')
-rwxr-xr-x | lxc/lxc-import.sh | 15 |
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 |