Repository navigation
Expand file tree
/
Copy pathflake.nix
More file actions
65 lines (58 loc) · 2.59 KB
/
Copy pathflake.nix
File metadata and controls
65 lines (58 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
{
description = "ROS overlay for the Nix package manager";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
rosdistro = { url = "github:ros/rosdistro"; flake = false; };
};
outputs = { self, nixpkgs, flake-utils, rosdistro }:
with nixpkgs.lib;
with flake-utils.lib;
eachSystem systems.flakeExposed (system: let
pkgs = import nixpkgs {
inherit system;
overlays = [ self.overlays.default ];
};
exampleForDistro = exampleName: rosDistro:
nameValuePair "example-${exampleName}-${rosDistro}" (
import ./examples/${exampleName}.nix { inherit pkgs rosDistro; }
);
inherit (pkgs.rosPackages.lib) distroNames;
in {
legacyPackages = (intersectAttrs (self.overlays.default null pkgs) pkgs)
// pkgs.rosPackages; # for backward compatibility
packages.update-overlay = pkgs.callPackage ./maintainers/scripts/update-overlay.nix {
inherit rosdistro;
};
devShells = {
example-ros2-basic = import ./examples/ros2-basic.nix { inherit pkgs; };
example-ros2-desktop = import ./examples/ros2-desktop.nix { inherit pkgs; };
example-ros2-desktop-full = import ./examples/ros2-desktop-full.nix { inherit pkgs; };
example-ros2-gz = self.devShells.${system}.example-ros2-gz-jazzy;
example-ros2-turtlebot4-gz = import ./examples/ros2-turtlebot4-gz.nix { inherit pkgs; };
# Development environment for the custom GitHub action
nix-ros-build-action = pkgs.callPackage ./.github/actions/nix-ros-build-action/shell.nix { };
}
// (genAttrs' [ "jazzy" "kilted" "lyrical" "rolling" ] (exampleForDistro "ros2-gz"))
// (genAttrs' distroNames (exampleForDistro "ros2-desktop"))
// (genAttrs' distroNames (exampleForDistro "ros2-desktop-full"))
;
}) // {
overlays.default = import ./overlay.nix;
nixosModules.default = ./modules;
overlay = nixpkgs.lib.warn
"'nix-ros-overlay.overlay' is deprecated, use 'nix-ros-overlay.overlays.default' instead"
self.overlays.default;
nixosModule = nixpkgs.lib.warn
"'nix-ros-overlay.nixosModule' is deprecated, use 'nix-ros-overlay.nixosModules.default' instead"
self.nixosModules.default;
templates.default = {
path = ./examples/flake;
description = "Basic ROS flake";
};
};
nixConfig = {
extra-substituters = [ "https://ros.cachix.org" ];
extra-trusted-public-keys = [ "ros.cachix.org-1:dSyZxI8geDCJrwgvCOHDoAfOm5sV1wCPjBkKL+38Rvo=" ];
};
}