Move the check suite and the registry validators out of flake.nix #37
Labels
No labels
blocked
bug
decision
duplicate
enhancement
handoff
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/secrets#37
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?
Bring
secrets/flake.nixup to the same standard allod/archetypes#93 set for the framework flake: the checks move tochecks/, the registry validators move tolib/, and the flake is the composition of data and exports again.Primary goals:
flake.nixis composition again — it is 1465 lines today and thechecksoutput starts at line 398, so roughly three quarters of the file is test apparatus sitting beside the data it validates.lib/— the credential-registry and local-auth-refresh validators are library code that happens to be bound in the flake's top-level scope;lib/already exists with four files in exactly that role.pkgsas arguments and declares them, withchecks/default.nixas the index that hands them over.libattribute set are unchanged, which is the same gate allod/archetypes#93 used.Current state and specifics
Seven checks are declared inline in the
checksoutput:external-ssh-trust-targets(flake.nix:402),dev-ssh-hosts(:437),credential-registry(:543),credential-store-url(:760),local-auth-refresh(:804),pi-credential-registry(:948) andcredential-inventory(:1272), running to the end of the file. The top-level scope above them (flake.nix:14-367) mixes reading the data files with the validators over them:credentialRegistryDiagnostics(:40),validateCredentialRegistry(:142), the credential-store-URL predicates (:163-192), and the local-auth-refresh contract and diagnostics (:194-305).lib/dev-ssh-hosts.nix,lib/pi-credential-contract.nix,lib/pi-credential-schema.nixandlib/pi-credential-recipients.nixshow the shape the validators should take.allod/archetypes#93 records the method that made the framework move safe and cheap, and it applies here unchanged: extract each check body verbatim into its own file, discover its free variables from parse-time undefined-variable errors, shift root-relative path literals for the new location, and compare every derivation path before and after with one
nixprocess per check. One extra witness this repo needs: the exportedlibset is consumed by allod/archetypes (credentials,forgeSshKeys,rotationRegistry,credentialStoreUrl,isCredentialStoreUrlSource,devIdentities,privacyIdentities,nexusIdentity,identity,vmUsernames,machineHostKeys,vmHostKeySecretFiles,githubCredentialTargets,validatePiProviderReferences,consumedInventorySource), so its attribute names and values must be identical too, and the archetypes gate should be run once against the branch with--override-input secrets.Scope
In scope: the seven checks, the validators named above,
checks/default.nix, and whatever shared helpers the move makes worth extracting.Explicitly not in scope: changing what any check asserts or what any validator accepts. The gate is that every check's derivation path and the
libexport are unchanged by it.Refs allod/archetypes#93