Compare commits

..

No commits in common. "4fc026d14d813dda91bd619140f8c080f909a075" and "b0ee932e770a72947660e9e2311aba88cdc1324c" have entirely different histories.

View file

@ -10,32 +10,24 @@
let let
apps = [ "main" "events" "wallet" "chat" "market" "forum" "tasks" "restaurant" "libra" ]; apps = [ "main" "events" "wallet" "chat" "market" "forum" "tasks" "restaurant" "libra" ];
# Use this flake's pinned nixpkgs for the build, regardless of which
# nixpkgs the consumer's `pkgs` is from. Without this, the pnpmDeps
# hash drifts as soon as a consumer's nixpkgs has a different
# pnpm_10 minor version (snapshots are byte-for-byte different per
# pnpm version). Only `pkgs`'s system attribute is honored.
flakePkgsFor = pkgs: import nixpkgs {
inherit (pkgs.stdenv.hostPlatform) system;
};
mkWebapp = { pkgs, brandDir ? ./branding/default, app ? "main" }: mkWebapp = { pkgs, brandDir ? ./branding/default, app ? "main" }:
let let
buildScript = if app == "main" then "build" else "build:${app}"; buildScript = if app == "main" then "build" else "build:${app}";
outDir = if app == "main" then "dist" else "dist-${app}"; outDir = if app == "main" then "dist" else "dist-${app}";
flakePkgs = flakePkgsFor pkgs;
in in
flakePkgs.stdenv.mkDerivation (finalAttrs: { pkgs.stdenv.mkDerivation (finalAttrs: {
pname = "aio-webapp-${app}"; pname = "aio-webapp-${app}";
version = "0.0.0"; version = "0.0.0";
src = ./.; src = ./.;
# pnpm comes from THIS flake's pinned nixpkgs (via flakePkgs), # Pin pnpm major version (10.x) regardless of consumer's nixpkgs
# never the consumer's, so the pnpmDeps snapshot is stable. # so the pnpmDeps hash stays stable for downstream callers that
pnpm = flakePkgs.pnpm_10; # bring their own pkgs. package.json's packageManager field
# declares pnpm@10.33.0; pnpm_10 satisfies that.
pnpm = pkgs.pnpm_10;
pnpmDeps = flakePkgs.fetchPnpmDeps { pnpmDeps = pkgs.fetchPnpmDeps {
inherit (finalAttrs) pname version src; inherit (finalAttrs) pname version src;
inherit (finalAttrs) pnpm; inherit (finalAttrs) pnpm;
fetcherVersion = 3; fetcherVersion = 3;
@ -43,16 +35,16 @@
}; };
nativeBuildInputs = [ nativeBuildInputs = [
flakePkgs.nodejs pkgs.nodejs
finalAttrs.pnpm finalAttrs.pnpm
flakePkgs.pnpmConfigHook pkgs.pnpmConfigHook
flakePkgs.autoPatchelfHook pkgs.autoPatchelfHook
]; ];
# sharp's prebuilt libvips binaries (under @img/sharp-libvips-*) # sharp's prebuilt libvips binaries (under @img/sharp-libvips-*)
# are dynamically linked; autoPatchelfHook needs the runtime libs. # are dynamically linked; autoPatchelfHook needs the runtime libs.
buildInputs = [ buildInputs = [
flakePkgs.stdenv.cc.cc.lib pkgs.stdenv.cc.cc.lib
]; ];
# Brand kit env knobs read by vite-branding.ts and # Brand kit env knobs read by vite-branding.ts and
@ -80,7 +72,7 @@
runHook postInstall runHook postInstall
''; '';
meta = with flakePkgs.lib; { meta = with pkgs.lib; {
description = "AIO webapp${if app == "main" then "" else " (${app} standalone)"}"; description = "AIO webapp${if app == "main" then "" else " (${app} standalone)"}";
homepage = "https://git.atitlan.io/aiolabs/webapp"; homepage = "https://git.atitlan.io/aiolabs/webapp";
license = licenses.mit; license = licenses.mit;