Skip to content

Commit 472a273

Browse files
committed
Add rust-toolchain.toml + shell.nix files.
This makes it easier to start a devshell without using Docker.
1 parent 80a1b1d commit 472a273

File tree

4 files changed

+28
-9
lines changed

4 files changed

+28
-9
lines changed

Dockerfile-devel

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@ RUN apt-get update && \
5454
gcc-aarch64-linux-gnu \
5555
g++-aarch64-linux-gnu
5656

57-
RUN rustup component add rustfmt clippy
58-
RUN rustup target add mips-unknown-linux-musl
59-
RUN rustup target add armv5te-unknown-linux-gnueabi
60-
RUN rustup target add armv7-unknown-linux-gnueabihf
61-
RUN rustup target add aarch64-unknown-linux-gnu
62-
6357
RUN cargo install cargo-bitbake
6458
RUN cargo install cargo-bloat
6559

docker-compose.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ services:
44
volumes:
55
- ./:/chirpstack-mqtt-forwarder
66
- ./.rust/target:/chirpstack-mqtt-forwarder/target
7-
- ./.rust/.cargo/registry/index:/usr/local/cargo/registry/index
8-
- ./.rust/.cargo/registry/cache:/usr/local/cargo/registry/cache
9-
- ./.rust/.cargo/git/db:/usr/local/cargo/git/db
7+
- ./.rust/rustup:/usr/local/rustup
8+
- ./.rust/cargo/registry/index:/usr/local/cargo/registry/index
9+
- ./.rust/cargo/registry/cache:/usr/local/cargo/registry/cache
10+
- ./.rust/cargo/git/db:/usr/local/cargo/git/db
1011
ports:
1112
- "1700:1700/udp"
1213
depends_on:

rust-toolchain.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[toolchain]
2+
channel = "1.68.2"
3+
components = ["rustfmt", "clippy"]
4+
targets = [
5+
"mips-unknown-linux-musl",
6+
"armv5te-unknown-linux-gnueabi",
7+
"armv7-unknown-linux-gnueabihf",
8+
"aarch64-unknown-linux-gnu",
9+
]
10+
profile = "default"

shell.nix

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{ pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-22.11.tar.gz") {} }:
2+
3+
pkgs.mkShell {
4+
buildInputs = [
5+
pkgs.cacert
6+
pkgs.rustup
7+
pkgs.protobuf
8+
pkgs.perl
9+
pkgs.cmake
10+
pkgs.clang
11+
];
12+
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
13+
BINDGEN_EXTRA_CLANG_ARGS = "-I${pkgs.llvmPackages.libclang.lib}/lib/clang/${pkgs.llvmPackages.libclang.version}/include";
14+
}

0 commit comments

Comments
 (0)