gunk-dev/the-valley

packages.nix

sourced040e13810bfmain's published tip history
24.8 KiB
1# Everything this flake builds: the CLI and its Go verbs, the
2# formatter, the attestation helper, the integrator, the identity
3# compiler, the pre-receive hook's policy, the security-key signature
4# verifier. The flake wires these into packages, apps, and the checks that
5# drive them; nothing here knows about any of those outputs.
6{
7 pkgs,
8 lib,
9 # The commit the flake is built from: its full SHA, the SHA with -dirty
10 # after it for a tree with uncommitted changes, or null when nix knows no
11 # commit. Only the installed CLI's version stamp reads it.
12 rev ? null,
13}:
14rec {
15 # The CLI's version, which `valley --version` prints and self-update
16 # reads to tell which commit is installed (selfupdate/): cliVersion and
17 # the short commit, as 0.1.0-97db597. A dirty tree's has -dirty after
18 # it, and with no commit known it ends in -unknown, so neither names a
19 # commit.
20 cliVersion = "0.1.0";
21 version =
22 if rev == null then
23 "${cliVersion}-unknown"
24 else if lib.hasSuffix "-dirty" rev then
25 "${cliVersion}-${builtins.substring 0 7 rev}-dirty"
26 else
27 "${cliVersion}-${builtins.substring 0 7 rev}";
28
29 # What no Go build or test here reads: prose and .gitignore files. A Go
30 # package's source leaves them out, so editing a module's README rebuilds
31 # nothing.
32 unread = lib.fileset.fileFilter (f: f.hasExt "md" || f.name == ".gitignore") ../.;
33
34 # Every Go test file in the tree. No package's build reads one.
35 goTests = lib.fileset.fileFilter (f: lib.hasSuffix "_test.go" f.name) ../.;
36
37 # A Go module of this repository, built as a package that runs no tests,
38 # with its unit tests beside it as the package's unit attribute.
39 #
40 # The package's source is what its build reads: the module's directory
41 # (dir) and the modules of this repository it uses (modules), which its
42 # go.mod replaces with their local directories, each in its place in the
43 # tree. Nothing shared this way is fetched. The source holds no test file
44 # and none of the files only the tests read (tests.reads), and the
45 # package's checkPhase is off. So an edit to a test, or to a file only the
46 # tests read, changes neither the package nor any check built on it.
47 #
48 # unit is the same build over the same source with the module's own tests
49 # and tests.reads added, and with its checkPhase on. The checkPhase runs
50 # go test, with the rest of tests: the tools the tests need, and what runs
51 # before and after them, such as go vet. Each module's unit is its unit
52 # check (nix/checks/), so its tests run in that check and in no package
53 # build.
54 #
55 # excluded names files of dir that neither the build nor the tests read,
56 # because only a flake check reads them.
57 goModule =
58 {
59 dir,
60 modules ? [ ],
61 excluded ? [ ],
62 tests ? { },
63 ...
64 }@args:
65 let
66 testReads = tests.reads or [ ];
67 source =
68 fileset:
69 lib.fileset.toSource {
70 root = ../.;
71 inherit fileset;
72 };
73 build = lib.fileset.difference (lib.fileset.unions ([ dir ] ++ modules)) (
74 lib.fileset.unions ([ unread goTests ] ++ excluded ++ testReads)
75 );
76 withTests = lib.fileset.difference (lib.fileset.unions (
77 [
78 build
79 (lib.fileset.intersection goTests dir)
80 ]
81 ++ testReads
82 )) (lib.fileset.unions ([ unread ] ++ excluded));
83 in
84 pkgs.buildGoModule (
85 finalAttrs:
86 removeAttrs args [
87 "dir"
88 "modules"
89 "excluded"
90 "tests"
91 ]
92 // {
93 version = "0";
94 src = source build;
95 modRoot = lib.path.removePrefix ../. dir;
96 # Standard library only, so no module is fetched.
97 vendorHash = null;
98 doCheck = false;
99 passthru.unit = finalAttrs.finalPackage.overrideAttrs (
100 prev:
101 removeAttrs tests [ "reads" ]
102 // {
103 pname = "${prev.pname}-unit";
104 src = source withTests;
105 doCheck = true;
106 }
107 );
108 }
109 );
110
111 # vendorHash = null builds in vendor mode, which has no reading of a local
112 # replace. The replaced module is a directory beside the program and
113 # nothing is fetched either way, so these builds read go.mod as written.
114 readsGoMod = ''
115 export GOFLAGS="''${GOFLAGS//-mod=vendor/-mod=mod}"
116 '';
117
118 # Markdown prose is filled paragraphs hard-wrapped at 100 columns
119 # (ida-1ec03b1). One flag string backs both the formatter app and the
120 # prose-format check, so the two cannot drift. Embedded-language
121 # formatting is off so fenced code blocks pass through byte-for-byte.
122 proseFmtArgs = "--prose-wrap always --print-width 100 --embedded-language-formatting off";
123
124 # The integrator's CLI (bin/valley) wrapped for `nix run`. The script
125 # itself must keep running bare from any checkout — the package is the
126 # second of its two shipping modes, never a dependency of the first.
127 valley-script-unwrapped = pkgs.writeShellApplication {
128 name = "valley";
129 runtimeInputs = [
130 pkgs.git
131 pkgs.natscli # tail and replay only; every other verb needs just git
132 pkgs.cue # checks and approving — it composes the policy layers
133 pkgs.less # review only — its v key is what takes a note
134 attest # approving only — it runs the checks and signs them
135 valley-go # status, ready, unready, withdraw and rebase, naming a change by its ID, and pending's drafts
136 ];
137 text = builtins.readFile ../bin/valley;
138 };
139
140 # The shipping form. The verification schema travels with the script, as
141 # it does with the integrator: only the-valley's own tree carries
142 # schema/, so a project's checkout has none to read. --set-default leaves
143 # an explicit VALLEY_VERIFICATION_SCHEMA in charge.
144 valley-script =
145 pkgs.runCommand "valley"
146 {
147 nativeBuildInputs = [ pkgs.makeWrapper ];
148 meta.mainProgram = "valley";
149 }
150 ''
151 mkdir -p $out/bin
152 makeWrapper ${lib.getExe valley-script-unwrapped} $out/bin/valley \
153 --set-default VALLEY_VERIFICATION_SCHEMA ${../schema/verification.cue}
154 '';
155
156 # The installed package: the wrapped script stamped with its version, the
157 # shell completions at the standard paths home-manager/NixOS auto-link,
158 # and the tiny policy self-update's smoke test derives checks from
159 # (examples/policy/smoke/). The stamp is set on this outer wrapper alone,
160 # so the packages the checks and the integrator use do not change with
161 # every commit. The name carries the version as well: nix profile names
162 # the element valley from it, and self-update reads a hand-installed
163 # valley's commit from it.
164 valley =
165 pkgs.runCommand "valley-${version}"
166 {
167 inherit version;
168 nativeBuildInputs = [
169 pkgs.makeWrapper
170 pkgs.installShellFiles
171 ];
172 meta.mainProgram = "valley";
173 }
174 ''
175 mkdir -p $out/bin $out/share/valley
176 makeWrapper ${lib.getExe valley-script} $out/bin/valley \
177 --set VALLEY_VERSION ${version}
178 installShellCompletion --bash --name valley ${../completions/valley.bash}
179 installShellCompletion --zsh --name _valley ${../completions/_valley}
180 cp -r --no-preserve=mode ${../examples/policy/smoke} $out/share/valley/smoke-policy
181 '';
182
183 # The verbs of the CLI written in Go (status/). status reads one change's
184 # request and outcome record from origin, and prints them as sentences or
185 # as the valley-status/v1 JSON object front ends read. ready, unready and
186 # withdraw write a change's record, with the one reading of a record the
187 # push hook shares (../change). rebase rebases a change's whole stack and
188 # adds each change's rebased head to its record, through the rebase engine
189 # (../rebase), which also reads how far each version has landed for the
190 # listings. knot reads and writes the plan graph, with the one reading of
191 # a graph the push hook shares (../knot), and plan shows that graph as a
192 # view. compare reads a version's file delta and its approved version's
193 # with the one reading of valley-delta-v1 (../delta), for review.
194 # self-update installs the tip of a branch of the-valley into the user's
195 # nix profile (../selfupdate). checks prints which checks a change
196 # requires, as the deriver (../derive) derives them from the policy the
197 # composed-policy reader (../composed) reads. Go, standard library only.
198 # It runs whatever git and cue are on PATH, which inside the CLI's package
199 # are the CLI's own. Its unit tests hold its shell quoting to the bash it
200 # replaced, so they need bash, lay pending out over real repositories,
201 # so they need git, and derive a change's checks under the verification
202 # schema, so they need cue and the schema. The plan's golden files
203 # (status/testdata/plan/) are valley-plan's, and no Go test reads them.
204 valley-go = goModule {
205 pname = "valley-go";
206 dir = ../status;
207 modules = [
208 ../change
209 ../composed
210 ../delta
211 ../derive
212 ../knot
213 ../note
214 ../rebase
215 ../selfupdate
216 ];
217 excluded = [ ../status/testdata/plan ];
218 preBuild = readsGoMod;
219 tests = {
220 reads = [ ../schema/verification.cue ];
221 nativeCheckInputs = [
222 pkgs.bash
223 pkgs.git
224 pkgs.cue
225 ];
226 # A test that cannot find a tool it needs fails rather than skipping.
227 preCheck = ''
228 export VALLEY_TEST_TOOLS=required
229 '';
230 };
231 meta.mainProgram = "valley-go";
232 };
233
234 # The check worker: one pass of `valley-go work` (status/worker.go), which
235 # builds the nix checks ready changes require and publishes the evidence
236 # before anyone approves them. It runs this flake's git, cue and attest,
237 # and the verification schema travels with it, as it does with the CLI.
238 # nix is the machine's own, for the reason attest gives.
239 valley-worker =
240 pkgs.runCommand "valley-worker"
241 {
242 nativeBuildInputs = [ pkgs.makeWrapper ];
243 meta.mainProgram = "valley-worker";
244 }
245 ''
246 mkdir -p $out/bin
247 makeWrapper ${lib.getExe valley-go} $out/bin/valley-worker \
248 --add-flags work \
249 --prefix PATH : ${
250 lib.makeBinPath [
251 pkgs.git
252 pkgs.cue
253 attest
254 ]
255 } \
256 --set-default VALLEY_VERIFICATION_SCHEMA ${../schema/verification.cue}
257 '';
258
259 # `nix run .#fmt` — rewrap every tracked *.md in the repo to 100 columns.
260 prose-fmt = pkgs.writeShellApplication {
261 name = "valley-fmt";
262 runtimeInputs = [
263 pkgs.git
264 pkgs.prettier
265 ];
266 text = ''
267 cd "$(git rev-parse --show-toplevel)"
268 git ls-files -z -- '*.md' | xargs -0 --no-run-if-empty \
269 prettier ${proseFmtArgs} --write
270 '';
271 };
272
273 # The Phase 2 attestation helper (dcr-0de694f). Go, standard library
274 # only, note format included, and hence no module fetch at build time.
275 # Its unit tests need git and ssh-keygen. It reads signed notes with the
276 # note module (../note), the one reading of the envelope shared by the
277 # programs that write, verify and admit attestations. The conformance
278 # vectors (attest/conformance/) are attest-conformance's, and no Go test
279 # reads them.
280 attest-unwrapped = goModule {
281 pname = "valley-attest";
282 dir = ../attest;
283 modules = [ ../note ];
284 excluded = [ ../attest/conformance ];
285 preBuild = readsGoMod;
286 tests.nativeCheckInputs = [
287 pkgs.git
288 pkgs.openssh
289 ];
290 meta.mainProgram = "attest";
291 };
292
293 # The shipping form. git and cue are pinned to this flake's nixpkgs,
294 # so every host composes and vets a statement with the same tools.
295 # Signing needs no tool at all: a note is signed on crypto/ed25519
296 # inside the binary. `nix` is deliberately NOT pinned: the check being
297 # attested to must be built by the nix the machine actually runs, and
298 # a nix carried in here would be a second one.
299 attest =
300 pkgs.runCommand "valley-attest"
301 {
302 nativeBuildInputs = [ pkgs.makeWrapper ];
303 meta.mainProgram = "attest";
304 }
305 ''
306 mkdir -p $out/bin
307 makeWrapper ${lib.getExe attest-unwrapped} $out/bin/attest \
308 --prefix PATH : ${
309 lib.makeBinPath [
310 pkgs.git
311 pkgs.cue
312 ]
313 } \
314 --set-default VALLEY_ATTEST_SCHEMA ${../schema/attestation.cue}
315 '';
316
317 # The identity registry compiler (dcr-b87f6e8). Go, standard library
318 # only, note format included, same trade as attest and the integrator, so
319 # no module is fetched. Its unit tests pin the note format's key hash
320 # against the reference vector attest is held to, and verify a real
321 # YubiKey attestation against the Yubico roots it carries. The test
322 # vectors (identity/testdata/) are read by the tests and by identity-e2e,
323 # never by the build.
324 identity-unwrapped = goModule {
325 pname = "valley-identity";
326 dir = ../identity;
327 modules = [ ../note ];
328 preBuild = readsGoMod;
329 tests.reads = [ ../identity/testdata ];
330 meta.mainProgram = "identity";
331 };
332
333 # The shipping form. git reads the registry out of the instance
334 # repository's tip and cue vets and exports it, both pinned to this
335 # flake's nixpkgs so every host compiles a registry the same way. The
336 # schema travels with the binary: a compiler judging a registry against a
337 # schema the consumer supplied would be no floor at all.
338 identity =
339 pkgs.runCommand "valley-identity"
340 {
341 nativeBuildInputs = [ pkgs.makeWrapper ];
342 meta.mainProgram = "identity";
343 }
344 ''
345 mkdir -p $out/bin
346 makeWrapper ${lib.getExe identity-unwrapped} $out/bin/identity \
347 --prefix PATH : ${
348 lib.makeBinPath [
349 pkgs.git
350 pkgs.cue
351 ]
352 } \
353 --set-default VALLEY_IDENTITY_SCHEMA ${../schema/identity.cue}
354 '';
355
356 # The security-key signature verifier (sigverify/README.md). Go,
357 # standard library only, so no module is fetched.
358 #
359 # The git its git-tag command runs is fixed at build time to this
360 # flake's git, as an absolute store path compiled into the binary. A
361 # wrapper that puts git on PATH would leave the binary inside it looking
362 # git up on PATH, and a caller's environment could change which git that
363 # is. Compiled in, there is no PATH lookup to change.
364 #
365 # Its tests run against real ssh-keygen and git. The security-key cases
366 # among them need OpenSSH's sk-dummy authenticator, which the
367 # sigverify-unit check supplies. Building this package runs no test, so a
368 # consumer building it never builds OpenSSH.
369 sigverify = goModule {
370 pname = "valley-sigverify";
371 dir = ../sigverify;
372 ldflags = [ "-X main.gitProgram=${lib.getExe pkgs.git}" ];
373 tests.nativeCheckInputs = [
374 pkgs.git
375 pkgs.openssh
376 ];
377 meta.mainProgram = "sigverify";
378 };
379
380 # The pre-receive hook's policy (valleyhook/): what a push may write to a
381 # project a valley host serves. It validates a push to the plan graph
382 # with the one reading of a graph the CLI shares (../knot). The same
383 # binary is the git user's login shell, which derives the pushing
384 # principal and pauses pushes until the host has converged. Go, standard
385 # library only, so no module is fetched.
386 #
387 # The git it reads the repository with is fixed at build time, the way
388 # sigverify's is: an absolute store path compiled into the binary, so no
389 # PATH a hook runs under can change which git that is.
390 valleyhook = goModule {
391 pname = "valley-valleyhook";
392 dir = ../valleyhook;
393 modules = [
394 ../note
395 ../change
396 ../knot
397 ];
398 preBuild = readsGoMod;
399 ldflags = [ "-X main.gitProgram=${lib.getExe pkgs.git}" ];
400 # The walk's and the change records' tests build hostile objects with
401 # real git.
402 tests.nativeCheckInputs = [ pkgs.git ];
403 meta.mainProgram = "valleyhook";
404 };
405
406 # The note envelope (note/). Its tests hold it to refusing every line a
407 # relayer could append that one of its readers would refuse.
408 note = goModule {
409 pname = "valley-note";
410 dir = ../note;
411 };
412
413 # The plan graph (knot/): its canonical form, its layout, cycles and
414 # transitions, held by its own tests. The package is knotcheck, which
415 # knot-agree runs to hold the Go validator to the CUE schema and the
416 # knowledge lint.
417 knot = goModule {
418 pname = "valley-knot";
419 dir = ../knot;
420 meta.mainProgram = "knotcheck";
421 };
422
423 # The rebase engine (rebase/): a family of stacked changes captured from
424 # one snapshot of origin, rebased in a throwaway worktree, and published
425 # as one atomic branch push and one record append per change. Its tests
426 # run against real repositories, real pushes and real git, with go vet
427 # after them. Go, standard library only, so no module is fetched.
428 rebase = goModule {
429 pname = "valley-rebase";
430 dir = ../rebase;
431 modules = [ ../change ];
432 preBuild = readsGoMod;
433 tests = {
434 nativeCheckInputs = [ pkgs.git ];
435 postCheck = ''
436 go vet ./...
437 '';
438 };
439 };
440
441 # Self-update (selfupdate/): the installed CLI brought up to the tip of a
442 # branch, built with nix and installed into the user's profile. Its tests,
443 # with go vet after them, use a real bare repository for ls-remote and a
444 # stand-in for nix whose builds are small scripts, so nothing is built and
445 # no profile is touched. Go, standard library only, so no module is
446 # fetched.
447 selfupdate = goModule {
448 pname = "valley-selfupdate";
449 dir = ../selfupdate;
450 tests = {
451 nativeCheckInputs = [ pkgs.git ];
452 postCheck = ''
453 go vet ./...
454 '';
455 };
456 };
457
458 # The deriver of required checks (derive/): a change's paths read from
459 # git diff -z, globs matched byte by byte, and the required checks, pins,
460 # carry mode and unclassified paths derived from the whole composed
461 # policy (../composed). Its tests, with go vet after them, hold it to
462 # bin/valley's deriver, run over the repository's own policy, the example
463 # policies and paths drawn from a fixed seed. So the tests read
464 # bin/valley, the schema and those policies, and need bash, git and cue.
465 # bin/valley is run under C.UTF-8 and en_US.UTF-8 as well as C, so the
466 # tests read the UTF-8 locales' archive. Go, standard library only, so no
467 # module is fetched.
468 derive = goModule {
469 pname = "valley-derive";
470 dir = ../derive;
471 modules = [ ../composed ];
472 preBuild = readsGoMod;
473 tests = {
474 reads = [
475 ../bin/valley
476 ../schema/verification.cue
477 ../examples/policy
478 ../policy/project
479 ];
480 nativeCheckInputs = [
481 pkgs.bash
482 pkgs.git
483 pkgs.cue
484 ];
485 # A test that cannot find a tool it needs, or a locale, fails rather
486 # than skipping.
487 preCheck = ''
488 export VALLEY_TEST_TOOLS=required
489 export LOCALE_ARCHIVE=${pkgs.glibcLocalesUtf8}/lib/locale/locale-archive
490 '';
491 postCheck = ''
492 go vet ./...
493 '';
494 };
495 };
496
497 # The change record (change/). Its tests cover its strict reading, its
498 # fuzz target's seed corpus, and its branch-name rule, which they hold to
499 # real git's check-ref-format.
500 change = goModule {
501 pname = "valley-change";
502 dir = ../change;
503 tests.nativeCheckInputs = [ pkgs.git ];
504 };
505
506 # valley-delta-v1 (delta/): the encoding's strict reading, and the delta
507 # read from real trees. Its unit tests run go vet, the conformance
508 # vectors' script in its --check mode, which holds the committed expected
509 # results to what the script computes, and go test, which builds each
510 # vector's trees with real git and holds the Go code to those results.
511 delta = goModule {
512 pname = "valley-delta";
513 dir = ../delta;
514 tests = {
515 reads = [ ../delta/testdata ];
516 nativeCheckInputs = [
517 pkgs.git
518 pkgs.python3
519 ];
520 preCheck = ''
521 go vet ./...
522 python3 -I testdata/vectors.py --check testdata
523 '';
524 };
525 };
526
527 # Review records (review/): the-valley/review/v1's strict reading, a
528 # review's binding to the version it judged, recomputed from git within a
529 # budget, and the append-only history a review is kept in, with the check
530 # an append is held to. It reads change records with the one reading of a
531 # record the push hook shares (../change), and the delta with
532 # valley-delta-v1's bounded reading (../delta). Its tests build every
533 # repository they read with real git and run its fuzz target's seed
534 # corpus, and go vet runs after them. Go, standard library only, so no
535 # module is fetched.
536 review = goModule {
537 pname = "valley-review";
538 dir = ../review;
539 modules = [
540 ../change
541 ../delta
542 ];
543 preBuild = readsGoMod;
544 tests = {
545 nativeCheckInputs = [ pkgs.git ];
546 postCheck = ''
547 go vet ./...
548 '';
549 };
550 };
551
552 # The restacker (restack/): `valley-restacker once --report-only` reads
553 # one snapshot of origin through the rebase engine (../rebase), says
554 # which families it would restack and which it would hold, and builds the
555 # writes a pass would push, pushing none. It reads the cap on its
556 # automatic versions through the composed-policy reader it shares with
557 # the integrator (../composed), and a signer projects file through the
558 # note module (../note). Its unit tests cover request association,
559 # outcome currency, capacity and report bounds, and, against real git,
560 # the journal of writes and recovery's decisions, its environment, its
561 # scratch repository's identity, its state directory's lock and binding,
562 # and the deadline on what it runs. go vet runs after them. Go, standard
563 # library only, so no module is fetched.
564 restack-unwrapped = goModule {
565 pname = "valley-restacker";
566 dir = ../restack;
567 modules = [
568 ../change
569 ../composed
570 ../note
571 ../rebase
572 ];
573 # The program alone: e2e/transport is a module of restack-e2e's own,
574 # which neither this build nor its tests read.
575 excluded = [ ../restack/e2e ];
576 subPackages = [ "." ];
577 preBuild = readsGoMod;
578 tests = {
579 nativeCheckInputs = [ pkgs.git ];
580 postCheck = ''
581 go vet ./...
582 '';
583 };
584 # The module is named for its directory; the program, for what it is.
585 postInstall = ''
586 mv $out/bin/restack $out/bin/valley-restacker
587 '';
588 meta.mainProgram = "valley-restacker";
589 };
590
591 # The shipping form: git to read origin, cue to compose the policy, and
592 # attest to check a transfer statement, all pinned to this flake's
593 # nixpkgs, with the packaged verification schema as the default.
594 valley-restacker =
595 pkgs.runCommand "valley-restacker"
596 {
597 nativeBuildInputs = [ pkgs.makeWrapper ];
598 meta.mainProgram = "valley-restacker";
599 }
600 ''
601 mkdir -p $out/bin
602 makeWrapper ${lib.getExe restack-unwrapped} $out/bin/valley-restacker \
603 --prefix PATH : ${
604 lib.makeBinPath [
605 pkgs.git
606 pkgs.cue
607 attest
608 ]
609 } \
610 --set-default VALLEY_VERIFICATION_SCHEMA ${../schema/verification.cue}
611 '';
612
613 # The Phase 3 integrator (dcr-439b771). Go, standard library only,
614 # same trade as attest, so no module is fetched. It reads change records
615 # with the one reading of a record the push hook shares (../change), and
616 # verifier keys with the one reading of a key the note format defines
617 # (../note).
618 integrator-unwrapped = goModule {
619 pname = "valley-integrator";
620 dir = ../integrator;
621 modules = [
622 ../change
623 ../composed
624 ../note
625 ];
626 # The scenarios (integrator/e2e/) are integrator-e2e's, and no Go test
627 # reads them.
628 excluded = [ ../integrator/e2e ];
629 preBuild = readsGoMod;
630 tests = {
631 # The policy bridge's tests compose a policy under the verification
632 # schema with real cue, and check a deriver's report against real git.
633 reads = [ ../schema/verification.cue ];
634 nativeCheckInputs = [
635 pkgs.git
636 pkgs.cue
637 ];
638 };
639 meta.mainProgram = "integrator";
640 };
641
642 # The shipping form. The integrator drives four programs rather than
643 # reimplementing what they do: attest judges every statement and
644 # every note, the valley deriver and cue compose the policy, and git
645 # holds the requests and the refs. All four are pinned to this
646 # flake's nixpkgs so an instance's integrators agree; `nix` is
647 # deliberately absent for the same reason it is absent from attest —
648 # a closure must be recomputed by the nix the machine actually runs.
649 integrator =
650 pkgs.runCommand "valley-integrator"
651 {
652 nativeBuildInputs = [ pkgs.makeWrapper ];
653 meta.mainProgram = "integrator";
654 }
655 ''
656 mkdir -p $out/bin
657 makeWrapper ${lib.getExe integrator-unwrapped} $out/bin/integrator \
658 --prefix PATH : ${
659 lib.makeBinPath [
660 pkgs.git
661 pkgs.cue
662 pkgs.natscli
663 attest
664 valley-script
665 ]
666 } \
667 --set-default VALLEY_ATTEST_SCHEMA ${../schema/attestation.cue} \
668 --set-default VALLEY_VERIFICATION_SCHEMA ${../schema/verification.cue} \
669 --set-default VALLEY_EVENT_SCHEMA ${../schema/events.cue}
670 '';
671}