Has it really been two months?! It’s like the quarter starts and I get sucked into a black hole, never to be heard from again. I’m starting to pick up Real World Haskell again, and I needed reliable documentation without relying on an internet connection, so I spun up a local Hoogle server as a systemd service.
Running Hoogle locally is nothing revolutionary. I followed some great sources. However, I did need more than a few sources, especially to get the systemd stuff worked out, so I’m writing everything down here so it’ll be in one place.
Edit: I was poking around in Twitter and I found my main source. It’s John Wiegley on Lost in Technopolis
Pretty obvious, except we have a choice. We can install with
cabal-install, but I prefer to use
luakitis not exactly required. You can just use your default browser (mine is Chromium), but I like using luakit in this context because I like having an icon and window for Hoogle separate from my main browser.
hoogle.desktopfile is a launcher for Linux GUIs that adhere to the Freedesktop.org standard, so you’ll have an icon in your applications menu and on your dock (where applicable).
This part is just tedious. To make your life easier, I’ll provide a zip archive. Just unpack it and move the
.icondirectory to your home directory.
This archive provides something of a minimal example for creating your own custom icons for Freedesktop.org-compliant environments, so you might peek inside to get an idea for how things work.
hoogle.servicedefines a system daemon that will run Hoogle in the background. We can enable it to run at boot, or we can manually start and stop the service as needed.
Create a system user called
We don’t want our Hoogle server running as root, so we’ll create a special non-login user.
/var/log/hoogleand set ownership and mod rules.
Start and/or enable
If you want the Hoogle daemon to run at system boot, replace
disablewill undo this. If you want to manually start (res. stop) the Hoogle daemon, replace
And, that’s it. Once Hoogle is running as a daemon, you can use then find “Hoogle” in your GUI application launcher and launch it like any other app.