haskell-language-server: check supportedGhcVersions in assert

This produces a better error message than just returning the error of
the `haskell.packages."ghc${version}"` interpolation.
This commit is contained in:
Profpatsch
2023-11-09 17:27:20 +01:00
parent 2099ebdf59
commit 529cbf1a03
@@ -14,6 +14,16 @@
# See https://haskell-language-server.readthedocs.io/en/latest/troubleshooting.html#static-binaries for more information.
, dynamic ? true
}:
assert
lib.asserts.assertEachOneOf
"supportedGhcVersions"
supportedGhcVersions
(lib.pipe haskell.packages [
lib.attrNames
(lib.filter (lib.hasPrefix "ghc"))
(map (lib.removePrefix "ghc"))
]);
#
# The recommended way to override this package is
#