forked from tangled.org/core
this repo has no description

nix: add script to do the lexgen dance

h/t https://github.com/bluesky-social/indigo/issues/931#issuecomment-2635675099
for the inspiration

Signed-off-by: Winter <winter@winter.cafe>

authored by winter.bsky.social and committed by Tangled 10cd7fbb 1b0033f6

Changed files
+25
+25
flake.nix
··· 207 207 ${gomod2nix.legacyPackages.${system}.gomod2nix}/bin/gomod2nix generate --outdir ./nix 208 208 ''); 209 209 }; 210 + lexgen = { 211 + type = "app"; 212 + program = 213 + (pkgs.writeShellApplication { 214 + name = "lexgen"; 215 + text = '' 216 + if ! command -v lexgen > /dev/null; then 217 + echo "error: must be executed from devshell" 218 + exit 1 219 + fi 220 + 221 + rootDir=$(jj --ignore-working-copy root || git rev-parse --show-toplevel) || (echo "error: can't find repo root?"; exit 1) 222 + cd "$rootDir" 223 + 224 + rm api/tangled/* 225 + lexgen --build-file lexicon-build-config.json lexicons 226 + sed -i.bak 's/\tutil/\/\/\tutil/' api/tangled/* 227 + ${pkgs.gotools}/bin/goimports -w api/tangled/* 228 + go run cmd/gen.go 229 + lexgen --build-file lexicon-build-config.json lexicons 230 + rm api/tangled/*.bak 231 + ''; 232 + }) 233 + + /bin/lexgen; 234 + }; 210 235 }); 211 236 212 237 nixosModules.appview = {