From ee669aae8e234bcb4d2e9162682929369a635039 Mon Sep 17 00:00:00 2001 From: Artemis Tosini Date: Tue, 27 Aug 2024 20:01:40 +0000 Subject: [PATCH] shells/rust{,9x}: init --- flake.nix | 2 ++ shells/rust/default.nix | 46 +++++++++++++++++++++++++++++++++++++++ shells/rust9x/default.nix | 46 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 94 insertions(+) create mode 100644 shells/rust/default.nix create mode 100644 shells/rust9x/default.nix diff --git a/flake.nix b/flake.nix index a652dc1..de5338d 100644 --- a/flake.nix +++ b/flake.nix @@ -40,6 +40,8 @@ devShells = forAllSystems (pkgs: { armTrustedFirmware = pkgs.callPackage ./shells/armTrustedFirmware { }; plotter = pkgs.callPackage ./shells/plotter { }; + rust = pkgs.callPackage ./shells/rust { }; + rust9x = pkgs.callPackage ./shells/rust9x { }; ryujinx = pkgs.callPackage ./shells/ryujinx { }; uboot = pkgs.callPackage ./shells/uboot { }; zephyr = pkgs.callPackage ./shells/zephyr { }; diff --git a/shells/rust/default.nix b/shells/rust/default.nix new file mode 100644 index 0000000..880d2e0 --- /dev/null +++ b/shells/rust/default.nix @@ -0,0 +1,46 @@ +{ + binutils, + cacert, + cmake, + curl, + git, + glibc, + lib, + mkShell, + ninja, + nix, + openssl, + patchelf, + pkg-config, + python3, + rustup, + stdenv, +}: + +mkShell { + name = "rustc-dev"; + nativeBuildInputs = [ + binutils + cacert + cmake + curl + git + ninja + nix + patchelf + pkg-config + python3 + rustup + ]; + buildInputs = [ + glibc.out + glibc.static + openssl + ]; + # Avoid creating text files for ICEs. + RUSTC_ICE = "0"; + # Provide `libstdc++.so.6` for the self-contained lld. + LD_LIBRARY_PATH = "${lib.makeLibraryPath [ + stdenv.cc.cc.lib + ]}"; +} diff --git a/shells/rust9x/default.nix b/shells/rust9x/default.nix new file mode 100644 index 0000000..6d8bc3c --- /dev/null +++ b/shells/rust9x/default.nix @@ -0,0 +1,46 @@ +{ + binutils, + cacert, + cmake, + curl, + git, + glibc, + lib, + mkShell, + ninja, + nix, + openssl, + patchelf, + pkg-config, + python3, + rustup, + clangStdenv, +}: + +(mkShell.override { stdenv = clangStdenv; }) { + name = "rustc-win9x-dev"; + nativeBuildInputs = [ + binutils + cacert + cmake + curl + git + ninja + nix + patchelf + pkg-config + python3 + rustup + ]; + buildInputs = [ + glibc.out + glibc.static + openssl + ]; + # Avoid creating text files for ICEs. + RUSTC_ICE = "0"; + # Provide `libstdc++.so.6` for the self-contained lld. + LD_LIBRARY_PATH = "${lib.makeLibraryPath [ + clangStdenv.cc.cc.lib + ]}"; +}