mkServiceVm: root-only guest with /var/lib on the data disk, LAN-only by default, and the Forgejo package pin #137
Labels
No labels
blocked
bug
decision
duplicate
enhancement
help wanted
invalid
landed?
question
ready-to-merge
stale
wontfix
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
allod/archetypes#137
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?
mkServiceVmis the fourth builder: a hypervisor guest with no operator account, administered as root over the hypervisor's keys, its whole/var/libon the data disk the hypervisor attaches so a reprovision keeps the service's state, and a firewall that admits LAN peers on the ports the profile opens and no outbound traffic unless the profile widens it. Part of allod/strategy#65 (the forge VM is the first such machine) and the hypervisor-placed first step of allod/strategy#45's service archetype. allod/archetypes#60 was a rented-host attempt under the same name and is not reused: a service VM is a guest, so it composessharedModuleslike dev and privacy VMs.Primary goals:
users.users.root.openssh.authorizedKeys.keysis the builder'shostPublicKeys(pinned bymachineConfigurationsto the hypervisor's keys, as for every guest); sshd key-only withPermitRootLogin = "prohibit-password". A definition declaringhomeModulesis an evaluation error naming why, the one place this archetype could fall back silently./var/lib— the builder declaresfileSystems."/var/lib"on/dev/disk/by-id/virtio-allod-data(the serialallod/nexusattaches asvdb), ext4, formatted by the guest on first boot (autoFormat),neededForBootso activation's uid map in/var/lib/nixoslands on it and file ownership survives a reinstall by construction. A service machine whose inventory entry lacksdata_diskis refused by the builder as well as by inventory.modules/forgejosetsservices.forgejo.package = lib.mkDefault pkgs.forgejo, never nixpkgs' LTS default, so a template forge runs the same Forgejo a deployment's VPS pins and a dump always restores onto an equal or newer version;checks/forgejo.nixasserts the booted version is that package's.profileArchetypesandbuildersgainservice;mkIdentitiestakesserviceIdentities(read assecrets.lib.serviceIdentities or {});vmFactsincludes service machines withusernamefrom that identity, which isroot.builders.servicewith a fixture and forcing its toplevel, with sabotage for thehomeModulesrefusal and the missing-data-disk refusal; and a VM test: a service node with a second drive carrying serialallod-data(virtualisation.qemu.driveswithdeviceExtraOpts.serial) and a peer node, where first boot formats and mounts the drive at/var/lib(findmntnames the device),/var/lib/nixosis on it, a file written there survives a reboot, root logs in on the administrative port with the fixture hypervisor key and a second valid key is refused with a publickey denial, no login account other than root exists, the peer reaches a port the fixture profile opens and is refused on one it does not, and the node's outbound connection to an address outside its network is refused while one to the peer succeeds.Current state and specifics
flake.nixmapsbuilders = { dev; privacy; hypervisor; },profileArchetypes = [ "dev" "privacy" "hypervisor" ], andmkIdentities { devIdentities, privacyIdentities, hypervisorIdentities };nix/builders/privacy.nixis the closest sibling (sharedModules,runtimeandplatformdefaulting to inventory, home-manager for the identity's user) and the new builder is that file minus home-manager and the user, plus the three things above.nix/vm-facts.nixincludeMachineistype != "hypervisor", so service machines are already included once inventory accepts them;requireAttr vm "username"readsvmUsernames, which secrets will supply asroot.checks/public-host.nixandchecks/static-site.nixare the shape for the eval check and the VM test;checks/forgejo.nixfor a two-node test with a custody grep. A framework check reads fixtures it builds, never a template machine by name (README, Fork-safe checks).Scope
In: the builder, the flake wiring, the Forgejo package pin and its assertion, the two checks, README (Builders and Exports). Out: the
forgemachine, profile and secrets entry (allod/strategy#65's next slice); anything inallod/nexus, which needs no change because its scripts log in as the identity's username and provisioning installs as root already; at-rest encryption of guest disks (allod/archetypes#135).Landed on master as
a40fab0.