https://github.com/justinrubek/nix-sqlx-example
Example of using sqlx in a nix flake, with pre-commit hooks
https://github.com/justinrubek/nix-sqlx-example
example flake nix nix-flake pre-commit rust sqlx
Last synced: 11 months ago
JSON representation
Example of using sqlx in a nix flake, with pre-commit hooks
- Host: GitHub
- URL: https://github.com/justinrubek/nix-sqlx-example
- Owner: justinrubek
- Created: 2023-03-13T03:22:31.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-08-25T23:03:24.000Z (over 2 years ago)
- Last Synced: 2025-02-23T01:41:54.250Z (11 months ago)
- Topics: example, flake, nix, nix-flake, pre-commit, rust, sqlx
- Language: Nix
- Homepage:
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# sqlx example
This is a small example of using nix to manage sqlx in a project.
The main benefit of the current configuration is the use of a custom pre-commit hook inside the nix devShell.
The hook runs `cargo sqlx prepare --merged` which will ensure that a commit cannot be made without updating sqlx's `sqlx-data.json`.
The hook is disabled during `nix flake check` runs, so it will not cause issues with a sandbox.
Additionally a `build.rs` script is included to set environment variables for docs.rs builds.