-
-
Notifications
You must be signed in to change notification settings - Fork 17k
Description
Describe the bug
x86_64 packages are built and attempted to be installed when targeting an aarch64-linux
machine.
Example:
nixos-rebuild build --target-host r2 --flake .#r2
Error:
error: a 'x86_64-linux' with features {} is required to build '/nix/store/b1kxbl7araqsqhfbd5m77vf41kiab6gh-append-initrd-secrets.drv', but I am a 'aarch64-linux' with features {benchmark, big-parallel, gccarch-armv8-a, kvm, nixos-test}
I'm new to NixOS, but im guessing that because we're grabbing architecture from the local system this is why this behaviour is happening?
ex. nixSystem() is defined via local invocation of uname -a
and then used a few lines later when defining nixStorePath
Steps To Reproduce
Steps to reproduce the behavior:
- Have nixosConfiguration that can be built on aarch64 e.g. I've copied this flake to the device and can run
nixos-rebuild switch --flake '.#'
without any issue regarding architecture. nixos-rebuild build --target-host <my_aarch64_target_host> --flake .#targetHostNameThatIsAarch64
- Observe error about the packages requiring x86 but being aarch64 (above).
Expected behavior
nixos-rebuild builds/switches using the correct architecture of the target-host.
Additional context
From what I can work out we can't pass args like --argstr system aarch64-linux
to nixos-rebuild as we're likely assuming same architecture.
Notify maintainers
Metadata
Machine invoking nixos-rebuild --target-host
- system: `"x86_64-linux"`
- host os: `Linux 5.10.48, NixOS, 21.05.20210710.9376bf7 (Okapi)`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.4pre20210601_5985b8b`
- channels(pyle): `""`
- channels(root): `"nixos-21.05.2362.b09c989b82f"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos
--target-host in question
- system: `"aarch64-linux"`
- host os: `Linux 5.10.48, NixOS, 21.05.20210710.9376bf7 (Okapi)`
- multi-user?: `yes`
- sandbox: `yes`
- version: `nix-env (Nix) 2.4pre20210601_5985b8b`
- channels(root): `"nixos-21.05.2501.94c989365d5"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
Maintainer information:
# a list of nixpkgs attributes affected by the problem
attribute:
# a list of nixos modules affected by the problem
module: nixos-rebuild