Common pattern of .${stdenv.hostPlatform.system} or (throw "Unsupported platform: ${stdenv.hostPlatform.system}")
should be encapsulated in library function
#314224
Labels
Currently there's a lot of code in Nixpkgs that selectively use a different src/hash/rev/etc. depending on the target system. This is especially common in proprietary software that have different download links for pre-built binaries, for instance, in UT1999, the url and hash are different for each given platform:
Searching through the entire repository, there are 69 occurrences of this pattern, given by running
rg -l '.\$\{stdenv.hostPlatform.system\} or \(throw' | wc -l
.Without the
or (throw
part, it's more like 205 occurrences.In my opinion, this already makes it common enough to justify having a library function that simplifies this.
List of files that feature this pattern
The text was updated successfully, but these errors were encountered: