From 55989d7ac8a3650a084d82dc65f75c6aa2a36554 Mon Sep 17 00:00:00 2001 From: jaschutte <34577095+jaschutte@users.noreply.github.com> Date: Mon, 4 Aug 2025 09:54:15 +0000 Subject: [PATCH] Expose all supported GHC versions (#2987) Right now the only default GHC version gets exported by the flake. This means that libraries wanting to use the clash-compiler flake realistically can only support the default GHC version. If someone wants to use any of the other supported versions, that would work fine for clash-compiler, but it wouldn't trickle down to the libraries (which are stuck with the default ghc version). Graphs visualizing the issue: If you want to develop with the default version (ghc9101) ``` myprogram => ghc9101 |- clash-compiler => ghc9101 \- clash-protocols => ghc9101 |- clash-compiler => ghc9101 \- circuit-notation => ghc9101 \- clash-compiler => ghc9101 ``` With a non-default, but supported version (ghc964) ``` myprogram => ghc964 |- clash-compiler => ghc964 \- clash-protocols => ghc9101 |- clash-compiler => ghc9101 \- circuit-notation => ghc9101 \- clash-compiler => ghc9101 ``` (cherry picked from commit 6a0810496560e2ff2a0071f315afb573c12bba39) --- flake.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/flake.nix b/flake.nix index c6f6284112..012806b7b2 100644 --- a/flake.nix +++ b/flake.nix @@ -83,6 +83,10 @@ in assert pkgs.lib.asserts.assertOneOf "defaultGhcVersion" defaultGhcVersion ghcVersions; { + # Export the variable so that other flakes can use it. + ghcVersion = defaultGhcVersion; + supportedGhcVersions = ghcVersions; + packages = { inherit (pkgs."clashPackages-${defaultGhcVersion}") clash-benchmark