diff --git a/lib/strings.nix b/lib/strings.nix index 39112407c570..ee5a59bdaf80 100644 --- a/lib/strings.nix +++ b/lib/strings.nix @@ -47,7 +47,9 @@ rec { # Construct a library search path (such as RPATH) containing the # libraries for a set of packages, e.g. "${pkg1}/lib:${pkg2}/lib:...". - makeLibraryPath = makeSearchPath "lib"; + makeLibraryPath = pkgs: makeSearchPath "lib" + # try to guess the right output of each pkg + (map (pkg: pkg.lib or (pkg.out or pkg)) pkgs); # Idem for Perl search paths. diff --git a/nixos/modules/config/system-path.nix b/nixos/modules/config/system-path.nix index d22f9ebd1dfd..58ebea1dabc2 100644 --- a/nixos/modules/config/system-path.nix +++ b/nixos/modules/config/system-path.nix @@ -115,7 +115,15 @@ in system.path = pkgs.buildEnv { name = "system-path"; - paths = config.environment.systemPackages; + paths = let + #outputs TODO: make it user-customizable? + pkgOutputFun = pkg: lib.filter (p: p!=null) [ + (pkg.bin or (pkg.out or pkg)) + (pkg.man or null) + (pkg.info or null) + (pkg.doc or null) + ]; + in lib.concatMap pkgOutputFun config.environment.systemPackages; inherit (config.environment) pathsToLink; ignoreCollisions = true; # !!! Hacky, should modularise.