Add the service archetype and a builder for a rented host #59
Labels
No labels
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/archetypes#59
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Add
serviceas a fourth archetype and the builder that composes it, so a rented internet-facing host can be built the same way every other machine is.Primary goals:
dev,hypervisorandprivacy.mkHypervisor— noruntime, no guest module, because nothing in this fleet runs the machine.modules/public-host.nixandmodules/static-site.nixare already here and already tested.What exists already
modules/public-host.nixprovides the base: Caddy with ACME, administrative SSH on a caller-chosen non-standard port with keys only, fail2ban, and a firewall opening 80, 443, the administrative port, and whatever a service contributes. A service contributes a virtual host and its ports and nothing machine-wide.modules/static-site.nix,nix/build-zola-site.nixand the four static-site checks are also here. So the first consumer of this archetype is already written and verified; only the builder and the archetype registration are missing.flake.nixcarries a comment wheremkServiceVmused to be, explaining why a builder was not written earlier: the shape was unknown from a single machine, and a rented host has no inventory representation. The first is now answered — see below. The second is tracked inallod/inventory.The builder's shape
mkDevVmandmkPrivacyVmtakeruntime ? machines.${name}.runtimeand map it to a libvirt or microvm guest module, failing when there is none.mkHypervisortakes noruntimeat all, because nexus is bare metal and no guest module applies.A rented host is the same shape as
mkHypervisorin the only respect that matters here: nothing in this fleet runs it, so there is no guest module to select. That is the template. It differs from a hypervisor in owning no guests, so themicrovmGuestsmachinery does not apply either.Expect this to be small — the interesting decisions are all in the modules it composes and in the registry it reads.
Depends on
allod/inventorymust first accept a machine with noruntimeunder theservicetype, and constrain such machines tox86_64-linux. Reasoning and the rejected alternatives are recorded there. This builder cannot read a machine the registry refuses to describe, so that lands first.Scope
In scope: registering
servicein the archetype names the framework validates, the builder, and a check exercising it.Not in scope: any actual machine. The first service machine is a profile entry in a profiles repository, added once its host is rented.
Refs #55, #56, #57.
Closing: the service archetype was built, reviewed four times, and abandoned.
allod/archetypes#60carries the full reasoning; the short version is that this repo predicted the outcome before the work started.The note above
builderssaid a service builder would "either invent [an inventory concept] now or take every value as an argument, which is a builder in name only." Four review rounds produced exactly that:platformbecame an argument so the builder stopped readingmachines, the builder moved to its own file soinventoryleft its lexical scope, andadminAuthorizedKeysbecame required so it stopped reaching intosecrets. Every coupling to the framework turned out to be a defect, including one real security hole — the old key default handed root on a rented internet-facing box to the nexus host identity, a recipient of every ciphertext in the fleet.A builder here is the join of inventory × secrets × profiles. A dev guest has all three legs; the hypervisor has all three; a rented static-site host has none. A service inventory entry was a single permitted platform value plus the literal string
service, with every other field null or meaningless.What a rented host needs already exists and is exported:
nixosModules.publicHost,staticSite,rentedKvmGuest, andlib.buildZolaSite. It is anixosConfigurationsentry composed from those, inside the management path and outside the data-model path.The
unknown machine typeassertion inmachineConfigurationsis untouched and will loudly reject aservicemachine, which is now the correct behaviour.Closed as not planned.
Closing: the service archetype was built, reviewed four times, and abandoned.
allod/archetypes#60carries the full reasoning; the short version is that this repo predicted the outcome before the work started.The note above
builderssaid a service builder would "either invent [an inventory concept] now or take every value as an argument, which is a builder in name only." Four review rounds produced exactly that:platformbecame an argument so the builder stopped readingmachines, the builder moved to its own file soinventoryleft its lexical scope, andadminAuthorizedKeysbecame required so it stopped reaching intosecrets. Every coupling to the framework turned out to be a defect, including one real security hole — the old key default handed root on a rented internet-facing box to the nexus host identity, a recipient of every ciphertext in the fleet.A builder here is the join of inventory × secrets × profiles. A dev guest has all three legs; the hypervisor has all three; a rented static-site host has none. A service inventory entry was a single permitted platform value plus the literal string
service, with every other field null or meaningless.What a rented host needs already exists and is exported:
nixosModules.publicHost,staticSite,rentedKvmGuest, andlib.buildZolaSite. It is anixosConfigurationsentry composed from those, inside the management path and outside the data-model path.The
unknown machine typeassertion inmachineConfigurationsis untouched and will loudly reject aservicemachine, which is now the correct behaviour.Closed as not planned.