@@ -56,29 +56,33 @@ data BuildInputSpec projectType = BuildInputSpec
5656buildInputsBindings :: HasProjectSuperType t => BuildInputSpec t -> [Binding ]
5757buildInputsBindings spec@ BuildInputSpec {bisNativeNixpkgsPackages} =
5858 catMaybes
59- [ Just $ [nixproperty |buildInputs|] |= foldr (|++) buildInputGroupExpr1 otherBuildInputGroupExprs,
59+ [ case buildInputGroupExprs of
60+ [] -> Nothing
61+ [buildInputGroupExpr1] ->
62+ Just $ [nixproperty |buildInputs|] |= buildInputGroupExpr1
63+ (buildInputGroupExpr1 : otherBuildInputGroupExprs) ->
64+ Just $ [nixproperty |buildInputs|] |= foldr (|++) buildInputGroupExpr1 otherBuildInputGroupExprs,
6065 if null bisNativeNixpkgsPackages
6166 then Nothing
6267 else Just $ [nixproperty |nativeBuildInputs|] |= groupToExpr (BIGNativeNixpkgsInputs bisNativeNixpkgsPackages)
6368 ]
6469 where
65- buildInputGroups :: NonEmpty BuildInputGroup
70+ buildInputGroups :: [ BuildInputGroup ]
6671 buildInputGroups = buildInputGroupsFor spec
6772 groupPackageSets :: Bool
6873 groupPackageSets = length buildInputGroups > 1
6974 groupToExpr :: BuildInputGroup -> Expr
7075 groupToExpr g = (if groupPackageSets && requiresGrouping g then EGrouping else id ) (toNixExpr g)
71- buildInputGroupExpr1 :: Expr
72- otherBuildInputGroupExprs :: [Expr ]
73- (buildInputGroupExpr1 :| otherBuildInputGroupExprs) = groupToExpr <$> buildInputGroups
76+ buildInputGroupExprs :: [Expr ]
77+ buildInputGroupExprs = groupToExpr <$> buildInputGroups
7478
75- buildInputGroupsFor :: HasProjectSuperType t => BuildInputSpec t -> NonEmpty BuildInputGroup
79+ buildInputGroupsFor :: HasProjectSuperType t => BuildInputSpec t -> [ BuildInputGroup ]
7680buildInputGroupsFor BuildInputSpec {.. } =
77- BIGNixpkgs bisNixpkgsPackages
78- :| catMaybes
79- [ if unPreCommitHooksConfig bisPreCommitHooksConfig then Just BIGPreCommitHooks else Nothing ,
80- if projectSuperType bisProjectType == PSTPython then Just BIGPythonPackages else Nothing ,
81- case bisOtherPackages of
82- [] -> Nothing
83- otherPackages -> Just $ BIGOther otherPackages
84- ]
81+ catMaybes
82+ [ if null bisNixpkgsPackages then Nothing else Just ( BIGNixpkgs bisNixpkgsPackages),
83+ if unPreCommitHooksConfig bisPreCommitHooksConfig then Just BIGPreCommitHooks else Nothing ,
84+ if projectSuperType bisProjectType == PSTPython then Just BIGPythonPackages else Nothing ,
85+ case bisOtherPackages of
86+ [] -> Nothing
87+ otherPackages -> Just $ BIGOther otherPackages
88+ ]
0 commit comments