-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathflake.nix
124 lines (119 loc) · 3.83 KB
/
flake.nix
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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
{
inputs = {
nix-ros-overlay.url = "github:lopsided98/nix-ros-overlay/develop";
nixpkgs.follows = "nix-ros-overlay/nixpkgs";
example-parallel-robots = {
url = "github:gepetto/example-parallel-robots";
inputs.nixpkgs.follows = "nixpkgs";
};
toolbox-parallel-robots = {
url = "github:gepetto/toolbox-parallel-robots";
inputs.nixpkgs.follows = "nixpkgs";
};
## Patches for nixpkgs
# init HPP v6.0.0
# also: hpp-fcl v2.4.5 -> coal v3.0.0
patch-hpp = {
url = "https://github.com/nim65s/nixpkgs/pull/2.patch";
flake = false;
};
# hpp-tutorial needs PR2 robot in example-robot-data
# which is available in >= 4.2.0, which landed in master but not yet on nix-ros
patch-example-robot-data = {
url = "https://github.com/NixOS/nixpkgs/pull/363802.patch";
flake = false;
};
# gepetto-viewer has a fix to understand AMENT_PREFIX_PATH in #239/devel
gepetto-viewer = {
url = "github:Gepetto/gepetto-viewer/devel";
inputs.nixpkgs.follows = "nixpkgs";
};
};
outputs =
{ nixpkgs, self, ... }@inputs:
inputs.nix-ros-overlay.inputs.flake-utils.lib.eachDefaultSystem (
system:
let
pkgs = import ./patched-nixpkgs.nix {
inherit nixpkgs system;
overlays = [
inputs.nix-ros-overlay.overlays.default
(_super: prev: {
gepetto-viewer = prev.gepetto-viewer.overrideAttrs {
inherit (inputs.gepetto-viewer.packages.${system}.gepetto-viewer) src;
};
})
];
patches = [
inputs.patch-example-robot-data
inputs.patch-hpp
];
};
in
{
devShells = {
default = pkgs.mkShell {
name = "Gepetto Main Dev Shell";
packages = [
pkgs.colcon
self.packages.${system}.python
self.packages.${system}.ros
];
};
ms = pkgs.mkShell {
name = "Dev Shell for Maxime";
inputsFrom = [ pkgs.python3Packages.crocoddyl ];
packages = [
(pkgs.python3.withPackages (p: [
p.fatrop
p.gepetto-gui
p.ipython
p.matplotlib
p.mim-solvers
p.opencv4
p.pandas
p.proxsuite
p.quadprog
self.packages.${system}.example-parallel-robots
]))
];
shellHook = ''
export PYTHONPATH=${
pkgs.lib.concatStringsSep ":" [
"$PWD/src/cobotmpc"
"$PWD/install/${pkgs.python3.sitePackages}"
"$PYTHONPATH"
]
}
'';
};
};
packages = {
example-parallel-robots =
inputs.example-parallel-robots.packages.${system}.example-parallel-robots.override {
inherit (pkgs.python3Packages) pinocchio;
inherit (self.packages.${system}) toolbox-parallel-robots;
};
toolbox-parallel-robots =
inputs.toolbox-parallel-robots.packages.${system}.toolbox-parallel-robots.override {
inherit (pkgs.python3Packages) pinocchio;
};
python = pkgs.python3.withPackages (p: [
p.crocoddyl
p.gepetto-gui
p.hpp-corba
]);
ros =
with pkgs.rosPackages.humble;
buildEnv {
paths = [
ros-core
turtlesim
pkgs.python3Packages.example-robot-data # for availability in AMENT_PREFIX_PATH
pkgs.python3Packages.hpp-tutorial # for availability in AMENT_PREFIX_PATH
];
};
};
}
);
}