File tree Expand file tree Collapse file tree 2 files changed +9
-14
lines changed Expand file tree Collapse file tree 2 files changed +9
-14
lines changed Original file line number Diff line number Diff line change @@ -126,17 +126,15 @@ let
126126 # access to the store is restricted. If origSrc was already in the store
127127 # you can pass the project in as a string.
128128 rawCabalProject =
129- if cabalProject != null
130- then cabalProject + (
131- if cabalProjectLocal != null
132- then ''
133-
134- -- Added from cabalProjectLocal argument to cabalProject
135- ${ cabalProjectLocal }
136- ''
137- else ""
138- )
139- else null ;
129+ # Even if `cabal.project` doesn't exist, `cabal.project.local` is still used by cabal.
130+ # We tested this: https://github.com/input-output-hk/haskell.nix/pull/1588
131+ if cabalProject == null && cabalProjectLocal == null
132+ then null
133+ else (
134+ # like fmap
135+ let f = g : x : if x == null then "" else g x ; in
136+ f ( x : x ) cabalProject + f ( x : "\n -- Added from cabalProjectLocal argument to cabalProject\n ${ x } " ) cabalProjectLocal
137+ ) ;
140138
141139 cabalProjectIndexState =
142140 if rawCabalProject != null
Original file line number Diff line number Diff line change 2626 # Avoid readDir and readFile IFD functions looking for these files in the hackage source
2727 # `mkOverride 1100` means this will be used in preference to the mkOption default,
2828 # but a `mkDefault` can still override this.
29- cabalProject = lib . mkOverride 1100 ''
30- packages: .
31- '' ;
3229 cabalProjectLocal = lib . mkOverride 1100 null ;
3330 cabalProjectFreeze = lib . mkOverride 1100 null ;
3431 src =
You can’t perform that action at this time.
0 commit comments