at 23.11-beta 570 B view raw
1#! /usr/bin/env bash 2 3set -euo pipefail 4 5export NIX_PATH=nixpkgs=$(dirname $(readlink -f $0))/../../../.. 6export NIXOS_CONFIG=$(dirname $(readlink -f $0))/../../../modules/virtualisation/oci-image.nix 7 8if (( $# < 1 )); then 9 ( 10 echo "Usage: create-image.sh <architecture>" 11 echo 12 echo "Where <architecture> is one of:" 13 echo " x86_64-linux" 14 echo " aarch64-linux" 15 ) >&2 16fi 17 18system="$1"; shift 19 20nix-build '<nixpkgs/nixos>' \ 21 -A config.system.build.OCIImage \ 22 --argstr system "$system" \ 23 --option system-features kvm \ 24 -o oci-image