Got it to work. A few things were needed.
- the package in the flake should be
aarch64-darwin
but the actual nixOSsystem should be “x86_64-linux”. - GitHub - cpick/nix-rosetta-builder setup
- call nix build without
--system "x86_64-linux"
and with--option substitute false
some drvs were failing:warning: error: unable to download 'https://cache.nixos.org/ssvqaik8k1b7hhbjc4ja0p1vxsrxjx5l.narinfo': Could not resolve hostname (6); retrying in 281 ms
(this could also be because of my special dns setup though) nix.settings.builders-use-substitutes = lib.mkForce false;
nix build --verbose --option substitute false
{
description = "Minimal NixOS installation media";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-24.05";
outputs = {
self,
nixpkgs,
}: {
#1:
packages.aarch64-darwin = rec {
default = headnode.config.system.build.isoImage;
headnode = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
({
modulesPath,
lib,
...
}:{
imports = [
(modulesPath + "/installer/cd-dvd/installation-cd-minimal.nix")
];
isoImage = {
makeEfiBootable = true;
makeUsbBootable = true;
squashfsCompression = "zstd -Xcompression-level 6"; #way faster build time
};
})
];
};
};
};
}