Unfortunately this duplicates some code from NixOS but it does allow much more flexibility and, hopefully, stability in the Home Manager documentation. Fixes #254.