Somebody already tested it and said it works, but it would be good if someone could take a look at this PR
As suggested in one of the comments, linking this one here for review/merging:
https://github.com/NixOS/nixpkgs/pull/158098
https://github.com/NixOS/nixpkgs/pull/161713
https://github.com/NixOS/nixpkgs/pull/159666