{ description = "Wangan Midnight Maximum Tune 6 private server"; inputs = { nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable"; flake-utils.url = "github:numtide/flake-utils"; }; outputs = { self, nixpkgs, flake-utils }: let packages = flake-utils.lib.eachDefaultSystem (system: let pkgs = nixpkgs.legacyPackages."${system}"; inputs = with pkgs; [ pkg-config python3 prisma-engines ]; # This likely sucks ass # https://github.com/prisma/prisma/issues/3026 prismaHook = with pkgs; '' export PRISMA_MIGRATION_ENGINE_BINARY="${prisma-engines}/bin/migration-engine" export PRISMA_QUERY_ENGINE_BINARY="${prisma-engines}/bin/query-engine" export PRISMA_QUERY_ENGINE_LIBRARY="${prisma-engines}/lib/libquery_engine.node" export PRISMA_INTROSPECTION_ENGINE_BINARY="${prisma-engines}/bin/migration-engine" export PRISMA_FMT_BINARY="${prisma-engines}/bin/prisma-fmt" ''; in rec { packages.bayshore = pkgs.buildNpmPackage { pname = "bayshore"; version = "1.0.5"; src = ./.; npmDepsHash = "sha256-7iVoTJv5rvdiUWyhrDOGEboOo1sdQ7YvZOqbgvz/mF8="; nativeBuildInputs = inputs; buildInputs = inputs; preBuild = '' ${prismaHook} # Generate the Prisma client - without this the build'll fail npm run prisma-generate ''; installPhase = '' runHook preInstall mkdir -p $out cp -r dist $out/dist cp -r prisma $out/prisma # SLOW AND TAKES UP TOO MUCH DISK! # THIS IS A MASSIVE BODGE! cp -r node_modules $out/node_modules mkdir -p $out/bin cat > $out/bin/bayshore < $out/bin/prisma <