From f8dfe861b309f3a26353ce73e331470d07f487b5 Mon Sep 17 00:00:00 2001 From: Christoph Hollizeck Date: Sun, 13 Oct 2024 17:01:33 +0200 Subject: [PATCH] shells: make barebones rust shell and create additional screeps shell --- shells/rust-screeps/default.nix | 35 +++++++++++++++++++++++++++++++++ shells/rust/default.nix | 11 +---------- 2 files changed, 36 insertions(+), 10 deletions(-) create mode 100644 shells/rust-screeps/default.nix diff --git a/shells/rust-screeps/default.nix b/shells/rust-screeps/default.nix new file mode 100644 index 0000000..39b3846 --- /dev/null +++ b/shells/rust-screeps/default.nix @@ -0,0 +1,35 @@ +{ + # Snowfall Lib provides a customized `lib` instance with access to your flake's library + # as well as the libraries available from your flake's inputs. + lib, + # You also have access to your flake's inputs. + inputs, + + # The namespace used for your flake, defaulting to "internal" if not set. + namespace, + + # All other arguments come from NixPkgs. You can use `pkgs` to pull shells or helpers + # programmatically or you may add the named attributes as arguments here. + pkgs, + mkShell, + system, + ... +}: +let + fenix = + with inputs.fenix.packages.${system}; + combine [ + latest.toolchain + targets.wasm32-unknown-unknown.latest.rust-std + ]; +in +mkShell { + # Create your shell + nativeBuildInputs = [ + fenix + pkgs.llvmPackages.bintools + pkgs.wasm-pack + ]; + + CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER = "lld"; +} diff --git a/shells/rust/default.nix b/shells/rust/default.nix index 39b3846..960de8f 100644 --- a/shells/rust/default.nix +++ b/shells/rust/default.nix @@ -16,20 +16,11 @@ ... }: let - fenix = - with inputs.fenix.packages.${system}; - combine [ - latest.toolchain - targets.wasm32-unknown-unknown.latest.rust-std - ]; + fenix = inputs.fenix.packages.${system}.latest.toolchain; in mkShell { # Create your shell nativeBuildInputs = [ fenix - pkgs.llvmPackages.bintools - pkgs.wasm-pack ]; - - CARGO_TARGET_WASM32_UNKNOWN_UNKNOWN_LINKER = "lld"; }