Skip to content

Commit a640a92

Browse files
committed
feat(nix): Define initial nix dev shell
1 parent dedfcee commit a640a92

File tree

3 files changed

+160
-0
lines changed

3 files changed

+160
-0
lines changed

flake.lock

Lines changed: 100 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

flake.nix

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
inputs = {
3+
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
4+
flake-parts.url = "github:hercules-ci/flake-parts";
5+
fenix = {
6+
url = "github:nix-community/fenix";
7+
inputs.nixpkgs.follows = "nixpkgs";
8+
};
9+
};
10+
11+
outputs =
12+
inputs@{ flake-parts, ... }:
13+
flake-parts.lib.mkFlake { inherit inputs; } {
14+
systems = [ "x86_64-linux" ];
15+
perSystem =
16+
{
17+
pkgs,
18+
inputs',
19+
self',
20+
...
21+
}:
22+
{
23+
24+
devShells.default = import ./shell.nix { inherit pkgs self' inputs'; };
25+
26+
};
27+
};
28+
}

shell.nix

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
pkgs,
3+
self',
4+
inputs',
5+
}:
6+
let
7+
wasm-rust =
8+
with inputs'.fenix.packages;
9+
with latest;
10+
combine [
11+
cargo
12+
rustc
13+
llvm-tools
14+
targets.wasm32-unknown-emscripten.latest.rust-std
15+
];
16+
in
17+
with pkgs;
18+
mkShell {
19+
20+
hardeningDisable = [ "all" ];
21+
22+
packages = [
23+
24+
cargo
25+
wasm-rust
26+
emscripten
27+
binaryen
28+
llvm
29+
rust-analyzer
30+
];
31+
32+
}

0 commit comments

Comments
 (0)