gunk-dev/the-valley

cli.nix

source01f84ae34d8amain's published tip history
27.2 KiB
1# bin/valley: that it stays a lint-clean script, what its review verb
2# anchors a note to, what its deriver makes of a policy and a diff, that
3# the-valley's own policy composes and names only checks that exist, what
4# its review verb publishes when it files an integration request, what it
5# walks with no change, what its
6# Go verbs' unit tests and the rebase engine's hold, what its ready and withdraw verbs write to a
7# change's record through the real push hook, what its knot verbs write to
8# the plan graph, what its plan verb shows of that graph, what its
9# self-update verb installs and what the home-manager module runs it with,
10# and that its package evaluates for aarch64-darwin.
11{
12 pkgs,
13 lib,
14 self,
15 system,
16 packages,
17 hosts,
18 nixStandIns,
19 ...
20}:
21let
22 # A stand-in for git, sort or cue that fails one chosen call; see
23 # fail-nth.sh.
24 failNth = pkgs.writeShellScript "fail-nth" (builtins.readFile ./fail-nth.sh);
25
26 # The user units the home-manager module renders for a home with
27 # self-update on. The module is evaluated over stand-ins for the
28 # home-manager options it sets, because this flake has no home-manager.
29 selfUpdateUnits =
30 (lib.evalModules {
31 modules = [
32 self.homeManagerModules.valley
33 {
34 options = {
35 systemd.user.services = lib.mkOption { type = lib.types.attrsOf lib.types.anything; };
36 systemd.user.timers = lib.mkOption { type = lib.types.attrsOf lib.types.anything; };
37 home.homeDirectory = lib.mkOption { type = lib.types.str; };
38 home.username = lib.mkOption { type = lib.types.str; };
39 };
40 config = {
41 _module.args.pkgs = pkgs;
42 home.homeDirectory = "/home/someone";
43 home.username = "someone";
44 programs.valley.selfUpdate = {
45 enable = true;
46 repo = "git@valley-host:the-valley";
47 };
48 };
49 }
50 ];
51 }).config.systemd.user;
52
53 # Throwaway keys for valley-request's reuse scenarios, made once at build
54 # time: a check worker's and the operator's, which sign evidence, and the
55 # integrator's. They hold no authority anywhere. The protected host's
56 # hook, rendered with these as its known signers, admits evidence the
57 # worker and the operator sign.
58 reuseKeys =
59 pkgs.runCommand "valley-request-keys"
60 {
61 nativeBuildInputs = [
62 pkgs.openssh
63 packages.attest
64 ];
65 }
66 ''
67 mkdir $out
68 for who in worker operator integrator; do
69 ssh-keygen -q -t ed25519 -N "" -C "$who" -f "$out/$who"
70 done
71 {
72 attest key --key "$out/worker" --name worker.valley.invalid/attestations
73 attest key --key "$out/operator" --name operator.valley.invalid/attestations
74 } > "$out/hook_signers"
75 '';
76 reuseHost = hosts.protectedHost.extendModules {
77 modules = [
78 { services.valley.integrator.knownSignersFile = lib.mkForce "${reuseKeys}/hook_signers"; }
79 ];
80 };
81
82 # The integrator host with the operator valley-walk approves as holding
83 # the approve grant, so its hook takes the requests the walk files.
84 walkHost = hosts.integratorHost.extendModules {
85 modules = [ { services.valley.grants.approve = [ "alice" ]; } ];
86 };
87in
88{
89 # The CLI must stay a lint-clean script whose help verb answers
90 # without a repo or a remote — the cheap end of its eviction clause
91 # (dcr-74c3158); anything needing more graduates instead. The
92 # completions are held to the same bar, and the installed package
93 # must carry them at the auto-linked paths.
94 valley-cli = pkgs.runCommand "valley-cli" {
95 nativeBuildInputs = [
96 pkgs.git
97 pkgs.shellcheck
98 pkgs.zsh
99 packages.valley
100 ];
101 cliScript = ../../bin/valley;
102 bashCompletion = ../../completions/valley.bash;
103 zshCompletion = ../../completions/_valley;
104 valley = packages.valley;
105 } (builtins.readFile ./valley-cli.sh);
106
107 # review's notes: the anchors are the whole claim, so they are
108 # pinned here rather than left to the reader of bin/valley. The
109 # session is real — a pty, real less, a pager filter that
110 # restructures the diff, and an $EDITOR that inserts lines while
111 # the pager is open — because every property under test is a
112 # property of that arrangement: that v is handed the raw buffer
113 # and not the rendering, that an inserted line becomes a note,
114 # and that the file and line it names are the ones it sat on. It goes
115 # on to review a stack layer by layer, and a stale stack: approving its
116 # top refused, its bottom approved, and review's [b]ase before the first
117 # page, after which the pages and the request are at the rebased heads,
118 # and the layer approved before the rebase is printed as rebased with the
119 # same file changes instead of paged. Last, a note written beside an
120 # edited line of a version paged as edited since its approval keeps its
121 # file and line, through a structure-preserving renderer and through
122 # less, whose views are styled while the buffer the editor opens is
123 # plain. Ctrl-C with the pager open, and SIGTERM at the prompt, end the
124 # review with status 130, its walk outcome interrupted, and nothing of
125 # its own left in its TMPDIR.
126 review-notes = pkgs.runCommand "valley-review-notes" {
127 nativeBuildInputs = [
128 pkgs.git
129 pkgs.less
130 pkgs.util-linux # script(1), for the pty less insists on
131 packages.valley-script
132 ];
133 # The reviewer, as a script: five insertions and one edit of a
134 # line that was already there. The edit is deliberately far
135 # from every insertion, since -U0 would otherwise merge them
136 # into one hunk and the note would be dropped with it.
137 reviewer = pkgs.writeShellScript "valley-review-notes-editor" (
138 builtins.readFile ./review-notes-editor.sh
139 );
140 } (builtins.readFile ./review-notes.sh);
141
142 # The verification-policy deriver (dcr-f41f718), through `valley checks`.
143 # Composing the two layers is CUE's job and is pinned by cue-vet; a path
144 # matcher is wrong exactly at the glob boundaries — `*` inside one
145 # segment against `**` across segments, `**` matching no segment at all
146 # — and at the sides of a diff a naive reader drops: a rename's old path
147 # and a deletion. Each is pinned by driving the verb over a scratch
148 # repository and the scratch policy in examples/policy/deriver/, whose
149 # floor is one glob boundary per class. A check's cost is pinned the same
150 # way: marking a check slow moves it between the summary lines and the
151 # --cost lists, and changes nothing required. So is the carry mode:
152 # overlapping classes, and paths in different classes, report the
153 # strictest of their modes, and an unclassified path is same-paths. A
154 # mode written by refining `policy` counts.
155 #
156 # And the deriver fails closed: failNth stands in for git and cue, and
157 # fails each call the derivation makes in turn.
158 # Every failure must end the derivation with nothing on stdout, because
159 # a failure read as an empty list is a change that requires nothing. The
160 # check runs valley-go, which `valley checks` hands the verb to, because
161 # the package's wrapper puts its own git ahead of anything on PATH.
162 policy-deriver = pkgs.runCommand "valley-policy-deriver" {
163 nativeBuildInputs = [
164 pkgs.git
165 pkgs.cue
166 packages.valley-script
167 packages.valley-go
168 ];
169 fixtures = ../../examples/policy/deriver;
170 schema = ../../schema/verification.cue;
171 inherit failNth;
172 } (builtins.readFile ./policy-deriver.sh);
173
174 # the-valley's own project layer (policy/project), which is what gates
175 # every change to this repository. A layer that stopped composing would
176 # stop every derivation once it landed, the derivation of its own fix
177 # included, so it is held here before it lands. The floor it is composed
178 # with is the example one: the owning valley's is not in this tree. The
179 # check also holds every check the layer names to being an attribute of
180 # this flake's checks, and holds a docs-only change to requiring
181 # prose-format alone. And it holds a check's own files to requiring
182 # that check: every file in this directory named after a check, and every
183 # other script here, read from the directory itself so a new one is
184 # held as soon as it is added. It holds each scope to its carry mode,
185 # the scopes the carry classes classify to every check they required
186 # before, and the restacker's cap to the default.
187 own-policy = pkgs.runCommand "valley-own-policy" {
188 nativeBuildInputs = [
189 pkgs.git
190 pkgs.cue
191 packages.valley-script
192 ];
193 schema = ../../schema/verification.cue;
194 project = ../../policy/project;
195 floor = ../../examples/policy/instance/floor-format.cue;
196 template = ../../examples/policy/instance/template-docs.cue;
197 checkNames = builtins.attrNames self.checks.${system};
198 checkFiles = builtins.attrNames (builtins.readDir ./.);
199 } (builtins.readFile ./own-policy.sh);
200
201 # review's [a]pprove and the approve and rebase verbs, driven end to end
202 # over scratch repositories: a branch reviewed, the request filed, and
203 # what the receiving side then holds. The claim is about sequencing, so
204 # it is only observable from there — the bare repo logs every push it
205 # receives, and the check reads that log to see that ONE of them carried
206 # the evidence and the request together. A change whose version names no
207 # branch is approved at its recorded head the same way. Every check the scratch policy
208 # declares uses the command runner, for the reason attest-e2e gives: a
209 # nix build has no daemon. The packaged CLI carries its own schema, so
210 # the scratch projects that stand for projects other than the-valley
211 # carry no schema/. cliScript is bin/valley itself, for its other
212 # shipping mode: run straight from a the-valley checkout, it reads the
213 # schema there.
214 #
215 # Last, evidence a check worker already published, over a second origin
216 # that runs the protected host's rendered hook and a project whose two
217 # checks use the nix runner, through integrator-e2e's stand-in for nix.
218 # Its owning valley publishes the signers clients verify with. Evidence
219 # for every required check is reused: approve runs no nix, needs no
220 # signing key, and pushes the request alone, and approving that head
221 # again pushes nothing. Evidence for one check is reused and the other is
222 # not: the worker's note for it names another flake attribute. approve,
223 # and review's [a]pprove, file the request at once without --build-here,
224 # build nothing, publish no evidence, and name that nix check as missing.
225 # With --build-here it runs, the operator's evidence goes in one push
226 # with the request, and the real integrator lands it on the two signers'
227 # evidence. Origin
228 # holding the operator's own ref for a tree, without the check still
229 # missing, is refused before anything runs (bd-7b7d58f). A listing or a
230 # fetch of origin's evidence that fails is refused, and nothing runs or
231 # is published. A request filed while a fully covered approval is
232 # prepared wins the lease. Then evidence approve must not reuse, each
233 # judged by approve and by the real integrator from the same refs: a
234 # worker the host has revoked and a local known-signers file still
235 # trusts, a local file that trusts less than the host, a failure and an
236 # observation that sit before a pass in ref order, a note without its
237 # last newline, a signer nobody knows, a note about another tree, an
238 # expired observation, and a note for another flake attribute. Notes the
239 # hook would refuse are planted past it. Then the host publishes a
240 # signer projects file, and each integrator pass is given it: a note
241 # whose only signer counts in another project is not reused, the
242 # integrator does not accept it, and review --build-here builds that
243 # check; the same note countersigned by the integrator is not reused
244 # either; a published list that does not read, or is no file, reuses
245 # nothing; and a note
246 # from a signer restricted to this project is reused and lands. A change
247 # whose only uncovered check is a command check runs it without
248 # --build-here, and lands. A change missing a nix check and a command
249 # check runs the command check alone, and files with its evidence.
250 #
251 # Then the check worker, as packaged, over the same origin and ready
252 # changes, with its key restricted to the project: it builds a change's nix checks and publishes the evidence
253 # before any request exists, and approve then reuses all of it with no
254 # key and the integrator lands it. Two passes at once take turns, and the
255 # second builds nothing. A failed batch waits 15 minutes, then twice as
256 # long, by VALLEY_NOW, and its record is gone once it passes. A push whose
257 # reply is lost, landed or not, is never built again: the next pass finds
258 # it on origin, or pushes the ref the first pass stored. A head
259 # superseded while it is built still has its evidence published, and the
260 # new version is built next. Origin holding the worker's own ref without a
261 # required check is reported and nothing is built. approve files the
262 # request without it, the integrator holds that request as stale, and
263 # approve --build-here builds the rest, which lands. An origin the pass cannot read stops it before it builds. On the
264 # real clock, a failed batch's wait runs from when the batch ended. A
265 # failed push waits a minute, then two, by the object it publishes, so
266 # two changes holding one tree try one push. A pass over another project
267 # keeps this project's waits. A pass killed mid-batch leaves attest
268 # holding the lock, so the next pass waits for it, then publishes what
269 # it stored. A tag in the cache clone named like the worker's own ref is
270 # not taken for evidence an earlier pass stored. A cache clone whose
271 # making was interrupted by git dying with its config.lock held is made
272 # again, and a half-made clone with a stale config.lock in the cache's
273 # place is set aside and made again.
274 #
275 # Last, approve reads each ref by its exact name. A branch on origin
276 # named like a missing request stops the push, and once it is deleted
277 # the request is filed. A tag named like the remote-tracking ref of a
278 # branch origin lacks, or of a main origin lacks, and an owning valley
279 # with no main each refuse the approval, and nothing is filed.
280 valley-request = pkgs.runCommand "valley-request" {
281 nativeBuildInputs = [
282 pkgs.git
283 pkgs.cue
284 pkgs.jq # the timing log's lines
285 pkgs.openssh
286 pkgs.util-linux # setsid, to stop an approval as ctrl-C does
287 packages.attest
288 packages.valley-script
289 packages.valley-go
290 packages.valley-worker
291 packages.integrator
292 ];
293 schemaFile = ../../schema/verification.cue;
294 cliScript = ../../bin/valley;
295 inherit failNth reuseKeys;
296 reuseInitScript = reuseHost.config.systemd.services.valley-init.script;
297 passAsFile = [ "reuseInitScript" ];
298 integratorE2e = nixStandIns;
299 attestSchema = ../../schema/attestation.cue;
300 eventSchema = ../../schema/events.cue;
301 } (builtins.readFile ./valley-request.sh);
302
303 # The rebase engine's tests (rebase/), run with go vet: a chain, a
304 # shared lower layer, a conflict, an empty layer, a lease lost to a moved
305 # branch, a record append refused after the branches moved, a branch
306 # push and a record push that origin takes and never acknowledges, a
307 # cancellation before the push, and a cancellation while a hook or a
308 # filter blocks, each over real repositories and real pushes. A restack
309 # append kept and restored still reads the branch
310 # before its push, and is refused once the owner has moved it; a kept
311 # write that is malformed does not restore. If a snapshot fetch fails
312 # because main was rewritten and pruned after listing refs, ReadSnapshot
313 # lists origin and fetches again, up to three attempts in total.
314 # valley-ready and integrator-e2e drive it through valley rebase.
315 rebase-unit = packages.rebase.unit;
316
317 # The Go verbs' tests (status/), in valley-go's unit build: the
318 # outcome records status accepts, the names its JSON refuses, its shell
319 # quoting held to the bash it replaced, a rebase ended by a SIGTERM
320 # while a hook blocks it, where review anchors a note in a renamed file
321 # and in a diff of a diff, and the valley-checks/v1 document checks prints
322 # over a real repository, a path that is not UTF-8 in base64. valley-status
323 # and valley-ready drive the verbs through the CLI over real repositories.
324 valley-go-unit = packages.valley-go.unit;
325
326 # Read origin's request/outcome refs and distinguish a pending request,
327 # a recorded decision and a landing, without moving the user's checkout.
328 # Each state is read again through --json, and jq holds the object to
329 # the valley-status/v1 contract. A change's restack report is shown as
330 # current, and as historical once a ref it observed has changed: its
331 # branch, main, its record, a branch it saw missing, or a request that
332 # held it back. Status, changes and pending all show it.
333 valley-status = pkgs.runCommand "valley-status" {
334 nativeBuildInputs = [
335 pkgs.git
336 pkgs.jq
337 packages.valley-script
338 ];
339 } (builtins.readFile ./valley-status.sh);
340
341 # ready, unready and withdraw, through real pushes to a bare repo wired
342 # with the rendered pre-receive hook, as each principal: a change created
343 # at v1, a second version, the same head refused, a withdrawal, revived
344 # at the same version and then at a new one, a principal that neither
345 # owns the change nor holds the request grant refused by the hook, and
346 # the operator, who holds it, let through. Then each source of a change's ID — the jj
347 # header, the Change-Id trailer, a generated ID, --stamp — a header and a
348 # trailer that disagree, and a change whose commits hold a merge. Last, a
349 # change named by its handle is approved, reviewed and rebased at the head
350 # its record names: a record pushed with its branch moved elsewhere in the
351 # same push is refused, the branch at the recorded head is filed at that
352 # head, and a later version whose branch is elsewhere is refused. A
353 # version that names no branch is approved at its head, and refused by
354 # review and rebase, which act on a branch. A name no record is on that
355 # is no branch name is refused. Then a
356 # draft: unready, ready again at the same head and at a new one, listed
357 # apart by pending, refused by approve and rebase, and shown by review
358 # as a draft, with neither [a]pprove nor [r]eject offered,
359 # whether it is named by its handle or its branch, and a request pending
360 # under either name warned of by unready and withdraw, a request for an
361 # earlier version's branch too. review shows a withdrawn change the same
362 # way. A change behind main is asked the ordinary prompt under a line
363 # that says so, with no [b]ase, and is approved as it is. A review left
364 # open while another principal unreadies the change, or readies a new
365 # version, says so in one line and acts on nothing. A branch no record is
366 # on is acted on as a branch, and one two records are on is refused.
367 # Last, stacks rebased whole: every layer moved and each change given a
368 # version, by ancestry and by trees; a
369 # conflict in the middle layer; each refusal before the rebase; a branch
370 # moved, and a plain branch readied, after the rebase read the stack; a
371 # change unreadied between the branch push and its record write, and the
372 # command the manifest gives to finish it; and a second stack left on an
373 # old head. review of a stack whose middle layer is a draft, then
374 # withdrawn, offers [a]pprove under it and neither at it nor above it.
375 # Then review set against a change's approved version: a clean
376 # restack after a rebase, with the landing between the bases listed and no
377 # diff paged; a later version with an edited file, paged with the
378 # range-diff and its own diff of that file; a version whose message
379 # alone changed and one whose author alone did, each flagged; a change
380 # with no approved version, paged in full; and a stack whose lower layer
381 # is set against its own approval while its top, which has none, is
382 # paged. The hook is followed from the protected host's rendered init
383 # script, so the rules the record meets are the ones a host applies.
384 valley-ready = pkgs.runCommand "valley-ready" {
385 nativeBuildInputs = [
386 pkgs.git
387 pkgs.jq
388 pkgs.util-linux # script(1), for approve's confirmation on a terminal
389 packages.valley-script
390 ];
391 initScript = hosts.protectedHost.config.systemd.services.valley-init.script;
392 passAsFile = [ "initScript" ];
393 } (builtins.readFile ./valley-ready.sh);
394
395 # valley changes and valley pending over the projects of one test host,
396 # made by the integrator host's rendered valley-init, so discovery reads
397 # the project list a host publishes and every record goes through the
398 # hook it installs. Two repositories with ready, draft and withdrawn
399 # records; handles unique across them; one listed repository that cannot
400 # be read; a change ID recorded in several, with qualified handles; --repo;
401 # a version landed by fast-forward, one landed as a new commit with a
402 # transfer statement the integrator signed, one consumed with no
403 # evidence, one whose statement another key signed, one with a landed
404 # version's tree on another parent, a landing's tree replayed on a later
405 # main, and heads below a merge that dropped them, through either
406 # parent; a project named origin that shares a change ID; a
407 # policy/valley git would read as an option or
408 # as ext::; includes as the nearest ancestor only; pending's human shape,
409 # its drafts array and --checks; and a branch name read as a branch again
410 # once its change has landed, before the branch moves and after.
411 valley-changes = pkgs.runCommand "valley-changes" {
412 nativeBuildInputs = [
413 pkgs.git
414 pkgs.jq
415 pkgs.openssh
416 packages.valley-script
417 packages.valley-go
418 packages.attest
419 ];
420 initScript = hosts.integratorHost.config.systemd.services.valley-init.script;
421 passAsFile = [ "initScript" ];
422 # The floor --checks derives under.
423 floor = ../../examples/policy/instance;
424 } (builtins.readFile ./valley-changes.sh);
425
426 # valley review with no change, walking what needs the operator across
427 # the projects of the test host valley-changes makes: three ready changes
428 # in two projects, the other project's read through the walk's cache
429 # clone, approved, rejected and skipped there; a stale stack in that
430 # clone based with [b]ase; changes unreadied and readied at a new version
431 # while the walk is under way; Ctrl-C at a prompt on a terminal; a
432 # project that does not read; and an empty queue. It runs the packaged
433 # CLI, so the verification schema is the package's.
434 valley-walk = pkgs.runCommand "valley-walk" {
435 nativeBuildInputs = [
436 pkgs.git
437 pkgs.util-linux # script(1), for Ctrl-C on a terminal
438 packages.valley-script
439 packages.valley-go
440 ];
441 initScript = walkHost.config.systemd.services.valley-init.script;
442 passAsFile = [ "initScript" ];
443 floor = ../../examples/policy/instance;
444 } (builtins.readFile ./valley-walk.sh);
445
446 # valley knot against local bare repositories that run no hook, as any
447 # git remote would: every verb, the ref's shape after each write, a
448 # comment's edits read back through log and show --at, another
449 # project named by --project and by a qualified id, and then each way a
450 # write may fail to land the first time. A stand-in for git, first on
451 # PATH, makes another writer land between a read and its push, drops the
452 # connection after a push lands and after one that did not, takes a
453 # claim, changes a field or edits a comment first, and releases and
454 # retakes a claim an unclaim read. Each write must then land exactly
455 # once, or be reported as a conflict. Two writers also run at once. cliScript
456 # is bin/valley itself, because the package's wrapper puts its own git
457 # ahead of the stand-in.
458 valley-knot = pkgs.runCommand "valley-knot" {
459 nativeBuildInputs = [
460 pkgs.git
461 pkgs.jq
462 packages.valley-go
463 ];
464 cliScript = ../../bin/valley;
465 } (builtins.readFile ./valley-knot.sh);
466
467 # valley plan against local bare repositories that run no hook: a graph
468 # built with the real knot verbs, each at a time VALLEY_NOW fixes, so
469 # every date and age it shows is the same on every run. The text, off a
470 # terminal, and the valley-plan/v1 document are compared with golden
471 # files kept beside the code that prints them (status/testdata/plan/).
472 # Then a project with no graph, --all over the projects the instance
473 # publishes with one that cannot be read, and the operator named by
474 # --owner and by no one. cliScript is bin/valley itself, as for
475 # valley-knot.
476 valley-plan = pkgs.runCommand "valley-plan" {
477 nativeBuildInputs = [
478 pkgs.git
479 pkgs.jq
480 pkgs.gawk
481 pkgs.diffutils
482 packages.valley-go
483 ];
484 cliScript = ../../bin/valley;
485 golden = ../../status/testdata/plan;
486 } (builtins.readFile ./valley-plan.sh);
487
488 # Self-update's own tests (selfupdate/), run with go vet: a real bare
489 # repository for ls-remote and a stand-in for nix, over an install, an
490 # up-to-date run, each step of the smoke test failing and being skipped,
491 # --retry, a rollback and its return, a pin, a valley removed from the
492 # profile by hand, and the repositories and branches it refuses.
493 # valley-self-update drives the verb through the CLI.
494 selfupdate-unit = packages.selfupdate.unit;
495
496 # valley --version and valley self-update through the installed package,
497 # against a real bare repository. A build has no nix, so a stand-in for
498 # nix builds a commit as a valley that runs the real, unstamped script
499 # under the stamp nix would give that commit, beside the package's own
500 # share/. The smoke test therefore runs the real CLI over the policy the
501 # package ships, under the schema it carries. A run installs main's tip;
502 # the next finds it up to date, also from a repository whose own git
503 # config names another; a commit whose build cannot compose a policy
504 # fails the smoke test, installs nothing, and is skipped. Then the
505 # home-manager module, evaluated over stand-ins for the home-manager
506 # options it sets: its timer, its service's PATH, and the arguments its
507 # script runs valley with. A real nix build into a throwaway profile
508 # needs a nix daemon and a writable store, which a build does not have.
509 valley-self-update = pkgs.runCommand "valley-self-update" {
510 nativeBuildInputs = [
511 pkgs.git
512 pkgs.jq
513 packages.valley
514 ];
515 inherit (packages.valley) version;
516 valley = packages.valley;
517 valleyScript = packages.valley-script;
518 cliScript = ../../bin/valley;
519 units = builtins.toJSON selfUpdateUnits;
520 passAsFile = [ "units" ];
521 } (builtins.readFile ./valley-self-update.sh);
522
523 # The CLI is offered for aarch64-darwin, which nothing here builds or
524 # tests (flake.nix). This check holds that offer to evaluating: an input
525 # with no Darwin build fails here rather than on a Mac. The package's
526 # drvPath is forced while this check is evaluated, and its string context
527 # is discarded, so the Darwin derivations are written to the store but
528 # are not inputs of this one. Building this check builds and substitutes
529 # nothing for Darwin.
530 valley-darwin-eval = pkgs.runCommand "valley-darwin-eval" {
531 darwinDrv = builtins.unsafeDiscardStringContext self.packages.aarch64-darwin.valley.drvPath;
532 darwinSystem = self.packages.aarch64-darwin.valley.system;
533 } (builtins.readFile ./valley-darwin-eval.sh);
534}