-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflake.nix
More file actions
44 lines (37 loc) · 1.05 KB
/
flake.nix
File metadata and controls
44 lines (37 loc) · 1.05 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
{
description = "ROC development environment";
inputs.nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
in {
devShells.${system}.default = pkgs.mkShell.override {
stdenv = pkgs.stdenvAdapters.keepSystem (pkgs.stdenv);
} {
packages = with pkgs; [
# Build tools
clang
cmake
ninja
gdb
# Rust toolchain
rustc
cargo
rustfmt
rust-analyzer
# nix-ld to keep system libraries accessible
pkgs.nix-ld
];
# Set up Rust environment
shellHook = ''
# Set RUSTUP_HOME to avoid conflicts with system rustup
export RUSTUP_HOME=$(pwd)/.direnv/rustup
# Add Cargo bin directory to PATH
export PATH=$PATH:$(pwd)/target/debug:$(pwd)/target/release
# Source ROS setup
source /opt/ros/jazzy/setup.sh
'';
};
};
}