ocharles/netwire-classics — pull request #4 by cessationoftime (2013-09-22 21:08:10+00:00)
Title: added automatic downloading of ttf font, LD_LIBRARY_PATH wrapper

Hi,
I am trying to learn Haskell, and I wanted a simple game to learn with so I have been playing with your asteroids implementation after seeing your post about it on Reddit (hope you dont mind). And since seeing your build setup I am now learning Nix too.

I ended up modifying default.nix to autodownload, unzip, and save a .ttf file from openfontlibrary.org to the /nix/store. The font is then symlinked to ./result/shared/fonts and an additional dependency system-filepath is then used to locate the .ttf file and use it with the asteroids project. This font is not as good-looking, but it definitely has an open license, and picking a different one from openfontlibrary (or elsewhere) is about as simple as copying a link now.

When I built the program (under NixOS) it couldn't find the gcc library files, so I ended up using Nix's makeWrapper to allow me to attach the needed LD_LIBRARY_PATH env variable to the output.

I also found I had to point the src at the asteroids directory or it would not build when I ran "nix-build", are you using a different command to build?

Chris