Skip to content
This repository has been archived by the owner on Aug 27, 2024. It is now read-only.

Commit

Permalink
build(nix): add Rust to default shell
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Volosatovs <roman@profian.com>
  • Loading branch information
rvolosatovs committed Sep 6, 2022
1 parent b3748da commit 53b7a23
Showing 1 changed file with 17 additions and 25 deletions.
42 changes: 17 additions & 25 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
codex = final: prev: let
rust = with fenix.packages.${final.system};
combine [
stable.rustc
stable.cargo
stable.rustc
targets.wasm32-wasi.stable.rust-std
];

Expand Down Expand Up @@ -340,47 +340,39 @@
;
};

devShells =
devShells = let
rust = with pkgs.fenix;
combine [
stable.cargo
stable.clippy
stable.rustc
stable.rustfmt
targets.wasm32-wasi.stable.rust-std
];
in
{
default = pkgs.mkShell {
buildInputs = [
enarx.packages.${system}.enarx-static

rust
];
};

rust = devShells.default.overrideAttrs (attrs: let
rust = with pkgs.fenix;
combine [
stable.rustc
stable.cargo
targets.wasm32-wasi.stable.rust-std
];
in {
buildInputs =
attrs.buildInputs
++ [
rust
];
rust = devShells.default.overrideAttrs (attrs: {
buildInputs = attrs.buildInputs ++ [rust];
});
}
// pkgs.lib.optionalAttrs (!pkgs.tinygo.meta.broken) {
# NOTE: TinyGo is broken on some platforms, only add Go shell on platforms where it works
go = devShells.default.overrideAttrs (attrs: {
buildInputs =
attrs.buildInputs
++ [
pkgs.tinygo
];
buildInputs = attrs.buildInputs ++ [pkgs.tinygo];
});
}
// pkgs.lib.optionalAttrs (!pkgs.zig.meta.broken) {
# NOTE: Zig is broken on some platforms, only add Zig shell on platforms where it works
zig = devShells.default.overrideAttrs (attrs: {
buildInputs =
attrs.buildInputs
++ [
pkgs.zig
];
buildInputs = attrs.buildInputs ++ [pkgs.zig];
});
};
in {
Expand Down

0 comments on commit 53b7a23

Please sign in to comment.