A collection of utilities for the Daggerheart SRD katari.fyi
daggerheart ttrpg gleam api
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

nix: Add nix runs

Signed-off-by: Naomi Roberts <mia@naomieow.xyz>

lesbian.skin db99584c a64a3de4

verified
+56 -6
+1 -2
.tangled/workflows/test-api.yaml
··· 7 7 steps: 8 8 - name: test api 9 9 command: | 10 - cd api 11 - nix develop --command bash -c 'gleam test' 10 + nix run .#test-api
+1 -4
.tangled/workflows/test-web.yaml
··· 6 6 7 7 steps: 8 8 - name: test website 9 - environment: 10 - KATARI_API_DOCS: "true" 11 9 command: | 12 - cd web 13 - nix develop --command bash -c 'gleam test' 10 + nix run .#test-web
+7
api/README.md
··· 7 7 8 8 ## Running 9 9 ```bash 10 + cd api 10 11 gleam run 12 + ``` 13 + 14 + ### Nix 15 + 16 + ```bash 17 + nix run .#api 11 18 ``` 12 19 13 20 If 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
··· 22 22 ]; 23 23 }; 24 24 }); 25 + apps = forEachSupportedSystem ({pkgs}: { 26 + api = { 27 + type = "app"; 28 + program = toString (pkgs.writeShellScript "run-api" '' 29 + rootDir=$(jj --ignore-working-copy root || git rev-parse --show-toplevel) || (echo "error: can't find repo root?"; exit 1) 30 + cd "$rootDir/api" 31 + export KATARI_SRD_PATH="$rootDir/srd" 32 + ${pkgs.gleam}/bin/gleam run 33 + ''); 34 + }; 35 + web = { 36 + type = "app"; 37 + program = toString (pkgs.writeShellScript "run-web" '' 38 + rootDir=$(jj --ignore-working-copy root || git rev-parse --show-toplevel) || (echo "error: can't find repo root?"; exit 1) 39 + cd "$rootDir/web" 40 + export KATARI_SRD_PATH="$rootDir/srd" 41 + export KATARI_API_DOCS=true 42 + ${pkgs.gleam}/bin/gleam run 43 + ''); 44 + }; 45 + test-api = { 46 + type = "app"; 47 + # TODO: Check if env vars are already set 48 + program = toString (pkgs.writeShellScript "test-api" '' 49 + rootDir=$(jj --ignore-working-copy root || git rev-parse --show-toplevel) || (echo "error: can't find repo root?"; exit 1) 50 + cd "$rootDir/api" 51 + export KATARI_SRD_PATH="$rootDir/srd" 52 + ${pkgs.gleam}/bin/gleam test 53 + ''); 54 + }; 55 + test-web = { 56 + type = "app"; 57 + program = toString (pkgs.writeShellScript "test-web" '' 58 + rootDir=$(jj --ignore-working-copy root || git rev-parse --show-toplevel) || (echo "error: can't find repo root?"; exit 1) 59 + cd "$rootDir/web" 60 + export KATARI_SRD_PATH="$rootDir/srd" 61 + export KATARI_API_DOCS=true 62 + ${pkgs.gleam}/bin/gleam test 63 + ''); 64 + }; 65 + }); 25 66 }; 26 67 }
+6
web/README.md
··· 7 7 8 8 ## Running 9 9 ```bash 10 + cd web 10 11 gleam run 12 + ``` 13 + 14 + ### Nix 15 + ```bash 16 + nix run .#web 11 17 ``` 12 18 13 19 Set the `KATARI_API_DOCS` environment variable to `true` to enable them.