Skip to content

Commit

Permalink
Improve dev environment
Browse files Browse the repository at this point in the history
  • Loading branch information
acaloiaro committed Jan 26, 2024
1 parent 51452ed commit 33b9a0b
Show file tree
Hide file tree
Showing 8 changed files with 539 additions and 6 deletions.
11 changes: 11 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/2.2.1/direnvrc" "sha256-zelF0vLbEl5uaqrfIzbgNzJWGmLzCmYAkInj/LNxvKs="
fi

watch_file flake.nix
watch_file flake.lock
if ! use flake . --impure
then
echo "devenv could not be built. The devenv environment was not loaded." >&2
fi

7 changes: 3 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ vendor/
# it's handy to have a docker-compose available during development
docker-compose.yml

.pre-commit-config.yaml

dist/


.devenv/
.direnv/
.pre-commit-config.yaml
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,40 @@ nq.Enqueue(ctx, &jobs.Job{

Additional example integration code can be found at https://github.com/acaloiaro/neoq/tree/main/examples

# Developing

Neoq development is largely based on Nix and `devenv`.

After [installing nix](https://nixos.org/download), this repository contains everything else you will need to develop
and run tests.

## Automatic setup and teardown

`direnv` is used to let neoq automatically configure its own dev environment. This includes installing dependencies and
developer tooling.

See [installing direnv](https://direnv.net/docs/installation.html) if you want the dev environment setup to be automated.

## Manual setup and teardown

Neoq uses `devenv` to manage development environments and services.

To enter the development shell, run `nix develop --impure`.

In order to run the test suite, the required services need to be started. Start services by running the following:

## Running services for tests

The neoq development shell gives you the `devenv` executable.

To run postgres and redis for tests and development, run

```
devenv up
```

This runs Postgres and Redis in the foreground. In a separate terminal, run `make test` to run the test suite.

# Status

This project is currently in alpha. Future releases may change the API.
This project is currently pre-1.0. Future releases may change the API.
3 changes: 3 additions & 0 deletions bin/gomod2nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!env bash

gomod2nix
308 changes: 308 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 33b9a0b

Please sign in to comment.