# Why does the NixOS infrastructure have to be hosted in a centralized way?

**URL:** https://discourse.nixos.org/t/why-does-the-nixos-infrastructure-have-to-be-hosted-in-a-centralized-way/46789
**Category:** Infrastructure
**Created:** [June 10, 2024, 4:51am UTC](https://discourse.nixos.org/t/why-does-the-nixos-infrastructure-have-to-be-hosted-in-a-centralized-way/46789 "2024-06-10T04:51:40Z")
**Posts on this page:** 1
**Showing post:** 41

<div class="post-metadata">

### Author: ![amjoseph](https://discourse.nixos.org/user_avatar/discourse.nixos.org/amjoseph/32/28378_2.png) [@amjoseph](https://discourse.nixos.org/u/amjoseph)
#### Post date: [August 6, 2024, 9:52pm UTC](https://discourse.nixos.org/t/why-does-the-nixos-infrastructure-have-to-be-hosted-in-a-centralized-way/46789/41 "2024-08-06T21:52:59Z")

</div>

> [@emily](#):
>
> I think there are probably ways that downstream derivations could condition on the availability of an API that would be tricky to deal with.

You might have heard of a tool that does this on purpose, called “`autoconf`” 😜

> [@emily](#):
>
> Re: `prelink`, @fzakaria’s recent blog posts on optimizing dynamic loading with Nix and “management time” feel very relevant here.

Yes I had, but I couldn’t remember where I had read it. Thanks for the reminder; for everybody else: @fzakaria’s article [Speeding up ELF relocations for store-based systems](https://fzakaria.com/2024/05/03/speeding-up-elf-relocations-for-store-based-systems.html) shows what’s possible, and the results are much better than `prelink(8)`.

> [@emily](#):
>
> Unfortunately there is also the matter of tests … but maybe something clever could be cooked up.

Yeah, in long run the the `(install)checkPhase` needs to be moved into a separate derivation (like [#209870](https://github.com/NixOS/nixpkgs/pull/209870) did for `gcc`) and `nix-build`’s scheduler needs to learn _validations_ like [Ninja has](https://ninja-build.org/manual.html#validations). Then the checks could run after relinking. It would also let us run the `checkPhase` for cross-compiled builds, using either qemu or a smaller cluster of native builders. [Some more details](https://github.com/NixOS/nix/issues/7662#issuecomment-1902600295).

---

_[View the full topic](https://discourse.nixos.org/t/why-does-the-nixos-infrastructure-have-to-be-hosted-in-a-centralized-way/46789)._
