I am trying to deploy my nixos configuration to a remote x86 machine from my aarch64 laptop.
{
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
outputs =
{
nixpkgs,
...
}:
{
nixosConfigurations.rebuild= nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./configuration.nix
./hardware-configuration.nix
];
};
};
}
However when I deploy using:
nixos-rebuild switch \
--flake ".#rebuild" \
--build-host james@192.168.1.253 \
--target-host james@192.168.1.253 \
--use-remote-sudo
I get the following error:
error: a 'x86_64-linux' with features {} is required to build '/nix/store/1gdwjhp6b5wv3d6s9333jp8i59w4prkb-nixos-rebuild.drv', but I am a 'aarch64-linux' with features {benchmark, big-parallel, gccarch-armv8-a, kvm, nixos-test}
This is obviously saying that my arm64 cpu doesn’t know how to build x86 packages however this doesn’t make sense as I have told it to offload the build (via --build-host
above).
I must be missing something. Does anybody know what is going on here?