nixpkgs/pkgs/applications/editors/emacs/elisp-packages/manual-packages/agda2-mode/default.nix
Philipp Joram 294245f750 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`.
2024-04-07 16:36:57 +03:00

30 lines
644 B
Nix

{ trivialBuild
, haskellPackages
}:
let
Agda = haskellPackages.Agda.bin;
in
trivialBuild {
pname = "agda-mode";
version = Agda.version;
dontUnpack = true;
# already byte-compiled by Agda builder
buildPhase = ''
agda=`${Agda}/bin/agda-mode locate`
cp `dirname $agda`/*.el* .
'';
meta = {
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.
Simply add this to user profile or systemPackages and do `(require
'agda2)` in init.el.
'';
};
}