dotfiles/config/nix/build-vm.sh
2023-11-22 01:51:48 +01:00

23 lines
448 B
Bash
Executable file

#/usr/bin/env sh
# Build a NixOS VM for testing
#
# For x86_64 hosts: use curacao config
# For aarch64 hosts: use pindakaas config
if ! command -v nom-build
then
exec nix-shell -p nix-output-monitor --run $0
fi
export NIXPKGS_ALLOW_UNFREE=1
if [ "$(uname -m)" == "x86_64" ]
then
config=./curacao.nix
elif [ "$(uname -m)" == "aarch64" ]
then
config=./pindakaas.nix
fi
nom-build '<nixpkgs/nixos>' -A vm \
-I nixos-config=${config}