-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
142 lines (135 loc) · 5.8 KB
/
Copy pathflake.nix
File metadata and controls
142 lines (135 loc) · 5.8 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
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
{
description = "mission10 development environments for workstations";
inputs = {
nix-ros-overlay.url = "github:lopsided98/nix-ros-overlay/master";
nixpkgs.follows = "nix-ros-overlay/nixpkgs"; # Remeber to be in lockstep with the overlay!
rust-overlay.url = "github:oxalica/rust-overlay";
};
outputs = { self, nix-ros-overlay, nixpkgs, rust-overlay }:
nix-ros-overlay.inputs.flake-utils.lib.eachDefaultSystem (system:
let
pkgs = import nixpkgs {
inherit system;
overlays = [
nix-ros-overlay.overlays.default
rust-overlay.overlays.default
];
};
uwbRust = pkgs.rust-bin.stable."1.92.0".default.override {
targets = [
"thumbv7em-none-eabihf"
"aarch64-unknown-linux-gnu"
];
extensions = [ "rust-src" "llvm-tools-preview" ];
};
# PX4<->ROS2 uXRCE-DDS bridge. Not in nixpkgs; pinned to the
# PX4-compatible v2.4.3 (v3.x breaks the client). Built against the
# overlay's Fast-DDS (fastrtps). See nix/microxrce-agent.nix.
microxrceAgent = pkgs.callPackage ./nix/microxrce-agent.nix {
inherit (pkgs.rosPackages.jazzy) fastrtps;
};
in {
devShells = {
# Pure-core development. Runs anywhere, including macOS; mirrors CI.
# Enough to hack on ros/*/ cores, run every test suite, and work on
# models/. Python extras that aren't in nixpkgs (qtm-rt, pyulog)
# live in per-package venvs via uv.
default = pkgs.mkShell {
name = "mission10";
packages = [
pkgs.python3
pkgs.vcstool
pkgs.uv
];
};
# DWM3001CDK software is always built on a workstation. The Pis only
# receive the resulting ELF and run probe-rs/serial tooling.
uwb = pkgs.mkShell {
name = "mission10-uwb";
packages = [
uwbRust
pkgs.cargo-zigbuild
pkgs.cargo-binutils
pkgs.flip-link
pkgs.probe-rs-tools
pkgs.zig
];
};
} // nixpkgs.lib.optionalAttrs pkgs.stdenv.isLinux {
# Hosted VLM review. inference-sdk imports the desktop OpenCV wheel,
# so its dynamic loader needs these libraries even for HTTP-only use.
qwen = pkgs.mkShell {
name = "mission10-qwen";
packages = [
pkgs.ffmpeg
pkgs.python3
pkgs.uv
];
shellHook = ''
export LD_LIBRARY_PATH="${pkgs.lib.makeLibraryPath [
pkgs.glib
pkgs.libglvnd
pkgs.stdenv.cc.cc.lib
pkgs.zlib
]}''${LD_LIBRARY_PATH:+:}''${LD_LIBRARY_PATH:-}"
'';
};
# ROS rim + sim development (Linux only since ros.cachix.org)
#
# nix provides the ENVIRONMENT; colcon builds at the repo root,
# discovering ros/* (incl. the vendored px4_msgs, synced from the
# PX4 fork by scripts/sync_px4_msgs.sh). Artifacts land in gitignored
# build/install/log. Our packages never become nix derivations.
sim = pkgs.mkShell {
name = "mission10-sim";
packages = [
pkgs.colcon
pkgs.vcstool
microxrceAgent # PX4<->ROS2 bridge (MicroXRCEAgent udp4 -p 8888)
# Colcon builds px4_msgs from source; expose its build tools as
# real prefixes instead of only through the aggregate ros-env.
# PX4's top-level Makefile also probes PATH for ninja before
# delegating into its existing CMake/Ninja build directory.
pkgs.ninja
pkgs.rosPackages.jazzy.ament-cmake
pkgs.rosPackages.jazzy.ament-cmake-core
pkgs.rosPackages.jazzy.rosidl-default-generators
pkgs.rosPackages.jazzy.builtin-interfaces
(with pkgs.rosPackages.jazzy; buildEnv {
paths = [
ros-core # rclpy, ros2cli, ament, ...
rmw-cyclonedds-cpp # drone image RMW; needed to talk to the fleet
nav-msgs # gz truth odometry -> sim_truth_ev
vision-msgs # detection wire contract
ros-gz-sim # Gazebo (gz) integration
ros-gz-bridge
# px4_msgs is deliberately NOT here: pinned in
# externals.repos, colcon-built in the workspace so it
# always matches deployed PX4 firmware.
];
})
];
shellHook = ''
export CMAKE_PREFIX_PATH="''${AMENT_PREFIX_PATH}''${CMAKE_PREFIX_PATH:+:}''${CMAKE_PREFIX_PATH:-}"
export QT_QPA_PLATFORM=xcb
# PX4 SITL fork checkout (the fork's flake owns the binary; this
# shell only points at it).
if [ -z "''${PX4_DIR:-}" ]; then
export PX4_DIR="$(cd "$(git rev-parse --show-toplevel 2>/dev/null)/.." 2>/dev/null && pwd)/PX4-Autopilot"
fi
[ -x "$PX4_DIR/build/px4_sitl_default/bin/px4" ] || \
echo "note: no PX4 SITL binary under PX4_DIR=$PX4_DIR (build the fork, or set PX4_DIR)"
'';
# TODO(first sim session):
# - PX4 SITL binary: belongs to the PX4-Autopilot fork's flake,
# not this one. This shell only needs to talk to a running SITL.
# - GUI apps (rviz2, gz gui) on non-NixOS need nixGL or
# nix-system-graphics for GL.
};
};
});
nixConfig = {
extra-substituters = [ "https://ros.cachix.org" ];
extra-trusted-public-keys = [ "ros.cachix.org-1:dSyZxI8geDCJrwgvCOHDoAfOm5sV1wCPjBkKL+38Rvo=" ];
};
}