add nix shell

This commit is contained in:
f321x
2024-06-05 10:29:32 +02:00
parent 55fe8f80e2
commit 466bf83be3
3 changed files with 19 additions and 2 deletions

View File

@ -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"
}

15
shell.nix Normal file
View File

@ -0,0 +1,15 @@
{ pkgs ? import <nixpkgs> {} }:
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"

View File

@ -4,7 +4,7 @@
fn index() -> &'static str {
"Hello, world!"
}
j
#[launch]
pub fn webserver() -> Rocket<build> {
rocket::build().mount("/", routes![index])