aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoris2021-02-13 19:59:56 +0100
committerJoris2021-02-13 19:59:56 +0100
commit95c70591ffd4f35bbc27e1d5f787d896150b5fff (patch)
tree8bc122d93d76e3ff5ad9a2be586c1a3d1c7f5482
parent492d1f0c93d559ab275ecd7974b156b93d395ac3 (diff)
downloadgame-of-life-95c70591ffd4f35bbc27e1d5f787d896150b5fff.tar.gz
game-of-life-95c70591ffd4f35bbc27e1d5f787d896150b5fff.tar.bz2
game-of-life-95c70591ffd4f35bbc27e1d5f787d896150b5fff.zip
Update dev tooling
-rw-r--r--shell.nix29
-rwxr-xr-xwatch12
2 files changed, 26 insertions, 15 deletions
diff --git a/shell.nix b/shell.nix
index 45261c8..a8f2db4 100644
--- a/shell.nix
+++ b/shell.nix
@@ -1,17 +1,30 @@
-with import <nixpkgs> {};
+with import (builtins.fetchGit {
+ name = "nixpkgs-20.09";
+ url = "git@github.com:nixos/nixpkgs.git";
+ rev = "cd63096d6d887d689543a0b97743d28995bc9bc3";
+ ref = "refs/tags/20.09";
+}) {};
-let unstable = import (
- fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz
- ) {};
-in
+let nixpkgs-mozilla = fetchFromGitHub {
+ owner = "mozilla";
+ repo = "nixpkgs-mozilla";
+ # commit from 2020-10-28
+ rev = "8c007b60731c07dd7a052cce508de3bb1ae849b4";
+ sha256 = "1zybp62zz0h077zm2zmqs2wcg3whg6jqaah9hcl1gv4x8af4zhs6";
+}; in
+
+with import "${nixpkgs-mozilla.out}/rust-overlay.nix" pkgs pkgs;
mkShell {
buildInputs = [
- entr
+ ((rustChannelOf { channel = "1.49.0"; }).rust.override {
+ targets = [ "wasm32-unknown-unknown" ];
+ })
+ psmisc # fuser
gzip
python3
- rustup
- unstable.binaryen
+ binaryen
wasm-pack
+ watchexec
];
}
diff --git a/watch b/watch
index 802c503..fd9f3bb 100755
--- a/watch
+++ b/watch
@@ -1,13 +1,11 @@
#!/usr/bin/env bash
+set -euo pipefail
python -m http.server --directory public 8000 &
trap "fuser -k 8000/tcp" EXIT
-CMD="clear && wasm-pack build --target web"
-
-while true; do
-
- find src | entr -d -s "$CMD"
-
-done
+watchexec \
+ --clear \
+ --watch src \
+ "wasm-pack build --target web"