{
  description = "reidlab.online";

  inputs = {
    flake-utils.url = "github:numtide/flake-utils";
    nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
  };

  outputs = { self, nixpkgs, flake-utils }:
    flake-utils.lib.eachDefaultSystem (system:
      let
        pkgs = import nixpkgs {
          inherit system;
        };
        package = builtins.fromJSON (builtins.readFile ./package.json);
      in
      rec {
        packages = flake-utils.lib.flattenTree {
          reidlab-online = pkgs.buildNpmPackage {
            pname = package.name;
            inherit (package) version;

            # uncomment this and let the build fail, then get the current hash
            # very scuffed but endorsed!
            #npmDepsHash = "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
            npmDepsHash = "sha256-aPRFARC1WJsH1NIrm9OmBv/bH9ME1K4apfWqbA+VPf4=";
            
            installPhase = ''
              mkdir -p $out
              mv ./dist/* $out/
            '';

            src = ./.;
          };
        };

        defaultPackage = packages.reidlab-online;

        devShells.default = pkgs.mkShell {
          packages = with pkgs; [
            nodejs
            nodePackages.npm
          ];
        };
  });
}