nix #11
|
@ -2,19 +2,22 @@
|
|||
|
||||
# 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 we have binfmt QEMU (https://nixos.wiki/wiki/NixOS_on_ARM#Compiling_through_binfmt_QEMU),
|
||||
# we can pretend we're aarch64.
|
||||
if [ -f /proc/sys/fs/binfmt_misc/qemu-aarch64 ]
|
||||
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"
|
||||
# Otherwise, use cross-compilation...
|
||||
# theorically faster but doesn't use the cache and never got it to build a full customized image
|
||||
else
|
||||
extra="--argstr nixpkgs.crossSystem.system aarch64-linux"
|
||||
fi
|
||||
fi
|
||||
nix-build '<nixpkgs/nixos>' -A config.system.build.sdImage -I nixos-config=./pindakaas.nix $extra --show-trace
|
||||
nom-build '<nixpkgs/nixos>' -A config.system.build.sdImage \
|
||||
-I nixos-config=./pindakaas.nix $extra --show-trace
|
||||
|
|
|
@ -5,6 +5,11 @@
|
|||
# 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
|
||||
|
@ -13,6 +18,5 @@ elif [ "$(uname -m)" == "aarch64" ]
|
|||
then
|
||||
config=./pindakaas.nix
|
||||
fi
|
||||
nix-build '<nixpkgs/nixos>' -A vm \
|
||||
-I nixpkgs=channel:nixos-23.05 \
|
||||
nom-build '<nixpkgs/nixos>' -A vm \
|
||||
-I nixos-config=${config}
|
||||
|
|
Loading…
Reference in a new issue