24 lines
601 B
Bash
Executable file
24 lines
601 B
Bash
Executable file
#/usr/bin/env sh
|
|
|
|
# Build a disk image for testing on pindakaas via sd card
|
|
|
|
if ! command -v nom-build
|
|
then
|
|
exec nix-shell -p nix-output-monitor --run $0
|
|
fi
|
|
|
|
export NIXPKGS_ALLOW_UNFREE=1
|
|
extra=""
|
|
if [ "$(uname -m)" != "aarch64" ]
|
|
then
|
|
if [ ! -f /proc/sys/fs/binfmt_misc/qemu-aarch64 ]
|
|
then
|
|
echo "Use binfmt QEMU!"
|
|
echo "https://nixos.wiki/wiki/NixOS_on_ARM#Compiling_through_binfmt_QEMU"
|
|
exit 1
|
|
fi
|
|
extra="--argstr system aarch64-linux"
|
|
fi
|
|
nom-build '<nixpkgs/nixos>' -A config.system.build.sdImage \
|
|
-I nixos-config=./pindakaas.nix $extra --show-trace
|