- Introduction: Garnix enables quick NixOS server deployment by defining on
flake.nix
andgit push
. Their blog post explains deployment steps. The author uses this to set up a web analytics server for the blog. - Web Analytics: Chose Plausible, an open-source self-hosted analytics solution. Set up with NixOS using specific configurations in
hosts/default.nix
, including proxying through nginx and using a PostgreSQL instance. Also uses agenix for secrets. - Secrets: Plausible service requires admin password and keybase secret. Set up safely with agenix as documented in Garnix docs. Requires importing agenix NixOS module and setting up secrets manually.
- Garnix Configuration: Can choose continuous deployment on main branch with
on-branch
type ingarnix.yaml
. Also deploy on pull requests. Configuration nameweb
corresponds to exposed NixOS configuration. - See it live!: After a few hours of traffic, active metrics can be seen. Live at https://analytics.gvolpe.com/gvolpe.com, but signing up via web is disabled by default.
- Persistence: Important aspect of server deployments is state. By default, a new server is provisioned on every commit. Garnix supports persistence via NixOS configuration to keep data available on new deployments. Can consider using Borg for backups.
- Machine: Comes with a FREE NixOS machine accessible via SSH. Has an Intel Xeon CPU with 2 cores and 4Gb RAM, and 40Gb of disk space. Services like Clickhouse and Postgres are running.
- Final words: Garnix is featured again. Considers hosting and continuous deployment simple. It's in beta, so report issues. The author is not affiliated.
- Addendum: Blog-post shared on Hacker News, and metrics increased greatly, a good test for the Plausible server.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。