Skip to content

Commit 7a3a9ff

Browse files
committed
Update pkgconf-nixpkgs-map.nix
Handle `throw`.
1 parent 365d39b commit 7a3a9ff

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/pkgconf-nixpkgs-map.nix

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ pkgs:
66

77
# Only include derivations that exist in the current pkgs.
88
# This allows us to use this mapping to be used in allPkgConfigWrapper.
9-
# See ./overlas
9+
# See ./overlays
1010
lookupAttrsIn = x: __mapAttrs (_pname: names:
11-
# The first entry is should be used for the version by allPkgConfigWrapper
12-
# so we need it to be present.
13-
if __length names != 0 && x ? ${__head names}
14-
then
15-
pkgs.lib.concatMap (
16-
name: if x ? ${name} then [ x.${name} ] else []) names
17-
else []);
11+
# The first entry is should be used for the version by allPkgConfigWrapper
12+
# so we need it to be present.
13+
with pkgs.lib; optionals (__length names != 0 && x ? ${__head names})
14+
(concatMap
15+
(name: optionals (x ? ${name})
16+
(let p = __tryEval (x.${name}); in optionals p.success p.value))
17+
names));
1818
in lookupAttrsIn pkgs ({
1919
# Based on https://github.com/NixOS/cabal2nix/blob/11c68fdc79461fb74fa1dfe2217c3709168ad752/src/Distribution/Nixpkgs/Haskell/FromCabal/Name.hs#L23
2020

0 commit comments

Comments
 (0)