# How to enable cross compilation on Hydra?

**URL:** https://discourse.nixos.org/t/how-to-enable-cross-compilation-on-hydra/41862
**Category:** Hydra
**Created:** [March 20, 2024, 6:34am UTC](https://discourse.nixos.org/t/how-to-enable-cross-compilation-on-hydra/41862 "2024-03-20T06:34:55Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![catsedgrep](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/c/35a633/32.png) [@catsedgrep](https://discourse.nixos.org/u/catsedgrep)
#### Post date: [March 20, 2024, 6:34am UTC](https://discourse.nixos.org/t/how-to-enable-cross-compilation-on-hydra/41862/1 "2024-03-20T06:34:55Z")

</div>

Hi all.

I run a hydra server that builds x86 targets perfectly. The jobset is configured with a github repo that uses flake.nix, and besides x86 in it is also enabled with aarch64. But the builds fail for aarch64 jobs, which makes me believe there is a server side configuration to be added on hydra’s configuration.nix that will enable cross compilation. The status of the failed jobs are “unsupported system type”.

I’m running hydra 2022-10-22 using nix-2.11.0.

---

<div class="post-metadata">

### Author: ![vcunat](https://discourse.nixos.org/user_avatar/discourse.nixos.org/vcunat/32/11_2.png) [@vcunat](https://discourse.nixos.org/u/vcunat)
#### Post date: [March 20, 2024, 1:35pm UTC](https://discourse.nixos.org/t/how-to-enable-cross-compilation-on-hydra/41862/2 "2024-03-20T13:35:26Z")

</div>

In NixPkgs there’s a difference between native and cross builds. I.e. during evaluation you already choose. If you choose cross, you’ll get a different derivation and different results – and you won’t need a machine with the “host” platform (only “build”).

---

<div class="post-metadata">

### Author: ![catsedgrep](https://discourse.nixos.org/letter_avatar_proxy/v4/letter/c/35a633/32.png) [@catsedgrep](https://discourse.nixos.org/u/catsedgrep)
#### Post date: [March 25, 2024, 10:44am UTC](https://discourse.nixos.org/t/how-to-enable-cross-compilation-on-hydra/41862/3 "2024-03-25T10:44:30Z")

</div>

Hi vcunat, thanks. You mentioned

> If you choose cross, you’ll get a different derivation and different results

While configuring the evaluation in Hydra, I cannot see any specific option to choose cross compilation. Could you specify where this option can be chosen while configuring the job.

---

<div class="post-metadata">

### Author: ![vcunat](https://discourse.nixos.org/user_avatar/discourse.nixos.org/vcunat/32/11_2.png) [@vcunat](https://discourse.nixos.org/u/vcunat)
#### Post date: [March 25, 2024, 10:57am UTC](https://discourse.nixos.org/t/how-to-enable-cross-compilation-on-hydra/41862/4 "2024-03-25T10:57:28Z")

</div>

That’s because it’s nothing specific. You don’t even have specific choice for which native platforms to use.

In NixPkgs the [`crossSystem` thing is exposed](https://nixos.org/manual/nixpkgs/stable/#sec-cross-usage), and in Hydra’s jobset you can click to add overrides for any parameters.
