Skip to content

Commit 58e6d54

Browse files
committed
Nix: Fix --compiler nixpkgs attribute mapping.
1 parent 4d4e8f4 commit 58e6d54

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/Stack/Config/Nix.hs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,8 @@ nixOptsFromMonoid mproject NixOptsMonoid{..} os = do
3838
let mresolver = resolverOverride <|> fmap projectResolver mproject
3939
mcompiler = compilerOverride <|> join (fmap projectCompiler mproject)
4040
in case (mresolver, mcompiler) of
41-
(_, Just (GhcVersion v)) ->
42-
T.filter (== '.') (versionText v)
43-
(Just (ResolverCompiler (GhcVersion v)), _) ->
44-
T.filter (== '.') (versionText v)
41+
(_, Just (GhcVersion v)) -> nixCompilerFromVersion v
42+
(Just (ResolverCompiler (GhcVersion v)), _) -> nixCompilerFromVersion v
4543
(Just (ResolverSnapshot (LTS x y)), _) ->
4644
T.pack ("haskell.packages.lts-" ++ show x ++ "_" ++ show y ++ ".ghc")
4745
_ -> T.pack "ghc"
@@ -50,6 +48,7 @@ nixOptsFromMonoid mproject NixOptsMonoid{..} os = do
5048
return NixOpts{..}
5149
where prefixAll p (x:xs) = p : x : prefixAll p xs
5250
prefixAll _ _ = []
51+
nixCompilerFromVersion v = T.filter (/= '.') $ T.append (T.pack "haskell.compiler.ghc") (versionText v)
5352

5453
-- Exceptions thown specifically by Stack.Nix
5554
data StackNixException

0 commit comments

Comments
 (0)