Open Kreyren opened 3 years ago
I think this needs an RFC.
The thing is, we have the module system for a reason, namely extensibility. I don't really understand why we should make our configurations even more complicated and thus shift the workload towards the maintainers (for use-cases - or at least solutions - I don't consider really common). This sounds pretty much like the job of a systems engineer who's responsible to design such an environment and not like the job of a Linux distribution.
I marked this as stale due to inactivity. → More info
TL;DR: Set nixpkgs's profiles default values to provide services on e.g.
nextcloud.hostname.systems.domain.tld
with redirect fromnextcloud.domain.tld
through alt-svc HTTP header to enable easier integration of load-balancing and federated/decentralized networks while keeping compatibility with non-loadbalanced networks.The solution should be discussed as it's integration is complicated.
Federated networks are clusters of computers that collectively work on one task which name resolution is usually defined as
service.hostname.systems.domain.tld
that is then redirected onservice.domain.tld
through e.g. alt-svc HTTP header which makes the browser display e.g. https://fsfe.org while you are using https://hostname.fsfe.org.Think of it as load-balancing (explained on https://www.youtube.com/watch?t=86&v=gMIslJN44P0) which members provide services that pose as online clients that interact with a database that is federated (data of the database is spread across multiple systems).
Currently i have to make lot of custom profiles with expressions alike:
because NixOS's profiles are not optimized for this runtime which increases the complexity of the integration.
Proposal
Proposing to optimize NixOS for these networks using e.g.
With the default redirect handling as:
Redirect method
webserver (e.g. NGINX) defining defaults with that are compatible with non-federated while making is painless to integrate on federated:
Which redirects user from
service.domain.tld
onservice.hostname.domain.tld
andservice.hostname.systems.domain.tld
.This changes the URL in the browser which might be unwanted
Alternative Service HTTP header (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Alt-Svc)
webserver (e.g. NGINX) defining defaults with:
Real life example:
Additional informations
I've notice this issue with all nixpkgs profiles namely discourse and nextcloud.
This configuration is also required for load-balancing rl-example: https://invidious.snopyta.org