From 11dacc8405a2967f787f5869aa40d7558f5073a6 Mon Sep 17 00:00:00 2001 From: "J.A.A.Tsimouris" Date: Tue, 19 Sep 2023 17:30:43 +0300 Subject: [PATCH 1/7] nix-shell documentation --- README.md | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/README.md b/README.md index 8a6c559b0b312..48e9b3b92e858 100644 --- a/README.md +++ b/README.md @@ -75,7 +75,55 @@ 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 Contributor 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 users: + +```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 + libstc + libstdc++5 + ]; +in +pkgs.mkShell { + buildInputs = packages; +} +``` ### Building on a Unix-like system #### Build steps From f140d1cd8236582540ead3264a99fc7ca54e31ab Mon Sep 17 00:00:00 2001 From: "J.A.A.Tsimouris" Date: Tue, 19 Sep 2023 17:33:41 +0300 Subject: [PATCH 2/7] Create rust_user_shell.nix --- nix-shell/rust_user_shell.nix | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 nix-shell/rust_user_shell.nix 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; +} From 4f903d0107441bcba6553226e0e0399ab031dd58 Mon Sep 17 00:00:00 2001 From: "J.A.A.Tsimouris" Date: Tue, 19 Sep 2023 17:34:37 +0300 Subject: [PATCH 3/7] Create rust_contributor_shell.nix --- nix-shell/rust_contributor_shell.nix | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 nix-shell/rust_contributor_shell.nix diff --git a/nix-shell/rust_contributor_shell.nix b/nix-shell/rust_contributor_shell.nix new file mode 100644 index 0000000000000..75fb03b8e5c35 --- /dev/null +++ b/nix-shell/rust_contributor_shell.nix @@ -0,0 +1,24 @@ +# 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 + libstc + libstdc++5 + ]; +in +pkgs.mkShell { + buildInputs = packages; +} From 452e3365550f09b2ce44758c7ce6481dcb71a3ea Mon Sep 17 00:00:00 2001 From: "J.A.A.Tsimouris" Date: Tue, 19 Sep 2023 17:35:02 +0300 Subject: [PATCH 4/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 48e9b3b92e858..e496fd9828809 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ See [the rustc-dev-guide for more info][sysllvm]. In the case of the Nix Package Manager being used, the following shell can be used to install deependencies for users: ```nix -# Rust Contributor Shell +# Rust User Shell let # Unstable Channel | Rolling Release pkgs = import (fetchTarball("channel:nixpkgs-unstable")) { }; From ef006c597684aaaf37db63f57a533ec3e5f49afa Mon Sep 17 00:00:00 2001 From: "J.A.A.Tsimouris" Date: Tue, 19 Sep 2023 17:43:38 +0300 Subject: [PATCH 5/7] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e496fd9828809..fc235b8f07041 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ pkgs.mkShell { } ``` -In the case of the Nix Package Manager being used, the following shell can be used to install deependencies for users: +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 From 3ba74e5b7c6a39ee95ffbaaad5f4c92820731ef2 Mon Sep 17 00:00:00 2001 From: "J.A.A.Tsimouris" Date: Tue, 19 Sep 2023 18:27:53 +0300 Subject: [PATCH 6/7] Update README.md --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index fc235b8f07041..628bb764b5ebf 100644 --- a/README.md +++ b/README.md @@ -116,8 +116,7 @@ let gnumake curl cmake - libstc - libstdc++5 + libstdcxx5 ]; in pkgs.mkShell { From 9fed7922740f8de8bd0643b9bf72e9fa327b4a39 Mon Sep 17 00:00:00 2001 From: "J.A.A.Tsimouris" Date: Tue, 19 Sep 2023 18:28:17 +0300 Subject: [PATCH 7/7] Update rust_contributor_shell.nix --- nix-shell/rust_contributor_shell.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/nix-shell/rust_contributor_shell.nix b/nix-shell/rust_contributor_shell.nix index 75fb03b8e5c35..5f52dd359cc07 100644 --- a/nix-shell/rust_contributor_shell.nix +++ b/nix-shell/rust_contributor_shell.nix @@ -15,8 +15,7 @@ let gnumake curl cmake - libstc - libstdc++5 + libstdcxx5 ]; in pkgs.mkShell {