Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env bash

eval "$(devenv direnvrc)"
use devenv
47 changes: 29 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,29 +47,40 @@ Configuration is loaded from the following paths, in order of priority:
3. `$XDG_CONFIG_HOME/rustpolnak.toml`
4. `~/.config/rustpolnak.toml`

## devenv
1. get nix
2. have `devenv` in your PATH or get it via `nix develop`
3. `devenv shell`
4. `devenv up` to run API and RFID services
5. `cargo run`
## Set up your dev environment
Prerequisites - have `nix` and `devenv` in your system:

`$ nix shell nixpkgs#devenv` to get `devenv` into your `$PATH` in a temporary shell

OR

`$ nix profile add nixpkgs#devenv` to install imperatively to your system

`$ devenv shell` to enter the dev environment

Optional: automatically enter the environment via `direnv`
- Have [`direnv`](https://direnv.net/docs/installation.html) in your system
- On first `cd` into this repository, you may need to call `direnv allow` to whitelist this path
- On subsequent `cd` into this repository, `direnv` should pick up automatically and drop you into a `devenv shell`

## Build & Run

```bash
$ dx serve
```
Run the app:
`$ devenv up dx`
`$ cargo run`

Start testing API server:
```bash
$ cd stubs
$ uv run fastapi dev
```
`$ devenv up api`

Create virtual serials `stubs/dev/rfid0` and `stubs/dev/rfid1` and begin publishing TAGs:
`$ devenv up rfid`

Run `rfiddump` to test RFID readers:
`$ devenv up rfiddump`

Run both API and virtual RFID:
`$ devenv up api rfid`

Run `rfid.py` to create virtual serials `stubs/dev/rfid0` and `stubs/dev/rfid1` and begin publishing TAGs:
```bash
$ cd stubs
$ uv run rfid.py
```

Run `rfiddump` to test RFID readers:
```
Expand Down
2 changes: 2 additions & 0 deletions devenv.nix
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ in
WEBKIT_DISABLE_COMPOSITING_MODE = 1;
};
processes = {
dx.exec = "dx serve";
api.exec = "uv --directory stubs run fastapi dev";
rfid.exec = "uv --directory stubs run rfid.py";
rfiddump.exec = "cargo run --bin rfiddump";
};
}
26 changes: 0 additions & 26 deletions flake.lock

This file was deleted.

27 changes: 0 additions & 27 deletions flake.nix

This file was deleted.

Loading