gunk-dev/the-valley

flow-policy.nix

sourceb8e46aa6aaccmain's published tip history
1.0 KiB
1# The project policy's classification of the paths around klaus (flow/):
2# what a change to klaus's Go or prose, to its check definition, to the
3# packaging it shares, to the valley command its end-to-end suite runs, and
4# to an unrelated module requires.
5{
6 pkgs,
7 packages,
8 ...
9}:
10let
11 checker = packages.goModule {
12 pname = "valley-flow-policy";
13 dir = ./flow-policy-checker;
14 meta.mainProgram = "flow-policy";
15 };
16in
17{
18 # The real floor is in the owning valley's repository, which a build
19 # cannot fetch; the example floor stands in for it, as in own-policy.
20 flow-policy =
21 pkgs.runCommand "valley-flow-policy"
22 {
23 nativeBuildInputs = [
24 checker
25 pkgs.git
26 packages.valley-unstamped
27 ];
28 }
29 ''
30 flow-policy \
31 --schema ${../../schema/verification.cue} \
32 --floor ${../../examples/policy/instance/floor-format.cue} \
33 --template ${../../examples/policy/instance/template-docs.cue} \
34 --project ${../../policy/project}
35 touch $out
36 '';
37}