Created
December 17, 2023 19:57
-
-
Save adamcstephens/4e3e397ab8f562210caeea44789255ad to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env nu | |
def main [--vm: bool = true, --container: bool = true] { | |
if ($vm) { | |
print ":: [virtual-machine] building image" | |
let paths = nix-build -A lxdVirtualMachineImageMeta.x86_64-linux -A lxdVirtualMachineImage.x86_64-linux ./nixos/release.nix | lines | |
print ":: [virtual-machine] importing image" | |
incus image import --alias nixos/unstable/virtual-machine ($paths.0 + /tarball/nixos-system-x86_64-linux.tar.xz) ($paths.1 + /nixos.qcow2) | |
} | |
if ($container) { | |
print ":: [container] building image" | |
let paths = nix-build -A lxdContainerMeta.x86_64-linux -A lxdContainerImageSquashfs.x86_64-linux ./nixos/release.nix | lines | |
print ":: [container] importing image" | |
incus image import --alias nixos/unstable/container ($paths.0 + /tarball/nixos-system-x86_64-linux.tar.xz) $paths.1 | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment