Updated docs.
This commit is contained in:
parent
6eb72c5091
commit
a60ef7d25b
3 changed files with 66 additions and 67 deletions
|
|
@ -105,23 +105,27 @@ docker run -p 8180:8180 \
|
|||
|
||||
## NixOS
|
||||
|
||||
Turnpike builds with `buildGoModule` using the pure-Go SQLite driver (no CGO):
|
||||
Turnpike builds with `buildGoModule` + `buildNpmPackage` (pure-Go SQLite, no CGO). The frontend is built separately and copied into the Go build:
|
||||
|
||||
```nix
|
||||
frontendDist = pkgs.buildNpmPackage {
|
||||
pname = "turnpike-frontend";
|
||||
src = "${src}/frontend";
|
||||
npmDepsHash = "sha256-...";
|
||||
buildPhase = "npm run build";
|
||||
installPhase = "cp -r dist $out";
|
||||
};
|
||||
|
||||
turnpike = pkgs.buildGoModule {
|
||||
pname = "turnpike";
|
||||
version = "0.1.0";
|
||||
src = ./path/to/turnpike; # must include vendor/ and frontend/dist/
|
||||
vendorHash = null;
|
||||
src = fetchgit { url = "..."; rev = "v2.0.0"; hash = "sha256-..."; };
|
||||
vendorHash = "sha256-...";
|
||||
env.CGO_ENABLED = 0;
|
||||
preBuild = "cp -r ${frontendDist} frontend/dist";
|
||||
};
|
||||
```
|
||||
|
||||
The source directory must contain:
|
||||
- Go source files and `vendor/` (run `go mod vendor`)
|
||||
- Pre-built frontend at `frontend/dist/` (run `cd frontend && npm run build`)
|
||||
|
||||
A complete NixOS module example with `DynamicUser`, `StateDirectory`, and agenix secrets is in the project's `homelab/turnpike.nix`.
|
||||
A complete NixOS module with `DynamicUser`, `StateDirectory`, and secrets is in the project's `homelab/turnpike.nix`.
|
||||
|
||||
## Reverse Proxy
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue