This draws entirely on the work of github.com/tadfisher, who basically did all the work and almost documented it. Consider this a tutorial in one way to use their stuff. Most significantly, I used tadfisher/android-nixpkgs and was guided by this gist.
This should be usable by:
- Checking it out.
- Producing the update-locks script
- Running the update-locks script in the android package
- Building it.
1% git checkout https://github.com/tmcl/minimal-android-example
2% nix-build -A updateLocks
3% cd ../android
3% ../nix/result/bin/update-locks
3% mv deps.json ../nix
3% cd ../nix
4% nix-build
But it isn't. Different compilations of the same maven packages that use the same name and version but have different SHA224 sums are uploaded to different repos. In order to get the same dependencies from update-locks and the nix script, you might need to reorder the repos in default.nix a few times (and use --keep-going). Eventually it will build.
I show my working in the history of this repo. This may be useful if you want help adding this to your own project.