File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change 8
8
devshell = let
9
9
in {
10
10
packages = final . shell . nativeBuildInputs
11
+ # Cannot add the whole final.shell.buildInputs list because many collide with each other when fused.
12
+ # So we only add what is really used (by pkg-config):
13
+ ++ map ( p : p . dev or p ) ( lib . concatLists ( lib . concatMap ( p : p . components . library . pkgconfig or [ ] ++ p . components . setup . pkgconfig or [ ] ++ lib . concatMap ( c : lib . concatMap ( a : a . pkgconfig ) ( lib . attrValues c ) ) ( lib . attrValues ( removeAttrs p . components [ "library" "setup" ] ) ) )
14
+ ( lib . attrValues final . pkg-set . config . packages ) ) )
11
15
# devshell does not use pkgs.mkShell / pkgs.stdenv.mkDerivation,
12
16
# so we need to explicit required dependencies which
13
17
# are provided implicitely by stdenv when using the normal shell:
14
18
++ ( lib . filter lib . isDerivation final . shell . stdenv . defaultNativeBuildInputs )
15
19
++ lib . optional final . shell . stdenv . targetPlatform . isGnu final . pkgs . buildPackages . binutils ;
16
- env = lib . mapAttrsToList lib . nameValuePair ( {
20
+ # We need to expose all the necessary env variables:
21
+ env = [
22
+ {
23
+ name = "PKG_CONFIG_PATH" ;
24
+ # devshell fuse every all `packages` into a single directory ($DEVSHELL_DIR), so we use it:
25
+ prefix = "$DEVSHELL_DIR/lib/pkgconfig" ;
26
+ }
27
+ ] ++ lib . mapAttrsToList lib . nameValuePair ( {
17
28
inherit ( final . shell ) NIX_GHC_LIBDIR ;
18
29
# CABAL_CONFIG is only set if the shell was built with exactDeps=true
19
30
} // lib . optionalAttrs ( final . shell ? CABAL_CONFIG ) {
You can’t perform that action at this time.
0 commit comments