Add rust-toolchain.toml + shell.nix files.

This makes it easier to start a devshell without using Docker.
This commit is contained in:
Orne Brocaar 2023-05-17 14:46:13 +01:00
parent f32c5eb5af
commit e3383baa02
4 changed files with 23 additions and 7 deletions

View File

@ -40,9 +40,6 @@ RUN apt-get update && \
zlib1g-dev:armhf \
zlib1g-dev:arm64
RUN rustup target add armv7-unknown-linux-gnueabihf
RUN rustup target add aarch64-unknown-linux-gnu
ARG TARGETPLATFORM
RUN mkdir -p /release/$TARGETPLATFORM

View File

@ -30,10 +30,6 @@ RUN apt-get update && \
zlib1g-dev:armhf \
zlib1g-dev:arm64
RUN rustup component add rustfmt clippy
RUN rustup target add armv7-unknown-linux-gnueabihf
RUN rustup target add aarch64-unknown-linux-gnu
RUN cargo install diesel_cli --version 2.0.0 --no-default-features --features postgres
RUN cargo install cargo-deb
RUN cargo install cargo-rpm

8
rust-toolchain.toml Normal file
View File

@ -0,0 +1,8 @@
[toolchain]
channel = "1.68.2"
components = ["rustfmt", "clippy"]
targets = [
"armv7-unknown-linux-gnueabihf",
"aarch64-unknown-linux-gnu",
]
profile = "default"

15
shell.nix Normal file
View File

@ -0,0 +1,15 @@
{ pkgs ? import (fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-22.11.tar.gz") {} }:
pkgs.mkShell {
buildInputs = [
pkgs.cacert
pkgs.rustup
pkgs.protobuf
pkgs.perl
pkgs.cmake
pkgs.clang
pkgs.postgresql
];
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang.lib}/lib";
BINDGEN_EXTRA_CLANG_ARGS = "-I${pkgs.llvmPackages.libclang.lib}/lib/clang/${pkgs.llvmPackages.libclang.version}/include";
}