diff --git a/README.md b/README.md index 8a6c559b0b312..628bb764b5ebf 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,54 @@ See [the rustc-dev-guide for more info][sysllvm]. [sysllvm]: https://rustc-dev-guide.rust-lang.org/building/new-target.html#using-pre-built-llvm +In the case of the Nix Package Manager being used, the following shell can be used to install deependencies for users: + +```nix +# Rust User Shell +let + # Unstable Channel | Rolling Release + pkgs = import (fetchTarball("channel:nixpkgs-unstable")) { }; + + packages = with pkgs; [ + pkg-config + rustc + cargo + rustfmt + rust-analyzer + ]; +in +pkgs.mkShell { + buildInputs = packages; +} +``` +In the case of the Nix Package Manager being used, the following shell can be used to install deependencies for contributors: + +```nix +# Rust Contributor Shell +let + # Unstable Channel | Rolling Release + pkgs = import (fetchTarball("channel:nixpkgs-unstable")) { }; + + packages = with pkgs; [ + pkg-config + rustc + cargo + rustfmt + rust-analyzer + python3 + git + libgcc + gnumake + curl + cmake + libstdcxx5 + ]; +in +pkgs.mkShell { + buildInputs = packages; +} +``` ### Building on a Unix-like system #### Build steps diff --git a/nix-shell/rust_contributor_shell.nix b/nix-shell/rust_contributor_shell.nix new file mode 100644 index 0000000000000..5f52dd359cc07 --- /dev/null +++ b/nix-shell/rust_contributor_shell.nix @@ -0,0 +1,23 @@ +# Rust Contributor Shell +let + # Unstable Channel | Rolling Release + pkgs = import (fetchTarball("channel:nixpkgs-unstable")) { }; + + packages = with pkgs; [ + pkg-config + rustc + cargo + rustfmt + rust-analyzer + python3 + git + libgcc + gnumake + curl + cmake + libstdcxx5 + ]; +in +pkgs.mkShell { + buildInputs = packages; +} diff --git a/nix-shell/rust_user_shell.nix b/nix-shell/rust_user_shell.nix new file mode 100644 index 0000000000000..34c033b139b15 --- /dev/null +++ b/nix-shell/rust_user_shell.nix @@ -0,0 +1,16 @@ +# Rust User Shell +let + # Unstable Channel | Rolling Release + pkgs = import (fetchTarball("channel:nixpkgs-unstable")) { }; + + packages = with pkgs; [ + pkg-config + rustc + cargo + rustfmt + rust-analyzer + ]; +in +pkgs.mkShell { + buildInputs = packages; +}