From 352a0be78919f8d6decce0a02a0e5df7ae150773 Mon Sep 17 00:00:00 2001 From: Thomas Zahner Date: Sat, 9 Nov 2024 17:41:20 +0100 Subject: [PATCH] Add Nix shell --- shell.nix | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 shell.nix diff --git a/shell.nix b/shell.nix new file mode 100644 index 000000000..fa7b78072 --- /dev/null +++ b/shell.nix @@ -0,0 +1,27 @@ +/* +based on +https://discourse.nixos.org/t/how-can-i-set-up-my-rust-programming-environment/4501/9 +*/ +let + rust_overlay = import (builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"); + pkgs = import { overlays = [ rust_overlay ]; }; + rustVersion = "latest"; # using a specific version: "1.62.0" + rust = pkgs.rust-bin.stable.${rustVersion}.default.override { + extensions = [ + "rust-src" # for rust-analyzer + "rust-analyzer" # usable by IDEs like zed-editor + ]; + }; +in +pkgs.mkShell { + buildInputs = [ + rust + ] ++ (with pkgs; [ + pkg-config + openssl + # other dependencies + #gtk3 + #wrapGAppsHook + ]); + RUST_BACKTRACE = 1; +}