From 1415d16a128192605f03df0fea2bc4b90f4da462 Mon Sep 17 00:00:00 2001 From: Igor Brylyov Date: Tue, 10 Jan 2023 15:42:12 +0300 Subject: [PATCH] Flake for ROS xacro --- flake.lock | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++++- flake.nix | 43 +++++++++++++++++++++++----------- 2 files changed, 97 insertions(+), 15 deletions(-) diff --git a/flake.lock b/flake.lock index 5a28b7d..0d2ccc8 100644 --- a/flake.lock +++ b/flake.lock @@ -1,5 +1,35 @@ { "nodes": { + "flake-utils": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "flake-utils_2": { + "locked": { + "lastModified": 1667395993, + "narHash": "sha256-nuEHfE/LcWyuSWnS8t12N1wc105Qtau+/OdUAjtQ0rA=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "5aed5285a952e0b949eb3ba02c12fa4fcfef535f", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, "nixpkgs": { "locked": { "lastModified": 1670498129, @@ -16,9 +46,46 @@ "type": "github" } }, + "nixpkgs_2": { + "locked": { + "lastModified": 1668192777, + "narHash": "sha256-C/koqhRmkV2hRCENfDUAK6HP7HTDwLAmhyP5QOy1jtI=", + "owner": "lopsided98", + "repo": "nixpkgs", + "rev": "cb892295b6674f6d942ce78df3a27f2f219972e0", + "type": "github" + }, + "original": { + "owner": "lopsided98", + "ref": "nix-ros", + "repo": "nixpkgs", + "type": "github" + } + }, "root": { "inputs": { - "nixpkgs": "nixpkgs" + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs", + "ros-flake": "ros-flake" + } + }, + "ros-flake": { + "inputs": { + "flake-utils": "flake-utils_2", + "nixpkgs": "nixpkgs_2" + }, + "locked": { + "lastModified": 1670693373, + "narHash": "sha256-bN57G4pVApAVIZqCtflto8v7vArnMwLEAger2N8FCG0=", + "owner": "lopsided98", + "repo": "nix-ros-overlay", + "rev": "795e67fe0e19118cef94209e4470edc64f13df93", + "type": "github" + }, + "original": { + "owner": "lopsided98", + "repo": "nix-ros-overlay", + "type": "github" } } }, diff --git a/flake.nix b/flake.nix index cb7200a..f0c19d4 100644 --- a/flake.nix +++ b/flake.nix @@ -1,19 +1,34 @@ { - description = " Computer Graphics Overlay"; - inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; - outputs = { self, nixpkgs }: let + description = "Nix Robossembler Overlay"; + inputs = { + nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; + flake-utils.url = "github:numtide/flake-utils"; + ros-flake.url = "github:lopsided98/nix-ros-overlay"; + }; + + outputs = { self, nixpkgs, ros-flake, flake-utils }: let systems = [ "x86_64-linux" - "i686-linux" - "x86_64-darwin" - "aarch64-linux" - "armv6l-linux" - "armv7l-linux" ]; forAllSystems = f: nixpkgs.lib.genAttrs systems (system: f system); - in { - packages = forAllSystems (system: import ./default.nix { - pkgs = import nixpkgs { inherit system; }; - }); - }; -} + nixpkgsFor = forAllSystems (system: + import nixpkgs { + inherit system; + overlays = [ self.overlay ]; + }); + in + flake-utils.lib.eachDefaultSystem + (system: + let pkgs = nixpkgs.legacyPackages.${system}; in + { + devShells.default = + let + pkgs = import nixpkgs { inherit system; }; + ros = ros-flake.legacyPackages.${system}.rolling; + in pkgs.mkShell { + buildInputs = with ros; [ ros2run rmw-fastrtps-dynamic-cpp xacro ]; + RMW_IMPLEMENTATION = "rmw_fastrtps_dynamic_cpp"; + }; + } + ); +} \ No newline at end of file