Hey all,
I’m pretty sure I am missing something here but I can’t find what. I am trying to build an aarch64-linux image (Raspberry Pi 3B+) on my x86_64-linux machine. In the image’s nix config I set
nixpkgs.crossSystem = lib.systems.examples.aarch64-multiplatform // { system = "aarch64-linux"; };
and in my flake.nix I have
nixosConfigurations.raspi = nixpkgs.nixosSystem {
system = "aarch64-linux";
modules = [
...
./hardware/raspberrypi.nix # <- this sets crossSystem like above
...
({ ... }: {
nixpkgs.localSystem.config = "x86_64-unknown-linux-gnu";
nixpkgs.localSystem.system = "x86_64-linux";
})
];
When I build this on my local machine, I have to compile a lot of packages myself. However, when I build this on an AWS graviton instance that is aarch64 native (without specifying localSystem
and crossSystem
), everything is fetched from the nix cache.
What am I missing for my local machine to fetch the packages from the nix cache? It’s the same flake, so the same nixpkgs revision, which means that everything should be in the cache.