add process-compose.yaml for starting up dev env more conveniently #305

closed
opened by ptr.pet targeting master from ptr.pet/core: process-compose

also adds a nix app that just points to process-compose to run it with nix run .#dev-compose. i didn't use process-compose nix module or provide the deps via nix, since doing that wouldn't let you be able to just restart commands in process-compose and pick up the newest changes (as opposed to restarting the entire process-compose which defeats the purpose of it).

+34
process-compose.yaml
···
+
env_cmds:
+
OAUTH_JWKS: "nix run .#genjwks"
+
+
processes:
+
redis:
+
command: nix shell nixpkgs#redis -c redis-server
+
description: "run redis server"
+
restart: on_failure
+
ready_log_line: "Ready to accept connections"
+
+
watch-tailwind:
+
command: nix run .#watch-tailwind
+
description: "watch and rebuild tailwind css"
+
is_tty: true # needed because tailwindcss expects a tty
+
restart: on_failure
+
ready_log_line: "Done in "
+
+
vm:
+
command: nix run .#vm
+
description: "run knot, spindle, ssh, etc."
+
restart: on_failure
+
ready_log_line: "nixos login: root (automatic login)"
+
+
watch-appview:
+
command: TANGLED_OAUTH_JWKS=$${OAUTH_JWKS} nix run .#watch-appview
+
description: "watch and rebuild app view"
+
restart: on_failure
+
depends_on:
+
watch-tailwind:
+
condition: process_log_ready
+
vm:
+
condition: process_log_ready
+
redis:
+
condition: process_log_ready
+4
flake.nix
···
${pkgs.nixos-shell}/bin/nixos-shell --flake .#vm
'');
};
+
dev-compose = {
+
type = "app";
+
program = "${pkgs.process-compose}/bin/process-compose";
+
};
});
nixosModules.appview = import ./nix/modules/appview.nix {inherit self;};