diff options
| author | Kevin J Hoerr <kjhoerr@protonmail.com> | 2024-11-01 18:06:05 -0400 |
|---|---|---|
| committer | Kevin Hoerr <kjhoerr@submelon.tech> | 2024-11-01 18:31:40 -0400 |
| commit | f879f438007f6e6d44dfdd0de970556acabe9ad0 (patch) | |
| tree | 5cfe46966b7235b9d92621f501950d479ce462e2 | |
| parent | 909cf65c97ef2ec56090559293f6619dbd1e9f1f (diff) | |
| download | august-offensive-f879f438007f6e6d44dfdd0de970556acabe9ad0.tar.gz august-offensive-f879f438007f6e6d44dfdd0de970556acabe9ad0.tar.bz2 august-offensive-f879f438007f6e6d44dfdd0de970556acabe9ad0.zip | |
shell.nix: Provide development environment using Nix
| -rw-r--r-- | shell.nix | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/shell.nix b/shell.nix new file mode 100644 index 0000000..9af70c0 --- /dev/null +++ b/shell.nix @@ -0,0 +1,33 @@ +# diesel min version is 1.77.2 +let + rust_overlay = import (builtins.fetchTarball "https://github.com/oxalica/rust-overlay/archive/master.tar.gz"); + pkgs = import <nixpkgs> { overlays = [ rust_overlay ]; }; + rustVersion = "1.81.0"; + rust = pkgs.rust-bin.stable.${rustVersion}.default.override { + extensions = [ + "rust-src" # for rust-analyzer + "rust-analyzer" + ]; + }; +in +pkgs.mkShell { + buildInputs = [ + rust + ] ++ (with pkgs; [ + pkg-config + openssl + postgresql + rustfmt + cargo + gcc + clippy + llvmPackages.bintools + ]); + RUST_BACKTRACE = 1; + + # Certain Rust tools won't work without this + # This can also be fixed by using oxalica/rust-overlay and specifying the rust-src extension + # See https://discourse.nixos.org/t/rust-src-not-found-and-other-misadventures-of-developing-rust-on-nixos/11570/3?u=samuela. for more details. + RUST_SRC_PATH = "${pkgs.rust.packages.stable.rustPlatform.rustLibSrc}"; + PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig"; +}
\ No newline at end of file |
