A character sheet creator for TTRPGs
sheetr.app/
gleam
dnd
dnd5e
atproto
1{
2 inputs = {
3 nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
4 };
5
6 outputs = {nixpkgs, ...} @ inputs: let
7 lib = nixpkgs.lib;
8 supportedSystems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
9 forEachSupportedSystem = f:
10 lib.genAttrs supportedSystems (system:
11 f {
12 pkgs = import nixpkgs {inherit system;};
13 });
14 in {
15 devShells = forEachSupportedSystem ({pkgs}: {
16 default = pkgs.mkShell {
17 packages = with pkgs; [
18 gleam
19 erlang_28
20 beam28Packages.rebar3
21 jq
22 ];
23 };
24 });
25 apps = forEachSupportedSystem ({pkgs}: let
26 cdInto = service: ''
27 rootDir=$(jj --ignore-working-copy root || git rev-parse --show-toplevel) || (echo "error: can't find repo root?"; exit 1)
28 cd "$rootDir/${service}"
29 '';
30 runtimeInputs = with pkgs; [
31 gleam
32 erlang_28
33 beam28Packages.rebar3
34 ];
35 in {
36 # TODO: make default app run both frontend and backend
37 frontend = {
38 type = "app";
39 program = "${(pkgs.writeShellApplication {
40 inherit runtimeInputs;
41 name = "run-frontend";
42 text = ''
43 ${cdInto "frontend"}
44 # TODO: dev server proxy thing
45 ${pkgs.gleam}/bin/gleam run -m lustre/dev start
46 '';
47 })}/bin/run-frontend";
48 };
49 backend = {
50 type = "app";
51 program = "${(pkgs.writeShellApplication {
52 inherit runtimeInputs;
53 name = "run-backend";
54 text = ''
55 ${cdInto "backend"}
56 ${pkgs.gleam}/bin/gleam run
57 '';
58 })}/bin/run-backend";
59 };
60 lexgen = {
61 type = "app";
62 program = "${(pkgs.writeShellApplication {
63 inherit runtimeInputs;
64 name = "run-lexgen";
65 text = ''
66 ${cdInto "shared"}
67 ${pkgs.gleam}/bin/gleam run -m alicia/lexgen -- --dir=${./lexicons}
68 '';
69 })}/bin/run-lexgen";
70 };
71 });
72 };
73}