I just wrote up the process of setting up self-hosted website analytics for NixOS for my personal blog: Enabling self-hosted website analytics with NixOS - Joseph Long
Feedback and suggestions would be welcome It proved to be trickier than anticipated thanks to the deprecation of the legacy GeoLite databases (and corresponding geoip nginx plugin, updater script included in NixOS, etc.)