244
244
repoResult = pkgs . haskell-nix . haskellLib . parseRepositories
245
245
cabalProjectFileName sha256map inputMap cabal-install nix-tools sourceRepoPackageResult . otherText ;
246
246
247
- extraSourceRepo =
247
+ extraSourceRepo = source :
248
248
let
249
249
src =
250
250
pkgs . evalPackages . runCommand "extra-source-repository-package" {
@@ -253,31 +253,17 @@ let
253
253
mkdir $out
254
254
cd $out
255
255
git init -b minimal
256
- ${
257
- builtins . concatStringsSep "\n " (
258
- pkgs . lib . lists . zipListsWith
259
- ( n : dep : "rsync -a --prune-empty-dirs ${ dep . src } / dep${ builtins . toString n } /" )
260
- ( pkgs . lib . lists . range 0 ( ( builtins . length extraSources ) - 1 ) )
261
- extraSources
262
- )
263
- }
256
+ rsync -a --prune-empty-dirs ${ source . src } / .
264
257
git add --force .
265
258
GIT_COMMITTER_NAME='No One' GIT_COMMITTER_EMAIL= git commit -m "Minimal Repo For Haskell.Nix" --author 'No One <>'
266
259
'' ;
267
260
in {
268
261
fetched = src ;
269
262
location = src ;
270
263
tag = "minimal" ;
271
- subdirs =
272
- builtins . concatLists (
273
- pkgs . lib . lists . zipListsWith
274
- ( n : dep :
275
- builtins . map ( d : "dep${ builtins . toString n } /" + d ) dep . subdirs
276
- )
277
- ( pkgs . lib . lists . range 0 ( ( builtins . length extraSources ) - 1 ) )
278
- extraSources
279
- ) ;
264
+ subdirs = source . subdirs ;
280
265
} ;
266
+ extraSourceRepos = if extraSources == null then [ ] else ( builtins . map extraSourceRepo extraSources ) ;
281
267
282
268
# we need the repository content twice:
283
269
# * at eval time (below to build the fixed project file)
289
275
# and, say, a linux release build job can identify the derivation
290
276
# as built by a darwin builder, and fetch it from a cache
291
277
sourceReposEval = builtins . map ( fetchPackageRepo pkgs . evalPackages . fetchgit ) sourceRepoPackageResult . sourceRepos
292
- ++ pkgs . lib . optional ( extraSources != null ) extraSourceRepo ;
278
+ ++ extraSourceRepos ;
293
279
sourceReposBuild = builtins . map ( x : ( fetchPackageRepo pkgs . fetchgit x ) . fetched ) sourceRepoPackageResult . sourceRepos
294
- ++ pkgs . lib . optional ( extraSources != null ) extraSourceRepo . fetched ;
280
+ ++ ( builtins . map ( x : x . fetched ) extraSourceRepos ) ;
295
281
in {
296
282
sourceRepos = sourceReposBuild ;
297
283
inherit ( repoResult ) repos extra-hackages ;
0 commit comments