Turns out the nixpkgs scripts are not consistent in which environment variable they expect to be defined...