2. Module system deep dive — nix.dev documentation
In this tutorial you will follow an extensive demonstration of how to wrap an existing API with Nix modules. This tutorial follows @infinisil’s presentation on modules (source) for participants of Summer of Nix 2021. It may help to play it alongside this tutorial to better keep track of changes to the code you will work on. You’ll write modules to interact with the Google Maps API, declaring module options which represent map geometry, location pins, and more. During the tutorial, you will first write some incorrect configurations, creating opportunities to discuss the resulting error messages and how to resolve them, particularly when discussing type checking. You will use two helper scripts for this exercise. Download map.sh and geocode.sh to your working directory. Warning To run the examples in this tutorial, you will need a Google API key in $XDG_DATA_HOME/google-api/key. Write the following into a file called default.nix: We will need some helper functions, which will come from t