From 466bf83be399ae38e8f420a5af7fbba04a269399 Mon Sep 17 00:00:00 2001 From: f321x Date: Wed, 5 Jun 2024 10:29:32 +0200 Subject: [PATCH] add nix shell --- .vscode/settings.json | 4 +++- shell.nix | 15 +++++++++++++++ .../coordinator/src/communication/mod.rs | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 shell.nix diff --git a/.vscode/settings.json b/.vscode/settings.json index 70bc39c..3af7e1f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -2,5 +2,7 @@ "rust-analyzer.linkedProjects": [ "taptrade-cli-demo/coordinator/Cargo.toml", "taptrade-cli-demo/trader/Cargo.toml", - ] + ], + "nixEnvSelector.suggestion": true, + "nixEnvSelector.nixFile": "${workspaceFolder}/shell.nix" } \ No newline at end of file diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..71024c5 --- /dev/null +++ b/shell.nix @@ -0,0 +1,15 @@ +{ pkgs ? import {} }: + pkgs.mkShell { + nativeBuildInputs = with pkgs.buildPackages; [ + pkg-config + zlib + openssl + cargo + rustc + rustfmt + gcc + ]; + RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}"; +} + +# For VSCode and Rust Analyzer use the Extension "Nix Environment Selector" \ No newline at end of file diff --git a/taptrade-cli-demo/coordinator/src/communication/mod.rs b/taptrade-cli-demo/coordinator/src/communication/mod.rs index f4e907c..7162661 100755 --- a/taptrade-cli-demo/coordinator/src/communication/mod.rs +++ b/taptrade-cli-demo/coordinator/src/communication/mod.rs @@ -4,7 +4,7 @@ fn index() -> &'static str { "Hello, world!" } - +j #[launch] pub fn webserver() -> Rocket { rocket::build().mount("/", routes![index])