summary refs log tree commit diff
path: root/nixos/maintainers/scripts/oci/create-image.sh
blob: 30583a20a1c6d8e9cd9fa94e1092d9b137ad07f5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#! /usr/bin/env bash

export NIX_PATH=nixpkgs=$(dirname $(readlink -f $0))/../../../..
export NIXOS_CONFIG=$(dirname $(readlink -f $0))/../../../modules/virtualisation/oci-image.nix

if (( $# < 1 )); then
	(
	echo "Usage: create-image.sh <architecture>"
	echo
	echo "Where <architecture> is one of:"
	echo "  x86_64-linux"
	echo "  aarch64-linux"
	) >&2
fi

system="$1"; shift

nix-build '<nixpkgs/nixos>' \
   -A config.system.build.OCIImage \
   --argstr system "$system" \
   --option system-features kvm \
   -o oci-image