From 992d284b4561eeede978fe5c7c43becd5470fe2f Mon Sep 17 00:00:00 2001 From: rina Date: Sat, 14 Oct 2023 02:34:01 +1000 Subject: [PATCH] trim size of godbolt. --- basil/{godbolt-basil.nix => godbolt.nix} | 12 +++++++++--- basil/overlay.nix | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) rename basil/{godbolt-basil.nix => godbolt.nix} (89%) diff --git a/basil/godbolt-basil.nix b/basil/godbolt.nix similarity index 89% rename from basil/godbolt-basil.nix rename to basil/godbolt.nix index 36946f5..17efc66 100644 --- a/basil/godbolt-basil.nix +++ b/basil/godbolt.nix @@ -9,7 +9,7 @@ basil-tool, nodejs, - godbolt-basil, + godbolt, }: let @@ -54,13 +54,19 @@ let runHook postBuild ''; + preInstall = '' + npm uninstall --omit=dev --ignore-scripts ts-node monaco-editor monaco-vim @fortawesome/fontawesome-free + ''; + postInstall = '' lib=$out/lib/node_modules/compiler-explorer - cp -r out $lib + + cp -r out $src/package.json $src/package-lock.json $lib + rm -rf $lib/test $lib/node_modules/.cache ''; }; in stdenv.mkDerivation { - pname = "godbolt-basil"; + pname = "godbolt"; version = ce-ailrst.version; buildInputs = [ bash nodejs ]; diff --git a/basil/overlay.nix b/basil/overlay.nix index 2f08444..ebb929c 100644 --- a/basil/overlay.nix +++ b/basil/overlay.nix @@ -10,7 +10,7 @@ let # .overrideAttrs { src = prev.lib.cleanSource ~/progs/basil; } ; - godbolt-basil = (prev.callPackage ./godbolt-basil.nix {}); + godbolt = (prev.callPackage ./godbolt.nix {}); basil-tool = prev.callPackage ./basil-tool.nix {}; jre = final.temurin-jre-bin-17;