I’m currently using NSQ for a small program, but it’s not packaged on Gentoo. Since NSQ is written in Go, writing an ebuild that fetches all dependencies and builds the final program is not that simple. Fortunately, NSQ developers provide binary packages.

My ebuild, nsq-bin, is available in my personal overlay. I added init files for nsqd, nsqlookupd and nsqadmin so that they run in background, and default configuration files to bind to 127.0.0.1 (NSQ uses 0.0.0.0 by default which is not a good idea in general) and store state in /var/lib/nsq. Additionally, the error output of these three daemons will be redirected to separate files in /var/log/nsq.

While docker seems to be a common way to deploy Go applications these days, this ebuild makes it easy to run NSQ on a Gentoo developement machine such as mine.