Skip to content

Commit 2496961

Browse files
Slight modifications to Plan.hs
1 parent 9a4dea1 commit 2496961

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/Cabal2Nix/Plan.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import qualified Data.Text as Text
1515
import Nix.Expr
1616

1717
type Version = Text
18-
type Revision = Text -- Can be: rNUM, cabal file sha256, or "revision"
18+
type Revision = Text -- Can be: rNUM, cabal file sha256, or "default"
1919

2020
data Plan = Plan
2121
{ packages :: HashMap Text Package
@@ -59,11 +59,11 @@ plan2nix (Plan { packages, compilerVersion, compilerPackages }) =
5959
]
6060
where
6161
bind pkg (Package { packageVersion, packageRevision, packageFlags }) =
62-
let verExpr = mkSym "hackage" @. quoted pkg @. quoted packageVersion
63-
revExpr = maybe verExpr ((verExpr @.) . quoted) packageRevision
64-
revBinding = bindPath (quoted pkg :| ["revision"]) revExpr
62+
let verExpr = mkSym "hackage" @. pkg @. quoted packageVersion
63+
revExpr = verExpr @. "revisions" @. maybe "default" quoted packageRevision
64+
revBinding = bindPath (pkg :| ["revision"]) revExpr
6565
flagBindings = Map.foldrWithKey
66-
(\fname val acc -> bindPath (quoted pkg :| ["flags", fname]) (mkBool val) : acc)
66+
(\fname val acc -> bindPath (pkg :| ["flags", fname]) (mkBool val) : acc)
6767
[]
6868
packageFlags
6969
in revBinding : flagBindings

0 commit comments

Comments
 (0)