mirror of
https://github.com/srid/nixos-config.git
synced 2026-07-16 22:01:33 +08:00
Self-contained reference under
modules/nixos/linux/incus/incus-pet/example/hello-web/ that satisfies
the incus-pet contract in the smallest possible form:
- packages.<sys>.default a darkhttpd wrapper that serves a
one-page index.html, reading HOST/PORT
from the environment
- nixosModules.default services.hello-web.{enable, package,
host, port} + a DynamicUser=true systemd
unit
- nixosModules.incus the deploy contract: services.hello-web
bound to 8080, hostname "hello-web"
Useful as a copy-paste template for new apps. Less moving parts than
the anywhen reference (no bun, no SQLite, no state dir, no e2e tests
to keep green) — just three flake outputs and a static HTML response.
Live-deployed end-to-end on pureintent during this PR's bring-up:
$ incus-pet deploy path:./.../example/hello-web hello-web \
--port 8081 --listen 100.122.32.106
$ curl http://100.122.32.106:8081/
<!doctype html>
<h1>Hello from incus-pet</h1>
Idempotent re-deploy verified (no flags needed — host-port + listen
read back from container metadata; container name auto-detected from
incus.container.hostname).
27 lines
567 B
JSON
Generated
27 lines
567 B
JSON
Generated
{
|
|
"nodes": {
|
|
"nixpkgs": {
|
|
"locked": {
|
|
"lastModified": 1779357205,
|
|
"narHash": "sha256-cCO8aTqss5x9Ky8GWkpY0Hy5fyTZEbtifSUV8QjSzic=",
|
|
"owner": "nixos",
|
|
"repo": "nixpkgs",
|
|
"rev": "f83fc3c307e74bc5fd5adb7eb6b8b13ffd2a36e1",
|
|
"type": "github"
|
|
},
|
|
"original": {
|
|
"owner": "nixos",
|
|
"ref": "nixos-unstable",
|
|
"repo": "nixpkgs",
|
|
"type": "github"
|
|
}
|
|
},
|
|
"root": {
|
|
"inputs": {
|
|
"nixpkgs": "nixpkgs"
|
|
}
|
|
}
|
|
},
|
|
"root": "root",
|
|
"version": 7
|
|
}
|