about summary refs log tree commit diff
path: root/pkgs/applications/editors
diff options
context:
space:
mode:
authorPhilipp Joram <nixpkgs@phijor.me>2024-04-05 16:56:52 +0300
committerPhilipp Joram <nixpkgs@phijor.me>2024-04-07 16:36:57 +0300
commit294245f7501e0a8e69b83346a4fa5afd4ed33ab3 (patch)
tree942b35d167eaa490a4c75fd67a7a9394b0ec8cab /pkgs/applications/editors
parent8a35fec862ef48c5a56f5121febe3eb86e085c2d (diff)
haskellPackages.Agda: Split outputs to reduce closure size
After enabling a separate binary output for the `Agda` Haskell package,
the new `bin` output measures ~100MiB, compared to the ~4.5GiB before.
Using it in `agdaWithPackages` reduces the closure size of an Agda
installation from ~5GiB to ~3GiB.  The remaining space is taken up
mostly by the GHC backend.

With this change, derivations depending on `haskellPackages.Agda`
directly need to pick the right (binary) output.  This concerns in
particular `emacsPackages.agda2-mode`.
Diffstat (limited to 'pkgs/applications/editors')
-rw-r--r--pkgs/applications/editors/emacs/elisp-packages/manual-packages/agda2-mode/default.nix12
1 files changed, 7 insertions, 5 deletions
diff --git a/pkgs/applications/editors/emacs/elisp-packages/manual-packages/agda2-mode/default.nix b/pkgs/applications/editors/emacs/elisp-packages/manual-packages/agda2-mode/default.nix
index 2533153bd4474..7418a842148a7 100644
--- a/pkgs/applications/editors/emacs/elisp-packages/manual-packages/agda2-mode/default.nix
+++ b/pkgs/applications/editors/emacs/elisp-packages/manual-packages/agda2-mode/default.nix
@@ -1,21 +1,23 @@
 { trivialBuild
 , haskellPackages
 }:
-
-trivialBuild rec {
+let
+  Agda = haskellPackages.Agda.bin;
+in
+trivialBuild {
   pname = "agda-mode";
-  version = haskellPackages.Agda.version;
+  version = Agda.version;
 
   dontUnpack = true;
 
   # already byte-compiled by Agda builder
   buildPhase = ''
-    agda=`${haskellPackages.Agda}/bin/agda-mode locate`
+    agda=`${Agda}/bin/agda-mode locate`
     cp `dirname $agda`/*.el* .
   '';
 
   meta = {
-    inherit (haskellPackages.Agda.meta) homepage license;
+    inherit (Agda.meta) homepage license;
     description = "Agda2-mode for Emacs extracted from Agda package";
     longDescription = ''
       Wrapper packages that liberates init.el from `agda-mode locate` magic.