Would be great to have another packager in the nix/guix family :)
For what its worth, here is what I do on nix: https://github.com/NixOS/nixpkgs/tree/master/pkgs/applications/science/math/sage
Particularly interesting for you right now should be `sagelib.nix` which actually builds the sage library and `sage-src.nix` which prepares the source (applying a bunch of patches). `sage-env.py` and `env-locations.py` define necessary environment variables.
See also: #21785: Installation of SAGE_SRC/ext/ in SAGE_LOCAL/share/sage/ext/ should be done by setup.py, not build/make/Makefile