From 4e05a1caca17a5d97e38dfb3fca3c2e6e56502ed Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Fri, 31 Mar 2023 15:55:46 +0200 Subject: [PATCH] Refactor examples to allow passing pkgs as an argument This will be useful in the next commit, where we integrate the example into flake.nix. --- examples/ros2-basic.nix | 3 ++- examples/turtlebot3-gazebo.nix | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/ros2-basic.nix b/examples/ros2-basic.nix index 3d64865d69..e9dcd82c28 100755 --- a/examples/ros2-basic.nix +++ b/examples/ros2-basic.nix @@ -1,6 +1,7 @@ # Environment containing basic ROS2 tools -with import ../. {}; +{ pkgs ? import ../. {} }: +with pkgs; with rosPackages.humble; mkShell { diff --git a/examples/turtlebot3-gazebo.nix b/examples/turtlebot3-gazebo.nix index a8c1c7f48e..49c30f1511 100755 --- a/examples/turtlebot3-gazebo.nix +++ b/examples/turtlebot3-gazebo.nix @@ -2,7 +2,8 @@ # roslaunch turtlebot3_gazebo turtlebot3_world.launch # roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch -with import ../. {}; +{ pkgs ? import ../. {} }: +with pkgs; with rosPackages.noetic; with pythonPackages;