File tree Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Expand file tree Collapse file tree 1 file changed +6
-14
lines changed Original file line number Diff line number Diff line change @@ -318,18 +318,13 @@ buildDerivationWithContext drvAttrs = do
318318 mHash
319319
320320 -- filter out null values if needed.
321- attrs <-
322- bool
323- (pure drvAttrs)
324- (M. mapMaybe id <$> forM drvAttrs
325- (demandF'
326- (pure . \ case
327- NVConstant NNull -> Nothing
328- value -> pure value
329- )
330- )
321+ attrs <- lift $ if not ignoreNulls
322+ then pure drvAttrs
323+ else M. mapMaybe id <$> forM drvAttrs (
324+ demand >=> \ case
325+ NVConstant NNull -> pure Nothing
326+ value -> pure $ Just value
331327 )
332- ignoreNulls
333328
334329 env <- if useJson
335330 then do
@@ -350,9 +345,6 @@ buildDerivationWithContext drvAttrs = do
350345
351346 -- common functions, lifted to WithStringContextT
352347
353- demandF' :: (NValue t f m -> WithStringContextT m a ) -> NValue t f m -> WithStringContextT m a
354- demandF' f v = join $ lift $ f <$> demand v
355-
356348 fromValue' :: (FromValue a m (NValue' t f m (NValue t f m )), MonadNix e t f m ) => NValue t f m -> WithStringContextT m a
357349 fromValue' = lift . fromValue
358350
You can’t perform that action at this time.
0 commit comments