website/flake.nix

70 lines
1.8 KiB
Nix
Raw Normal View History

2026-02-20 12:46:05 +00:00
{
description = "Bevy WASM website";
inputs = {
2026-09-14 16:19:58 +00:00
flake-parts.url = "github:hercules-ci/flake-parts";
2026-02-20 12:46:05 +00:00
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
rust-overlay = {
url = "github:oxalica/rust-overlay";
inputs.nixpkgs.follows = "nixpkgs";
};
};
2026-09-28 08:07:38 +00:00
outputs =
inputs@{
flake-parts,
nixpkgs,
rust-overlay,
...
}:
2026-09-14 16:19:58 +00:00
flake-parts.lib.mkFlake { inherit inputs; } {
systems = [
"x86_64-linux"
"aarch64-linux"
"x86_64-darwin"
"aarch64-darwin"
];
2026-09-28 08:07:38 +00:00
perSystem =
{ pkgs, system, ... }:
2026-09-14 16:19:58 +00:00
let
overlays = [ (import rust-overlay) ];
rustPkgs = import nixpkgs {
inherit system overlays;
};
rustToolchain = rustPkgs.rust-bin.fromRustupToolchainFile ./rust-toolchain.toml;
cargoLock = fromTOML (builtins.readFile ./Cargo.lock);
2026-09-28 08:07:38 +00:00
wasmBindgen = pkgs.lib.findFirst (
pkg: pkg.name == "wasm-bindgen"
) (throw "Could not find wasm-bindgen package") cargoLock.package;
wasm-bindgen-cli = pkgs.buildWasmBindgenCli rec {
src = pkgs.fetchCrate {
pname = "wasm-bindgen-cli";
version = wasmBindgen.version;
2026-09-28 08:07:38 +00:00
hash = "sha256-pcecKQd7E8Opw6bkFoE569epUi7gh5qpQF1e5PJY6V8=";
};
cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
inherit src;
inherit (src) pname version;
2026-09-28 08:07:38 +00:00
hash = "sha256-vmUrWVU7kPJJxO5qIVeAkwQyWDELO1Z4Z5gitz2kco8=";
};
};
2026-09-14 16:19:58 +00:00
in
{
devShells.default = pkgs.mkShell {
buildInputs = [
rustToolchain
wasm-bindgen-cli
2026-09-14 16:19:58 +00:00
pkgs.binaryen
pkgs.brotli
pkgs.just
2026-09-28 08:07:38 +00:00
pkgs.watchexec
2026-09-14 16:19:58 +00:00
];
};
2026-02-20 12:46:05 +00:00
};
2026-09-14 16:19:58 +00:00
};
2026-02-20 12:46:05 +00:00
}