Yesterday I also discovered this thread on NixOS bug tracker: https://github.com/NixOS/nixpkgs/pull/156974 They apply the same technique and remove dirtier workaround they had before: https://github.com/NixOS/nixpkgs/pull/153104/files Also, they patch the makefile template instead of source code, which maybe a little cleaner solution than the one I proposed above. -- Best regards, Andrew Tropin