···77steps:
88 - name: test api
99 command: |
1010- cd api
1111- nix develop --command bash -c 'gleam test'
1010+ nix run .#test-api
+1-4
.tangled/workflows/test-web.yaml
···6677steps:
88 - name: test website
99- environment:
1010- KATARI_API_DOCS: "true"
119 command: |
1212- cd web
1313- nix develop --command bash -c 'gleam test'
1010+ nix run .#test-web
+7
api/README.md
···7788## Running
99```bash
1010+cd api
1011gleam run
1212+```
1313+1414+### Nix
1515+1616+```bash
1717+nix run .#api
1118```
12191320If using a non-standard location for your SRD directory, this can be specified with the `KATARI_SRD_PATH` environment variable. It will default to `../srd` otherwise.
+41
flake.nix
···2222 ];
2323 };
2424 });
2525+ apps = forEachSupportedSystem ({pkgs}: {
2626+ api = {
2727+ type = "app";
2828+ program = toString (pkgs.writeShellScript "run-api" ''
2929+ rootDir=$(jj --ignore-working-copy root || git rev-parse --show-toplevel) || (echo "error: can't find repo root?"; exit 1)
3030+ cd "$rootDir/api"
3131+ export KATARI_SRD_PATH="$rootDir/srd"
3232+ ${pkgs.gleam}/bin/gleam run
3333+ '');
3434+ };
3535+ web = {
3636+ type = "app";
3737+ program = toString (pkgs.writeShellScript "run-web" ''
3838+ rootDir=$(jj --ignore-working-copy root || git rev-parse --show-toplevel) || (echo "error: can't find repo root?"; exit 1)
3939+ cd "$rootDir/web"
4040+ export KATARI_SRD_PATH="$rootDir/srd"
4141+ export KATARI_API_DOCS=true
4242+ ${pkgs.gleam}/bin/gleam run
4343+ '');
4444+ };
4545+ test-api = {
4646+ type = "app";
4747+ # TODO: Check if env vars are already set
4848+ program = toString (pkgs.writeShellScript "test-api" ''
4949+ rootDir=$(jj --ignore-working-copy root || git rev-parse --show-toplevel) || (echo "error: can't find repo root?"; exit 1)
5050+ cd "$rootDir/api"
5151+ export KATARI_SRD_PATH="$rootDir/srd"
5252+ ${pkgs.gleam}/bin/gleam test
5353+ '');
5454+ };
5555+ test-web = {
5656+ type = "app";
5757+ program = toString (pkgs.writeShellScript "test-web" ''
5858+ rootDir=$(jj --ignore-working-copy root || git rev-parse --show-toplevel) || (echo "error: can't find repo root?"; exit 1)
5959+ cd "$rootDir/web"
6060+ export KATARI_SRD_PATH="$rootDir/srd"
6161+ export KATARI_API_DOCS=true
6262+ ${pkgs.gleam}/bin/gleam test
6363+ '');
6464+ };
6565+ });
2566 };
2667}
+6
web/README.md
···7788## Running
99```bash
1010+cd web
1011gleam run
1212+```
1313+1414+### Nix
1515+```bash
1616+nix run .#web
1117```
12181319Set the `KATARI_API_DOCS` environment variable to `true` to enable them.