Ajout d'une flake nix

master
Florent Becker 2022-04-14 15:39:48 +02:00
parent 6bea1ee4a1
commit 0834a86d49
1 changed files with 36 additions and 0 deletions

36
flake.nix Normal file
View File

@ -0,0 +1,36 @@
{
description = "wasm-pack setup";
inputs = {
nixpkgs = { url = "github:nixos/nixpkgs/nixos-unstable"; };
rust-overlay = { url = "github:oxalica/rust-overlay"; };
};
outputs = { nixpkgs, rust-overlay, ... }:
let system = "x86_64-linux";
in {
devShell.${system} = let
pkgs = import nixpkgs {
inherit system;
overlays = [ rust-overlay.overlay ];
};
in (({ pkgs, ... }:
pkgs.mkShell {
buildInputs = with pkgs; [
cargo
cargo-watch
nodejs
wasm-pack
gcc
zlib
webfs
(rust-bin.stable.latest.default.override {
extensions = [ "rust-src" ];
targets = [ "wasm32-unknown-unknown" ];
})
];
shellHook = "";
}) { pkgs = pkgs; });
};
}