nix-ros-overlay/build-env/default.nix

31 lines
786 B
Nix
Raw Normal View History

{ lib, stdenv, writeText, buildEnv, catkin, cmake }:
{ paths ? [], ... }@args:
2019-03-21 00:23:14 -04:00
2019-04-06 02:18:37 -04:00
with lib;
2019-03-21 00:23:14 -04:00
let
propagatePackages = drvs: let
validDrvs = filter (d: d != null) drvs;
in if length validDrvs == 0 then []
else unique (validDrvs ++ (propagatePackages (unique (concatLists (catAttrs "propagatedBuildInputs" validDrvs)))));
env = buildEnv (args // {
name = "ros-env";
paths = propagatePackages paths;
ignoreCollisions = true;
2019-03-21 00:23:14 -04:00
passthru.env = stdenv.mkDerivation {
name = "interactive-ros-env";
buildInputs = [ env catkin ];
2019-03-21 00:23:14 -04:00
buildCommand = ''
echo >&2 ""
echo >&2 "*** ROS 'env' attributes are intended for interactive nix-shell sessions, not for building! ***"
echo >&2 ""
exit 1
'';
};
});
2019-03-21 00:23:14 -04:00
in env