Ideas about using NixOS in the architecture #4

Closed
kerstin wants to merge 0 commits from kerstin/architecture:kerstin-patch-1 into master
First-time contributor

That's all my brain can produce for now in the heat, I might be able to add better structure tomorrow.

But I'm already interested in talking with you about it.

One sentence per line for easier discussion, feel free to reformat when merging.

That's all my brain can produce for now in the heat, I might be able to add better structure tomorrow. But I'm already interested in talking with you about it. One sentence per line for easier discussion, feel free to reformat when merging.
@ -56,0 +54,4 @@
The entire system state is derived from a collection of NixOS modules, so changing system properties like e.g. IP addresses is like changing the arguments in a function call.
Nix evaluation can be done in the Control Tower, so that evaluation failures can be handled by the party responsible for the change.
Nix store path realisation can be done on dedicated build servers so containers never have to compile their own applications.
Build failures can be handled by the hosting provider.
Contributor

potential underlying assumption: hosting providers know Nix (our pilot hosting provider ProcoliX, for one, i would say barely does)

potential underlying assumption: hosting providers know Nix (our pilot hosting provider ProcoliX, for one, i would say barely does)
Owner

Not necessarily; we are discussing NixOS to run inside the containers, which will be built by recipe, as a Nix package. We discussed that during the arch meeting in Utrecht; that NixOS would be a bridge too far (on their metal) but Nix packages would work for them. What runs inside a container should matter less (but we didn't make that distinction back then).

Not necessarily; we are discussing NixOS to run _inside_ the containers, which will be built by recipe, as a Nix package. We discussed that during the arch meeting in Utrecht; that NixOS would be a bridge too far (on their metal) but Nix packages would work for them. What runs inside a container should matter less (but we didn't make that distinction back then).
Contributor

NixOS would be a bridge too far [...] but Nix packages would work for [idiomatic OCI]

no, my takeaway was: if our mission requires reproducibility, then NixOS would work, but idiomatic OCI would be a bridge too far, for now.

> NixOS would be a bridge too far [...] but Nix packages would work for [idiomatic OCI] no, my takeaway was: if our mission requires reproducibility, then NixOS would work, but idiomatic OCI would be a bridge too far, for now.
vanrein marked this conversation as resolved
@ -56,0 +59,4 @@
Binary distribution to the container can be done through a substituter run by the hosting provider.
The container only runs a system that is as immutable and ephemeral as possible: It doesn't have access to its own NixOS configuration files and it [regularly deletes all remaining state](https://github.com/nix-community/impermanence) except for the necessary directories.
NixOS system activation is used to migrate from the old system state to the new one, while being both atomic and also restarting/reloading as few systemd units as necessary.
Migrating a service container to another hosting provider will require nothing but transferring its Nixpkgs revision, the containers configuration modules and the few directories in the containers file system that actually hold state.
Contributor

fwiw the current imagining as per procolix included stuff like external garage-hosted central S3 storage (not to argue here's that's better), rather than self-contained application nodes. (#1204 has seemed able to deal with that, so in that sense the idea looks viable.)

in fact, both @koen (fediversity/fediversity#322) and @vanrein (#1) argued in favor of not even having separate application nodes at all, instead having one central multi-tenant node per application to share between operators - tho i've argued that would not combine with application version heterogeneity, be it from those migrating in from other hosting providers on newer versions that could not be downgraded to a (multi-tenant) older version, nor in scenarios where operators would be granted some level of control w.r.t. the timing of updates to their applications.

fwiw the current imagining as per procolix included stuff like external `garage`-hosted central S3 storage (not to argue here's that's better), rather than self-contained application nodes. (#1204 has seemed able to deal with that, so in that sense the idea looks viable.) in fact, both @koen (fediversity/fediversity#322) and @vanrein (#1) argued in favor of not even having separate application nodes at all, instead having one central multi-tenant node per application to share between operators - tho i've argued that would not combine with application version heterogeneity, be it from those migrating in from other hosting providers on newer versions that could not be downgraded to a (multi-tenant) older version, nor in scenarios where operators would be granted some level of control w.r.t. the timing of updates to their applications.
Owner

It's probably a good idea to address the common situation efficiently, and allow some exceptional handling for those special circumstances.

There may be fediverse applications that are so strongly developed for individual roll-out that they don't quite fit, but it should be possible in almost all situations, because it's rare to find such applications not built atop HTTP. So I'm willing to risk having to deal with exceptional situations, and consider that these may need a "virtualisation indirection" built into them, and allowing individual configuration. As we discussed before, Mastodon appears to have done this already.

In situations where applications need to be run individually, it's always possible to make an N==1 setup. This would be costly, and so it should not be the general case if we intend to get people on board that want to run this software massively. It's not a coincidence that networky people want shared hosting :-) because that's the way to get it to a point of being used. I'm pretty sure this argument can be passed down to application developers as well, especially when they are being paid to adopt a more flexible (and arguably more mature) scheme of configuration.

It's probably a good idea to address the common situation efficiently, and allow some exceptional handling for those special circumstances. There may be fediverse applications that are so strongly developed for individual roll-out that they don't quite fit, but it should be possible in almost all situations, because it's rare to find such applications not built atop HTTP. So I'm willing to risk having to deal with exceptional situations, and consider that these may need a "virtualisation indirection" built into them, and allowing individual configuration. As we discussed before, Mastodon appears to have done this already. In situations where applications need to be run individually, it's always possible to make an N==1 setup. This would be costly, and so it should not be the general case if we intend to get people on board that want to run this software massively. It's not a coincidence that networky people want shared hosting :-) because that's the way to get it to a point of being used. I'm pretty sure this argument can be passed down to application developers as well, especially when they are being paid to adopt a more flexible (and arguably more mature) scheme of configuration.
Contributor

yeah, in principle i agree.

short-term, i've had trouble on this for valkey, at least (haven't tried much for our operator-facing stuff so far).

yeah, in principle i agree. short-term, i've had trouble on this for valkey, at least (haven't tried much for our operator-facing stuff so far).
vanrein marked this conversation as resolved
Owner

I had trouble merging due to a fork (I edited after the work). I merged manually, pushing the added text into a new section at the end.

I had trouble merging due to a fork (I edited after the work). I merged manually, pushing the added text into a new section at the end.
vanrein closed this pull request 2026-08-06 14:20:22 +02:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
vanrein/architecture!4
No description provided.