diff --git a/README.md b/README.md index a66d09e0..bdc98db4 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,10 @@ TODO - [x] Redis - [ ] ... +## A note on process working directory + +The `dataDir` of these services tend to take *relative* paths, which are usually relative to the project root. As such, when you run these services using `nix run`, their data files are created relative to whichever directory you are in. If you want these data files to always reside relative to the project directory, instead of using `nix run` consider wrapping the process-compose packages in script, via either [mission-control](https://zero-to-flakes.com/mission-control/) module or a [justfile](https://just.systems/). The example uses the latter. + ## Contributing - If you are adding a *new* service, see https://github.com/cachix/devenv/tree/main/src/modules/services for inspiration. diff --git a/example/flake.nix b/example/flake.nix index 2534de78..d8ffc96e 100644 --- a/example/flake.nix +++ b/example/flake.nix @@ -63,6 +63,10 @@ machine.succeed("echo 'SELECT version();' | ${config.services.postgres.pg1.package}/bin/psql -h 127.0.0.1 -U tester ${dbName}") ''; }; + + devShells.default = pkgs.mkShell { + nativeBuildInputs = [ pkgs.just ]; + }; }; }; } diff --git a/example/justfile b/example/justfile new file mode 100644 index 00000000..ad604f86 --- /dev/null +++ b/example/justfile @@ -0,0 +1,2 @@ +default: + nix run