From a0c2dc3771c59b670d28890603687073a7004965 Mon Sep 17 00:00:00 2001 From: Max Date: Sun, 28 Aug 2022 23:14:37 +0200 Subject: [PATCH] packages/excalidraw: init at 0.12.0 (#30) * packages/excalidraw: init at 0.12.0 * packages/excalidraw: fix build * packages/excalidraw: build without sentry * packages/excalidraw: disable analytics * packages/excalidraw: add webroot attr --- .../dream2nix-overrides/nodejs/default.nix | 21 +++++++++++++++++++ packages/projects.nix | 8 +++++++ packages/sources/sources.json | 14 +++++++++++++ 3 files changed, 43 insertions(+) diff --git a/packages/dream2nix-overrides/nodejs/default.nix b/packages/dream2nix-overrides/nodejs/default.nix index 31afd6e..5e39d95 100644 --- a/packages/dream2nix-overrides/nodejs/default.nix +++ b/packages/dream2nix-overrides/nodejs/default.nix @@ -16,6 +16,27 @@ let in { + excalidraw.build = { + REACT_APP_DISABLE_SENTRY = "true"; + REACT_APP_FIREBASE_CONFIG = ""; + REACT_APP_GOOGLE_ANALYTICS_ID = ""; + + + nativeBuildInputs = [ pkgs.yarn ]; + + installPhase = '' + distRoot=$out/share/www + dist=$distRoot/excalidraw + mkdir -p $distRoot + mv $out/lib/node_modules/excalidraw/build $dist + chmod +w -R $out/lib + rm -rf $out/lib + find $dist -type f -name "*.map" -delete + ''; + + passthru.webPath = "share/www/excalidraw"; + }; + sharp.build = with pkgs; { nativeBuildInputs = old: old ++ [ pkg-config diff --git a/packages/projects.nix b/packages/projects.nix index c07bb42..4afb87e 100644 --- a/packages/projects.nix +++ b/packages/projects.nix @@ -34,6 +34,14 @@ packages = filters.doFilter filters.packages rec { cinny = pkgs.callPackage ./web-apps/cinny { inherit pins; }; + excalidraw = let + dream = dream2nix.makeOutputs { + source = pins.excalidraw; + }; + inherit (dream.packages) excalidraw; + in + excalidraw // { webroot = "${excalidraw}/${excalidraw.webPath}"; }; + uptime-kuma = let dream = dream2nix.makeOutputs { source = pins.uptime-kuma; diff --git a/packages/sources/sources.json b/packages/sources/sources.json index 8f327ec..5bbd5ec 100644 --- a/packages/sources/sources.json +++ b/packages/sources/sources.json @@ -14,6 +14,20 @@ "url": "https://api.github.com/repos/cinnyapp/cinny/tarball/v2.1.2", "hash": "1aw0v1wj8fbhi4v5jjn0dpyi4irnad5ni5f1ph6r1wyrgzncl9vg" }, + "excalidraw": { + "type": "GitRelease", + "repository": { + "type": "GitHub", + "owner": "excalidraw", + "repo": "excalidraw" + }, + "pre_releases": false, + "version_upper_bound": null, + "version": "v0.12.0", + "revision": "fe3d0b5e8b25d1530b5902359fdd21ed99cd3e93", + "url": "https://api.github.com/repos/excalidraw/excalidraw/tarball/v0.12.0", + "hash": "1y943iqamqd9kv8ph1mwxr5c4ypha6245qwkfdyjzmky2hzm3388" + }, "gohugo-theme-ananke": { "type": "GitRelease", "repository": {